3月 03

Flask code 400, message Bad HTTP/0.9 request type

Error from Flask:

 

code 400, message Bad HTTP/0.9 request type

 

This is due to feeding HTTPS to Flask.

 

Solution: Set HTTPS, use HTTP or use Nginx to handle the HTTPS decode.

10月 30

onedrivecmd:加入quota

下个版本加个setup.py吧。。。

 

 

9月 24

onedrivecmd: Yet another Onedrive command-line client for Linux and OSX / Onedrive的命令行工具

https://github.com/cnbeining/onedrivecmd

 

又撸了一个东西玩。

MS经常给EDU邮箱,但是Linux下没有工具,也就是说有巨大备份需求的大户反而跑不了。

按megacmd,照猫画虎,撸一个这玩意。

MS的SDK挺难用的,文档挺语焉不详的。但是幸好没遇到什么很大的需要debug的东西。

老样子,欢迎PR。

AGPL,麻烦想偷的自己琢磨琢磨先。

7月 21

Things to read in the free time

Speech side:

Audio Segmenting:

http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0144610#sec008

Then run FFMpeg with -s and -t with subprocess

Google Speech API: https://cloud.google.com/speech/reference/rest/v1beta1/speech/syncrecognize

curl ‘https://speech.googleapis.com/v1beta1/speech:syncrecognize?key=AIzaSyBmmqjUsStJat65IP7KgKuH2cz6rRvlIr8’ -H ‘Referer: https://cloud.google.com/‘ -H ‘Origin: https://cloud.google.com‘ -H ‘User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.75 Safari/537.36’ -H ‘Content-Type: text/plain;charset=UTF-8’ –data-binary ‘{“config”:{“encoding”:”LINEAR16″,”sampleRate”:44100,”languageCode”:”en-US”,”maxAlternatives”:1},”audio”:{“content”:”BASE64_BINARY”}}’ –compressed

Less than 1 min inline, better if under 30s

 

Video Side:

Thumbnail: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

Vision API:

curl ‘https://vision.googleapis.com/v1/images:annotate?key=AIzaSyBzeghi0W7mGczap8SC8AmNudYOlwfU-KE’ -H ‘Referer: https://cloud.google.com/‘ -H ‘Origin: https://cloud.google.com‘ -H ‘User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.75 Safari/537.36’ -H ‘Content-Type: text/plain;charset=UTF-8’ –data-binary ‘{“requests”:[{“image”:{“content”:”BASE64″},”features”:[{“type”:”TYPE_UNSPECIFIED”,”maxResults”:50},{“type”:”TEXT_DETECTION”,”maxResults”:50}]}]}’ –compressed

 

CC:

Question: How to difference the zone of CC?

ASS: Put them there.

 

Style:

ASS: {\pos(369.675,206)} with response, 1s

 

Translation:

Toolkit+API+CAT

 

Transcode:

Release:

 

6月 16

泛域名证书

https://assl.loovit.net/

https://hostsymbol.com/clients/cart.php?a=add&pid=1

6月 16

Biligrab日常换key更新

没什么要说的,换了个key,继续续命。

 

不行了再把新算法拿出来。

5月 11

密码保护:B09 Asm 1 Quick thoughts

这是一篇受密码保护的文章,您需要提供访问密码:

3月 10

Biligrab紧急升级0.98.9:换KEY

没想到又把我挤兑到用老Key了。

https://github.com/cnbeining/Biligrab

继续阅读 »

2月 04

A48: TT1 Notes for the noobs

OOP:

  • Yes, we are playing with Class.
  • Are you sure when you should define variables?(before/after _init_?) This is called Instance variable versus Class variable.
  • Inheritance: Father and child. Children can override father’s method.
  • So WHY? We want 1) no need to deal with tons of functions 2) make a “wrapper” method for lots of works 3) similar Classes, same method
  • Python is a week type language: the type of variable can be changed on the fly.

Encapsulation:

  • I mean…why copy your code for several times for doing the same thing?

Modular Programming:

  • Because no one would remember what the heck he had done 2 weeks ago
  • Also, people are forming groups to getting jobs done: think about popular open-source softwares.
  • Enable you to use the same stuff multiple times later

ADT:

  • We want to organize the inputed data.
  • Putting data into your machine feels good: taking them out can be pain in the a*s.
  • If you happen to need to sort your stuff or find something…
  • We focus on its behavior.
  • Don’t focus on its name: I can name my cat “puppy” , but it won’t bark.
  • This part of A48 is actually called “Data Structure”.

Bucket:

  • No this is NOT a common ADT.

Queue:

  • FIFO.
  • You can implement a Queue with a Doubly Linked List(DLL).
  • Wanna play with enqueue/dequeue/peak/isempty/len/etc.

Stack:

  • FILO.

Exceptions:

  • Yes you can handle exceptions in the code;
  • But maybe you just want to exit the function.
  • Exceptions are not equal to ERRORs: it only matters how you handle it.
  • Make sure you are catching the RIGHT one and ENOUGH ones. Names are important.
  • A pure except would catch everything. But is that what you want? You really want to include KeyboardInterrupt?

UML:

  • Objects: Nouns.
  • Methods: Verbs.
  • Attributes: Variables.
  • Said Nick.
  • If you do not understand it…how did you wrote your DocString?
  • You want to include the above 3 stuffs, linked.

LL:

  • Lovelive
  • Single/Double
  • Can become a Queue, Stack…or a branch of a Tree!

1月 11

Note: B09 Lab #1 Shell

  • Get the first # lines: head -n 3 hockey_stats.txt
  • Count words:  wc -c hockey_stats.txt
  • Sort by column #:   sort -nk#   Reverse: sort -nrk#
  • find sth. in a file: grep TOR hockey_stats.txt
  • cat hockey_stats.txt | sed ‘s/\|/ /’|awk ‘{print $1, $2}’

  • sort -nk1 hockey_stats.txt

  • sort -nk4 hockey_stats.txt | head -n 10 | grep TOR

  • head -n 20 hockey_stats.txt | tail -n 10

  • only display 2 columns: cat logfile | sed ‘s/|/ /’ | awk ‘{print $1, $8}’

旧文章 «

Fetch more items