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
hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Corla Plankun posted:

if you cant articulate them they're not questions they're just pointless anxiety hth

don't patronize me, I may be a testing noob but I know the data domain really well

regarding file paths, I won't bore you with details, just read this pretty comprehensive article: https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html (tldr: the syntax of Win32 paths defies formalization or normalization). also never ever loving use wcsicmp to compare two file paths, not even in the "C" locale (sloppy path normalization/comparison is the least of this code's problems though as I'm like 90% sure, from what I've seen, that I can craft a filename that injects a DROP TABLE and completely and silently breaks everything :ssh:)

do you trust your IPv4 address parser? does it only accept the canonical syntax with three dots, or does it also accept the two, one and zero dot BSD-style variants? do your tests account for it?

even something as innocuous as parsing a number is fraught with peril. if you use humble strtoul/wcstoul, you're silently allowing whitespace, '+', '-', leading zeroes and potentially trailing garbage in your syntax, at best making your data representation ambiguous

maybe I know too much about anomalies and too little about their effective exploitability for my own good. like, I know that ambiguities are bad in general, but I'm loathe to figure out if they're relevant to my case. hell, I don't want to think about it, I want to punch numbers in computer and let it figure it out

hackbunny fucked around with this message at 22:27 on Mar 9, 2019

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
the problem isn't that I don't know where to start with writing tests but that I don't know where to stop. and code freeze is coming up

AggressivelyStupid
Jan 9, 2012

Maybe look into boundary testing and equivalence partitioning?

There's also CFG, Metamorphic, and so on but I don't really know your use case and also I'd have to check my notes to see what the hell was what

Night Shade
Jan 13, 2013

Old School

hackbunny posted:

windows hell

at this point i half wonder if you wouldn't get better results from fuzzing and creating manual cases from things the fuzzer finds instead of trying to handcraft more tests around ...that


pr chat: we have it set up so that pr's need at least two reviewers, and one of them has to be a senior from the relevant area. works pretty well for us so far. i do like the idea of enforcing that juniors are involved too, might suggest it

Night Shade fucked around with this message at 00:10 on Mar 10, 2019

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i'm programming in go and the reason this language frustrates me so much is that it would be good if it werent for the dumb stuff that i have nothing new to say abouti.

if it had a repl it would make a great plang. with a repl+needed features it would be a the ultimate plang.

gonadic io
Feb 16, 2011

>>=
if you're not already using them, I strongly recommend switching to go modules so you don't have to clone your project into ~/src/go/github.com/my_org/my_project/src/go or whatever that bullshit is

PokeJoe
Aug 24, 2004

hail cgatan


I've been learning kotlin lately and I like it

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Night Shade posted:

at this point i half wonder if you wouldn't get better results from fuzzing and creating manual cases from things the fuzzer finds instead of trying to handcraft more tests around ...that

you know, thinking about it, I think I'll simply define a subset of the syntax and only accept inputs that are already normalized, maybe flag as suspicious any inputs that don't match. seems safer

as I believe I mentioned, I'm implementing a noise-reduction whitelist for an event logger; event fields that can be matched by the whitelist are things like paths, ip addresses, domain names, etc. now, false negatives are relatively benign, the backend will just have to deal with more noise than expected. users would also have immediate feedback that something's wrong, and fix their rules (or open a support ticket if the rules are fine but my implementation is buggy). false positives, ie whitelisting the wrong events, would be disastrous, so strictness would actually be good: the less I catch, the better

now, user-defined whitelisting rules are one input. the other input to the system is the stream of events itself, which comes from the aforementioned kernel driver. it receives (partially) pre-normalized paths from the OS, and it only deals with the registry and disk filesystems, so insane special cases like named pipes, where a filename can contain a backslash, don't apply. so I generally don't have to worry about weird inputs from that side... if we ignore "normal weirdness" like the fact that invalid unicode (undefined codepoints, unpaired surrogates, etc.) is valid in filenames, or the ntfs syntax for accessing alternate data streams and/or named attributes. but since the product is, at its core, an anomaly detector, I can simply flag anomalies as... anomalous, instead of going insane trying to normalize the unnormalizable. the ball would then be in the court of backend developers and data scientists

