skysight-inc/HackerNews huggingface dataset:
ActiveRecord does not treat SQL as "the source of truth". ActiveRecord objects maintain their own state, and still try to be a "proxy" for rows in the database. When you call "save", it's tracking the identity of the object using the primary key, and generating SQL from the runtime state of the object. This is backwards.

The biggest problem for me is this "proxy" behaviour. When you start treating objects as proxies for database rows, your database logic inevitably leaks into your business logic. Someone returns an ActiveRecord `User` object from a database method and now random other parts of your application are intricately linked to your database implementation.

On top of that you suffer terrible performance problems. Even if you're smart enough to avoid the whole N+1 query issue, you lose control (and more importantly visibility) over where database updates are coming from, and your ORM is either not smart enough to efficiently apply updates, or so smart that building the query takes longer than actually running it! (I have this problem with SQLAlchemy right now, where it's taking several seconds per request CPU bound in the ORM). Undoing this is literally impossible without a near total rewrite.

And it all serves no purpose! The application-specific interface to its database is usually quite simple. You can just have it be a literal interface/trait/whatever and implement each method by executing a bit of SQL, or calling a stored procedure, or however you like. Arguments and return values should be plain-old-data (no magic proxy objects) and each method should correspond roughly to a transaction so that the rest of the application doesn't have to worry about that database-specific stuff.

There are a ton of other benefits to doing stuff this way, too many to list here, but it really helps with complex migrations (like if you need to migrate from one database to another), maintainability, testing, etc.
A fair comparison would be ActiveRecord vs raw Arel.

I.e. ORM vs query builder.
>>"you fundamentally cannot know what will come out the other side"
> This is a baseless and false claim.

