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
Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

canis minor posted:

So, I'm integrating new payment gateway today. While their documentation makes sense, the example code is...
Is it just me or is every last one of those variable names using a prefix meant to designate "null-terminated string" in a language that doesn't expose the notion of null terminators?

Adbot
ADBOT LOVES YOU

boo_radley
Dec 30, 2005

Politeness costs nothing

Ralith posted:

Is it just me or is every last one of those variable names using a prefix meant to designate "null-terminated string" in a language that doesn't expose the notion of null terminators?

Love that szPassword, too. I'm sure it's nicely encrypted, though.

wide stance
Jan 28, 2011

If there's more than one way to do a job, and one of those ways will result in disaster, then he will do it that way.

Cuntpunch posted:

code:
//Please dearest colleagues, do not be tempted by the suggestions of Resharper to refactor this into Linq.  Please, just don't.
All to avoid

code:
return collection.Select(s => new Foo(s, funcParam == s.Property)).ToList();
Old programmers are funny.

One knock on LINQ prior to Visual Studio 2015(?) was that you couldn't debug lambda expressions.

Westie
May 30, 2013



Baboon Simulator

Ralith posted:

Is it just me or is every last one of those variable names using a prefix meant to designate "null-terminated string" in a language that doesn't expose the notion of null terminators?

yup, that's correct!

We had a look and it appears to be a software package that "payment merchants" can just buy and resell

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

wide stance posted:

One knock on LINQ prior to Visual Studio 2015(?) was that you couldn't debug lambda expressions.

Oh yeah, finding that in old legacy code might make some semblance of sense.

That comment is one month old on a UWP project so we are all working with vs2015

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
Spotted in logs

"No need to log this"

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Ghost of Reagan Past posted:

Spotted in logs

"No need to log this"

I wonder how often "this should never happen" or similar phrases show up in the production logs of your average Big Software Company.

Sedro
Dec 31, 2008

boo_radley posted:

Love that szPassword, too. I'm sure it's nicely encrypted, though.

Symmetrically encrypted with the Zodiac cipher

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

TooMuchAbstraction posted:

I wonder how often "this should never happen" or similar phrases show up in the production logs of your average Big Software Company.

well
code:
		
TC	BANKCALL	# TEMPORARY, I HOPE HOPE HOPE
CADR	STOPRATE	# TEMPORARY, I HOPE HOPE HOPE
this is from the Apollo 11 code

DaTroof
Nov 16, 2000

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

Ralith posted:

Is it just me or is every last one of those variable names using a prefix meant to designate "null-terminated string" in a language that doesn't expose the notion of null terminators?

Way back in the day I remember seeing tutorials that used an "lpstr" prefix for string variables in ASP code, written by someone who worked for Microsoft.

mmkay
Oct 21, 2010

The future is now
https://www.youtube.com/watch?v=F0r9D6HZEnU

canis minor
May 4, 2011


Truly a great time to be alive

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Something like a decade ago I watched a talk given by a programmer who got carpal tunnel syndrome but still needed to be able to code. During what little "real typing" time he had each day, he hacked one of the more modder-friendly voice recognition tools to add a bunch of special "words" that corresponded to actions and symbols that are common in programming but not in normal text. Like, "zzp" mean { and "pzz" meant }, and he had words for un/indenting, creating a ( ) and moving to the interior of the parens, etc.

He had some crazy setup to get the software to work, like, he did his programming in Vim running in a Windows VM in his Linux workstation, because the voice recognition software was Windows-only. But he demoed doing some nontrivial programming and it actually worked pretty well.

Gavinvin
Jan 3, 2013

Ambition is not a dirty word. Piss on compromise. Go for the throat.
Speaking of funny comments, found this at the start of one of our tree searching algorithm. I've guessing the dev got really bored...

code:
		//Now this is a story all about how my tree got searched all upside down
                //now let me take a minute, just sit right there, I'll tell you how I became the prince of a town called Tree Air
                //In west treeadelphia, born and raised. In the intertubes was where I spent most of my days.
                //Chillin' out maxin ' relaxin' all cool
                //And seaching some tree stores outside of school
                //When a couple of nodes who were up to no good
                //Starting making trouble in my treeborhood
                //I found one little node and my ma' got scared
                //She said you're getting a search algorithm and moving to Tree Air
e: Just a few lines below that I then found this:

code:
    //TO INFINITY, AND BEYOND!
    maxNodeDepth = maxNodeDepth || Infinity;

Gavinvin fucked around with this message at 17:38 on Nov 17, 2016

wide stance
Jan 28, 2011

If there's more than one way to do a job, and one of those ways will result in disaster, then he will do it that way.

