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
raminasi
Jan 25, 2005

a last drink with no ice
that sounds like code that academics who don't give a poo poo about code write

globals into parameterless functions and unnecessary, repeated deserialization are two specific calling cards i've seen

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Doom Mathematic posted:

People do the best work they can

this is YOSPOS you don’t need to keep up appearances

you can say what you really know deep down: people are lazy idiots

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

raminasi posted:

repeated deserialization

"this time will be different"

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



pokeyman posted:

"this time will be different"

what if the deserialization depends on global state, now you need it in the inner loop

Soricidus
Oct 21, 2010
freedom-hating statist shill

raminasi posted:

that sounds like code that academics who don't give a poo poo about code write

globals into parameterless functions and unnecessary, repeated deserialization are two specific calling cards i've seen

the repeated deserialisation was entirely my fault. I called a getButt() function that I assumed would be a trivial getter but lol nope it parses the butt out of a string every time. (I also wrote that but a long time ago)

the other bits, I don’t know the programmer personally but yeah it wouldn’t surprise me if they had an academic background

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

c tp s: just blew the mssql stack with a non-recursive query

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



eschaton posted:

new front page column?

seems more like a discarded weekend web idea tbh

if only i werent so anal about tiny details that nobody in their right mind would notice

cinci zoo sniper
Mar 15, 2013




c tp s: finished auditing a database. my favourite part in this one was, i think, either the fact that the reworked “super good” entity B model has literally no way to link records to entity A that causes them, or the one table with metric ton of records that have modification_date < creation_date- but not all, so it’s clearly not a mapping error

cinci zoo sniper
Mar 15, 2013




or the one lonely record with NULL creation_date and non-null modification_date. i think our etl guy will have a stroke when i send the full report in

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

CPColin posted:

I wrote a BBCode parser for Experts Exchange's special unicorn of a BBCode flavor and, thanks to a long request notification service that I also wrote, discovered that mismatched italics tags exhibited O(n²) or O(n³) behavior as it repeatedly scanned the input back and forth, desperate to find a matching [/i] tag. That was a fun one to hotfix.

Later, I had to write code to translate HTML to their BBCode format, because an ill-advised WYSIWYG editor project from years prior had saved a bunch of raw HTML into the database that the code was having to sanitize every time it was displayed.

Every day I wake up and see that company still alive is a shock.

counterpoint: SA is still alive, so that’s a pretty low bar

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

NihilCredo posted:

c tp s: just blew the mssql stack with a non-recursive query

:yosnice:

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
exotic unicode whitespace: there's always more of it and users will always find a way to insert it into your database

today i discovered the existence of U+E0020 TAG SPACE, which apparently breaks stuff in safari
i had no idea what a TAG SPACE was, but some googling reveals a presumably well-intentioned late 90's attempt to add in-band language metadata, but i have no idea how the user managed to input it. copy-paste from some word processor or other is our current best guess.

CPColin
Sep 9, 2003

Big ol' smile.
I couldn't use the proper indigenous name for one of our on-campus housing projects, yakʔitʸutʸu, because, while the web application was displaying the non-ASCII characters properly, something in the pipeline was translating them into question marks before they hit the database, where they then triggered validation errors because "yak?it?ut?u" was not a valid option.

Soricidus
Oct 21, 2010
freedom-hating statist shill
ctps: updated to intellij 2019.1 and now my code won't build. everything works just fine if i run mvn manually in a terminal but intellij is all "internal java compiler error"

CPColin
Sep 9, 2003

Big ol' smile.
That sounds great I'm gonna update right now and relax for the rest of the day!

lol the update window popped up over my browser twice while I was typing this and one of my spacebar hits threatened to cancel it

Gallatin
Sep 20, 2004

CPColin posted:

I couldn't use the proper indigenous name for one of our on-campus housing projects, yakʔitʸutʸu, because, while the web application was displaying the non-ASCII characters properly, something in the pipeline was translating them into question marks before they hit the database, where they then triggered validation errors because "yak?it?ut?u" was not a valid option.

Ahh stream encoding from unknown sources.

"The right way to handle that is to simply reject everything that isn't ASCII, right?" (sarcasm here can not be overestimated)

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

CPColin posted:

I couldn't use the proper indigenous name for one of our on-campus housing projects, yakʔitʸutʸu, because, while the web application was displaying the non-ASCII characters properly, something in the pipeline was translating them into question marks before they hit the database, where they then triggered validation errors because "yak?it?ut?u" was not a valid option.

correct me if i'm wrong, but i have a terrible feeling "not a valid option" has a drastically different meaning from "not a valid input"

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
like, i'm imagining that not only did the app mangle the name, but it broke apart the input at the ?'s and treated the result as multiple parameters

CPColin
Sep 9, 2003

Big ol' smile.
Nahh, there was a <select> element showing the various student housing communities we have and a form validator that returned true if the submitted value matched one of the ones we expected. Since "yak?it?ut?u" didn't match "yakʔitʸutʸu", it was returning false, but only after the bad value had made it into the database and the user (me, testing, fortunately) was trying to proceed to the next page of the flow.

Soricidus
Oct 21, 2010
freedom-hating statist shill

CPColin posted:

