Why use data URI scheme?

According to Wikipedia: Advantages: HTTP request and header traffic is not required for embedded data, so data URIs consume less bandwidth whenever the overhead of encoding the inline content as a data URI is smaller than the HTTP overhead. For example, the required base64 encoding for an image 600 bytes long would be 800 bytes, … Read more

Go client program generates a lot a sockets in TIME_WAIT state

The default http.Transport is opening and closing connections too quickly. Since all connections are to the same host:port combination, you need to increase MaxIdleConnsPerHost to match your value for num_coroutines. Otherwise, the transport will frequently close the extra connections, only to have them reopened immediately. You can set this globally on the default transport: http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost … Read more

parse multipart/form-data, received from requests post

If you’re receiving a multipart/form-data response, you can parse it using the requests-toolbelt library like so: $ pip install requests-toolbelt After installing it from requests_toolbelt.multipart import decoder testEnrollResponse = requests.post(…) multipart_data = decoder.MultipartDecoder.from_response(testEnrollResponse) for part in multipart_data.parts: print(part.content) # Alternatively, part.text if you want unicode print(part.headers)

How to get asp.net client id at external javascript file

I can suggest 2 ways. First way define your variables before call the javascript, inside the .aspx file that can be compiled. var ButtonXXXID = <%=buttonXXX.ClientID%> // and now include your javascript and use the variable ButtonXXXID Second way in the external javascript file, write your code as: function oNameCls(ControlId1) { this.ControlId1 = ControlId1; this.DoYourWork1 … Read more

How does jQuery .data() work?

Have a look at the source for it. From a quick glimpse, it looks like it’s storing the data in that cache variable that is created on line 2. Edit: Here’s a quick demo that finds the data in the cache: http://jsfiddle.net/CnET9/ You can also dump $.cache to your console and explore it manually.