Ghost of Reagan Past posted:

well
code:
		
TC	BANKCALL	# TEMPORARY, I HOPE HOPE HOPE
CADR	STOPRATE	# TEMPORARY, I HOPE HOPE HOPE
this is from the Apollo 11 code

I wonder if that's related to trying to land Neil and Buzz on a huge boulder.

Gavinvin posted:

Speaking of funny comments, found this at the start of one of our tree searching algorithm. I've guessing the dev got really bored...

code:
		//Now this is a story all about how my tree got searched all upside down
                //now let me take a minute, just sit right there, I'll tell you how I became the prince of a town called Tree Air
                //In west treeadelphia, born and raised. In the intertubes was where I spent most of my days.
                //Chillin' out maxin ' relaxin' all cool
                //And seaching some tree stores outside of school
                //When a couple of nodes who were up to no good
                //Starting making trouble in my treeborhood
                //I found one little node and my ma' got scared
                //She said you're getting a search algorithm and moving to Tree Air

The good thing is that it's obviously a joke and you're not obliged to read it to understand the code.

wide stance fucked around with this message at 18:07 on Nov 17, 2016

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

TooMuchAbstraction posted:

Something like a decade ago I watched a talk given by a programmer who got carpal tunnel syndrome but still needed to be able to code. During what little "real typing" time he had each day, he hacked one of the more modder-friendly voice recognition tools to add a bunch of special "words" that corresponded to actions and symbols that are common in programming but not in normal text. Like, "zzp" mean { and "pzz" meant }, and he had words for un/indenting, creating a ( ) and moving to the interior of the parens, etc.

He had some crazy setup to get the software to work, like, he did his programming in Vim running in a Windows VM in his Linux workstation, because the voice recognition software was Windows-only. But he demoed doing some nontrivial programming and it actually worked pretty well.

This guy? https://www.youtube.com/watch?v=8SkdfdXWYaI

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Yeah, that's the guy! Clearly I misremembered some of the details (including how long ago it was :sweatdrop:) but it's still really impressive.

Nude
Nov 16, 2014

I have no idea what I'm doing.

Wow that's really cool, that's kind of what I was hoping for someone would do when I was watching the other video.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

TooMuchAbstraction posted:

Something like a decade ago I watched a talk given by a programmer who got carpal tunnel syndrome but still needed to be able to code. During what little "real typing" time he had each day, he hacked one of the more modder-friendly voice recognition tools to add a bunch of special "words" that corresponded to actions and symbols that are common in programming but not in normal text. Like, "zzp" mean { and "pzz" meant }, and he had words for un/indenting, creating a ( ) and moving to the interior of the parens, etc.

https://www.youtube.com/watch?v=lQ91SVKryYU

Volguus
Mar 3, 2009
All this voice recognition stuff ... Bullshit. What we need is the ability to just think and the computer to just do: https://en.wikipedia.org/wiki/Brain%E2%80%93computer_interface . With a bit more research we can overcome whatever barriers exist right now in BCI to be commercialized. That's where the future is.

Dairy Power
Jul 23, 2013

He who lives in harmony with himself lives in harmony with the universe.
As someone who does research highly related to brain computer interfaces, I really don't see anything being viable for general use in any time soon unfortunately. Invasive technologies (require surgery to implant into the brain) like ECoG are showing some limited promise in very specific applications to my knowledge, but are obviously not viable for the general healthy public and require specific tuning for each individual. The only non-invasive technology (no surgery) that is even remotely viable is EEG. The rest of the technologies that currently exist either require a massive device and powerful electric/magnetic shielding (MEG,fMRI) or give almost no information (FNIR).

