Better HN
topnewbestaskshowjobs
Log inSign up

slackingoff2017

1,702 karma · joined Apr 30, 2017 (9y ago) · 374 submissions

Submissions

comment 9y ago · link · parent

Finally blocks ensure code executes even on exception. In the second example hideLoadSpinner will never get called if you hit the catch block

comment 9y ago · link · parent

Ehhhh that's not quite true either.

Above a certain rpm the engine cuts fuel completely and engine braking is strong. In cars with electronic throttle control the computer might also open the throttle to maximize energy consumed compressing air.

As you pass through that cutoff range the engine starts firing again, maybe 700 rpm above idle. Engine braking stops being effective when this happens.

Also, newer cars don't do a full fuel cut when engine braking with a cold engine or if the catalyst is getting too cold to work. So sometimes engine braking isn't very strong.

Basically you can't rely on engine braking so when you're doing it your foot usually hovers on the brake pedal. This isn't any different than the hybrids

comment 9y ago · link · parent

I think the author is reading too much into this. Even in ancient times it was known that hybrids were frequently larger than the parents. Take Ligers for example (lion tiger hybrid).

People were probably more familiar with animal husbandry than today, so it makes sense to exaggerate that natural tendency to make somewhat believable monsters.

I don't think it had anything to do with xenophopia or "category violation" . The Earth has all kinds of weird shit like flying squirrels and humans

comment 9y ago · link · parent

Uhhh, manual cars have worked like this forever. In first gear especially the braking when you let off the gas is enough to be jarring if you're not gentle

comment 9y ago · link · parent

True. The JVM is big. I've been meaning to try Golang one of these days, I see it as Java's spiritual successor

comment 9y ago · link · parent

Progaurd is default on Android and some other environments, it's not anything exotic.

comment 9y ago · link · parent

You can get under 200KB in Java easily by using proguard or similar to strip unused code from your dependencies.

comment 9y ago · link · parent

Java will use as much memory as you give it. Higher heap size is better for performance up to around 32GB. For most Java apps you can limit heap to 256M or less with little consequence.

AFAIK Java uses less ram than Python and JavaScript, only common languages that beat it are Golang and C/C++

comment 9y ago · link · parent

This is great

comment 9y ago · link · parent

I thought microwaves weren't high enough in the spectrum to disrupt DNA which is the main cause of cancer risk for gamma/x-ray? Individual waves don't have the energy to break bonds even for relatively high power transmitters, at least that's what I've been told.

I'm not a comms engineer but I've also been told the biggest risk microwave exposure is thermal burns. Especially to the eyes which have limited cooling ability and pain receptors

comment 9y ago · link · parent

This sounds unreal, but I found a place that was $210 a month about 6 years ago. The area was sketchy and the place was crap. Best thing about it was that it didn't have roaches.

Since college funding is usually on state level you have some latitude with where you initially move. Going to a community college in a farm town doesn't sound like a blast but it's probably the easiest way to make things work from a cash flow perspective.

Your friends/family are likely to think your "master plan" is crazy too lol

comment 9y ago · link · parent

I fail to see how moving to a place with better benefits is either one of those things.

Isn't that the reason that pretty much everyone moves? Better jobs, better schools, less crime, etc...

I guess it can be seen as egotistical and selfish if you're the kind of person that doesn't like anyone to build housing that spoils your view. The NIMBY archetype

comment 9y ago · link · parent

Nothing in there about money? Here's one I figured out a couple years too late...

You got average grades and nothing unusual about you that would lead to scholarships? If you go to school the "normal" way you're likely to end up in huge piles of debt. Even if you go to community college first.

An open secret is location. Find a place in the country, or even another country, where college is subsidized for residents. Instead of going to community college in your home town, prioritize moving to that location ASAP.

Get a part time job, a crappy apartment, and start community college there. Pay close attention to their residency requirements to make sure you meet them as quickly as possible. Then transfer to the college of your choice and save tons of money

comment 9y ago · link · parent

I have seen this happen firsthand. It took a few years but the "rail line to nowhere" built near me around 5 years ago has giant housing complexes surrounding every station. It runs over capacity during rush hour now.

I assume this only happens in places where the roads are overloaded though

comment 9y ago · link · parent

This is insane. They're using ML to predict wind speeds at different altitudes and how to move the balloons with their various speed and power restrictions to optimize on-the-ground connectivity while maintaining close enough clusters and decent backhaul. Incredible.

comment 9y ago · link · parent

This is excellent news and I'm incredibly grateful the code used to convict people will be publicly scrutinized.

That said, me and other C# devs have already found numerous signs that at least parts of the codebase were done by someone clueless or inexperienced with C#. And there's no tests.

If someone spends the time to look into the codebase, I'm predicting a basically 100% chance that parts of this code will be shown to produce inaccurate or completely wrong results. Innocent people will probably go free because of this.

comment 9y ago · link · parent

Nice! I can see more too.

Using out parameters, these are highly discouraged. C# let's you do terrible things (including goto) but the community is pretty aligned that it's bad practice. In my years of doing C# I've never used one once.

Not using var anywhere. This is C# type inference 101.

Throwing "Exception" in catch with only a message. This is horrific because it throws away the original context and any stack trace. You can just say "throw" (just the one word) or rethrow the exception with an innerexception with the original info trivially. This is unforgivable, an experienced C# developer would never do this.

