24,182 karma · joined Jul 22, 2017 (9y ago) · 14,302 submissions
https://hnbadges.netlify.app/?user=quickthrower2
comment 5y ago · link · parent
Import a csv reader library that can stream.
Read each line and apply a series of regex, each one classifying on match.
Eg
^0\d{8}$
Means stringThen have a reduction rule e.g.
If so far we think it’s a numeric column and we get a string then treat as string.
If so far we think it’s a numeric column and we get a number it is still a numeric column.
Then doing the regex and reduce in a loop will give you the final answers.
Happy to knock up some example code if you wish.
8672.
Limitations of a Lone Wolf (2019)(medium.com ↗)
1 points · by quickthrower2 · 5y ago · discuss
comment 5y ago · link · parent
Even if they can it’s a hat switching thing. Building something from 9-10 and then trying to break the shit out of it from 10–11 requires some mental discipline.
For quality I’d rather have testers. Developers will test their own work anyway if they know shit work will be sent back.
comment 5y ago · link · parent
comment 5y ago · link · parent
Sure you can choose to use nodejs instead of ruby or embed video instead of streaming it yourself or find a better confit system than admin pages but the entire product ideas are probably decided by the business well in advance of when the developer gets whiff of it.
Imagine you are about to purchase a car and the car dealer weirdly tries to convince you to take up cycling via “what’s the problem”. You’d probably walk to the next dealer as you’ve made up your mind you want a car.
comment 5y ago · link · parent
Is there an apartment in New York whose rent you can’t afford?
What is for sale as a private person that’s worth cashing in the billions and paying tax to buy? You already have a business you can use to turn that into more money anyway which is probably the most satisfying game.
comment 5y ago · link · parent
Also, if you are rich you will have less need to sell assets and can hold on to them in perpetuity.
IMO: Perhaps a fairer tax system would tax these gains and in turn reduce income tax. That would put more tax on “lazily earned” money.
comment 5y ago · link · parent
This is like a facade or a shop front. The menu you order from but not the kitchen or the chef.
This means you interact with the class just through the methods.
Sometimes the methods are simple - it can be a get and set method wrapping a state.
Why bother? Why not just make the state public?
Because then other classes start to depend on the inner workings of the class in order to not be broken.
For example suddenly you realise a string has to be valid e.g. it is an email address.
With a getter and setter later on you can add validation to the setter if you wish.
—-
When I said “Anyone outside” this might be misleading. I should say any code outside the class. This is not really for security - as you said if the other developer has the source they can change it and use the changed source. You don’t enforce security with classes.
Rather than security, the purpose of classes is abstraction: the goal of reducing the cognitive load. The load on your brain.
For example most programming languages will provide classes to open a file. You can now work with the file system in an abstract way without writing code that cares about Unix/windows file system differences in your code that is doing something else.
This means someone can write a program to scan your disk for mp3 files and catalog them without knowing the details of the files stem, and in such a way that if in the future the file system classes are updated to handle say NAS your mp3 hunter program still works.
Even better it gets a new feature for free!
comment 5y ago · link · parent
I very rarely use inheritance. I can’t remember the last time I added inheritance but I sometimes come across it in code bases. Normally when there are something resembling UI widgets that have a common base.
Instead I use c# interfaces for polymorphism (which basically means working with objects you don’t know what they are, e.g. I have something that behaves like a list, so i can call addItem() )
My first advice is don’t worry - if your code works and is understandable all is good.
My second advice is post your code for code review, or get a mentor or coach to help show you if and how your code could be better with OO
Functional programming avoids the need for OO but comes with its own “what is the best way to do this” type questions to which I give the same advice.
comment 5y ago · link · parent
Since I enjoy high level programming and the natural experience chicken/egg I never do the low level stuff. Not since Acorn Electron assembler! But I know of it.
comment 5y ago · link · parent
In other words want a comprehensive level of automated QA that runs fast enough to run on every CI build.
ML / AI? Maybe this could guess which tests need to be run based on past code changes and failures
comment 5y ago · link · parent
I feel with pure js you’d need more test coverage and better comments. My experience on larger js code bases it’s hard to know what to pass into a function “oh now I’ve read all the code I see you want an object with a couple of promises and a number” can be bad for productivity.
But I imagine in disciplined hands JS can scale without static type safety.
comment 5y ago · link · parent
However I disagree that cryptocurrency is untraceable.
In fact there is a public ledger!
And law enforcement can connect dots if they subpoena exchanges or even take down exchanges entirely.
Or they can do the normal cop thing and get someone you are dealing with to cooperate and link their address to yours.
Monero claims to be private and truly anonymous but I don’t know the technical details, many say it is.
comment 5y ago · link · parent
> A man of power, for example, often has dirty work that has to be done, but for the sake of appearances it is generally preferable to have other people do it for him; friends often do this the best, since their affection for him makes them willing to take chances. Also, if your plans go awry for some reason, you can use a friend as a convenient scapegoat. This “fall of the favorite” was a trick often used by kings and sovereigns: They would let their closest friend at court take the fall for a mistake, since the public would not believe that they would deliberately sacrifice a friend for such a purpose.
Oh
Seriously though I’m reading the preview and finding this all just game of thrones style crap that isn’t useful for modern work.
Or I am not making the connection AND the book doesn’t attempt to help the reader.
There are politics at work but there must be books that talk about that specifically rather than the constant “this man made this weird mistake and was gouged by a thousand swords stuff”
comment 5y ago · link · parent
You can fix those things, have fully signed off design docs, have a CCN process for every little change etc. and watch everything grind to a halt while you deliver the wrong thing on time.
I’m not saying don’t estimate. Do! Have a plan and realise it won’t survive contact with reality.
comment 5y ago · link · parent
This is because it’s better to use a database: simpler, faster, more efficient.
You can do crypto signing in a database or flat files if you really need proof that some actor approved something or other. Each actor can keep such signatures in a local db as evidence if needed.