Soricidus
Oct 21, 2010
freedom-hating statist shill
c autism status: it’s 1:45 am and I’m compulsively coding again but this time it’s actually fun because I’m writing my own terrible scripting language

sad that every existing scripting language manages to make itself unsuitable by doing at least one of:
- disappearing into a cloud of dsl farts
- being so dynamic that it’s impossible to have any kind of useful member completion
- forgetting what scripting languages are for and trying to be suitable for large scale programs and becoming a nightmare to integrate with an existing application
- being lua

but hey writing parsers is fun so maybe it’s good that I couldn’t find anything existing I could use?

DrPossum
May 15, 2004

i am not a surgeon

Soricidus posted:

writing parsers is fun

lol

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





PokeJoe posted:

I've been learning kotlin lately and I like it

google ‘kotlin platform types’ before it’s too late

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
kotlin owns

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

TheFluff posted:

listening to music harms concentration and i have no idea why everyone insists on doing it while coding.

maybe for you but for me it's hard to focus without music.

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?

hackbunny posted:

so one the one hand I'm mostly writing the tests for my future self, on the other hand I want them to be more than that, but I might be overdoing it. on the other, other hand, I've already caught several bugs :toot:

writing tests for your future self is good and useful and it has saved my rear end before

having already caught bugs with your tests means that they’ve already basically paid for themselves too

go you

PokeJoe
Aug 24, 2004

hail cgatan


the talent deficit posted:

google ‘kotlin platform types’ before it’s too late

i know about these, i've been writing production code in kotlin tacked on to a java android app. i just don't consider myself particularly good at it yet.


it's conciseness has really improved our code review time compared to java

Night Shade
Jan 13, 2013

Old School

aardvaard posted:

maybe for you but for me it's hard to focus without music.

for me anything with lyrics is super distracting but instrumentals are great, particularly through a good set of noise cancelling headphones

but i'm not really listening to it so much as having it be background noise instead of the office chatter, which is also super distracting

cinci zoo sniper
Mar 15, 2013




yeah my best focus zone is just natural quiet of my home. i will sometimes play music at work, but it will be one of those newly popular “low-fi jazz/hiphop beats” things that drowns out office chatter without particularly drawing attention to itself

toiletbrush
May 17, 2010

aardvaard posted:

maybe for you but for me it's hard to focus without music.
Same here, it's brilliant for helping me tune out distractions when I'm in the office.

Currently enjoying listening to this guy's mixes while this plays more quietly in another tab
https://www.youtube.com/watch?v=Qo4JIT8jMtI

PokeJoe
Aug 24, 2004

hail cgatan


cinci zoo sniper posted:

yeah my best focus zone is just natural quiet of my home. i will sometimes play music at work, but it will be one of those newly popular “low-fi jazz/hiphop beats” things that drowns out office chatter without particularly drawing attention to itself

same on both counts. no idea why 100% of these streams video is some anime laying in bed though

galenanorth
May 19, 2016

One of the more annoying part of web scraping an API is all the stuff where I'm not sure what it means, but maybe I'll find out if save it anyway after running the statewide or national scan for store locations using cached responses, like 'curbside': 'Y' in the JSON. There's a 'mobile': 'Y' which might be 'On-the-Go Mobile Ordering' but there's also a 'adv_ord': 'Y' which might also be 'On-the-Go Mobile Ordering'. There's also loyalty: 'Y' which I'd guess to be the same thing as dunkincardenabled: 'Y'. A lot of this stuff doesn't look like it's even used in the website's store locator GUI.

I'll figure it out eventually. It'll probably take a few more hours, though. Right now my dad is outside in a wheelchair smoking and I'm going to need to wheel him back in, and I'll wait until I can concentrate more

