HNHacker News
TopNewBestAskShowJobs

nickstefan12

432 karma · joined October 29, 2014

submissionscomments
nickstefan12··on How to implement a spreadsheet
I implemented a spreadsheet in react, flux, immutable, and used a command pattern here: https://github.com/NickStefan/rixif

I did not take the approach of cells actually observing each other. Instead I had a recursive function that worked from the entered cell to:

-- parsed a string DSL of "=sum(B4:B8)" into a javascript function, that pulls some premade functions like sum, vlookup etc, and makes a string list representing what an arguments getter will need to fetch ("a_r3c1_r7c1" ie array, row 3, col 1 to row 7 col 1). The user still just sees "=sum(B4:B8)"

-- note who "I depend on",

-- note who "depends on me"

-- recurse 'outwards', skipping cells in "depends on me" that are still waiting on 'needs recalc' of their own "I depend on".

The update algorithm is not the hard part. Microsoft also has a very detailed documentation of their own update algorithm online (cant find it at the moment though).

The hardest part was updating the string representations of the formulas when you insert a new column or row, and then re-updating each cell's dependencies arrays.

Definitely not a performance problem, but more of a "how the fuck do I wrap my head around all the different ways someone could want to insert, cut, copy and paster here".

One mistake I made was trying to impliment the undo/redo to be totally reversable at every step. So every command stores the way to go both back and forward. In hindsight, I should have just stored forward commands and rebaked from the beginning when someone wanted to go back in time.

I wish I had more time to work on the project, but I've been busy with other work.

notes: - an excel to JSON parsing library in node :) https://github.com/NickStefan/parsexcel.js

- A lot of people mentioning Handsontable.js. That library has some major design flaws. We used it in our git style version controlled spreadsheet app (http://www.gridhub.xyx). Handsontable only takes simple 'number' or 'string' value for each cell. It should have been an object that could store CSS for that cell, formula for that cell, and the value for that cell. I made a few pull requests, but they largely ignored me. The code is odd (they use labels, continue, and other C style code).Handsontable is great only for presenting tables. Its terrible for implementing a full excel clone.

nickstefan12··on Ask HN: Can you suggest some good JavaScript projects to read and learn?
ExpressJS is pretty interesting with its nested routers, middleware, request handling function as the app, and adjusting the prototype on each request.

It gets kind of hairy so I did a blog post on it: http://www.nickstefan.net/blog/view/express-under-the-hood

nickstefan12··on Redux: Atomic Flux with Hot Reloading
People should really just use the actual name for it: CQRS There would be a lot less future confusion over what's flux or not. It's actually a really old design pattern called command query responsibility separation. http://www.codeproject.com/Articles/555855/Introduction-to-C...
nickstefan12··on Ask HN: Startup ecosystems: SF vs. Seattle
says pretty much everyone in any desirable city ;)
nickstefan12··on Google, Microsoft, Mozilla and Others Team Up to Launch WebAssembly
Would it be wrong to interpret this as the possible end of browser focused engineers?

It seems to me that consumers have spoken that they prefer native apps (especially mobile ones) that they can quickly find on their phone's home screen. Consumers are using desktop web apps less comparatively to native mobile ones.

So rather than people making web apps and then trying to port them to native, we're going to have a bunch of native apps that port to the web?

OR

... maybe web goes back to being the defacto standard if people start making insane unity engine powered byte code based web apps that perform like native..

nickstefan12··on Show HN: Generate personalized swim workouts
It uses your best swim times to accurately calibrate all of the intervals. I guess it could have persisted that information with cookies, etc, but its using vanilla django accounts at this point. It's a lot of information to enter in, so I figured accounts were best.

thanks for the feedback though.

nickstefan12··on Why the Myers-Briggs test is totally meaningless
There is pseudoscience, and then there is "pseudoscience". What I've found with the MBTI is that it's mostly just "pseudoscience", by the strict definition of empiricism, however, that doesn't make it completely useless pseudoscience. Let me explain:

It's a convenient mental framework. If someone fits one of the archetypes very strongly, then the framework will be very useful in predicting and recognizing how they think and behave in general. If someone doesn't really fit any of the archetypes very strongly, then yes it is useless, they'll get different results all of the time, and it will be pseudoscience. So while the test is bad at predicting even 60% of people's types correctly, people who do fit the archetypes will still find the test valuable.

nickstefan12··on A fast, offline reverse geocoder in Python
Nice! Shameless plug for a SQLite no network geocoder that uses (I believe) the same text files to seed everything. https://github.com/NickStefan/no-network-geocoder
nickstefan12··on Rent Control Creates Higher Rents in SF
For a more accurate model we would need:

* the actual number of people who wish to move to SF at any given time

