HNHacker News
TopNewBestAskShowJobs

zb1plus

290 karma · joined January 4, 2017

submissionscomments
zb1plus··on Cantonese Font with Pronunciation
I use a similar one for Mandarin. Here's a cool little chrome extension I built to force the use of the font for all Hanzi/Han characters in a webpage.

```// This script changes the font of all Mandarin character on a page.

const url = chrome.runtime.getURL('font/Hanzi-Pinyin-Font.top.ttf');

const fontFace = ` @font-face { font-family: ZhongwenFont; src: url(${url}) } `;

window.onload = function () { const styleSheet = document.createElement("style"); styleSheet.innerHTML = fontFace document.head.appendChild(styleSheet); // For static pages, handle all elements: document.body.querySelectorAll("").forEach(handleElement); // support for dynamic pages // For dynamic apps, like Twitter, observe all DOM mutations henceforth within document body: addMutationObserver();

}

function handleText(textNode) { // Regular expression to match all Chinese characters const regex = /[\p{Script=Han}]+/gu; if (regex.test(textNode.nodeValue)) { const { style } = textNode.parentElement; style.fontFamily = 'ZhongwenFont'; style.fontSize = "large" } }

function addMutationObserver() { const observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { mutation.target.querySelectorAll("").forEach(handleElement); }); }); observer.observe(document.body, { subtree: true, childList: true }); }

function handleElement(e) { e.childNodes.forEach((child) => { if (child && !isUserInput(child) && child.nodeName === "#text") { handleText(child); } }); }

// Some helper functions used by the code above: function isUserInput(node) { const tagName = node.tagName ? node.tagName.toLowerCase() : ""; return ( tagName == "input" || tagName == "textarea" || isInsideContentEditable(node) ); }

function isInsideContentEditable(node) { while (node.parentNode) { if (node.contentEditable === "true") { return true; } node = node.parentNode; } return false; }```

