Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

feedmegin posted:

That's not a language thing, that's a 'my compiler is poo poo at reporting errors' thing. The language in no way mandates bad error reporting.
OTOH it is somewhat easier to sell bad tools to captive market that operates under a government mandate. For a while, anyway

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
This cache talk reminds me of the time I was looking into a complaint that our website would sometimes take a really long time to serve up pages, for no good reason. A profiler showed that once an hour, the site would go insane and start hitting the database like crazy for a few minutes.

It turns out that the a "senior" developer had written his own caching implementation instead of using the built-in ASP .NET caching system. Every hour, it would just totally clear itself, regardless of how stale the data was, or how stale the data could reasonably get without it being useless. This led to fun things like users customers placing orders for things that were out of stock and being told it would ship within 48 hours, because the cached data showed that we still had plenty of those in stock and could fulfill the request that day.

When asked why, he had no explanation, but insisted that we not use the ASP .NET cache.

New Yorp New Yorp fucked around with this message at 21:37 on Apr 10, 2014

Dirty Frank
Jul 8, 2004

I met my first foreach switch today, I shed a silent tear. The collection it iterated over was hardcoded and never altered. Honestly thought I'd never see this for real.

code:
private string[] poop = new string[] { "fart", "pants", "etc" };
...
foreach (string key in poop)
{
  switch (key)
  { 
    case "fart":
      // do thing with fart key
    case "pants":
      // do same thing but with pants key, duplicate code etc.
      ...

necrotic
Aug 2, 2005
I owe my brother big time for this!

Ithaqua posted:

This cache talk reminds me of the time I was looking into a complaint that our website would sometimes take a really long time to serve up pages, for no good reason. A profiler showed that once an hour, the site would go insane and start hitting the database like crazy for a few minutes.

It turns out that the a "senior" developer had written his own caching implementation instead of using the built-in ASP .NET caching system. Every hour, it would just totally clear itself, regardless of how stale the data was, or how stale the data could reasonably get without it being useless. This led to fun things like users customers placing orders for things that were out of stock and being told it would ship within 48 hours, because the cached data showed that we still had plenty of those in stock and could fulfill the request that day.

When asked why, he had no explanation, but insisted that we not use the ASP .NET cache.

I think this one wins the cache discussion. Ouch.

Plorkyeran posted:

I've encountered a lot of caches that don't actually make anything faster. Common reasons include terrible cache implementations that take as long to look up things as looking them up in the database, caching things that take less time to compute from scratch each time than to cache, the cache getting invalidated too frequently to be of any real use, having to spend enough time ensuring the cache gets invalidated when needed that it ends up outweighing the speed gains, bad LRU implementations that slow down as the cache gets bigger and so appear great in tiny benchmarks but suck in real usage, and just plain never actually reading stuff from the cache.

A cache making things slower is of course still far better than the more common failure case of stale things being read from the cache. I tend to get twitchy when people propose Just Cache It.

This is why nobody should home-roll a cache system... use one of the many excellent options (memcache, redis, varnish, ElastiCache [which is basically memcache anyway]), granted that doesn't solve the invalidation issue but it's much easier to solve that with a battle tested system than your own dumb poo poo.

Westie
May 30, 2013



Baboon Simulator

Dirty Frank posted:

I met my first foreach switch today, I shed a silent tear. The collection it iterated over was hardcoded and never altered. Honestly thought I'd never see this for real.

code:
private string[] poop = new string[] { "fart", "pants", "etc" };
...
foreach (string key in poop)
{
  switch (key)
  { 
    case "fart":
      // do thing with fart key
    case "pants":
      // do same thing but with pants key, duplicate code etc.
      ...

More common than you think.

Awfully sorry to break it to you.

jusion
Jan 24, 2007


Zombywuf posted:

Give it up, ADA is never going to be a thing outside the defence industry. Even there it's loosing ground: https://en.wikipedia.org/wiki/Lockh...35_Lightning_II
Yeah, and look how well that went...
http://www.reuters.com/article/2012/03/30/lockheed-fighter-idUSL2E8EU8C420120330
http://defensetech.org/2013/05/24/congress-orders-f-35-software-plan/
http://www.reuters.com/article/2014/01/23/us-usa-lockheed-fighter-idUSBREA0M1L920140123

I kept it to one article per year.

JawnV6
Jul 4, 2004

So hot ...
Was the software split up in such a way to hire a coder from every congressperson's district?

Zombywuf
Mar 29, 2008

Plorkyeran posted:

I've encountered a lot of caches that don't actually make anything faster. Common reasons include terrible cache implementations that take as long to look up things as looking them up in the database, caching things that take less time to compute from scratch each time than to cache, the cache getting invalidated too frequently to be of any real use, having to spend enough time ensuring the cache gets invalidated when needed that it ends up outweighing the speed gains, bad LRU implementations that slow down as the cache gets bigger and so appear great in tiny benchmarks but suck in real usage, and just plain never actually reading stuff from the cache.

A cache making things slower is of course still far better than the more common failure case of stale things being read from the cache. I tend to get twitchy when people propose Just Cache It.

I get really twitchy about people who think just slap more caching in makes things faster. This place loved to cache things, the answer to nearly everything was to just add more caching, or a queue. At one point I shaved 14% off page load time because the caching god object was getting initialised twice - yes initialising there was a cache initialised on every page load and it took a significant amount of time to init, most of that was reading stuff from other caches.

There were caches in IIS, there were caches in application memory, there was memcache, there were caches backed by database tables and there was even a HTTP cache over the front end but I think that part was added to the system by mistake. There was also the file cache which cached city locations for a flash based map, this read values from the database every 24 hours to write the cache files. One of my first tasks there was to make this cache regeneration take less than 24 hours to complete, I got it down to 7 seconds. I didn't know the full pipeline at the time so hadn't actually realised that these were used to serve as a real time lookup cache on the web front end. The files used all the latest cool technology, by which I mean XML. The files looked like this:
code:
<xml>value1,value2,value3,...</xml>
Then there was the cache that quite sensibly stored values in a hash table. Did I say sensibly? I meant :smith:. The key value pairs in the hash table looked like this "(<key>_<value>, True)". The entries would be iterated over until a key was found with a prefix matching the looked for value.

The most catastrophic caching failure was colloquially known as black Tuesday. The office had a number of large plasma displays showing real time, or near real time (yes some people wanted to add some caches to get lower latency), monitoring statistics from our various servers. Suddenly all 12 web nodes turned red on the displays, every graph - page load time, CPU usage, network connections, etc... - went to the limit and stayed there. Rebooting nodes gave a temporary respite of a couple of minutes but then it would immediately be pegged at maximum load. Naturally this created something of a panic, the site was completely down and nothing had changed, no new code, we weren't dealing with a dos attack - request attempts were down. We just didn't know what had happened. Eventually the cause was located, and there was much wailing and gnashing of teeth when it was. The system stored places mapped from identifying codes, and at some point it was decided that simply reading them from the database was for amateurs, so a cache was used. The architecture of the cache was for the application to read the entire table into memory and look it up from there, periodically the app would re-read the data. It would also re-read the data if it tried to look up a key that didn't exist in the cache, imagine what happens if an identifier gets into the system that doesn't exist in the database when this cache is used on nearly every page at a rate of about 6000 connections per minute.

raminasi
Jan 25, 2005

a last drink with no ice

Zombywuf posted:

Then there was the cache that quite sensibly stored values in a hash table. Did I say sensibly? I meant :smith:. The key value pairs in the hash table looked like this "(<key>_<value>, True)". The entries would be iterated over until a key was found with a prefix matching the looked for value.

This is definitely my favorite part.

Scaevolus
Apr 16, 2007

tractor fanatic posted:

Is it intractable to write a formally proven TLS library in C, or is mathematical correctness just not a high priority?

There's a formally proven TLS library in F#, miTLS.

Proving semantics is much easier in a functional language with a garbage collector. It's possible that miTLS could be "lowered" to C, but it would require carefully proving each step of the translation.

There are other attempts at formally verifying C programs like Frama-C which might be applicable as well.

vOv
Feb 8, 2014

Scaevolus posted:

There's a formally proven TLS library in F#, miTLS.

Proving semantics is much easier in a functional language with a garbage collector. It's possible that miTLS could be "lowered" to C, but it would require carefully proving each step of the translation.

There are other attempts at formally verifying C programs like Frama-C which might be applicable as well.

I can buy that miTLS is formally correct, but what about timing attacks?

Zombywuf
Mar 29, 2008

vOv posted:

I can buy that miTLS is formally correct, but what about timing attacks?

Also noise emission attacks?

raminasi
Jan 25, 2005

a last drink with no ice

vOv posted:

I can buy that miTLS is formally correct, but what about timing attacks?

http://www.mitls.org/wsgi/tls-attacks posted:

[timing-based side channel attacks against cryptographic primitives] are outside our model, and we rely on the proper implementation of core cryptographic algorithms by the Bouncy Castle library that we rely on.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Why in God's Greed Earth is it called Bouncy Castle. It's one of those names that may as well come with a record scratch sound effect when you mention it in a meeting.

return0
Apr 11, 2007
It would be cool if a record scratch noise played in a meeting when people suggest using some GPL bullshit

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

return0 posted:

It would be cool if a record scratch noise played in a meeting when people suggest using some GPL bullshit

A few of us had a little app that made record-scratch and sad-trombone noises for conference call use. It was very valuable when talking to a certain set of people.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

ultramiraculous posted:

Why in God's Greed Earth is it called Bouncy Castle. It's one of those names that may as well come with a record scratch sound effect when you mention it in a meeting.

Probably the same mentality that leads to one of the largest software companies in the world putting in a ball pit for its employees.

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING

carry on then posted:

Probably the same mentality that leads to one of the largest software companies in the world putting in a ball pit for its employees.

Because it's cheaper than paying cleaners to maintain urinals?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Said company will continue putting in ball pits as long as it remains an effective PR gimmick to attract talented introverts.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Gazpacho posted:

Said company will continue putting in ball pits as long as it remains an effective PR gimmick to attract talented introverts.

Almost as if not taking yourself 100% seriously can be an effective strategy for attracting adults with a sense of humor!

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

ultramiraculous posted:

Why in God's Greed Earth is it called Bouncy Castle. It's one of those names that may as well come with a record scratch sound effect when you mention it in a meeting.

I'm not sure if you just typoed but you are aware that it's "God's green Earth", not "greed", right

Zombywuf
Mar 29, 2008

Volmarias posted:

Almost as if not taking yourself 100% seriously can be an effective strategy for attracting adults with a sense of humor!

I'm starting to think a ball pit would work wonders for my back.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Hammerite posted:

I'm not sure if you just typoed but you are aware that it's "God's green Earth", not "greed", right

Awful.app :argh:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



ultramiraculous posted:

Why in God's Greed Earth is it called Bouncy Castle. It's one of those names that may as well come with a record scratch sound effect when you mention it in a meeting.

Because the charity that maintains it is called Legion of the Bouncy Castle, obviously:

https://www.bouncycastle.org/about.html posted:

As the Legion of the Bouncy Castle Inc. (ABN 84 166 338 567) operates as a Registered Charity

At least they didn't pick some godawful 1337 poo poo name, I guess :shobon: As Volmaris pointed out, being overt about having a sense of humor is better than confirming you have none, but I'm not crazy about the name they picked, either.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


I wonder if any companies refuse to use git or python because of the silliness of their names.

I just recently saw a clojure-related vim plugin called "fireplace." The readme says the name was changed from "foreplay" "so Java developers wouldn't have to speak in hushed tones."

HFX
Nov 29, 2004

return0 posted:

It would be cool if a record scratch noise played in a meeting when people suggest using some GPL bullshit

What's wrong with GPL bullshit if it is pretty much industry standard. Right now I'm having to use Eclipselink 2.1 (with 2.0 persistence / mapping files) on Weblogic 10.3.6.0 since we are allergic to Hibernate. I still can't get named stored procedures to work in the orm file, persistence file, or annotations. It takes us twice as long to get solutions to our problems / figure out implementation. At least using JPA 2.1 with Hibernate as the persistence provider, everything just worked. We have actually been told to start looking for commercial solutions rather then using open source solutions (including Apache, BSD, or Google Licensed software).

Another horror:
We are just moving people to Maven. However, we can only use white listed artifacts from the artifact server. Yes, even the version has to be white listed. If we require some other software, I have to fill out a 20 page document, have it sent off to legal, wait 2 months, and then get a yes or no. Did I mention we are agile?

Scaevolus posted:

Proving semantics is much easier in a functional language with a garbage collector. It's possible that miTLS could be "lowered" to C, but it would require carefully proving each step of the translation.

I often think it would be great to teach functional languages at the start. Then I remember that most people have been taught how to do most things in life as procedural tasks. It would be pretty hard to break that ingrained method.

HFX fucked around with this message at 19:16 on Apr 11, 2014

MrMoo
Sep 14, 2000

Well here's a good sign for the books: hopefully cut down some posts here, ...

GCC 4.9 posted:

- Google has added an Undefined Behavior Sanitizer to GCC 4.9, complementing the existing Address Sanitizer, etc. When passing -fsanitize=undefined, GCC will attempt to detect undefined runtime behavior for C/C++ code-bases.

http://www.phoronix.com/scan.php?page=news_item&px=MTQ0OTc

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


As a followup to "bool success = true" from pages back it turned out that on a more detailed look (i.e. I fixed the code) it also used a foreach over 5 executions with a set to success on each one and no throw on failure so even if the first execution failed as long as one of the others succeeded it returned a success for the whole lot. Then again, it didn't log anything on failure so I guess it didn't matter :v:

The Laplace Demon
Jul 23, 2009

"Oh dear! Oh dear! Heisenberg is a douche!"

MrMoo posted:

Well here's a good sign for the books: hopefully cut down some posts here, ...

http://www.phoronix.com/scan.php?page=news_item&px=MTQ0OTc

Its scope is really narrow. I just compiled and ran a couple examples of undefined behavior from the C++ standard with no observable effect. From the commit linked, it looks like as of that article, it only adds runtime checks for division by zero, INT_MIN/-1, out-of-bound shifts, and reaching __builtin_unreachable.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

The Laplace Demon posted:

Its scope is really narrow. I just compiled and ran a couple examples of undefined behavior from the C++ standard with no observable effect. From the commit linked, it looks like as of that article, it only adds runtime checks for division by zero, INT_MIN/-1, out-of-bound shifts, and reaching __builtin_unreachable.

It'll probably get better quickly. In my experience just convincing gcc to take a new thing can take a while, and the simpler the thing the easier it is. I'd be surprised if their internal version wasn't already more advanced.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
UBSan's been around for quite a while without getting anything new, and the other sanitizers haven't had a burst of new development after being ported to GCC.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Plorkyeran posted:

UBSan's been around for quite a while without getting anything new, and the other sanitizers haven't had a burst of new development after being ported to GCC.

Why must you crush my hope?

JawnV6
Jul 4, 2004

So hot ...
Wasn't that LLVM post linked here? The one that went through undefined code and how hard it is to report out "the compiler is assuming this comparison with a variable hoisted out of an inline looped submodule pinch header will always be true". IIRC it was in the context of that dereferenced pointer eliminating the null check.

fake edit: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


The Laplace Demon posted:

Its scope is really narrow. I just compiled and ran a couple examples of undefined behavior from the C++ standard with no observable effect. From the commit linked, it looks like as of that article, it only adds runtime checks for division by zero, INT_MIN/-1, out-of-bound shifts, and reaching __builtin_unreachable.

I guess they need to define more of the undefined behaviors they're looking for.

vOv
Feb 8, 2014

JawnV6 posted:

Wasn't that LLVM post linked here? The one that went through undefined code and how hard it is to report out "the compiler is assuming this comparison with a variable hoisted out of an inline looped submodule pinch header will always be true". IIRC it was in the context of that dereferenced pointer eliminating the null check.

fake edit: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html

Why did you change your avatar from a CPU to an anime

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

vOv posted:

Why did you change your avatar from a CPU to an anime

... what does that have to do with anything in this thread?

ohgodwhat
Aug 6, 2005

I have stared into the code of non technical interns, and the code has stared back into me.

Why have functions that can take parameters when you can just make a class called "input" which takes a bunch of user input from the console when it's initialized, and then derive classes from that which then implement functions that use the instance variables to figure out what to do? That's helpful.

kitten smoothie
Dec 29, 2001

Doc Hawkins posted:

I wonder if any companies refuse to use git or python because of the silliness of their names.

I just recently saw a clojure-related vim plugin called "fireplace." The readme says the name was changed from "foreplay" "so Java developers wouldn't have to speak in hushed tones."

At one of the talk sessions at I/O a couple years ago, Google introduced a game development framework that would let you write Java and then it would generate code for running the game in either a Java runtime, iOS, Android, or HTML5.

They named it "ForPlay." The framework was interesting but it was hilarious how the presenter was awkwardly trying his hardest to use the same inflection while saying the name, so that it sounded "For Play," not "Foreplay."

necrotic
Aug 2, 2005
I owe my brother big time for this!

kitten smoothie posted:

At one of the talk sessions at I/O a couple years ago, Google introduced a game development framework that would let you write Java and then it would generate code for running the game in either a Java runtime, iOS, Android, or HTML5.

They named it "ForPlay." The framework was interesting but it was hilarious how the presenter was awkwardly trying his hardest to use the same inflection while saying the name, so that it sounded "For Play," not "Foreplay."

This one? https://www.youtube.com/watch?v=F_sbusEUz5w&t=861s

Adbot
ADBOT LOVES YOU

kitten smoothie
Dec 29, 2001


That's the one. Maybe a month or so after that talk was given, they renamed it PlayN.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply