HNHacker News
TopNewBestAskShowJobs

jmulho

391 karma · joined June 29, 2010

submissionscomments
jmulho··on Guide to JavaScript Frameworks
This is pure html:

<div id=“div01”></div>

This is magic monkey html:

<div id=“div01” monkey=“true”></div>

jmulho··on Ask HN: What's the recommended method of adding authentication to a REST API?
Ah, so there are other contexts (e.g. native mobile apps) that may be sharing the API, not just browser (web) apps. I think I get it. Thanks.
jmulho··on SPAs are harder and always will be (2013)
You aren't going to like this answer at first, but bear with me. There is another way. When you see the other way done well you may conclude, as I have, that it is the best trade-off given the technology you've chosen (the web). You want to use pagination. That is, your user won't be able to see 10s of thousands of rows at once. They will have to page through them. That doesn't mean your user won't be able to sort and filter and rearrange the data as a whole; but after each action, they will only see the first page of the changed result. If you do this well, every user action will result in a near instantaneous change on screen. You'll need to make every link in the chain as fast as it can be. The key is going to be the database. The first thing you'll need to know is the fastest way to do pagination in the particular database you are using. You need to be able to do something like this: getCustomers(81,160) and get instant results. You'll need database connection pooling. You'll want to send the smallest possible payload over the wire. HTML, XML, and JSON are too verbose. Don't send the word "LastName:" with every row. This will double your payload. Include the column names only one time in the response. When the client gets the payload, slap html on it, and inject it into the DOM (replace a div: <div id="results"></div>). Let the user set their page size (40, 80, 160). If you play with this, you'll find that every device/browser/connection combination will eventually choke if you keep increasing page size (and have a large enough result set), but every device/browser/connection will enjoy beautiful responsiveness at 40 or 80 results per page. When you feel what this is like you wont want to go back to watching a spinner for 10 seconds and then watching your browser hang up every time you scroll. And your user who is using an iPhone 4 with some old version of Safari on a 3g connection really doesn't want to watch a spinner for 30 seconds, then see a blink of results, then see their browser crash. But that is exactly what will happen if you give them 10s of thousands of rows.
jmulho··on Ask HN: What's the recommended method of adding authentication to a REST API?
Is there any reason to favor bearer tokens over cookies?
jmulho··on A letter about Google AMP
Uh, there definitely isn’t any fixation with load speeds amongst web devs. If there were, the web wouldn’t be a complete disaster and there wouldn’t be any need for AMP. Users care about load speeds. Web devs care about getting their sites to work when their core i7 workstations are connected to the corporate intranet, and getting paid.
jmulho··on Exercise Alters Our Microbiome
Flax seeds. Buy them whole so they keep. Grind them in a coffee grinder just before consuming so you get the fat. Put them in a breakfast smoothie: 2 cups frozen fruit, 2 pitted dates (optional), 6 or 8 almonds or walnuts, 2TB ground flax seeds, 1 cup kale (or spinach or arugula), water.
jmulho··on Intentional Fire-Spreading by “Firehawk” Raptors in Northern Australia
According to Dr. Michael Greger, medical care is the third leading cause of death in America:

"Since side effects from prescription drugs kill an estimated 106,000 Americans a year, the sixth leading cause of death may actually be (gulp) doctors. And that’s just from adverse drug reactions. Add in medical mistakes (which the U.S. Institute of Medicine estimates kills at least 44,000) and that brings “healthcare” up to our country’s third leading cause of death. Throw in hospital-acquired infections, and we’re talking maybe 187,000 Americans dead every year (and millions injured) by medical care."

https://nutritionfacts.org/2013/07/16/dr-gregers-new-annual-...

jmulho··on In Raising the World’s I.Q., the Secret’s in the Salt (2006)
Other good sources include seaweed, supplements, and apparently milk (because an iodine solution used to clean tanks leaches into the milk!). I like to use a piece of kelp in soups, the same way you would use a bay leaf. Or throw a handful of re-hydrated wakame in soup at the end, the way you would use parsley. This video has a lot of info on iodine sources (including what to avoid): https://nutritionfacts.org/video/avoiding-iodine-deficiency-...
jmulho··on The Death of Flash and Rewriting 1.4M Lines of Code
Tools like Flash made it easy for beginners to make a giant mess. Tools like React and Angular make it easy for experts to make a giant mess.
jmulho··on How Hard Is It to Generate a 10X Return on an Investment?
I agree about equity exposure, low fees, and simple approaches like a three fund portfolio. Here is a slightly more sophisticated way to think about the percentage that should be in equities. One year from now, equities could be up 25% or down 50%. Twenty years from now, equities are likely to be up, likely to have outpaced inflation, and likely to have outperformed "safer" alternatives (money market funds, bond funds, etc.). If you have a $10,000 bill coming due in one year, and $10,000 in the bank, it would be risky to invest any of it in equities. If you have money to invest that you won't be forced to liquidate for 20 years (e.g. your 401k at age 40), then it is probably fine to start with 100% of in equities. The percentage should be based on when you might be forced to liquidate each available investment dollar. In many cases this will agree with the rule of thumb.

