HNHacker News
TopNewBestAskShowJobs

ericHosick

1,083 karma · joined August 24, 2009

https://github.com/erichosick
submissionscomments
ericHosick··on Bugs in Hello World
This Porsche has a design flaw: I can only go 22,500 kilometers before I have to replace the tires.

This VW bus has a design flaw: I can't pull more than 1G on the race track.

ericHosick··on How not to blow up the production database
> Still hoping for those automatically refreshed materialized views in PostgreSQL, ala what VoltDB has.

Not exactly what you're hoping for and you probably already follow this pattern. pg_cron can help (and is now available in AWS RDS).

```sql CREATE EXTENSION IF NOT EXISTS pg_cron;

CREATE MATERIALIZED VIEW IF NOT EXISTS activeschema.some_thing_cached AS ...;

SELECT cron.schedule('some_thing_cached', '/5 * * *', $CRON$ REFRESH MATERIALIZED VIEW some_thing_cached; $CRON$ ); ```

ericHosick··on SQLBolt – Interactive lessons and exercises to learn SQL
In some cases, we aren't in a position to normalize the database due to legacy situations.

However, one thing that could be done is to use views (maybe scoped in their own schema) to make the database look normalized (Facade the database). This would help with writing future SQL.

It is then possible to iteratively normalize the underlying tables by pointing legacy code at the normalized views until the denormalized tables are no longer in use. Finally, "convert" the views into tables and drop the denormalized tables.

ericHosick··on Crazy fast build times, or when 10 seconds starts to make you nervous (2012)
> 1) Make sure devs can run a realistic version of the whole stack locally.

This idea is greatly under-appreciated in the industry.

ericHosick··on Speeding up SQL queries by orders of magnitude using UNION
> Every additional JOIN you make creates a cartesian product of all previously joined records and the number of rows grows exponentially => you join tables A to B to C to D -> SQL engine has to create AxBxCxD number rows, each letter representing number of rows in that table)

I think a cartesian product would be:

SELECT * FROM A, B; Given sizes a, b the resulting number of rows would be a X b or O(N^2).

With a join SELECT * FROM A INNER JOIN B ON A.id = B.id then the result rows would be MAX(a,b) or O(N).

A JOIN is a predicate that filters down the dataset.

ericHosick··on Ask HN: Who wants to be hired? (February 2021)
Location: Santa Cruz County Area (US Citizen)

Remote: Yes

Willing to relocate: No

Specialties : my preferred full-stack environment. infrastructure : AWS (most services), cloud formation, IAC (orchestration), docker (containers), Github Actions CI/CD. back-end : SQL (Postgresql). m iddle-tier: GraphQL, Postgraphile, express, node/javascript, python, typescript. front-end : react, ract-native, Expo, design : mocking (Figma), adobe illustrator. m anagement: technical leadership, team building, planning. other: Mysql, ruby, sketch, Balsamiq mockup. practices : agile, BDD/TDD (mocha/chai), UI mocking, data modeling, data scaling, and governance.

Résumé: https://www.linkedin.com/in/erichosick

Linkedin: https://www.linkedin.com/in/erichosick

email: erichosick {at} gmail {dot} com

About: Sr. Full Stack Architect and Developer

I'm really interested in working with a group of people who are focused on building solutions with positive social and/or environmental impacts.

I'm a highly creative and dedicated individual with over 35 years of experience working in startups, enterprise, services business, and everything in between.

* first principal focused and very detail-oriented

* created my first commercially used software product when I was 16

* in-depth experience in database, software, and systems architecting, agile, product ownership, and team building

* enjoy enabling others to grow and become successful

* love to innovate but always deliver

* excellent listening skills and also not afraid to say “I need help”

* enjoy solving challenging problems

* work well under high energy, “we can do it” environments

ericHosick··on Movies you should own: The Andromeda Strain
This is the only movie I've watched that has left me feeling disturbed for weeks. I couldn't even watch all the parts and I haven't been able to watch again.

It is really well done.

ericHosick··on Apple engineer killed in Tesla crash had previously complained about autopilot
I use autopilot daily. It drives me, on a twisty road, from my house to work with intervention when I get into town.

> how quickly might it react to a perceived obstacle?

I've had it head towards a curbed median in the middle of the road and within 10 feet swerve to the right to miss it (in a spot that I've driven by hundreds of times, but this time it kinda decided to head towards the curbed median). Auto pilot can react surprisingly quickly in a good way.

So far, for me, it has never swerved quickly towards anything. There are situations, like on blind curves in the mountains, where it doesn't know what to do. At this time, it will start beeping, showing red on the screen and try its best to keep driving: even if that means quickly heading off the road. But, it doesn't act aggressive in any way. This is what I've experienced so far.

I've had auto pilot take me, hands free, between freeway interchanges, merging, changing lanes, etc. and I'm totally amazed. At other times, it does seem to do dumb things and I wonder what it had seen to consider taking the action it took.

