News for hackers. Stuff that matters.

ArtB

Re:1970 Clean Air Act Was Intended to Cover Carbon Dioxide on Wednesday August 07, 2024 @10:16PM (#41187503)
1) how would states rights prevent the tragedy of the commons? CO2 emissions surely apply. You would need to have state-level tarrifs for bad actors.

2)If you move it to the state-level how does that simplify the statutes?

Re:UK: Fast charging EVs more expensive than filling petrol on Thursday February 09, 2023 @03:42PM (#34731096)
People need efficient transport not efficient cars. Efficient cars are merely less bad, rather than good. We need more public transit and less urban sprawl so that we can reuse infrastructure efficiently.
Yes! I wish this was known. Mine lasted a couple of days. Thought I'd never feel joy again.
> Jobs aren’t for financially sustaining you—they’re for financially sustaining us.

That is the crux. I feel like most businesses actually don't produce enough value to justify their own existence and therefore require below cost-of-living wages to keep them afloat.

Sounds like it would have lots of noise.
Re:The work-from-home future is destroying bosses' brains on Thursday June 10, 2021 @09:38PM (#27468373)
> the rest is socialization, pointless meetings, lunches, or trying to look busy.

The parts that for me made the job bearable. The rest is legacy support for CRUD apps. The office is a perk for people with few other outlets.

Re:Johnson and Johnson Has a Baby Powder Problem on Sunday April 03, 2016 @10:12AM (#11416149)
Yeah, but they might live for another 6 months, or 18 months. They might see there kid graduate or get married or met a grandson in that time.

Also, a close family friend was given 6 months to 3 years to live when her cancer spread through her body. It's been 10 years. She is getting sicker and sicker and on chemo the whole time, but she is still managing to attend the odd family function when she is feeling up to it.

This shit isn't a game, these are peoples lives and we need to make sure they can live it even if it means a few less unicorn start ups.

Re:Ask HN: Is Python dying? on Monday February 15, 2016 @09:53AM (#11103637)
Object oriented does not require state: it requires encapsulation. I incorporate as much immutability into my code as possible and I would say most of our objects never have their state changed from instantiation and I write Enterprise Java all day long.
Re:Invalid Object Is an Anti-Pattern on Wednesday December 30, 2015 @01:59PM (#10813609)
> If it's the latter that's the domain job.

The domain's job is to represent and encapsulate valid transformations in the domain. If it's not valid within the domain then it doesn't belong in it. If you get a well-formed XML file that has -7 as a social security number, that is not something that your domain has to deal with. It should be caught by the corruption layer. It's not a valid value for your domain. Where I work we regularily build an import domain that allows users to see all the invalid data and manually correct it before allowing it into the rest of the system. Once I have an instance of a Person object I should be able to trust that it is sane.

> The third, from the experience I have, is a big flashy "no no".

It depends; I'd say it's on a case-by-case. Doing a read can be much more acceptable than a write. It's all about trade-offs at that point, but the benefit of knowing "if I have an instance I know that it is sane" means you don't need to litter your code with guards and that pays dividends in maintenance and bugs and agility and testability and, yes, even performance. A big factor is the cost of load. I usually work on low-load (~14 concurrent users) high-importance systems (eg global pricing management) where correctness is at a premium and we usually have system resources to spare. YMMV. As I said: it depends.

Re:Invalid Object Is an Anti-Pattern on Wednesday December 30, 2015 @12:23PM (#10813083)
> Some validation only makes sense on a specific operation. The object you constructed, due to some business rule, may be invalid to delete but valid to update for instance.

These are two different concepts I feel you are mixing up. An object may be valid, but that doesn't mean it's valid for all operations. For example there is basic validation that a file object is valid if it exists, but if you only have read access to it .append("foo") will fail on it. But it's still a valid file. Your constructor should be checking for the first kind of validity, and your methods for the second.

> What if you receive, from a webservice or something, a valid object format-wise but invalid from the business rule perspective?

That is what you need an [anti-corruption layer](http://www.markhneedham.com/blog/2009/07/07/domain-driven-de...) for. The object makes sense within that other services domain but not within yours. That domain may be closely related to yours, but it isn't you. You need a separate object for that (a simple struct ought to suffice usually). Then you act as a gatekeeper only allowing conforming objects into your system. Basically filter out the shit, and make sure if it makes it past your gate it is clean. Otherwise you might want to use the [state pattern](https://en.wikipedia.org/wiki/State_pattern) to allow for different validation rules of the same object (eg legacy accounts might not have an email address but all new ones must).

> What if there's some info in the database that would allow or not you to construct the object the way you need? You would go to the database and check the info in your constructor?

This is touchy. Sometimes, if it's important enough then yes. Sometimes you can code around it (eg having case numbers auto-generated at time of persistence). Other times you bite the bullet. Other times you rearchitect the data (storing it in memory to do the check quickly). Or as a last resort, except it as a compromise and start coding up some roll-back functionality. Aim for the ideal, and know when to step backwards towards the practical: that is the art of software development.

Re:DataGrip 1.0 (formerly 0xDBE): A New IDE for DBs and SQL on Thursday December 17, 2015 @05:10AM (#10750548)
> EDIT2: The price is also way too much in my opinion. It basically costs as much as PHPStorm. Not sure why you would by DataGrip instead of Navicat.

Uhm for Navicat you need to buy a different license for each database and operating system you use. Where I work we use both SQL Server and MySQL and I use three different computers with different operating systems. JetBrains terms are much friendlier.

Re:The Danger of E-Books on Friday October 16, 2015 @10:04AM (#10399323)
I honestly just use my Kobo for tech books like Manning and classics from Project Gutenberg. Otherwise dead tree.
Re:Shinichi Mochizuki and the impenetrable proof on Wednesday October 07, 2015 @08:06PM (#10350021)
> And most mathematicians have been reluctant to invest the time necessary to understand the work because they see no clear reward: it is not obvious how the theoretical machinery that Mochizuki has invented could be used to do calculations.

I find this _deliciously_ ironic since that is the position most students have towards mathematics in general (replace "calculations" with "anything relevant in their lives").

Re:C++ concepts support merged into GCC trunk on Friday August 07, 2015 @10:33PM (#10026111)
Any summary on what was omitted? I'm not a C++ programmer so going to the source wouldn't help me much, but I'd love to know.
Libertarians care about [1] and are a significant percentage of the user base and a worthwhile demographic for advertising etc.
The property of homoiconicity is shared by all Lisps, Forths, and Prolog amongst others: https://en.wikipedia.org/wiki/Homoiconicity
Re:Suddenly, a leopard print sofa appears on Saturday June 20, 2015 @12:56PM (#9750407)
Hmm, in your opinion do you think this would be a good technique then for digitizing paper maps? And if so, could you point in the direction of a library or textbook you'd recommend?
Re:Why Open Source Misses the Point of Free Software on Saturday June 13, 2015 @05:27PM (#9712730)
Don't forget the AGPL.
Re:PaperLike: 13.3″ E Ink Monitor by Dasung Tech on Monday January 26, 2015 @09:06AM (#8947025)
Is there an e-ink reader with a 8.5"x11"/A4 screen that'll display PDFs? All I want is to be able to bring all my tech ebooks with me to work and be able to look things up/brush up on things on the commute/flight etc.
Re:JRuby 9.0.0.0-pre1 Released on Tuesday January 20, 2015 @11:45PM (#8921491)
With the plug pulled on Groovy I'd love to see optional static typing added to JRuby, even if it wasn't a Ruby-compatible extension.
Re:Why I vertically align my code on Saturday November 29, 2014 @01:15PM (#8674508)
Formatting -IMHO- depends on context. I have one convention I generally use which is chaining methods together on one line, but when chaining together builder method call I make one line per call. That means the semantics not the syntactics of the code determine my formatting. For this reason I abhor auto formatting code unless it is currently like an unrecoverable mess (ie NO thoguht put into it, not just "not my style"). Honestly, put your curlies wherever you like them, then don't effect readability as much as lacking comments or convoluted flow.
Re:The Unreasonable Effectiveness of C (2013) on Thursday November 27, 2014 @09:59PM (#8669488)
That dream is so child-like that you should treat that person as a child.
Re:Project Oberon, 2013 Edition on Monday November 17, 2014 @11:51PM (#8622418)
For those looking for Wirth's book mentioned by the parent: http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf
Re:How My Employer Put the “FML” in FMLA on Friday October 31, 2014 @10:51AM (#8539034)
>>> but my guess is that the majority of companies fall into the category where losing a person for a month is crippling.

I'm of the opinion that this is a reason to discourage the growth of small businesses. They are too small to absorb shocks like pregnancy or family emergency that contribute to the well-being of a society.

Re:What will it take to run a 2-hour marathon? on Friday October 10, 2014 @04:32PM (#8439862)
No, it should be part of HTML. A dimension or unit tag. It seems like a perfect continuation of semantic tags and the direction of XHTML 2 before the presentation-focused monstrosity that is HTML 5.
I'm still not clear on what this library actually does...
...as did factory owners.

Is there a name for the logical fallacy where one knowingly misrepresents true statements to suggests things that aren't true? (ie that only unions used violence or had criminal ties).

Re:Gödel’s Loophole in the US constitution on Sunday June 01, 2014 @09:50PM (#7831486)
> a single inconsistency in a formal logical system means you can prove anything. if both A and !A are true, then you can prove anything you wish via contradiction.

I believe this has been solved in intuitionistic logic (http://en.wikipedia.org/wiki/Intuitionistic_logic). If you don't except the law of the excluded middle and require constructive proofs you avoid many of these shenanigans.

Re:Open-Source Graphics Processor on Wednesday October 09, 2013 @08:27AM (#6520802)
How will this be different than http://en.wikipedia.org/wiki/Open_Graphics_Project which had some promise and then faded into the sunset?
And then not be able to see your family and grandkids often? Might as well move their now, lay down roots and work remotely.

Older »