By equities I mean low cost equity ETFs (or index funds) that invest in broad indexes. I do not mean a portfolio of 10 to 30 stocks hand-picked by you or any fund manager. The hand-picked portfolio could be down 100% in 20 years, or in 1 year.

jmulho··on A Beginner's Guide to Progressive Web Apps (2016)
PWA is an acryonym that you don't need to worry about, unless you buy in to the argument that web apps are lacking certain desirable characteristics of native mobile apps.

Most of the PWA required characteristics are pretty obvious:

"Progressive" and "Responsive" - not new ideas.

"Discoverable", "Linkable", "App-like" - the classic problems of single-page web apps

"Fresh" and "Safe" - as if some people desire apps that are stale and dangerous.

Then there are the characteristics that set PWAs apart:

"Connectivity-independent" (should work offline) - My app lets you check yesterday's weather.

"Re-engageable" (receives push notifications when the browser is closed) - Because users really love push notifications.

"Installable" (can be installed on the devices home screen) - Isn't there something called a link that does this?

The PWA requriements seem to be as set of priorities for websites heavily influenced by the experience (pros and cons) of native mobile app development. As such, they seem out of touch with what should be the priorities for a web app.

jmulho··on The Effect of Cold Showering on Health and Work: A Randomized Controlled Trial
These videos reference some studies on brown fat: https://nutritionfacts.org/video/brown-fat-losing-weight-thr... https://nutritionfacts.org/video/boosting-brown-fat-through-...
jmulho··on Why American Workers Pay Twice as Much in Taxes as Wealthy Investors
I don't need evidence to know that increasing return on investment stimulates investment. Some things are self-evident. I am giving the professor a D-.
jmulho··on How I implemented my own crypto
> "Just because an AES implementation matches the test vectors does not make it correct or safe."

Actually, this does make it correct. Whether or not it is safe depends on the application. For example, I sent my friend Bob some cyphertext that I calculated by hand with a pencil and paper using the AES algorithm. I sent it via my trusted courier Eve. It took four hours for me to do the calculation. At the last minute I started to second guess my math so I double checked it against a respected crypto library. It was fine, so I handed it off to Eve. I am pretty sure that in this application my choice to calculate the answer by hand was exactly as safe as if I had just used the library. In fact, I am so sure (given that the answers were identical), that just as Eve was walking out the door, enroute to Bob, I pulled her close and whispered in her ear: "Eve, be very careful with this cyphertext, it took me four hours to create it."

jmulho··on How I implemented my own crypto
> "If you mean just implementing a known good algorithm on your own (again, like AES) - why? You are overwhelmingly more likely to shoot yourself in the foot"

I've never understood this argument. Encryption algorithms are deterministic. If you implement a known good algorithm on your own, and it gets the same outputs given the same inputs, then you are highly unlikely to shoot yourself in the foot. This is not what people are talking about when they warn not to roll your own crypto.

jmulho··on We Evolved to Run But We're Doing It Wrong
Here is the theory. Lean forward until you start to fall. Put one foot out to catch yourself. Note where your foot lands. This is where your foot needs to land to stop a fall. You will feel a significant jolt. You have successfully sucked up all the energy of your fall and stopped yourself. You put on the brakes. Now try this again, but place your foot short of where you did the first time. You shouldn't fall, but you will keep moving forward and will need to take another step to stop the fall. Now you have stopped yourself from falling over two steps which is less jolting. Now try again and place the second step short of where you would need to place it to stop, then the third, then fourth. Now you are running. If you want to go faster, shorten your stride and focus on turning your feet over as quickly as you can. If you want to slow down or stop, lengthen your stride and absorb your forward energy. You could overcome the braking action of a long stride by pushing off hard with your back foot but this is not as efficient and harder on the joints. That's the theory. The way to find out if it works for you is to experiment. For me, as soon as I understood this, running became a lot easier. If it works for you, be sure not to overdo it at first.
jmulho··on Passwords Evolved: Authentication Guidance for the Modern Era
The Hubris System(R) provides adequate protection and is highly practical. The scheme is well known, but what attack against it outperforms an exhaustive search? How do you build a database of poetry I haven't written yet and will never publish? Frequency analysis may help, but many of my poems are about a yellow zebra named x-ray who plays the xylophone. If you come up with an attack that outperforms an exhaustive search, I will just write longer poems. You will never catch me. Password cracking is an arms race. The crackers can't win. The math is against them. Every character I add to my password makes their problem exponentially harder.