Even with all that, there is still a huge advantage to auto pilot. Driving with it on seems to remove >a lot< of micro adjustments that I would normally be taking. I do drive with my hand on the wheel (enough pressure so I don't get the warning messages). On long drives, I really am a lot less tired: even keeping my hand on the wheel all the time.

I also have more time to scan the road for anything going on. Looking down to see my speed, for example, (basically any action that takes my focus off the road for a second or two) is less stressful.

It is utterly amazing technology and I still can't believe it is happening while I'm alive.

ericHosick··on Ask HN: How do you organize and manage database migrations?
We're trying out a few things right now.

1) Use a migration tool (flyway, dbmigate, etc.)

2) We try and keep scripts idempotent to minimize on migration script explosion. Also helps to keep changes to similar assets located within the same file: easier to see the progress of a given asset as it changes throughout the lifetime of your app.

3) We have a dedicated repository for each database/schema. A CI/CD process triggers on a push to a given branch (dev, qa, stage, prod, etc.). The CI/CD process runs the migration script (in this case AWS Code Pipeline). Having the schema in its own repository decouples our databases from the service(s) that use them.

4) We try our best to separate schema changes from feature changes: a) push database changes first maintaining backwards compatibility, b) then push feature changes, c) then remove backwards compatibility. So, try to minimize on rollback script.

Local development is same as yours: docker-compose.

ericHosick··on The Case Against Lectures
We used an approach called student centered learning at the University I lectured at. Basically, students sit in groups and work with each other and the lecturer acts as an enabler (this is actually harder than just lecturing for 1+ hours).

But considering we retain 90% of what we teach, I decided to have a team of students give a lecture. For QA, the team would come into my office and give me their lecture along with student centered learning tasks they created.

They then lectured in the class. Other students were a lot more attentive and ask a lot more questions. The students who lectured really knew the material.

In some cases, students would come to my office and ask if they could give another lecture.

Later, I found out, a few students liked lecturing so much that they became teachers.

ericHosick··on Tesla's $2.6B Musk Award Too Costly, Glass Lewis Says
I think a lot of people miss that R&D is expensive and it is often takes those who can 'throw away money' to help fund it. This is on top of any subsidies that may exist for that R&D.