* the number of people who pay rent control, but could pay more, and what that number is

* the actual rents that people pay under rent control

As obvious as parts of a toy model might be to people who are familiar with economics terminology, the toy model's conclusions are really quite 'new' to some people. For example: the rents in SF dont need to be 'supported' in the sense most of us think (by everyone). They merely need to be supported by a small amount of wealthy people bidding on a tiny amount of available apartments.

I think that's an important fact regarding how 'frothy' the market is. It can definitely go higher.

nickstefan12··on Rent Control Creates Higher Rents in SF
this. Its actually cheaper for me to live in rent controlled SF than "close to BART" Oakland. Bart isn't cheap. Owning a car isn't cheap. With the state of our transit, I would never want to live in Oakland without a car, but I would definitely live in SF without one.

Basically, if we had the mass transit system of new york, the rest of the bay might actually not be that bad compared to walking to work.

nickstefan12··on Rent Control Creates Higher Rents in SF
Because the old market price was $4 due to there only being 20 houses that could freely move on price.

If there's 100 houses there will more supply and the market rate will drop. Basically market rent is simply the price at the available margin.

nickstefan12··on Britain's housing crisis is a human disaster
The Vancouver market is probably out of wack due to foreign money looking for a place to park.
nickstefan12··on Britain's housing crisis is a human disaster
Exactly! How can we say the free market isn't keeping up when it's hardly free? California has an insanely slow build rate because of how much red tape sits in front of it. This slow build rate leads to less housing which gives us high prices. And then people seem to think we somehow need even more red tape to save the day.
nickstefan12··on Reddit: can anyone clean up the mess behind 'the front page of the internet'?
It's amazing how much harder a decent wysiwyg is to make in web technologies than you'd think. Content editable was supposed to get us there, but needs a ton of override. Grouping key and click events into actions the way youd expect ms word to function is again not easy!
nickstefan12··on Antiwork – a radical shift in how we view “jobs”
And what makes you so confident people wouldn't use universal income to be lazy? The default behavior of young people who have lots of free time is basically what college students do: drink and copulate haha. Lowest common denominator there would be plenty of people who would use it to be lazy.

Sure the ones with families now would spend more time with theirs, but the generations coming up it would have unintended effects I think.

Think about the invention of the internet. Sure some people use it to learn and connect meaningful. But what do most people use it for? Cat pictures, YouTube celebrities and Facebook stalking.

nickstefan12··on Jobs, automation, Engels’ pause and the limits of history
Interesting thought: what if it's the effeciency of technology rather than the automation that is the real problem to old school economics?

In order for me to be able to pay rent and eat food, and still have money left over, means that I'm "making a profit" in the business of me. In perfect competition, companies don't make any money. Technology is taking us closer to perfect competition between laborers. Everyone is now in competition with everyone and isn't this what we would expect in perfect competition: no one saves any money, you only get paid enough to eat and live.

Software engineers are fine for now, but look at the competition between soft skill positions, it's so fierce that people are barely making it.

My point is that it isn't automation, it's the lowering of friction between different laborers, and the commoditization of knowledge workers.

nickstefan12··on Why inequality persists in America
That basically is today in America. Many of the poor have flat screen tvs, cellphones etc. I think we as humans will always focus on the inequality part bcuas were social beings.
nickstefan12··on Teach or Perish
It's the law of unintended consequences. Political people saw how much better off the college educated were way back when and decided that "everyone should go to college". What they did not understand was that scarcity of college grads and the socioeconomic signaling it provided were the true source of better life. The now "everyone is college educated" are no better off because of the signaling and scarcity has been lost.

It's deeply connected to socialist ideals to have everyone go to college. If people are upset that everyone going to college don't get to be ahead of everyone, then what they're really mad at is socialism, not college.

nickstefan12··on Online Degrees That Are Seen as Official
Unless the online degrees can signal prestige they'll never be seen as official by employers. Traditional Employers don't actually care about what impractical academic stuff you learned. They like that "you're like me" and that's what college really serves as: the Harry potter sorting hat.

It's time we do something else though. Paying 100k just to signal to employers your socioeconomic background is bankrupting everyone.

nickstefan12··on Ask HN: What code do you frequently read?
I read the express.js source quite a few times. I wanted to reason out how one goes from raw node to something like express. I found it well written, but to really understand it I found myself making toy versions of each functionality. http://www.nickstefan.net/blog/view/express-under-the-hood
nickstefan12··on Coding is not the new literacy
non trivial front end stuff does involve systems modeling in the sense mentioned in the article. Just saying ;)
nickstefan12··on Coding is not the new literacy
> There are a number of tools that already help us do this - from Matlab to Quartz Composer - but Excel is unquestionably the king. Through Excel we can model any system that we can represent as numbers on a grid, which it turns out, is a lot of them. We have modeled everything from entire businesses to markets to family vacations. Millions of people are able to use spreadsheets to model aspects of their lives and it could be argued that, outside of the Internet, it's the single most important tool available to us on a computer. It gains this power by providing a simple and intuitive set of tools for shaping just one material: a grid of numbers. If we want to work with more than that, however, we have to code.