thspapaihp tsiwkbwaaioaes hdybadopihwyawnp famhbmompaaayznxwptx iycuwaatoaesiwjwlpywncm pciaartccwtmiateciatmpmtpeh

jmulho··on Passwords Evolved: Authentication Guidance for the Modern Era
> Producing a good password without the help of a random generator on the other hand is simply impossible

You just produced one: pagpwthoargotohisi

jmulho··on Filing Taxes in Japan Is a Breeze. Why Not in the US?
Modifying the tax code is also the easiest way to accomplish redistribution of wealth (for better or for worse). This is at least in part because the complexity of the tax code obfuscates the cost of the program. For example, should we continue to fund the budget of the "Department of Benefits for People with Spouses Born Before January 2, 1952"? Who benefits (how many and by how much)? What does this program cost? Nobody knows. There is no such department. Instead there is a check box on line 39a of the 1040. Checking it might change the standard deduction, for people who take the standard deduction, if they checked some other boxes, "see instructions".
jmulho··on Backpage Raided, CEO Arrested on Sex-Trafficking Charges
It is fine to steal as long as it is only a small percentage of your income?
jmulho··on ‘Five Second Rule’ for Food on Floor Is Untrue, Study Finds
The article did not provided much useful information about food born illness. Watermelon picks up more bacteria than a gummy bear when dropped on the floor. That is obvious. A couple of things that would be much more helpful to point out: 1) your kitchen floor is much less likely to be coated with salmonella if you avoid bringing raw chicken carcasses into your house, and 2) a major factor in the severity of food born illness is dose. It is much safer, for example, to pick up a piece of watermelon from the kitchen floor ant eat it immediately than it is to pick it up and toss it in a salad that you are taking to a picnic, giving any bacteria that was picked up hours to multiply at moderate temperatures before being eaten.
jmulho··on Go’s march to low-latency GC
How about if you have a culture of being willing to try new things not invented here? That would be quite different from NIH syndrome.
jmulho··on An Open Letter to Apache Foundation and Apache OpenOffice Team
Count the number of widgets used in the top two inches of screen real estate. If it is greater than say 10, that isn't beautiful; not for someone trying to figure out how to use it.
jmulho··on Python is the new BASIC
I ran across this book (http://www.greenteapress.com/thinkpython/html/index.html) several years ago and had a lot of fun with Python and turtles. See TurtleWorld at around the fourth chapter.
jmulho··on The wealth gap between young and old people
The goal of the tax is not redistribution of wealth. The goal is to fund the benefits. The tax is capped because the benefits are capped.
jmulho··on Things to Know When Making a Web Application in 2015
In 2015, my primary use of web apps "for mobile" is to find the link that says "full site".
jmulho··on New electric engine improves safety of light aircraft
> "an airplane trying to hover without these mechanisms would be essentially uncontrolled. it would almost certainly spin like a top"

Controlled prop hanging is done all the time with RC planes. Example: https://www.youtube.com/watch?v=EAtByLuzXpI

jmulho··on How to Become a Great JavaScript Developer
Take a beginner player who has been playing at the local chess club once a week (two hours) for 12 weeks. This player enjoys the game and wants to be better. He plays anyone who will give him a game. He occasionally wins against other beginners. He loses to the stronger players when he gets a chance to play them. This player has 24 hours available to work on chess over the next 12 weeks. What is the best way for this player to improve? Suppose the options are, 1) continue attending chess club for the next 12 weeks, or 2) stay at home and study two hours a week for the next 12 weeks. The study material is Logical Chess Move By Move by Irving Chernev (mentioned above by msluyter). The book covers 33 master-level games in two categories: kingside attack, and queen's pawn opening. Chernev, a Grandmaster, explains the reasoning behind every move in all 33 games. When the player shows up at chess club on week 25, will he be better off having chosen option 1 or option 2?
jmulho··on The Science of Addictive Junk Food (2013)
> "if you go and try to live on a vegetarian diet without careful attention to modern scientific knowledge about nutrition, you'll end up with all kinds of things like vitamin B-12 deficiency."

That is true. However, if you go and try to live on a meat-eating diet without careful attention to modern scientific knowledge about nutrition, you'll end up with all kinds of things like obesity, heart disease, cancer, diabetes, and stroke.

jmulho··on PostgreSQL vs. MS SQL Server
If you know PL/SQL, all you need is an example of the boilerplate that goes at the top and bottom of a PL/pgSQL procedure and you are good to go.
← PreviousPage 3 of 7Next →