Extraneous uses of "this" when it's the default.

Initializing variables to null

Not using shorthand object initializers(but this is only in newer versions of C#)

Using class variables instead of properties

Using parse instead of TryParse... Like Java exception handling is an expensive stack unwind on failure, not supposed to be used for control flow.

The worst though, is how did they didn't make a method to reuse the SQL connect and data table code and instead copy pasted it around 20 times.

comment 9y ago · link · parent

I love this type of thing in C# because it's such a terse and well designed language. It's easy to make something stand out.

A cult favorite of devs at my previous employer was to (ab)use the power of LINQ to try to create the longest single line methods possible. I held the unofficial record for a while with a LINQ statement over 1200 chars. Innocent enough since resharper can unwrap them into sane code but lots of fun

comment 9y ago · link · parent

I can overlook a lot of coding issues, but seeing so many in a few lines is a sign somebody doesn't know what they're doing. Just using a linter would probably find some of these automatically, so the fact that they're there is a strong signal that the dev didn't even know/care to use one.

I'm making assumptions based on experience with C# codebases and I think my argument on double vs float is solid. I don't think I've ever seen floats used in a production C# codebase because there's no point.

Overboard maybe :) but I still think whoever wrote that is very inexperienced.

comment 9y ago · link · parent

This guy that wrote this is a c# noob. He should just use a null conditional for the if, Epsilon for tiny but non-zero floats, and should very likely be using doubles instead of float since they're basically the same speed for double the precision.

Bonus points for not using the shorthand float literal syntax.

I would expect to see this many goofs only from someone that's been using C# for a month or so. I only used it for a couple years

comment 9y ago · link · parent

For something contracted this is the norm. We used to send out estimates for writing tests and clients never wanted to pay for them. I've found projects just as buggy with tests and now I only write them for code that's getting heavily reused.

Webforms is likely a client request as well, but also keep in mind that as shitty as webforms is it let's you throw functionality together faster than almost anything else. Again proly contractors

The funny comments others mentioned is another clue that this was not developed internally. I miss that about being a consulting company... The client is usually hiring you because they have no idea what they're doing so rest assured nobody there will ever look at the code.

comment 9y ago · link · parent

I have seen this happen to a lot of people that worked the same job for many years in the tech field. I'm sure ageism exists, but a lot of it is about how fast your skills become outdated.

I've always rode the bleeding edge of web tech for the fun of it. But if I don't make it into management track in another five years I'm moving to systems programming. There, I can learn my craft once and spend the rest of my career without recycling my skills every few years.

comment 9y ago · link · parent

The opposite. Government entities suck up all the world's crypto experts leaving very few working in the publics interest.

comment 9y ago · link · parent

Stop working for startups. Crazy hours and low pay with a tiny chance of a big payoff. Go work for a big established company where the pay and benefits are good. Where you show up at 9 and leave at the stroke of 5.

Life is short, waste as little time as possible doing work for somebody else.

comment 9y ago · link · parent

Don your shiny crinkly hats, but after https://en.m.wikipedia.org/wiki/Dual_EC_DRBG I started believing that NSA involvement is not subtle in their exploits.

They only need to fool laymen, and backdoored primes are an easy way to do so. The number of true cryptography experts beyond their walls is a dozen in the world at best. Case in point https://en.m.wikipedia.org/wiki/Daniel_J._Bernstein . And BTW he's been sued by the US government for ???. Thank God the EFF has decent funding.

comment 9y ago · link · parent

Haha same difference. Mathoverflow is just a lot more hardcore :)

comment 9y ago · link · parent

Not sure if this is case in Sweden, but here in the US the reforestation is actually a return to the natural state. Much of the country was logged repeatedly in the last few centuries. Modern sustainable logging and the transition to other energy sources is resulting in the land returning to the endless forest it was before settlers arrived.

This is mostly clearly seen on the east coast because most of the Midwest is still used for farming.

Edit: in Europe this is visible in coppiced forests. https://en.m.wikipedia.org/wiki/Coppicing . Haven't seen one here in the US but I assume they're somewhat common in Europe where they were an early and effective method of sustainable forestry.

comment 9y ago · link · parent

What are the odds that this was intentional? TPM and Bitlocker have been two of the biggest conjectured targets of compromise. To the point that most security people/libraries use neither. Maybe they were right?

If this is true one of Stackoverflow comments is quite chilling

It would be a terrible idea and it would raise suspicions of a deliberate trapdoor if the primes for RSA were chosen from a quadratic progression rather than randomly

comment 9y ago · link · parent

Bottleneck at the DB/network is BS. Cheap AWS boxes have 200Mbps of throughout and you'll basically never get that out of any of the slower languages on a box with something like 1VCPU 1GB ram. Slightly more expensive boxes have 1 gigabit which is hitting many thousands of HTTP requests per second, even Java/Go struggle with that load.

I have seen MS SQL server handle over 10k database queries per second on a regular machine in a real, huge application (over a million lines). Can Python handle 10k queries per second? Definitely not. In Java or go that load could probably be handled by a single AWS box that costs $10 a month.

I have never seen a database maxed out that wasn't stuck because of table locks. I've seen applications like WordPress die at 10, requests a second

comment 9y ago · link · parent

Twitter has moved key parts of the system to Java. The search functionality was redone on top of Netty which they had some articles about.
12345
13