Look at cars, cell phones, computers and airplanes ("[1930's] Most people still rode trains or buses for intercity travel because flying was so expensive. A coast-to-coast round trip cost around $260, about half of the price of a new automobile. Only business executives and the wealthy could afford to fly.)"

I would love to travel to Space one time and I hope some day I can take a flight into space. Right now, space flight will literally be a "luxury vehicle that only serve as a novelty for the rich." There is no way I'll ever be able to afford it unless it is first affordable by the rich.

ericHosick··on MI5 agents can commit crime in UK, government reveals
> Societies are societies because they put the good of the group above the good of the individual.

Doesn't necessarily make a society good (aka righteous).

ericHosick··on Tesla posts big loss, cuts production of Models X and S to catch up on Model 3
Yes. I did get an email. You should be able to login to your Tesla account and 'choose' the Model 3 you want. Based on your choice, they give an estimate on when you'll be able to order the Tesla.
ericHosick··on Jerry Pournelle has died
I grew up on his sci-fi books. The Mote in God's Eye, to me, is the best science fiction I've ever read.

Lucifer's Hammer was way up there and hit close to home (being in California and all).

ericHosick··on Why I shut down wizards.town and left Mastodon
The world in general for that matter.
ericHosick··on Want to rescue rural America? Bust monopolies
Fully agree. It wouldn't surprise me if acting 'scummy' was considered, by at least one party, to be non-consensual.
ericHosick··on Want to rescue rural America? Bust monopolies
> If achieving a free market requires a complete upheaval of all of our governments and laws, then the idea isn't very useful.

The idea is extremely useful: act consensual to others. There is no better basis of a social system than this. Having conversations like the one were having now is really all we need. To force the ideas on others in anyway, especially through democracy, would be hypocritical.

A social system based on utility, which is basically all social systems we've had throughout history, is violent, aggressive and dangerous. No wonder history repeats itself.

ericHosick··on Want to rescue rural America? Bust monopolies
This is a deep discussion to have: too deep for a medium like HN. That being said...

Your points pre-suppose parties consented to a dispute resolution system: one that is based on arbitrary boundaries and quite monopolistic (1).

> I can see why people don't think that the barebones style of "free market" is very free.

So, I agree that it is hard for people to understand what consent is when they were never given a chance to choose which dispute resolution system(s) they can participate in.

(1) Example being I was born in the USA so somehow automatically consented to the rules of the land.

ericHosick··on Want to rescue rural America? Bust monopolies
> "Free market" implies "I can do what I want"

I always though free implied free from non-consensual acts. It's not much of a free market if your actions are non-consensual (1).

(1) Defining what makes an action consensual is difficult but doable.

ericHosick··on Databases have failed the web
> All because we're programming against a frozen database spec.

Relational databases, unlike XML, JSON, Key/Value stores and ORMs, do not pre-suppose document structure. On top of that, it is very easy to create new relations (entities) using Views. On top of that, you get a real algebra to play with: relational algebra.

SQL makes it crazy easy, in real time, to see your data in any hierarchal manner you like (via denormalized entities).

The one thing SQL 'lacks', and JSON shines at, is a way to return data in a hierarchical format (aka: to return JSON directly). I have 'lacks' in quotes because there are SQL solutions that can consume/spit out JSON.

An interesting idea then is to provide a way to easily convert between SQL and JSON. To that end, there is an open source project https://github.com/erichosick/sql-json that attempts this. The results are promising but there is a lot of room to grow.

ericHosick··on Silicon Valley job seekers are increasingly looking for work elsewhere
SV seems to have migrated a bit North.

At one time, Scotts Valley (other side of Highway 17) was considered part of Silicon Valley (Borland and Seagate).

ericHosick··on US Senate votes to undo FCC internet privacy rules
There was a study a read (that I can't find now), I think by MIT, that showed there was no correlation between what bills passed in the house/senate and the 'will of the voter' (what people wanted).

Until you took into account money. Then there was a correlation between what was passed and the 'will of the lobbyist'.

Really wish I could find that study again.

ericHosick··on JPMorgan Software Does in Seconds What Took Lawyers Many Hours
> The issue has never been the backend systems at banks

I find this hard to believe considering the pains we were solving: now quite some time ago. Maybe they have changed.

Excessive burden on mortgage consumers is driven by many aspects.

At it's core is (was if what you say is true) the inability for backend systems to effectively aggregate and verify the necessary context to easily meet regulatory needs.

We were starting to aggregate such data allowing us to automatically verify and then fill out all forms necessary for the mortgage consumer.

ericHosick··on JPMorgan Software Does in Seconds What Took Lawyers Many Hours
Had a company that was solving sort of this problem a while back (early 2000s). Read in forms (1003 for example), did automated underwriting (hooked in with Fannie Mae), pulled in rate sheets from different Banks to do automatic rate calculations for loan officers. Rate sheets were loaded in daily. There was a rules engine to cover the many complex rules required to determine if a loan was viable for a given 1003 form, etc.

Managed warehouse lines, etc.

ericHosick··on Jq – Work with JSON on the command line
Friend wrote a feedforward neural network using jq.

https://github.com/kevin-albert/jq-neural-network

ericHosick··on Is democracy a failure? (1861)
> Heroin, meth, etc. definitely are harmful and addictive, and destroy lives. Selling them would be violent...

Unless you can personally claim ownership of those people, among other things you're claiming ownership* of, there is no aggression (initiation of violence) taken upon your person or things when someone is destroying their life.

If you can personally claim ownership of those people, and society as a whole, then you are correct and the selling of the drugs would be an act of aggression towards yourself.

* The act of withholding something from others.

ericHosick··on The Untold Story Behind Saudi Arabia’s U.S. Treasury Holdings
> I'd rather have fiat currency than gold, because that would save me the time and hassle of selling the gold and getting something I can actually spend.

Isn't currency backed by commodities considered something other than fiat currency?

ericHosick··on Nikola Motor Company
> Never plug in - Turbine charges batteries automatically while driving.

How does that work?

ericHosick··on Re: Obama on Fetishizing Our Phones
> If you don't trust judicial review, there's no hope left for you to function in a normal society

I would like to hear your definition of normal society. I personally feel that there are thousands of unique societies in the world.

Considering that technology knows no borders, I hope you and the "society filled with other people" have normal society figured out for us all.

ericHosick··on Income inequality is not the problem, it's a symptom
> In the end private property is indeed theft, more exactly the imposition of someone's moral values over the other's by intrinsic force (if you "steal" you might go to prison or worst).

What you're pointing out is a monopoly called "The Legal System": a single dispute resolution system everyone must adhere to without choice (Government/Mafia). This monopoly is often based on geolocation. Property will be inherently aggressive if one is forced to use a specific dispute resolution system.

Everyone withholds stuff from others: it is 100% universal. In this way, the notion of "property is theft" can not hold because everyone (even animals) do it: consciously or subconsciously.

There is then the system of dispute resolution. This defines if a particular act of withholding was an act of "theft".

The combination of withholding + dispute resolution results in what we call property.

Competing dispute resolution systems is really that free-market people hope for. Dispute resolution systems do not have to be based on geolocation. In fact, people form millions of these unique systems every day, freely, without resorting to monopolies or the lowest of low dispute resolution: killing one another.

> The sooner we realize this the better, there's no second-guessing about it.

So ya. Property in and of itself is not theft. Forcing others to use a specific dispute resolution could be viewed as the theft.

← PreviousPage 2 of 14Next →