javascript: winds below its wing

I think the new generations prefer online self-services rather than in-person service. They rely on well-designed online GUI, either on smartphone or computer.

always separate write^read traffic

Rahul pointed out my “simplistic” thinking. Now I feel there’s no good reason to create a web server to handle both read and write requests.

A Read server has a sizable data cache to service client requests. This cache gets updated ….

A Write server (“writer”) has no such data cache, but it might have an incoming request queue + a downstream queue.

The incoming queue introduces delay, but users who send updates often understand that writes take longer than read.

The downstream queue is relatively new to me, so here’s my hypothesis —

Say 100 writers all need to get their records persisted in a central data store. The infrastructure at the central data store is now a bottleneck, so the 100 writers send their records in a queue rather than wait indefinitely. The writers can then handle other incoming requests.

data-heavy big webpage: 99%content is received incrementally

Rahul introduced me to this concept briefly, so here’s my own guess.

Context — soccer world cup page with live comments. Heavy updates. Jargons

  • record — a comment, with some additional data fields
  • pull — browser-initiated, can be periodically scheduled
  • push — server-initiated
  • server-side cache — for each userID (or IP), server remembers what records already sent
  • client-side cache

Initially when a user visits this “frontpage”, the web server has to deliver quite a lot of records. Heavy load on the server.

Thanks to pagination, browser can immediately show the 10 latest comments right away. As user scrolls down, browser would read the client-side cache and display 10 more comments, without a round trip.

If user scrolls fast, then browser may (?) need to make another request. In any case, server’s response continues to trickle in carrying the #20+, #30+, #40+ records in the background, asynchronously. In my jargon, this is not server push, but rather the slow response to a client-pull request.

When user hits Refresh button, client sends a new pull. A smart server remembers the most recent record id, so its response would only carry more recent records. Browser would receive the payload, merge it with the client-side cache and use AJAX to redraw the screen.

Even without user’s refresh, the server also can push (or a periodic client-pull) latest updates. I feel server-push is more efficient than a periodic client-pull, and preempts a “run” on the server.

Without auto updates, the page would become static and outdated, like web 1.0. When user hits Refresh, server would receive a brand-new pull request — heavy load.

wasm: a distant threat to javascript

https://medium.com/javascript-scene/what-is-webassembly-the-dawn-of-a-new-era-61256ec5a8f6 is a good WebAssembly intro, by an author.

  • wsam is an in-browser language, like javascript
  • wsam offers low-level (web-ASSEMBLY) programming constructs to complement javascript
  • I feel wsam will only be considered by extreme-performance browser apps. It’s too low-level, too inconvenient to be popular.
  • How many percent market share will javascript lose to wsam? 0.1% to 0.5%
  • The fact that wsam is cited as the main challenger to javascript means javascript is unchallenged as the dominant choice on the browser

angular.js jQuery node.js — phrase book

server-side — Node.js is only library designed for server-side use.

web UI — most of the javascript libraries are meant for web UI

cross-browser support — jQuery, Angular

I feel jQuery is more popular than the other javascript libraries.

php-integration? I have seen books dedicated to jQuery+php

DOM — well supported in jQuery

Ajax — well supported in jQuery

data binding — a major feature of Angular.js, not jQuery.

compressed content in a http response

Now I feel an http response may be a zip containing multiple files. The response “body” will be an compressed bytes array. (To avoid confusion, I will call this a “zip” rather than a “file”.) When you parse these bytes, you may see multiple zip entries.

If you assume the entire zip is a single file and try to decompress/deflate it, it might fail. The output may be empty.

The http response also contains useful response headers. One of the headers would be content-type. The gzip and zip types seem to require different parsers.

Fairchild Semicon’s IP traffic priority

Practical insight. Extremely useful to a company economizing on bandwith

Based on packet “protocol” [1], an IP router can give relative priorities to
Priority 1: voip packets
Priority 2: peoplesoft traffic
Priority 3: browser traffic
Proirity 4: lotus notes replication traffic

Lower priority packets are dropped more.

The most important browser traffic is, hold your breath, sales processing[2]. Sales staff use a web interface to process sales data. DB resides on another continent! In a rare but illustrative /incident/, lotus traffic ate into Priority 3 bandwidth and brought sales processing to a grinding slowdown.

As an alternative to a relatively fragile web interface, I suggested async messaging-based sales processing application. No clear answer.

[2] perhaps including but not limited to sales order
[1] packet headers on one layer of the envelopes

3 steps to understand "signing a msg" with a private key

1) understand basic meanings of your private key ^ your pub key.

If you can’t remember anything, remember to keep your private key very
very private, and publish your pub key to friends.

If you can remember one more thing, then remember

“sign with private key; verify with public key”.

2) understand “digsig” — an encryption of a msg, encrypted with your
private key

You often send the digsig to your receipients to certify something.
Receipients can verify your digsig using your pub key

3) understand what it means to “sign a msg”.

In the simplest case, it means “produce a digsig, and send the (cleartext) msg + the digsig”

Q: This process offers CIAn?
A: IAn but not Confidentiality since you actually send a cleartext msg

css selector clearly explained

http://www.btinternet.com/~wildfire/articles/11.htm

Q: what's a “selector”, in one sentence of plain english?
A: bit of a CSS definition that says what the styles are applied to

Q: 3 basic types of selectors?
A:
* HTML Elements, such as

tags, tags etc.
* Elements with a specific class, for example an element with the
class “mystyle” (

)
* Elements with a specific ID, for example an element with the ID
“myparagraph” (

)

Q: pseudo selectors's signature, purpose, eg?
A: Examples of this are link states (unused, visited, active) and
first lines and letters. The selector has a colon after it with the
state before the definition. An example of this is the CSS definition
for changing the colours of link colours:

A:link {color:blue;}
A:visited {color:green;}
A:active {color:gold;}

Q: nested selector example?

ldap names

In LDAP, the situation is slightly more complicated. Names are built from components that are separated by commas (“,”). Like DNS names, they read from right to left. However, components in an LDAP name must be specified as name/value pairs. The name “cn=Todd Sundsted, o=ComFrame, c=US” names the person “cn=Todd Sundsted” in the organization “o=ComFrame, c=US.” Likewise, the name “o=ComFrame, c=US” names the organization “o=ComFrame” in the country “c=US.”