EEG has a fairly terrible signal to noise ratio, poor spatial localization due to the scalp's effects on the signal as an insulator, is drowned out by any muscle movement including blinks, and can't even detect signal from more than a centimeter or so below the surface of the skull. Furthermore, the EEGs that actually give worthwhile signals cost tens of thousands of dollars and require set ups that are far from mobile. I'd say we still don't have a particularly great idea what level of information can even be decoded from an EEG signal (my area of research). Simple devices like the P300 speller (https://www.youtube.com/watch?v=wKDimrzvwYA) that take several seconds and full concentration + visual attention to print out a single letter are still basically state of the art. Here's a recent publication where they achieved a 120 bits per minute information rate with a p300 device: http://iopscience.iop.org/article/10.1088/1741-2560/13/2/026024/meta

Hopefully some breakthrough physics will allow engineers to develop some technology that can actually extract reasonable amounts of information from the brain and be mobile. I don't have any idea what that would be since electrical information is limited by the distance square law and the insulation of the scalp, and magnetic information is at the femtotesla (10^-15) level, which literally anything that produces a electricity/ a magnetic current will drown out. As it stands, I don't see BCIs being used outside of specific medical and research settings for a very long time.

I hope I'm wrong though!

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Dairy Power posted:

Hopefully some breakthrough physics will allow engineers to develop some technology that can actually extract reasonable amounts of information from the brain and be mobile. I don't have any idea what that would be since electrical information is limited by the distance square law and the insulation of the scalp, and magnetic information is at the femtotesla (10^-15) level, which literally anything that produces a electricity/ a magnetic current will drown out. As it stands, I don't see BCIs being used outside of specific medical and research settings for a very long time.

I hope I'm wrong though!
I wonder if you could do some sort of filtering on the magnetic signals. Surely muscle contractions produce very different looking impulses than neuron activations?

Dairy Power
Jul 23, 2013

He who lives in harmony with himself lives in harmony with the universe.

Ralith posted:

I wonder if you could do some sort of filtering on the magnetic signals. Surely muscle contractions produce very different looking impulses than neuron activations?

Well, one of the biggest issue with the magnetic signal is that it's extraordinarily hard to measure something at the femtotesla level. It involves devices that require a super conductor to measure a macroscopic quantum phenomena (https://en.wikipedia.org/wiki/SQUID). To even have these things functions at the femtotesla level, the sensors have to be cooled by liquid helium -- liquid nitrogen isn't cold enough. So, toting around liquid helium and having the requisite insulation is already a huge barrier. Worse yet, the presence of any electrical device (or anything else that produces a magnetic field) can completely destroy the tuning on these things. One of the grad students I worked with accidentally walked into the MEG room with her cellphone in her pocket, which led to the medical imagining researcher we worked with having to manually recalibrate all 306 sensors. He wasn't too pleased with that situation!

But, you can filter out the signals from muscle contractions. I'm not sure about real time methods, but people will frequently use independent components analysis to filter out artifacts that are created by eye blinks after the fact.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Dairy Power posted:

Well, one of the biggest issue with the magnetic signal is that it's extraordinarily hard to measure something at the femtotesla level. It involves devices that require a super conductor to measure a macroscopic quantum phenomena (https://en.wikipedia.org/wiki/SQUID). To even have these things functions at the femtotesla level, the sensors have to be cooled by liquid helium -- liquid nitrogen isn't cold enough. So, toting around liquid helium and having the requisite insulation is already a huge barrier. Worse yet, the presence of any electrical device (or anything else that produces a magnetic field) can completely destroy the tuning on these things. One of the grad students I worked with accidentally walked into the MEG room with her cellphone in her pocket, which led to the medical imagining researcher we worked with having to manually recalibrate all 306 sensors. He wasn't too pleased with that situation!

But, you can filter out the signals from muscle contractions. I'm not sure about real time methods, but people will frequently use independent components analysis to filter out artifacts that are created by eye blinks after the fact.
Oh, I assumed that was the type of detection EEGs used. Can you tell I have no idea what I'm talking about? :ohdear:

I'll refrain from further speculation about untapped ideas in your literal research area. Thanks for the links, those'll be interesting reading! It's exciting to hear "we still don't have a particularly great idea what level of information can even be decoded" rather than "we're pretty sure it's useless," to say the least.

Dairy Power
Jul 23, 2013

He who lives in harmony with himself lives in harmony with the universe.

Ralith posted:

Oh, I assumed that was the type of detection EEGs used. Can you tell I have no idea what I'm talking about? :ohdear:

I'll refrain from further speculation about untapped ideas in your literal research area. Thanks for the links, those'll be interesting reading! It's exciting to hear "we still don't have a particularly great idea what level of information can even be decoded" rather than "we're pretty sure it's useless," to say the least.

No worries, I was throwing out acronyms left and right with very little explanation. (E)EG measures electricity and (M)EG measures magnetic field. And yeah, I'm actually super excited to see how far these things will go. There's only a few papers even trying to use modern machine learning techniques in this field, so there's a lot of fairly low hanging fruit to explore from the CS side.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Dairy Power posted:

Well, one of the biggest issue with the magnetic signal is that it's extraordinarily hard to measure something at the femtotesla level. It involves devices that require a super conductor to measure a macroscopic quantum phenomena (https://en.wikipedia.org/wiki/SQUID). To even have these things functions at the femtotesla level, the sensors have to be cooled by liquid helium -- liquid nitrogen isn't cold enough. So, toting around liquid helium and having the requisite insulation is already a huge barrier.

And good luck even getting access to an MEG machine.
The cost of supplying the Helium alone is enough that only a handful of UK universities have one, though HyQUIDs are supposed to require much less Helium.
There's also the fact that there's basically only one company currently selling MEG machines, and I've heard that they are very noisy and require constant re-calibration, so radiographers hate them.

quote:

Worse yet, the presence of any electrical device (or anything else that produces a magnetic field) can completely destroy the tuning on these things. One of the grad students I worked with accidentally walked into the MEG room with her cellphone in her pocket, which led to the medical imagining researcher we worked with having to manually recalibrate all 306 sensors. He wasn't too pleased with that situation!

At least that just means the data is nonsense, if it were an MRI machine they could have had their phone tear through their leg.

Munkeymon
Aug 14, 2003

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



Dairy Power posted:

Hopefully some breakthrough physics will allow engineers to develop some technology that can actually extract reasonable amounts of information from the brain and be mobile. I don't have any idea what that would be since electrical information is limited by the distance square law and the insulation of the scalp, and magnetic information is at the femtotesla (10^-15) level, which literally anything that produces a electricity/ a magnetic current will drown out. As it stands, I don't see BCIs being used outside of specific medical and research settings for a very long time.

Decades of SciFi literature have promised we'll get room temperature superconductors any day now...

Dairy Power
Jul 23, 2013

He who lives in harmony with himself lives in harmony with the universe.

Edison was a dick posted:

The cost of supplying the Helium alone is enough that only a handful of UK universities have one, though HyQUIDs are supposed to require much less Helium.

Oh wow, that's really cool. I wasn't familiar with HyQUIDs. Every time I see an advance like this, I get the urge to learn more physics. Also, to try to restart an MEG collaboration...

quote:

At least that just means the data is nonsense, if it were an MRI machine they could have had their phone tear through their leg.

Ha, yeah. Though, I'd imagine she wouldn't have made the same mistake if she'd heard an active MRI machine.

Munkeymon posted:

Decades of SciFi literature have promised we'll get room temperature superconductors any day now...

I'll settle for my general purpose AI assistant and daily use jetpack, personally.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Dairy Power posted:

I'll settle for my general purpose AI assistant and daily use jetpack, personally.

We're scarily close to the former, honestly. It turns out that rearranging information is a lot easier than the complete wreckage of thermodynamics that is required for the less subtle sci-fi achievements like flying cars and safe, quiet jetpacks.

xtal
Jan 9, 2011

by Fluffdaddy
This is definitely one of the more interesting coding horror derails

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Dairy Power posted:

Oh wow, that's really cool. I wasn't familiar with HyQUIDs.

I'm only familiar with them because I'm working with the group that's planning to make them.

The fun bit is that electronics and chemistry advances mean you can theoretically do a combined MEG and MRI by pinging tuned parahydrogen instead of water and measuring the EM from that using a HyQUID, though you'd need an MEG scanner sampling at a higher frequency than anyone even had plans to make.

FlapYoJacks
Feb 12, 2009
https://www.youtube.com/watch?v=QM1iUe6IofM

theratking
Jan 18, 2012

Sounds like this guy would really like zero capture lambdas in c++.

Carbon dioxide
Oct 9, 2012

theratking posted:

Sounds like this guy would really like zero capture lambdas in c++.

Seriously. "I'd love this but I haven't seen it anywhere ever" *describes lambdas*

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings
code:
private async Task<bool> ResetButton_EventHandler()
{
	var can = false;
	var evt = new ManualResetEvent(false):

	var cancelAction = () => { can = false;  evt.Set(); }
	var confirmAction = () => { can = true; evt.Set(); }

	PopupYesNoDecisionMessageAsync(cancelAction, confirmAction);
	
	await Task.Run(() => {evt.WaitOne();});

	if(can)
	{
		//flip some booleans
	}

	return can;
}
For the life of me I cannot figure out why we wouldn't have simply made the confirmAction just do the work we wanted done on confirm.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.
Gonna make a browser extension that replaces "Object-Oriented Programming" with "My Preconception of Java from Cookie Cutter Enterprises".

xtal
Jan 9, 2011

by Fluffdaddy
OOP is a coding horror unless there is some stateless fashion of OO that I am unaware of

spiritual bypass
Feb 19, 2008

Grimey Drawer

xtal posted:

OOP is a coding horror unless there is some stateless fashion of OO that I am unaware of

Immutable objects?

fritz
Jul 26, 2003

xtal posted:

OOP is a coding horror unless there is some stateless fashion of OO that I am unaware of

Don't be tiresome.

Adbot
ADBOT LOVES YOU

xtal
Jan 9, 2011

by Fluffdaddy

rt4 posted:

Immutable objects?

Immutable state is still state (unless you mean immutable bc no instance variables)

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