The idea that the entire average joe population needs more than excel has never sounded quite right to me. Anything closer to "real" programming and I think we're asking people to devote too much of their time to something that looks like software developing. I Just honesty think not everyone has the demeanor to enjoy programming. It's a very introverted, abstract, high focus, and high patience endevour.

nickstefan12··on “Implement text editor DOM updates manually instead of via React”
It seems like they never really gave react a real chance. although react is just a view render, to really get its red line performance requires going all in. I think it would have been worth it. a unidirectional data flow is worth the pain. It's so much easier to design something that only ever has to "rerender".

React isn't a magic bullet without using shouldComponentUpdate, and shouldComponentUpdate really works best with immutable data. Immutable data works best all in... See where this all in keeps going? Basically atom didn't wanr react to dictate their entire app and dictate how the plugins would all have to be rendered.

nickstefan12··on Side projects
BART never has seats. So I waste about 2 hours a day standing and doing nothing of value :(. Very jealous you get to program then.
nickstefan12··on Central Illinois Xpress Emerge as Unlikely Force in Fifth-Grade League
This article has some nice points about what the girls are learning (team work, discipline etc), but it's not nearly "breaking down barriers" as it seems. I coached swimming for 8 years:

Girls are 10x easier to coach than boys (on average). At that age they are also more coordinated, taller and sometimes stronger.

Also at that age: continual year round well coached practice is infinitely more important than gender. The boys teams in this article are seasonal recreational, while the girls team is a year round club team. I can tell you from swimming that a 5th grade year round swimmer would easily crush a recreational swimmer, regardless of gender, on average.

nickstefan12··on How Software in Half of NYC Cabs Generates $5.2M a Year in Extra Tips
I can remember back in 2010, in sf, when taxis would haggle you for wanting to use a credit card, even when they all were labeled with visa window stickers and had machines! They would put cardboard signs in the back that said "cash only, I pay 5% to cc company". I felt bad for drivers who 'all of the sudden' found themselves making 5% less because of credit cards, but come on, let's get with the times! don't haggle your customers. hide that from the customers and raise all prices if you have to.

At the minimum, über has forced taxis to get with the program.

nickstefan12··on How Software in Half of NYC Cabs Generates $5.2M a Year in Extra Tips
The meter said 100, but after I tried to manually enter a tip other than 20, is when I found out about it "actually being 150". He claimed that he had turned the meter off at one point and was actually doing me a favor he wouldn't have done if he had known I was going to barely tip him. I would have stood my ground (having to give turn by turn to your cab driver for 20 minutes is hardly tip worthy), but being in front of my house I didn't want to cause a scene and was tired from my flight.

The irony is that I actually was about to take an über x quoted at $70, but I decided on a cab last minute (wish I hadnt).

nickstefan12··on How Software in Half of NYC Cabs Generates $5.2M a Year in Extra Tips
I just ran into this last night: I took a cab home from the airport. One: he had no gps and took a wrong freeway change getting home. Two he barely spoke English. Three I basically had to navigate him back on track and painfully turn by turn.

End of the trip I go pay, and he's sad that I want to pay with a credit card. Then the tip meter only has 20% or other. I hit other with a much lower tip. He cancels the transaction from the front, and says that the ride is actually 150 not 100, and that's why I need to tip. So I say fine and end up tipping him the 20% at 100.

But seriously isn't a tip like a bonus!? Why are we all required to give 20% tips even when the service sucks?

Next time I'll just uber.

nickstefan12··on Predictions for the future from 1930
Eugenics was in more than just Germany in the 1930s. Amazing how widespread eugenics ideas were (so widespread they came out in this high brow Brit's 'utopian' future).
nickstefan12··on MOOCs are closed platforms and probably doomed
I would argue that the problem is signaling. Where and what you studied in school are signals employers use to rank you against your peers. IE going to Harvard signals that you are the elk that got into Harvard. No one really cares what you studied there. This is the primary function of college in the employment landscape: signaling. Very few people go to college for the actual learning (they go to get the signaling that will allow them to get a job).

MOOCS would need to get into signaling and have employers take their signal seriously. I hate to sound classist, but unfortunately MOOCS lack of selectivity means they don't signal as much as a college with a low acceptance rate.

I myself did not go to an elite school, and realize that the above is a very broad generalization...

← PreviousPage 3 of 4Next →