Nahh, there was a <select> element showing the various student housing communities we have and a form validator that returned true if the submitted value matched one of the ones we expected. Since "yak?it?ut?u" didn't match "yakʔitʸutʸu", it was returning false, but only after the bad value had made it into the database and the user (me, testing, fortunately) was trying to proceed to the next page of the flow.

solution: use the value as a glob and succeed if that gives a unique answer

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Soricidus posted:

ctps: updated to intellij 2019.1 and now my code won't build. everything works just fine if i run mvn manually in a terminal but intellij is all "internal java compiler error"

I've had this before, doing a clean reinstall fixed it for me.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Soricidus posted:

solution: use the value as a glob and succeed if that gives a unique answer

pull request accepted

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Krankenstyle posted:

pull request accepted
You are just like ur mom

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Fatty Crabcakes posted:

You are just like ur mom

wontfix, works as intended

Arcsech
Aug 5, 2008

Soricidus posted:

ctps: updated to intellij 2019.1 and now my code won't build. everything works just fine if i run mvn manually in a terminal but intellij is all "internal java compiler error"

IntelliJ 2019.1 is broken on our poo poo too, something about a gradle hack that IntelliJ has technically never supported but started enforcing this version.

which blows because 2019.1 has some cool poo poo in it. but on the other hand this is getting some folks to get around to making the build less hacky

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
I love me some IntelliJ but it's a pretty glitchy program. after every update the first project I open will open a window but then just sit there. restarting IntelliJ solves that... :iiam:

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Soricidus posted:

lol fixing those two things literally cuts the runtime in half again on typical inputs. well that was a productive hour

you're like a little baby, watch this:

see, i was caching user results from the database in a hashmap, like this
code:
User user = usersByErpId.computeIfAbsent(erpId, e -> userRepository.findFirstByErpId(e));
turns out, if the lambda call returns null, the hashmap doesn't store the value. with a non-null value it works as (i) expected.

well, our development environment doesn't have many users, so when we read the erp ids from another endpoint and start iterating over them, the call hits the database almost every time. i profiled the code, found the above offending line of code, read the documentation of computeIfAbsent and now the lambda returns a static USER_NOT_FOUND constant object instead if a user is not found in the database.

runtime went from 1 hour 40 minutes to 20 seconds.

thankfully this wasn't a problem in our production environment because all the erp ids exist in the production database.

this is some of the code produced during february month of crunch

Soricidus
Oct 21, 2010
freedom-hating statist shill
I “fixed” intellij by repeatedly mashing the build project button and eventually it succeeded

still the least bad ide tho, I don’t miss eclipse in the slightest

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Wheany posted:

runtime went from 1 hour 40 minutes to 20 seconds.

:eyepoop:

gonadic io
Feb 16, 2011

>>=

Soricidus posted:

I “fixed” intellij by repeatedly mashing the build project button and eventually it succeeded

still the least bad ide tho, I don’t miss eclipse in the slightest

You know what I'd love? Sublime to emulate the plugin APIs of intellij and vscode so it can use their plugins

Corla Plankun
May 8, 2007

improve the lives of everyone
i started loving around with a toy autoencoder in my spare time at work because im writing tests and its boring af, and i think i'm actually being more productive now than i was before when i was only working on tests

cinci zoo sniper
Mar 15, 2013




https://www.theregister.co.uk/2019/03/28/hcsec_huawei_oversight_board_savaging_annual_report/ lomarf

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.



This is a fun part:

quote:

In the first version of the software, there were 70 full copies of 4 different OpenSSL versions, ranging from 0.9.8 to 1.0.2k (including one from a vendor SDK) with partial copies of 14 versions, ranging from 0.9.7d to 1.0.2k, those partial copies numbering 304. Fragments of 10 versions, ranging from 0.9.6 to 1.0.2k, were also found across the codebase, with these normally being small sets of files that had been copied to import some particular functionality.

cinci zoo sniper
Mar 15, 2013




Private Speech posted:

This is a fun part:

what about

code:
#define SAFE_LIBRARY_memcpy(dest, destMax, src, count) memcpy(dest, src, count)

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Private Speech posted:

This is a fun part:

wow. sounds like we should recruit from huawei to get some fresh blood in the thread

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Private Speech posted:

This is a fun part:

thats amazing

cinci zoo sniper posted:

what about

code:
#define SAFE_LIBRARY_memcpy(dest, destMax, src, count) memcpy(dest, src, count)

:psyboom:

mystes
May 31, 2006

Private Speech posted:

This is a fun part:
Finally at least someone is criticizing Huawei on actual technical grounds rather than "my uncle who works at Nintendo told me they might be putting secret spy chips in their phones" level stuff.

(Not to say that they weren't put up to it by the US government or that any other telecom companies are likely to be better.)

Soricidus
Oct 21, 2010
freedom-hating statist shill
I bet the chinese backdoors are there and the uk government is just pretending it didn’t find them so it can exploit them too

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


Soricidus posted:

I bet the chinese backdoors are there and the uk government is just pretending it didn’t find them so it can exploit them too

Well for one thing it does say that they're not sure if the source code they have is actually all that gets compiled because they don't have everything they need to build it.

On the other hand I'm sure they've kept some vulnerabilities back for themselves anyway.

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill
runtime is now down to about 15% of what it was before I started fixing performance. possibly I should stop profiling now? but yesterday I thought 200ms was as fast as I could get and now it’s around 140ms and I can’t stop wondering whether 100ms is achievable, help

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