Xah Web Dev Blog Archive 2019-01
Brendan Eich on Fixing JavaScript String Methods Fail on Emoji
ECMAScript 2016, 2017, 2018, 2019 new. still incomplete.
JavaScript requestAnimationFrame sucks
requestAnimationFrame(f)
- calls the function f when browser is ready to update display.
f is passed a integer ms of type
DOMHighResTimeStamp
.
It is milliseconds from
performance.timing.navigationStart
.
new Date(performance.timing.navigationStart + ms)
should be equal to
new Date()
let x = performance.now(); let y = performance.timing.navigationStart + x; let z = new Date(); console.log( new Date(y) ) console.log( z )
The purpose of
requestAnimationFrame
is when animation done by JavaScript needs to be updated frequently (say, few times a second).
Instead of using
setInterval
, one can use it in combination with
requestAnimationFrame
, so that the code runs only when browser updates the display.
Example usage:
const update_clock = ((timestamp) => { const dd = new Date(performance.timing.navigationStart + timestamp); sec_hand.setAttribute("transform", "rotate(" + (dd.getSeconds()*6 + (dd.getMilliseconds()*6/1000)).toString() + ")"); }); setInterval( (() => { requestAnimationFrame(update_clock) }) , 1000/20);
the JavaScript web requestAnimationFrame is nasty. Extremely complex semantics, yet, no loop construct, so that user either need to use recursion with complicated manual timing control, or need to use setInterval anyway.
Array.prototype.flat (new)
number faq
- number to string Convert Decimal/Hexadecimal
- string to int Number.parseInt
converted all call of Object.getPrototypeOf
to Reflect.getPrototypeOf
parceljs, a new js tech. nodejs Ryan Dahl highly recommended. https://parceljs.org
spent 1 hour on the svg path ellipse. still haven't figured out how to use it to draw a quarter circle arc. extremely idiotic tech.
HTML4 Frameset, Best Idea Killed by Google
it's a sad story that the html4 frameset is killed, by Google and web dev community beginning around 2005. it's the best idea. Today's html5 and JavaScript still cannot do anything close.
- HTML Frameset HTML: Frameset to Split Windows
- HTML Iframe HTML: Iframe
Java doc is still (and only one) using frameset https://docs.oracle.com/javase/7/docs/api/
the JavaScript spec, ECMA-262 ECMAScript® Language Specification (LOL™) is the worst lang spec i've read. It is INCOMPREHENSIBLE and UNNECESSARILY so. Also, originally i put links to it from my tutorial for my own convenience of writing tutorial. But nobody else read it.
programers posting bullshit to get followers
this guy, posts bullshit daily, for like at least 3 years. basically, it's a marketing strategy, posting drama things and soundbytes to get lots clicks by the masses who don't know stuff. that's at least part of the reason he got 40k followers.
JavaScript here's my intro to the topics he listed
Google Webfont Tutorial (minor update)
do you have a specific case situation where programer needs to know type coercion result?
i think when one saw a code location where type coercion is happening, you simply just change the code so it's explicit type conversion, unless it's trivial or well-known cases such as number to string.
type coercion results between types that doesn't make sense, are usually just arbitrary, depending on the lang desiner or what happens to be the case in the lang. especially lang with bad history like js.
old articles
- Google AdSense Ban on Ancient Asian Goddess Sculpture Page
- How to Start Google Chrome in a New Instance?
- Google Reader RIPS
- Google's Deceptive Ad: Google Puts Ad in Email Under Promotion Tab
- Google: DON'T BE EVIL vs DON'T DO EVIL
- Google Now Requires JavaScript AND Cookies?
- Google Sitemap.org Domain Typosquatting Scam
- Are Googlers the Minions of Google Marketing?
- Steve Jobs 3 Months Before He Died
- TV Has Arrived on The Web
- Industrial Tech: Twilio, SendGrid, Google Cloud Messaging, Apple Push Notification Service
- Adjust Your Google Ad Preferences, or Opt Out
- Amazon Closes CA Affiliate Program
- Tech Humor: Apache vs Node.js vs NGINX 📺
- What is the Difference Between Google's “following” a Blog vs Subscribe?
- Humor: CSS Experimental Pain, Window Blind
- Gmail State-Sponsored Attack Warning
- Google Do Evil
- Google Gmail Blocks Mozilla Thunderbird
- Google Crimes
- Google's PageSpeed Insights Fails Its Own Site
- Google Search Dropped Traffic To XahLee.org (2009)
- SEO: Underscore vs Hyphen: How Google Webmaster Advices Hurt Quality Writers 📺
- Hacker News Traffic Effect
- Web Tech Gossip
- Internet Explorer Anime Girl
- Global Internet Usage Hour Pattern
- Web Advertisement in 2011: JavaScript Popups
- MegaUpload Crime Boss
- Monolithic Web Pages
- Opera Browser Can't Load Twitter CSS: OCSP Error
- Software Piracy, Open Source, Free Software, Copyright
- How Much Can You Make by Blogging? Google AdSense?
- Why I'm Removing Tech Blogger Celebrities and Googler on Google Plus
- Social Network Post Scoring Systems and Their Consequences
- My Personal Photos of Steve Jobs (1955 to 2011)
- Steve Yegge's Google Platforms Rant
- SOPA: Stop or Start Online Piracy Act?
- JavaScript DOM SVG font-size sucks
- Modern Tablet Computer Features
- Twitter Usage Map
- Web Hosting Compared: 2006-01
- What Your Google Plus Strategy Should Be?
- Wikipedia Morons, 2005
- On Wikipedia's Misinformation, 2005
- Women in Tech: Today's Google Plus Recommendation?
the last breath of google plus
the last breath of google plus
rewritten
while reviewing old article Web Design: Should Hyperlinks Have Underline? discovered, that time.com does not use https still. very strange.
new nav box
Firefox Chinese Serif Font Touches Top CSS Border
Stupid Firefox bug. When you have font-family:serif on chinese char, it touches the top css border. Does not happen in Google Chrome or Safari.
Twitter Usage Map
This is How Google will Collapse
great article. the title is a click bait, but the article has lots relevant info.
[This is How Google will Collapse By Daniel Colin James. At https://hackernoon.com/how-google-collapsed-b6ffa82198ee ]
Twitter Spam, from “JavaScript teacher”