4lokos basilisk
Jul 17, 2008


cinci zoo sniper posted:

yeah my best focus zone is just natural quiet of my home. i will sometimes play music at work, but it will be one of those newly popular “low-fi jazz/hiphop beats” things that drowns out office chatter without particularly drawing attention to itself

i think someone posted this in another thread but someone has made a data center noise generator which is pretty good at making a really benign hum to drown out open plan office hell without being distracting

https://mynoise.net/NoiseMachines/dataCenterNoiseGenerator.php

cinci zoo sniper
Mar 15, 2013




PokeJoe posted:

same on both counts. no idea why 100% of these streams video is some anime laying in bed though

it’s because the recent popularity surge of the genre is something high schoolers/college extremely internet crowd are responsible for, which makes shaded circle when you plot a venn diagram against anime weaboo population

Penisface posted:

i think someone posted this in another thread but someone has made a data center noise generator which is pretty good at making a really benign hum to drown out open plan office hell without being distracting

https://mynoise.net/NoiseMachines/dataCenterNoiseGenerator.php

might try this one, i usually do flavour of the week rain noises when i want a noise generator per se. sadly, i do in general just suffer office noise for the most of it, since our office is small and im in managerialish position, with all the consequences wrt the frequency of people wanting something from me

Powerful Two-Hander
Mar 10, 2004

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


lol if you aren't listening to thumping techno beats 24/7 to drown your internal worries that you don't know what you are doing

Soricidus
Oct 21, 2010
freedom-hating statist shill
gently caress any noise. i would literally choose to work in a sensory deprivation chamber if i could persuade my employer to build one. admittedly that's mostly because my brain is broken tho

toiletbrush
May 17, 2010

Powerful Two-Hander posted:

lol if you aren't listening to thumping techno beats 24/7 to drown your internal worries that you don't know what you are doing
tbf the loudest and most idiotic jump-up dnb I can find is my second choice for coding music

cinci zoo sniper
Mar 15, 2013




Powerful Two-Hander posted:

lol if you aren't listening to thumping techno beats 24/7 to drown your internal worries that you don't know what you are doing

i listen to all sorts of dnb/edm type music and it all leaves me too distracted from working, im just staring at the monitor while i think “drat, that’s a sick drop. let’s google if this artist had more stuff”

Soricidus posted:

gently caress any noise. i would literally choose to work in a sensory deprivation chamber if i could persuade my employer to build one. admittedly that's mostly because my brain is broken tho

i saw a cool demo at local steelcase dealership, they make portable cabins like that. subdued ceiling light, sound-proof door, and a bench with shelf for one person to sit and place laptop on - all interior is some matte black velvet type thing

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.


cinci zoo sniper posted:

i saw a cool demo at local steelcase dealership, they make portable cabins like that. subdued ceiling light, sound-proof door, and a bench with shelf for one person to sit and place laptop on - all interior is some matte black velvet type thing

they sell those for east asian kids for studying, it's a thing but somewhat hard to google. I'm guessing it would work okay for programming?

cinci zoo sniper
Mar 15, 2013




Private Speech posted:

they sell those for east asian kids for studying, it's a thing but somewhat hard to google. I'm guessing it would work okay for programming?

the one i “test drove” (test sat???) would be okay for coding in hourly increments, provided your laptop is the only thing you need to work. it’s meant to be a conference call booth for open office spaces, so there’s nothing for long term comfort in it (also, airplane-tier legroom)

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.


cinci zoo sniper posted:

the one i “test drove” (test sat???) would be okay for coding in hourly increments, provided your laptop is the only thing you need to work. it’s meant to be a conference call booth for open office spaces, so there’s nothing for long term comfort in it (also, airplane-tier legroom)

here's the one I've seen before, maybe it's a bit bigger I'm not sure from you description, it has a few bookshelves and lights and such