zb1plus··on EARN IT Act undermines the privacy, security, and safety of law-abiding users
Agreed, we need to figure out ways to address the systematic pedophilia in schools, youth athletics and other institutions. Banning cryptography won't solve the problem, only push us closer to fascism.
zb1plus··on EARN IT Act undermines the privacy, security, and safety of law-abiding users
Technology will not solve CSAM. It is a social problem, you don't see policy makers going after the Catholic Church and other organizations that have systematic pedophilia as heavily as they are pursuing banning people's freedoms. This is an attempt by the state security establishment to restrict civil liberties using scare tactics around CSAM. This issue just highlights to the need to remove the power to restrict civil liberties from the State and the need for issues like CSAM to be addressed in a manner led by Psychologists as opposed to government officials without specialized knowledge and conflicts of interest intent.
zb1plus··on Reddit's proposed API changes and the continued existence of RedReader
Given how simple Reddit's API is to replicate, I'd love to see somebody build their own federated version of Reddit that the reader apps could consume alongside or in lieu of the main API.
zb1plus··on A small number of companies are colluding to cheat H1B visa lottery, US says
You can still regulate domestic vendors to prevent them from reselling products without disclosing they are noncompliant with safety standards or environmental rules (which you personally would face liability for the pollution caused by your usage of a noncompliant product) or other means of having the same effect as current regulations. Currently, we have people dying due to being unable to afford life saving medicine in the US due to its artificially high domestic cost.
zb1plus··on A small number of companies are colluding to cheat H1B visa lottery, US says
Free markets and free borders are the way. Border controls only serve the elites, I should be able to import whatever (within reason) I want from any country without interference.
zb1plus··on A small number of companies are colluding to cheat H1B visa lottery, US says
Yep, it's absolute nonsense. I am a US citizen and this is one of the many reasons I am planning on moving overseas and renouncing my US citizenship. It just isn't worth the hassle of spending thousands of dollars and waiting over a year of her being in a limbo state to live in an unsafe and deeply flawed society when we can take our skills to other parts of the world. We need to go back to the days of Ellis island. Staple a green card to the back of the every diploma issued by a regionally accredited university in the US. Allow anybody with a special talent the US legitimately lacks a easy path to obtaining a work permit for themselves and their families, and partners of US citizens should be able to get a Green Card and work permit within 30 days of marriage.
zb1plus··on Crypto must end anonymity for illicit finance, U.S. regulator says
Haha, I'm pretty sure that "safe and invasion-proof geography" is stolen property. It's always funny when statists try and pretend national sovereignty or law is more than having a big enough stick to force everyone else within a certain area to obey them.
zb1plus··on I worked at Google for -10 days
I feel the opposite way, when you look at blunders like the Metaverse or Google's complete failure to capitalize on its work with LLMs, you really have to question whether the executive boards of FAANGs really know how to do anything but make themselves more money these days. I can't help but wonder if Google and other FAANGs would making more money and producing better products if the people slinging code and talking to customers were running the company.
zb1plus··on Airline Forgets to Send Passengers to Customs, Tells Them to Return to JFK
Just another reminder that customs and immigration are just authoritarian controls with negligible positive value to society. Countries functioned fine with minimal border controls for hundreds of years. Let's put that wasted money and invest in helping homeless people or something else constructive.
zb1plus··on Maybe you don’t need to talk to someone
Probably better to talk to a therapist overseas virtually to avoid silly government rules. It also lets you keep a good therapist even when you move to a different territory or change insurance (as an American)
zb1plus··on Z-library founders arrested in Argentina
Couldn't agree more. It is disgraceful how our tax dollars are used to prop up failed business models and oppress the little guy. Just another example of how supposedly democratic states only serve the interests of the elite.
zb1plus··on UN says “No credible pathway” and “woefully inadequate” to stop global 1.5C
I actually think capitalism and free markets are the most viable solution. The problem is "short-sighted" capitalism that focuses on quarterly "hand to mouth" profits as opposed to people seeing the long-term business opportunities that lie in pivoting to renewables. As much as I detest Elon Musk, I think making the eco-friendly option cool and desirable for reasons beyond environmental impact is one of the best ways to encourage growth towards a more eco-friendly society.
zb1plus··on UN says “No credible pathway” and “woefully inadequate” to stop global 1.5C
I wish humanity could discard narrow-minded nationalist/short-sighted capitalist tendencies and unite against this threat. Imagine a climate pact between the US, EU, China and India where each society placed a similar focus on pivoting to renewables and developing reliable fusion energy as the Allies devoted to winning ww2 and developing atomic weaponry. Amusingly, the end of our dependency would also resolve many geopolitical concerns. However, governments across the globe are run by people who lack the proper morals or intelligence to see what needs to be done.
zb1plus··on How can I protect my H-1B and green card if I am laid off?
The world doesn't currently work in the this way sadly.
zb1plus··on How can I protect my H-1B and green card if I am laid off?
Performance based in my opinion means if you live in a region or territory for a certain amount of time and otherwise act in a manner that would indicate you intend to make this place your home, you would be eligible to be a citizen of that territory. I'm not a fan of the idea that buying a bunch of property or investing a bunch of money in a local business without living there would give the right to have an equal voice in the governing of that territory as somebody who makes their home there.
zb1plus··on How can I protect my H-1B and green card if I am laid off?
Citizenship should be performance based as opposed to based upon place of birth or being rich or lucky enough to obtain a piece of paper from some governmental body. It honestly shocks and disturbs me that this isn't a commonsense principle in 2022.
zb1plus··on Whatever Happened to Those Self-Service Passport Kiosks at Airports?
Anybody who cites 9/11 or terrorism as a reason to reduce civil liberties is a direct threat to American values. If you destroy what it means to be American in the face of terrorism, you are letting terrorists win. People need to understand that but sadly fascists increasingly availed of the cloak of national security to enact their schemes to destroy all of the hard won victories for progress.
zb1plus··on Ask HN: Which books are great for those who want to be self taught programmers?
nand2tetris.org is a great book for understanding what is going on "under the hood" without undergoing a traditional education in computer science.
zb1plus··on Downturn career decisions
Then companies should reward stellar talent with raises that go beyond inflation and COL changes. Not job hopping is leaving money on the table. As you say, "It costs a lot to acquire and hire talent" then one would think that companies wouldn't be penny foolish and properly reward talent instead of giving tiny 3% raises to star performers. Stock options are great way to reward and encourage commitment.
zb1plus··on Downturn career decisions
Yep. This whole thing about not hiring "job hoppers" is a conspiracy to suppress wages by the management class. Companies will drop you without a second thought, you should have the right to do the same. I think more software engineers should move into consulting where the gun for hire nature of our industry isn't hidden.
zb1plus··on 2000-Watt Society
Agree 100%. We should be building mega-factories for solar cells, nuclear plants and pumping trillions of dollars into fusion research. Pivoting to renewable energy should be giving the same society wide focus that nation states gave to warfare and the production of weapons during ww2.
zb1plus··on Privacy vs. “I have nothing to hide” (2019)
I hate to say it but all these examples seem to be implying is that the ordinary people should be able to purchase artillery, RPGs and tanks under the 2nd amendment. Indeed, the second amendment's language regarding well regulated militias would seem to suggest the formulation of civic organizations outside of the direct control of the state and federal government with such weapons. The evidence cited here would strengthen this notion that armed civic organizations that can go toe to toe with an army corps and are not under the command of the state or federal government are one the best ways to prevent the state from abusing the monopoly on violence that has somehow been normalized in western political thought.
zb1plus··on H1B rejected – builds unicorn back home
Exactly, H1B visas should be entirely blind to country of origin since to do otherwise would amount to de facto racism due to the racial demographics of many countries.
zb1plus··on Is sending Mississippi water to West feasible?
There's a lot of agriculture that occurs in California. I am certain people in the 32 states within Mississippi watershed eat a fair amount of food or enjoy lower food prices that occur in part because of California agriculture. Part of the whole reason of being in a 50 state union is to collectively pool our resources to improve everyone's lives and the wider economy.
zb1plus··on Job switchers are earning a lot more than those who stay
Sounds like Switzerland or Swiss banks have some sort of cultural bias against people who job hop. If companies want people who stick around, they should compensate fairly and reward people who are doing well and delivery quality work in order to retain talent. Many people have families and know that their employer views them solely as a means to an end, so why not treat the employer the same way and get the best possible deal out of them. By rejecting people who move around to gain the best possible opportunity, it creates an unfair bias against people who seek out the best possible compensation for themselves. Having worked in the banking sector myself, banks could benefit from more agile thinking but are instead stifled by bureaucratic processes that do little to promote security or create a quality product. I'm sure many of those people would love to stay and finish the product at conservative companies, but it is very hard to stick around in a suboptimal role that does not grow their skill set when they could be making 50% more money at a new firm. Many of these conservative companies as you put it only succeed because they do not complete in a free market and have unique privileges because of governmental barriers to free enterprise.
zb1plus··on Ask HN: A React-like framework for building pannable/zoomable canvas apps?
I've been looking for something similar in SwiftUI. Can anyone suggest a good tutorial??
zb1plus··on My students cheated... a lot
I have never understood why college professors / college classes are so uninnovative and have such an antagonistic approach to teaching/education. The entire grade culture at universities should be abolished in lieu of an evaluation system that is more reflective of the traits and skills that matter in industry and research environments. In CS programs geared towards helping graduates careers in industry, we should be rewarding students who help other succeed and in research oriented programs, we should have students conduct supervised research project oriented around their personal interests that require written and oral explanations of the work and why they choose the approach and what are the implications. There are so many easy ways to ensure cheating cannot occur that would also benefit students more than the current means of evaluation commonly used in higher education. On a semi related topic, if anyone is aware of research into experimental pedagogical approaches that move beyond traditional methods of evaluation and use concepts like mastery based learning in CS, I'd love to find a research group to work with on some ideas I have to improve instruction in CS and language learning.
zb1plus··on Master’s Degree in Computer Science
I second this. I attended OMSCS for a few semesters and ultimately dropped out because I felt most of the courses lacked any interactive component. Another factor that led me to drop out was that one of my biggest reasons for enrolling in a masters degree was to strengthen my research skills. Although I did manage to do research in a couple of courses and assist a professor, I found it very hard to juggle research, a full-time job and the demands of a part-time OMSCS course load (which is very time-consuming due to lack of interaction with instructors and faculty since it requires a lot of autodidacticism). Right now I am trying to determine the next steps in my educational journey. I am taking some online extension course with a synchronous lecture component and am finding it a lot better for really learning the material than OMSCS courses without synchronous learning component. However, it doesn't seem like full masters programs are offered in this manner. Has anyone found such a program in Computer Science that is geared towards people who already have a bachelor's degree in CS and are working full time in industry.
zb1plus··on Happy New Year HN! What are your plans for the new year?
Happy New Year HN! My goals for 2022 are: 1. Propose to my girlfriend 2. Determine if graduate school is the right path for me and get into a program that aligns with my interests 3. Get my AWS SSA cert and a GCP cert 4. Learn Swift 5. Natural Language Processing 6. Live a less stressful and happier life

If anybody on here can provide advice or mentorship around [2], I would deeply appreciate it!

← PreviousPage 2 of 3Next →