Last I checked it's impossible to predict the future. Please educate me otherwise, because we'll make a fortune in the bond markets.
EDO (https://www.edo.com/)

San Francisco/LA/NYC/Full-time/Onsite

EDO is a data science software firm that develops analytics tools to make data accessible and actionable for the media and entertainment industry. Currently focused on film and TV, we work with many major movie studios, TV networks, and consumer brands to help them forecast, market and distribute their content more effectively.

Open Positions: Fullstack Engineer, Backend Engineer, Data Engineer, Product Manager, Data Quality Manager

Job Board: https://www.edo.com/careers

Tech Stack: React, Angular, Ruby on Rails, MySQL, Python, Resque, AWS, Javascript

If interested please email: Careers@EDO.com
You can implement push/pull on both ends of an array-back deq in O(1) time for all. Store the backing array (know the size as well) and then store two indexes, the front of the deq and the back of the deq. You update the front/back the obvious way on push/pop except you do modular arithmetic if it would take you out of bounds.

You have a limited size of the deq of course, but here that's fine, it's actually constant size for all of them except the final possibly smaller one.

So now, what work do you have to do on insert? For the destination deq, you need to do one pop, one copy-in and up to n^1/2 moves. For every deq after that, up to about n^1/2 of them, you need to do one pop and one push, each of which costs O(1).
In my experience Django's migrations are really solid, assuming you're using the PG or Sqlite backends. This is especially true if you're working from a new Django project, and not a "legacy system" that wasn't initially built for Django.
Indeed this is a bad idea for many reasons.

I tried to think about it from a gitflow release cycle perspective to be generous. This would mean constant churn of migration code for each branch of the repo.

If you have complex migrations which go beyond simply renaming columns, it would require you to write special migration code on a release branch which would then need to be merged back. yuck!
To unify Northern Ireland with the Republic, I think there are a few people that have to be asked first.

I mean, it would be somewhat in character for the UK to attempt to achieve that unilaterally and with no consultation, but I think that to try and just 'give it back' as a solution to Brexit is, while no doubt well intentioned, still representing a bit of a colonial point of view.
I've seen "business logic" refer to both A) how a discount promotion works and B) how to arrange images of the product for a particular set of customers. Obviously it's fine to have A in the database...
California city experiments with universal basic income
Are scripts loaded in a web browser considered "users". If so, don't most people run systems which cant trust all of their users?
Good point. I can start doing that for mine.
True. Way over the top, obviously.

But the "did you even read the article" thing has been the death of a lot of otherwise interesting threads lately. Heck, look at this one.
That's a revelation? Thunderbolt has had all that for nearly a decade now.
Cast&Crew | Burbank Los Angeles | Full-Time | ONSITE | VISA

Cast & Crew is one of the largest providers of payroll solutions for the movie making industry.
Help design and build a platform for the next generation of Movie Studios, Film Makers and Actors!
Based in Burbank, Los Angeles, California.

Jobs at:
https://boards.greenhouse.io/113134

I need: Salesforce administrator, Salesforce engineer,
Node.js engineer, React.js engineer,
And C# engineer
Contact: John Cullen
Email: john.cullen@castandcrew.com
Tel: 415.350.3651
I wholeheartedly agree with the article. Every time I've used an ORM I've regretted it. SQL is already a great DSL for working with relational data, and there is no reason to create a leaky abstraction on top of it. The reality is that there is no practical way to do efficient mapping from relational data to object models, and pretty much every ORM ends up generating horridly inefficient queries when you start getting into non-trivial cases. At that point you're going to have to go in and write the queries by hand anyways. So, you might as well just skip that step and work directly with SQL.

The worst part is that you often find out that ORM is affecting performance when you start hitting real world loads in production.
Neural Structured Learning in TensorFlow
I’ve found that you want to be super careful in application code about where you do updates and inserts when using AR.

Sprinkling calls to order.save! or order.update(foo: bar) in random places is a recipe for disaster.
I’m curious if people are using raw Arel in Rails apps to this end.
I assume Google's policy is informed by trademark law and all the lawsuits that they have defended. https://www.forbes.com/sites/ericgoldman/2015/06/02/google-a...
I think you and the post you're replying to have opposite opinions, despite your post seemingly starting off by agreeing with them.
SEEKING WORK | Colorado | prefer Remote w/ max 25% travel

Frontend Engineer w/ Secret Clearance

Experience: 8 years contracting and consulting; All of my projects since 2015 have leveraged React and I prefer to stay in the React/Node space;

Beyond ReactJS, I also have experience w/ vue, angular, jquery, C#, Java, grails, salesforce 'languages', terraform, docker, kubernetes, a bit of tensorFlow and tensorForce.io, and many frontend libraries, (oh, and adobe flex; i loved flex).

Email: meowmitmeet@gmail.com
A lot of languages have pleasant multi-line string literals. Also if you have a 1000 line hand-crafted SQL query, it's probably not going to be pleasant in your ORM either.
Koenigegg Jesko – The 300mi/h super car
The charging thing in particular seems like a disaster— the situation is bad enough with dedicated power supplies, where we have Amazon pages listing specific devices and laptop models that are known to work; but then there's this whole classes of setups where the correct behaviour isn't even knowable without directly querying the user. If I plug that USB-C battery bank into my laptop, should it be charging the bank from the laptop, or charging the laptop from the bank? Does it depend on whether the laptop is plugged in or not? If the laptop is plugged in to a current-limited source, should it prioritize charging the bank or its internal battery? Gaah.

Here's what the Android prompt for this looks like: https://www.quora.com/Devices-can-charge-or-be-charged-via-U...
I'm going to say something that I hate myself for even as I type it: maybe historic building status would actually be a good place to use crowdfunding. If enough people want a building to be protected, then they should put their money where their mouths are and pool up enough to outbid the developer - that way the building owner doesn't get shafted and the preservationists get their way.
I think OP tried to argue that if USB-C is just a replacement for Micro and Mini then why USB-A -> USB-Micro is replaced with USB-C -> USB-C instead of USB-A -> USB-C. This proves that USB-C is a replacement not only for Mini and Micro, but for -A too.
My question is that each move is a set of push/pop. DEQ based on fixed array has linear complexity for either push (left aligned) or pop (right aligned). One way to have constant push AND pop is to allow for the left and right element to not be aligned to the initial fixed array memory allocation.

For example, for a full DEQ, in order to perform a push, I would have to:

1. Pop the last element

2. Move all element to the right by 1

3. Push the item into position 0

This would be a linear operation. Unless the address of the starting and ending element can change, I don’t think it’s possible to get both push and pop to less than linear time.

Edit: I was wrong--key is circular buffer
I am not arguing the cause of mass murder, I am arguing that people can't tell others what to do/say about it if they are the biggest benefactor of mass murder entertainment.
This is used to implement a unified login across Google properties.
At sufficient photon energy the initial absorption kicks off secondary electrons which blurs the feature edges/limits effective resolution. This problem already exists to some extent with EUV but gets much worse at X-ray energy.
ORMs are solving a problem that really should be solved on the DB layer: providing a non-bullshit programmatic API. As a developer, I DO NOT CARE whether the value of my object is saved in a different table or not I JUST WANT IT SAVED. A DB that will provide a good programmatic API AND analysis interfaces will be golden. And there have been a few good attempts reaching there. ORMs will be solved when you don't need an ORM to access your DB.
I flatly reject the notion that it is just a matter of common sense to be a part of the EU versus not.

Giving up a little bit of sovereignty to the EU has both benefits and costs. I am merely affirming my OPs point in that actions have consequences.

I'm just suggesting that it's possible that joining the EU may come with consequences that a country won't be willing to bare. 52% of the voting populace of the UK stated as much.
This was asked and answered on Web Applications.SE:
https://webapps.stackexchange.com/questions/30254/why-does-g...

> When you log into a Google site like GMail, Google also logs you into all your various accounts Google accounts - such as YouTube. In order to be logged into a site, Google sets a cookie in your browser.

> This is fine for most of their properties which are on the google.com domain (mail.google.com, docs.google.com, etc). However, a website can only set and read a cookie for its own domain - google.com can't set a cookie for youtube.com. To get around this, as part of the login process Google will redirect you through accounts.youtube.com to log you into YouTube - and typically your country specific domain if you are outside the US (e.g. I get logged into google.com.au as well).
I believe this case is very badly handled in this data structure implementation. It seems to be saying that you want to occasionally manually recreate the DS as it grows bigger, as the deqs won't automatically resize. So you'll just have linear behavior in that case, with extra constants because the deqs are useless logic.

I suspect an amortized data structure could automatically and internally do this rebalancing operation, but I'd have to work out the scheme and the analysis. At a guess, something like normal dynamic arrays do, where you multiply the max size by a constant when it fills up, would give you decent amortized bounds.
That sounds better, but it still throws a lot of thermodynamic theory out the window.

When it's cold outside, and you want to heat inside, you want to use indoors as the heatsink. Even if it's -20 outside and +20C inside, you can still heat the inside by removing heat from something +10C and making it -20C.

If you put liquid water into your electric freezer, a fridge pumps heat OUT of the water to freeze it and exhausts it indoors. A net benefit.

While the heat tube system moves the heat from the water outside when you really want to move that enthalpy into the home. But it instead moves that heat outside. That's bad when you're trying to heat inside. It's just throwing away energy.
No, I agree with the post I replied to in that migrations should be human versioned as opposed to auto-versioned via a VCS. Again, I was being generous to the author trying to imagine a scenario where this would not create a dumpster fire.

Hopefully I have cleared that up.
It's interesting that you chose to wiki-splain the scientific method in response to ... what? The notion of anthropogenic climate change? The accusation of being a denier?

Whatever, the reason that's interesting is that an increase in the frequency and severity of "anomalous" weather events is, in point of fact, one of the chief falsifiable predictions of the climate scientists whose work you dismiss.

Everyone always points to the hyper-specific, obviously catastrophic, missed predictions for which, e.g., Al Gore is probably most infamous as a failure of the models [0], when one of the main things they actually, specifically, said would (would, not could) happen, as more energy was added to the atmosphere ... is happening.

[0] The thing about those predictions, which I think the people watching in good faith assumed (on the basis that they were, you know, explicitly thusly disclaimed) is that they were known worst-case, hypothetical for illustrative purposes kinds of deals — which, yes, was a terribly dumb move, given how those predictions were taken, and have been pilloried since.

EDIT: Footnote and phrasing.
> I won’t speed through it but I sure as hell have a right to use it as much as the local home owners.

That's the point of No Through Traffic. It removes your "right" to impose your externality on the residents adjacent to previously-quiet street. You are not physically prevented from getting to your destination and are reduced to the path you already took.

> The needs of the many outweigh the needs of the few.

You are the few in this case.
As with anything, any bit counts. It may not seem like it makes a huge difference but in general anything that mitigates the culture of consumerism helps prevent waste.

Yes your own immediate impact on global waste is much higher from your kitchen trash than your device purchases. But people buying a new device every year, regardless of what they do with it after, encourages companies to keep producing these products at tremendous rates, which in turn results in far more environmental impacts due to everything that comes with it.

It’s sometimes hard to see the effects beyond the scope of what we see on a day to day basis, but they are absolutely there at the societal level.
Automatic migrations using only source-code snapshots don’t work for things like column renames or splitting/combining columns. Every tool I’ve used requires some migration metadata.
Drones from the truck to the door would work, however. I could see the elimination of the driver walking the package to more of a drone operator to dump the package on the doorstep. Automation could queue it up so they could just put it in park and fly it... or even have remote operators picking up the package from a truck to the doorstep.
You've answered your own question implicitly. The address of the starting and ending element can change. You just define yourself where in the backing array the start/end are, and let them wrap around (use modular arithmetic for the indexes).
What did the Romans learn from the barbarians in Germany and Britain? (2014)
yes the most successful analytic practice would be the one that could successfully traverse the boundaries we've constructed between mind and body. the idea is that h. pylori, for example, has a role to play (one way or another) in the reproduction of stomach ulcers, but the bacteria is not linearly causal. rather, it is situated in a complex dialectic web that modern medicine (and the "psychosomatic school" for that matter) are mostly unequipped to analyze. this is reflected in the gross failure of the diagnostic taxonomy produced by the medical/psychiatric industry whose validity should be (but is rarely) continuously questioned.

for what it's worth the "psychosomatic school" i'm most familiar with criticizes harshly the "psychosomatic school" that i believe you're familiar with. indeed there are many ineffective and harmful centers for the treatment of "chronic illnesses." it's really shameful
Anecdotal experience of mine. I did time in prison and went through a treatment program. A significant number of other inmates in that program had experienced head injuries prior to their criminal act, self included. It was enough other people that I found it remarkable at the time.

edit: I would also add that I don't consider that the injury gave the criminal no choice. I believe that it removed inhibitions that most people regularly experience.
Why is that the case? Isn't the BSD license more relaxed? I would think companies like RedHat would have liked the BSD license more.
It doesn't always affect performance. A lot of business apps are mostly doing CRUD under fairly light load. It may be that beefing up the database server is much cheaper than interacting with the database in a way that, while being more performant, is also more laborious.

That said. . . yeah, I've also had my share of cases where the app ended up seeing higher load than anyone anticipated, and it's hard to even see the source of the performance problem, because, with an ORM, it takes a little bit (or, with the worse ones, a lot) more work to find out what the actual queries being executed are so that you can ask the DBMS to `EXPLAIN` its query plans.
> most people simply blame the homeless person as someone who behaved badly, obviously.

I don't think blame has that much to do with how people form social connections. I think people assume there are a host of other problems associated with homeless people and stay away from them for those reasons, regardless of whose fault it is that they're homeless.

Great article, by the way.
Is innovation supposed to pause for society to catch up every time something drastic is created or discovered?
The only way to beat corruption is by shining a huge spotlight on it and remove every spot people have to hide.

I'll say the opposite - all college donations and income should be publicly available as soon as the ACH transaction clears. Questionable sources immediately flagged. Make every single dollar within the education system completely transparent. Then if some kid gets admitted, and we also see their parents made a $5 million donation, we can go ahead and appropriately stain that kid's admission.

What about the kids who really earned that admittance and their parents made a sizable donation? Then the parents donate their funds to another educational institution. Or the kid attends another institution. Wherever these two actions overlap - immediately assume fraud over anything else.

On bribes directly to individuals - their funds are all publicly available as well. If that's a problem, there are millions of other jobs they could pursue rather than being a useless parasite on the education system.
The major reason seems to be a lack of cultural support. Despite everything, people still largely dislike the idea of public transit. I read a very good article that said to generate interest, transit must preemptively provide better service... its a catch 22
Prior to the invention of the photograph, people were forgotten. I don't think that was a bad thing. Our brains weren't designed to retain all family member from all time. Also, why? Why would we need that? I don't care to see a family member from 4 generations ago walking to the refrigerator in some video.

No, this tech will be used to amuse and/or influence the intellectually challenged.
.NET Conf 2019: Agenda
> What if Waze labeled these as possibly $5 toll roads?

As a general rule of thumb, the law looks dimly on naked attempts to subvert it.
> the rest are just popping/pushing front/back.

Sure, but this step would require a right shift for (in the worst case) every element in the structure. Suppose you have the following DEQ:

[R0] -> [0, 1, 2]
[R1] -> [3, 4, 5]
[R2] -> [6, 7, 8]

And you want to remove 4. From my understanding of your README, the structure will look like this after the operation:

[R0] -> [0, 1, 2]
[R1] -> [3, 5, 6]
[R2] -> [7, 8, _]

This was not and O(sqrt(n)) operation, because you had to move elements 5, 6, 7, and 8 (not just 5 as suggested by your figures). So in general you still need to move O(n) elements upon any insertion or deletion.

EDIT: Just read some of the other comments and realized that this can be done with a circular buffer with a bit more memory than the subarrays themselves. Makes sense + clever! @OP, I really think you should clarify on this important implementation detail in your writeup.
One did. In your opinion, how should their foreign economic policy of the next 100 years proceed in order to help facilitate and spur continued growth?
> providing a non-bullshit programmatic API

ORMs are necessarily language-specific, and as a single DB interfaces with multiple languages it’s impossible to do as you suggest (that’s what SQL is anyway).

An object in JavaScript has different semantics and conventions around it (everything is a prototype and a dictionary simultaneously) compared to C# or Java (everything is statically defined)
We do, the domestic customers of the USPS. But not via tax money; rather via increased local rates.
A 26x33 mm die would yield 86E9 transistor. Pretty impressive.
Thanks! DEQ implementation with circular buffer. :)

Edit: should have thought of that. Brain fart—-long day at work.
I'd been hoping for an actively maintained spiritual successor to Inman’s Mint. https://haveamint.com
> I'm saying SQL is a bad API. You can probably make some api language that's more explicit and imperative on top of something like postgres. Change the API itself don't write something on top of it.

Something like VSAM or IMS?

The relational model and declarative query languages were invented because the previously existing imperative navigational model was far too inflexible and difficult to use. Access paths were baked into the data structures, you had to be your own optimizer, and if you optimized for the wrong usage patterns, you had to refactor everything or live with poor performance.
Because for a large number of workloads, hyperthreading gives real performance improvements.

The vast majority of consumers aren't running compute heavy workloads that are more amenable to SIMD work (which it sounds like this might be) than the sort of highly branching, often stalled work that general purpose programs do.