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}’

1月 09

备忘:逼站个人中心的隐藏API

curl ‘http://space.bilibili.com/ajax/settings/setPrivacy’ -H ‘Cookie: f******’ -H ‘Origin: http://space.bilibili.com‘ -H ‘Accept-Encoding: gzip, deflate’ -H ‘Accept-Language: en-CA,en;q=0.8,en-US;q=0.6,zh-CN;q=0.4,zh;q=0.2’ -H ‘User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36’ -H ‘Content-Type: application/x-www-form-urlencoded; charset=UTF-8’ -H ‘Accept: application/json, text/javascript, */*; q=0.01’ -H ‘Referer: http://space.bilibili.com/******/‘ -H ‘X-Requested-With: XMLHttpRequest’ -H ‘Connection: keep-alive’ -H ‘DNT: 1’ –data

‘looking_video=0&submited_video=1&fav_video=0&coins_video=0&bangumi=0&played_game=0&groups=0&tags=0’ –compressed

 

如果submited_video变成0 那么连过往投稿都不会出现。一键大小姐。

1月 05

Acfun自动老司机:自动按正则回复私信

有人提议,我就写个。

老规矩,GPLv2,自己测试,风险自担。

 

https://gist.github.com/cnbeining/b77a4f5762a78fb3878c

 

 

12月 06

普天同庆:乐视云,Acfun所有不二压全死了

我已经忘记我是不是写过很多关于这个问题的东西了,懒得查了。

总之:全死了。

原作者用了很长时间才杀死这东西。

感谢各位滥用和瞎BB的傻X 大爷 伸手党和喷子们。你们的存在让世界变得更好。

 

另:Acfun也全死了。

12月 04

bilibili-grab-silver用移动API,改成GFUL

https://github.com/cnbeining/bilibili-grab-silver

换成GFUL协议。

 

特此公告。

11月 20

大圣归来 B站正版 下载地址

不写这标题估计没人进来看我骂街。

其实不是想说这事 反正这片子我不看。

应该是通过验证cookie判断是不是已经“承包”,后台有一数据库,异步的。

经过测试,更加确信appkey也有三六九等。

 

想看?进丸妞群问吧。我对于盗版没有兴趣。

11月 17

又一个开源软件授权协议:GFUL (Go Fuck Yourself public License)

只想让人看源码 剩下的什么都不想要?

嫌偷代码狗太多?没人care GPL?

请选用GFUL。

https://www.cnbeining.com/gful-go-fuck-yourself-license-version-1/

Go Fuck Yourself Public License
Version 1.0, November 2015

Copyright (C) 2015 Beining <i@cnbeining.com>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document.

Go Fuck Yourself Public License
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You cannot do anything by/to/on/in/with/about/under/through this piece of code. Go fuck yourself.

旧文章 «

» 新文章

Fetch more items