4lokos basilisk
Jul 17, 2008


toiletbrush posted:

tbf the loudest and most idiotic jump-up dnb I can find is my second choice for coding music

this but also techno at insane bpms and small doses

liquid dnb is good too

but everything in moderation

cinci zoo sniper
Mar 15, 2013




Private Speech posted:

here's the one I've seen before, maybe it's a bit bigger I'm not sure from you description, it has a few bookshelves and lights and such

https://www.ocs-steelcase.nl/en/framery-phonebooth-o I was either in this one or something nearly identical

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.


cinci zoo sniper posted:

https://www.ocs-steelcase.nl/en/framery-phonebooth-o I was either in this one or something nearly identical

ahh okay yeah that's tiny

now that I think about it my university had similar soundproof booths for students to do group work/programming in, they were pretty great

e: also Frankfurt airport has these "silent chairs" (demonstration robot not included), but I can't remember if you can close them completely

I think I did type out some code there while waiting for a plane connection once

e2: pinterest has a huge amount of booths like that

Private Speech fucked around with this message at 22:26 on Mar 10, 2019

PokeJoe
Aug 24, 2004

hail cgatan


i don't think i would like working in the quiet porta potty

Soricidus
Oct 21, 2010
freedom-hating statist shill

cinci zoo sniper posted:

https://www.ocs-steelcase.nl/en/framery-phonebooth-o I was either in this one or something nearly identical

ugh that website. god forbid they just have clear pictures of the product that you can see, nope gotta make it all moving and zooming all the time and weird angles and closeups and poo poo. i managed 15 seconds before i had to close the tab because it was making me seasick :(

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

if you're not already using them, I strongly recommend switching to go modules so you don't have to clone your project into ~/src/go/github.com/my_org/my_project/src/go or whatever that bullshit is

i hadn't tried them yet but i just did and holy poo poo from a usability perspective this is so much better.

gonadic io
Feb 16, 2011

>>=

DONT THREAD ON ME posted:

i hadn't tried them yet but i just did and holy poo poo from a usability perspective this is so much better.

if by "much better" you mean "approaching usable" then yes. the vscode integration is good too.

it kind of feels like a more annoying/limited but faster python now

Powerful Two-Hander
Mar 10, 2004

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


cinci zoo sniper posted:

i listen to all sorts of dnb/edm type music and it all leaves me too distracted from working, im just staring at the monitor while i think “drat, that’s a sick drop. let’s google if this artist had more stuff”



actually if I'm honest my go to is actually 3 hour long gently caress/disco mixes off soundcloud and it oooowwwnnnnss for getting work done

GNU Order
Feb 28, 2011

That's a paddlin'

Powerful Two-Hander posted:

actually if I'm honest my go to is actually 3 hour long gently caress/disco mixes off soundcloud and it oooowwwnnnnss for getting work done

Interesting choice but whatever helps. Personally I just get horny waiting for my builds to finish

floatman
Mar 17, 2009
gently caress r.e. my previous story of using a logging library (monolog, PHP) to generate statefully held html to output back to page.

Today I found out that there was a monkey patched property being attached to the logger class, a property called "max_debug".
It was used something like this:

PHP code:

$this->logger->debug("Got html response!");
if ($this->logger->max_debug) {
     $this->logger->debug("Here is html body $body");
}

Putting aside the questionable sanity of having a logger collect html for output,
Basically everybody knows you can have various output levels for logger classes (i.e. warning, info, debug).
Instead of using info for info and debug for debug, this code uses debug for EVERYTHING and the monkey patched Boolean flag is there to represent a custom level lower than debug.

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I’m sorry this is happening to you, but I’m not sorry I get to read about it here

also, just today I was considering logging everything at one level because the console app won’t show you debug or info messages from the iOS simulator no matter what you do

gives a whole new meaning to "unified logging". more like unified level logging! boom gotem

never thought of the monkeypatched trace level though, that’s pretty clever

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