- 中国人很投机, 包括本人在部分情况下也是投机者. 总想不劳而获, 抄袭他人劳动成果. 想想我们学生时代的抄袭作弊之风盛行便可知... (然而为什么会这样)
- "土皇帝"情节, 因自己在某方面上比别人强, 听听粉丝的追捧, 就觉得自己不可一世, 比别人优越, 殊不知人外有人山外有山, 而且自己在其他方面也有不如他人的地方. (然而为什么会这样)
- 家长情节 总想要一个"家长"来管理一切, 把应该由自己解决的问题抛给别人"包办解决", 图一时之便. 久而久之结果就是并不了解你一切的"家长""包办解决"你的一切, 而你却失去了基本的思考解决问题能力, 看不到目标, 找不到方法, 只好任由"家长"摆布. 这种"爱"是现实的囚笼. (然而为什么会这样)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arbitrary-length tuples | |
* ======================= | |
* | |
* Working with tuples of unknown length in TypeScript is a pain. Most library authors fall back on enumerating all possible | |
* tuple lengths up to a threshold (see an example here https://github.com/pelotom/runtypes/blob/fe19290d375c8818d2c52243ddc2911c8369db37/src/types/tuple.ts ) | |
* | |
* In this gist, I'm attempting to leverage recursion to provide support for arbitrary length tuples. This has the potential | |
* to make some kinds of declarative APIs nicer and enhance type inference in some cases. | |
* This example shows how to take a variable-length tuple as an input, transform each of its types and use the resulting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8 | |
;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了 | |
;; Question section mismatch: got twitter.com/RESERVED0/CLASS256 | |
; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8 | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 |
This writeup describes a tricky Scala serialization issue that we ran into while porting Spark to Scala 2.11.
First, let's create a factory that builds anonymous functions:
class FunctionFactory extends Serializable {
// This method returns a function whose $outer scope is this class.
// Note that the function does not reference any variables in this scope,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.seancassidy.search; | |
import com.google.gson.FieldNamingPolicy; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonElement; | |
import org.elasticsearch.ElasticsearchException; | |
import org.elasticsearch.ElasticsearchTimeoutException; | |
import org.elasticsearch.action.ListenableActionFuture; | |
import org.elasticsearch.action.search.SearchPhaseExecutionException; |
人人的登录改版后,采用RSA加密后传输密码,该项目用于解决这种情况下人人的模拟登录
使用前先 pip install requests
捕捉浏览器中的JS运行时错误,主要通过监听window.onerror来实现。但是对于不同的脚本执行方式以及不同的浏览器,能捕获到的信息会有区别。
window.onerror 讲接收3个参数:
msg
:错误描述,比如:a is not definedurl
:出错脚本所在的urllineNumber
:出错脚本的行数
本文将对不同浏览器和不同的脚本执行方式进行测试,并总结这些区别。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is just an experiment. Don't read too much into the fact that these are global variables. | |
* The basic idea is to combine the two steps of defining a constructor and modifying a prototype | |
* into just one function call that looks more like traditional classes and other OO languages. | |
*/ | |
// Utility function | |
function mixin(receiver, supplier) { | |
if (Object.getOwnPropertyDescriptor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
有一存有整数的数组 A[n] (n <= 2^31 - 1, 但需要的话可以再扩大), 其中 0 <= i, A[i] <= n-1 且 i!=j 时 A[i]!=A[j] (即一个排列). 用你认为*最高效*的方法求 B=A^(-1) (即对范围内满足 A[B[i]]=i 的 B) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# by fcicq, released @ 2011.5.12, MIT License. | |
# eventlet is required. | |
import eventlet | |
from eventlet.green import socket | |
### SETTINGS ### | |
SERVER_PORT = 1080 | |
IPV6_ENABLED = socket.has_ipv6 |
NewerOlder