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
Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.
This script has been in daily use since 07/13/05:
code:
# Modified to make send_all.pl taking command line parameters: host_name and AE_Title
#(i.e. Send_all.pl P035.01.1_ -h G3k3sys3 -D redactedG3k33SCP)
#
# Usage : send_all.pl [file prefix] => works as before
# 	: send_all.pl => works as before
# 	: send_all.pl [file prefix] [-h HostName] [-D AE_Title] => Take host_name and AE_Title from command line and
#								send the files with an specified prefix
# 	: send_all.pl [-h HostName] [-D AE_Title] => Take host_name and AE_Title from command line and send all files
#							from current folder
#	: send_all.pl [file prefix] [-D AE_Title] [-h HostName]
# 	: send_all.pl [-D AE_Title] [-h HostName]
...and here's how that's implemented
code:
elsif ( @ARGV > 0  )
	{
		$send_all_flag = 0;
		if( $ARGV[0] =~ /-h|-D/ )
		{
			$filename = "";
			$send_all_flag = 1;
		}
		$i =0;
		$line = "";
		while ( $i < @ARGV )
		{
			$line = $line . " " . $ARGV[$i];
			$i++;
		}
		$hTemp = "";
		$calledTemp = "";
		if( $line =~ /-h(.*?)-D/ )
		{
			( $hTemp ) = ( $line =~ /-h(.*?)-D/ );
			if( $line =~ /-D(.*)/ )
			{
				( $calledTemp ) = ( $line =~ /-D(.*)/ );
				$hTemp =~ s/^\s+//;			#strip leading space
				$calledTemp =~ s/^\s+//;	#strip leading space
				$host=$hTemp;
				$called=$calledTemp;
			}
			else
			{
					print "Missing -D in command line parameter\n";
			}
		}
		else
		{
			if( $line =~ /-D(.*?)-h/ )
			{
				( $calledTemp ) = ( $line =~ /-D(.*?)-h/ );
				if( $line =~ /-h(.*)/ )
				{
					( $hTemp ) = ( $line =~ /-h(.*)/ );
					$hTemp =~ s/^\s+//;			#strip leading space
					$calledTemp =~ s/^\s+//;	#strip leading space
					$host=$hTemp;
					$called=$calledTemp;
				}
				else
				{
					print "Missing -h in command line parameter\n";
				}
			}
			else
			{
				print "No -h or -D specified in command line parameters\n";
			}
		}		
		if( $send_all_flag eq 1 )
		{
			send_all_files();
			exit;
		}
	}
:suicide:

"Hey guys, why do I have to specify the parameters in a specific order or it ignores them all?"

In the future I'm taking the blue pill...

Adbot
ADBOT LOVES YOU

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.
Can't actually post the code, but at work today I figured out that if you have the product I'm testing installed, anyone can create a webpage that can invoke any arbitrary dos command or change any setting in the registry with like three lines of setup.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

beuges posted:

At a previous job, I inherited a project with a couple of .cpp files being well over 15000 lines each... one class per file.

27000 lines is the largest I've seen for a single .cpp file so for... and that's one class.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

kalleth posted:

Ruby gives you loads of rope to do fancy poo poo with metaprogramming. When I start seeing myself write stuff like "string".singularize.classify.constantize.send("another_string") I realise that I'm probably using that rope to hang myself, and should probably stop :(

I've never even so much as looked at Ruby before but I looked up what that does and wow:

quote:

Constantize tries to find a declared constant with the name specified in the string. It raises a NameError when the name is not in CamelCase or is not initialized.

Examples

"Module".constantize #=> Module
"Class".constantize #=> Class

quote:

classify(table_name)

Create a class name from a table name like Rails does for table names to models. Note that this returns a string and not a Class. (To convert to an actual class follow classify with constantize.)

Examples

"egg_and_hams".classify #=> "EggAndHam"
"post".classify #=> "Post"

[ show source ]

quote:

singularize(word)

The reverse of pluralize, returns the singular form of a word in a string.

Examples

"posts".singularize #=> "post"
"octopi".singularize #=> "octopus"
"sheep".singluarize #=> "sheep"
"word".singluarize #=> "word"
"the blue mailmen".singularize #=> "the blue mailman"
"CamelOctopi".singularize #=> "CamelOctopus"


I'm going to have to look into this Ruby thing in the future, I've been looking at c++ COM objects too long to wrap my mind around this stuff.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

HORATIO HORNBLOWER posted:

Where's the horror? I write OO in C all the time and while I often wish I were doing it in a language that made it easier, it remains a great way to organize and think about your code. Anyone who has read or written code that does COM in C has seen stuff that looks practically identical to this. It may seem silly to you but Chen's justifications are valid ones, especially when you consider the constraints of the early 90s.

Yeah but we're in 2011 and you still need to deal with all this COM bullshit to write a shell extension. It hasn't gotten any better since the late 90's.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Beef posted:

Could someone translate for a non-C# initiate?

It's mostly a "what the gently caress would you be doing with 32k threads" issue. A semaphore limits the number of threads that can access a resource or resource pool concurrently. 32k is an enormous number of threads - on my machine, explorer.exe is using 32 threads (you can check in task manager what apps are using how many threads.)

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

The Gripper posted:

We had a guy that would do this regularly, and it frustrated every other person on the team to the point where no one even spoke to him anymore. Almost everything he committed wouldn't compile because he had things checked out for weeks, and it was on everyone else to make their code work with his broken merges.

The worst thing was, he kept a checklist of features he'd added, and passed that along to the Division Manager (above our team lead and project managers), and get patted on the back for it. If we reverted his changes, the Div. Manager would check logs and see that one of the other guys had reverted it, and the conversation would go:
:mad: : REDACTED added this feature and the system says you deleted it, why are you deleting other peoples work. I told the client this feature was complete.
:confused: : His commits didn't work, he improperly merged without testing. It broke the entire project.
:mad: : IT'S NOT REDACTED's JOB TO MAKE EVERYONE ELSES CODE WORK, EVERYONE HAS TO TAKE RESPONSIBILITY.

Instead of having to deal with lovely upper-management and having to fix all his crap, we (dickishly, I admit) kept track of what features he was working on and as a group beat him to almost every single one of them for close to a month, so when he went to commit his changes the team lead rejected them for needless duplication.

We all had a good laugh until we found out he was still filling out his checklist and passing it along to the division manager and getting props for his good work, so I guess the moral of the story is be a bad developer and get mad props, or something.

You aren't being clever enough. Break his stuff when it's merged in and modify commit history (exercise left to reader) so the bugs come in blaming him. Complain behind his back to upper management - use phrases like "his brain doesn't work right". Crack jokes. Set other managers against him.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.
Why I hate strings in c++ on win32 platform...

quote:

// Convert from string to ULONGLONG.
//
// VT_UI8 is not supported on W2K.
// So we can't use a variant to do the conversion
// (which we could on other platforms).
//
// There is a _ui64tow_s and a _wtoi64, but no _wtoui64,
// so we have to use _wtoi64 and convert the string to a LONGLONG
// and put that in our ULONGLONG.
// If the string is greater then _I64_MAX, then _wtoi64 returns _I64_MAX.
// But that should be plenty big for all practical purposes.
//
// If _wtoi64 encounters an error it will set the value to 0.
// This would only happen if the XML element contains a bad string,
// in which case 0 is appropriate.
// If the string has a number in the front, it will take that number
// "123 bad string" returns 123.
//
// _I64_MAX == 9,223,372,036,854,775,807
// _UI64_MAX == 18,446,744,073,709,551,615

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Suspicious Dish posted:

That is not how databases work. You could model it in three different tables: forums, threads and posts. A post would have a foreign key column to a thread, and a thread would have a foreign key column to a forum.

It's actually hard for me to imagine how you would model the DB so each thread has its own table. That must be pretty nasty.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Crosscontaminant posted:

Yes, but I thought that was related to a recent WTF about a customer refusing to escape their own ampersands and not supposed to be a WTF in itself.

Think about it this way: what happens if the XML passed in already has an escaped character in it?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Look Around You posted:

I don't feel bad really (and I don't hold it against him), I just feel dumb because I posted a kneejerk reaction of something without taking much time to figure out reasons behind it. Maybe part of it was I wasn't able to get a feel for the goals and stuff of the language right away, but that's not really an excuse for me posting retarded poo poo, that's just me not taking the time to comprehend something and then spouting poo poo off about ideas that I only half understood.

I think your core argument was "this language looks like C++, Perl and LISP hosed and C++ drank throughout the pregnancy." It might've looked better if the dude who was writing code for the standard libraries used variables that were longer than two characters and maybe threw in some whitespace, but yeah, that is some ugly code.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Aleksei Vasiliev posted:

Why the hell does Twitter need constants for both years and solar years?

edit: Skyrim's PC version was compiled without any compiler optimizations. A modder rewrote the x87 code to SSE2 and inlined a bunch of getters and got a boost of ~40% performance. Bethesda has now released a patch that, among other things, "Improved compiler optimization settings"

These are the same chucklefucks who evidently didn't understand what heap fragmentation was on release so you could put a performance counter on virtual bytes and just count the minutes until it hit 2 gb and then Skyrim would crash for some mysterious reason.

How much you want to bet that in this patch, they turned on full optimization instead of doing profiling and setting optimization pragmas in the methods that would benefit the most?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Internet Janitor posted:

If in-house developers come up with a simpler, less general solution that addresses the actual needs of the application, it's not hard to imagine it being easy to maintain. The real problems are feature-creep and in-house solutions that are as complex or even hairer than the off-the-shelf tools they were meant to replace.

Not using jQuery specifically means your organization has its head up your own rear end more than Microsoft does - it's been included as is in visual studio for 4 years.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Funking Giblet posted:

I ditched jQuery and wrote my own wrappers for common functions, and a builder to target specific contexts (per page scripting, or mobile device optimised scripts). jQuery, at best, is a rapid prototyping tool. It's not bullet-proof by any means.
My position is more along the lines of "try using it first and then move to other stuff if it isn't sufficient" - I was more aghast at the logic for not trying to use it in the other post (I'm a bit of a fanboy too I'll admit).

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

pokeyman posted:

I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood.

It explains garbage like Sharepoint so tidily.

A recruiter was talking about flying me out to redmond to interview with the "MS Office Team" for a SDET position. I was tempted but then I figured out the job was really about sharepoint and that tempered my interest level rather significantly.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Hammerite posted:

That doesn't seem too far off. I get 10.84 years using his numbers, so he's in the right ballpark.

That would be along the lines of saying "between the ages of zero and nineteen, I never scored. But one time when I was twenty, my friend had sex (with a woman). That is infinitely more sex than I ever have had. My mom was wrong. This is the future."

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

1337JiveTurkey posted:

There's lots of ways people get random numbers wrong and many of them aren't related to the algorithm used by the PRNG. It's still possible to get skewed probabilities even with a generator like Mersenne Twister. For example if a PRNG or even a genuine entropy source produced an output from 0-16, if you restricted the output modulo 15, the number 0 would be twice as likely to show up as all the other numbers.

One really dumbass thing I did one time was calling 'create new rand()' in the constructor for an object... The results were very much not random.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

ManlyWeevil posted:

The full paste is too long (~200 lines) but I was going through my groupmate's contribution to our senior project, and have been constantly banging my head on the desk reading it.

code:
Byte[] latitude = new Byte[8];

(snip)

latitude[0] = pack[4 + (32 * i)];
latitude[1] = pack[5 + (32 * i)];
latitude[2] = pack[6 + (32 * i)];
latitude[3] = pack[7 + (32 * i)];
latitude[4] = pack[8 + (32 * i)];
latitude[5] = pack[9 + (32 * i)];
latitude[6] = pack[10 + (32 * i)];
latitude[7] = pack[11 + (32 * i)];

(snip for 4 other variables)

lat = BitConverter.ToDouble(latitude, 0);
These blocks occur twice in a switch statement from adjacent cases where its identical. The full paste is: http://pastebin.com/ArbTafTP

For added fun: the files themselves are duplicated completely for two different projects in the solution. Or rather, they should be the same files, but comparing diffs seems to imply that one was updated when the other wasn't. I suppose its almost not fair mocking students, but the person who wrote this is a CS senior.
I looked at it and yup, there's code that messes with the GUI in that method too. Mixing presentation layer and business layer should be an automatic D in these programs.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Goat Bastard posted:

Don't forget the broken GROUP BY which silently picks a row to satisfy it instead of raising a compile error when it doesn't cover all the non-aggregate columns, leading to a depressingly large number of developers not understanding how to use aggregate functions properly.

Edit: actually I guess you covered that with the "stupid and unwanted" thing, but man I hate that so much.

Oh goddammit, this explains why Group By suddenly got annoying in grad school.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

narbsy posted:

Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP

What the gently caress?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

yaoi prophet posted:

Semantically significant comments. Hell loving yes.

I like how you actually have to 'compile' your php code if you use that framework. Just what php needs.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Golbez posted:

I'm an idiot, so what is bad about this? That he didn't know why he was adding it?

It's cargo cult as gently caress to just add in features without having a use case.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Bohemian Cowabunga posted:

So can we bitch about lovely teachers here?..
I am currently studying to become a network engineer and have taken an introductory course in C# on the side. The entire course has pretty much turned into a self-study. We have had zero theory and not turned in a single assignment, but merely worked on whatever we wanted during the classes.

Now we have never actually seen any of this guys own code until now, when he gave us the code our oral exam is based upon.

http://pastebin.com/RYHrAfRb

This guy is being paid to teach programming.

Wow, that is extremely uneducated C# - it's about what you'd expect if you gave a high school freshman a copy of winforms for dummies and two days.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Zombywuf posted:

You get to learn two languages for the price of one, where's the problem?

I went to Finland once - Finnish is completely unintelligible to (this) native English speaker. I didn't think I knew Swedish at all but I was actually pretty thankful that all the road signs were also written in Swedish because I am completely illiterate in Finnish but occasionally, Swedish has a loan word.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Suspicious Dish posted:

What should you write instead? stdbool.h is C99.

If I saw something called my_bool in someone else's code, it'd never occur to me that it was really a char without looking up how it was defined in the header and it would really piss me off - he'd have been better off just having a return type of char.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Jabor posted:

Okay I guess, but why does that mean you have to store them in the table in that fashion? Isn't that just bloating your indexes for no reason?

Don't forget making it impossible to auto-incrementing the key. Sure do love writing the code to do that manually if I want to maintain a synthetic key.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Jabor posted:

In InnoDB, the primary key is also used as a clustering key.

Someone familiar with MySQL might realize that this makes using strings as primary keys a bad idea :ssh:

Another issue is that strings are not a motherfucking data type in SQL. I actually have no idea if he was talking about text or varchar.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Chuu posted:

That "Standard module error handler" is where RAISE_ERROR lives, which in and of itself is a bit of a horror because before SQL Server 2012 you could not re-throw errors, which meant using RAISE_ERROR and more ugly boilerplate for reporting.

Are all databases this terrible for developing robust stored procs?

It isn't ordinarily that bad - you're showing an example dealing with nested transactions and try/catch at the same time, and frankly you're probably better off structuring the logic of your stored procs so you don't have to deal with nested transactions if you're at the point where you feel like they are necessary for some reason.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Zombywuf posted:

Even worse are the ways of simulating the processes of passing documents from person to person with a growing pile of notes stuck to the front. Excel is often used for this. Where MY GF works there is a person who's job is to take forms and turn a list of checkboxes into a binary representation and write it on the form so someone else can type it into a spreadsheet. You see, there's only one copy of the spreadsheet on a shared drive so only one person can edit it at a time. Periodically the spreadsheet is recreated and the previous one sent on to the next stage of the process.

While it is an excellent example of how to deal with contention using the single writer paradigm, it hurts to think of people doing it by hand.

I bet if you talk to the people at your GF's company, they'd look at you like you had two heads if you started talking about Google docs.

We moved over from Lotus Notes 6.5.1 to gmail... earlier this year. Lotus Notes was configured so that it was impossible to index your in-box (seriously) and that functionality was locked down by an administrator, so it took like 15 minutes to do a full text search of an inbox. Seriously. Yet when we moved over, everyone started complaining about GMail sucked - for the first 3 weeks after we moved over to gmail, the IT director would shout "gently caress GMAIL" across the entire office at 4 PM in the afternoon like clockwork every single day...

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Zombywuf posted:

I don't use memcached these days. Last time I did I used it as a db cache. Turns out the db didn't need caching and I should have told the people pestering me about caching to go gently caress themselves. All it did was add complexity and it could go for weeks with memcached down and no-one noticed, turns out my time was best spent making the db fast, which it was.

This poo poo is endemic when semi-technical users tell you how to improve the performance of a system - it's always a x-y problem except there's no solution because poo poo can always be faster...

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

yaoi prophet posted:

I don't know C++ at all, what's the horror?

The code only looks like it works. The functions are returning pointers that reference local variables - when a function goes out of scope, we stop tracking its local variables, and the memory used is on its own. You have no way of knowing if/when this memory is going to get munged later, the behavior is undefined and totally up to the system itself. This can lead to very hard to troubleshoot bugs - the compiler should warn you if you have warnings enabled about doing this.

But honestly, it's probably stupider that there is no explanation on the page about the use case for making a function return a pointer! Why bother telling how if the user doesn't know why he would want to do something?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

baquerd posted:

Regardless of what is being used for HFT trading, the EOD accounting is still done with systems that track every last fraction of a cent actually made/lost so it won't really be that much.
a bigger wtf moment I ever in commercial development had involved sorting a list of points in a class where x/y/z coordinates were stored as doubles. I wrote an algorithm that would sort by x coordinate, then y coordinate, then z coordinate... I got very, very weird results.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Thermopyle posted:

Sure, but the solution to the problem isn't "gently caress it, let's make it as hard as possible to replicate", it's to make the code open.

TBH that actually isn't the hard part - people have problems in the scientific community even if you give them the source code. Just making sure all the libraries/etc that you could have linked against are present and that your build environment is reproducible is pretty tough when you don't test how easy it is to replicate your build environment (and you don't really know what you're doing).

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

bucketmouse posted:

E: Probably the wrong thread for this. Visual Studio is terrible anyways.

VVV : tl;dr There's some weird quirk that will make the runtime crash violently (complete with call-stack corruption!) if it calls a method declared virtual within a C++ template. I've got no idea what causes it but I spent a good 4 hours today debugging what I thought was a memory corruption issue. I thought it was the original coder's fault (and was going to complain about it) but the code compiles and runs fine via g++ so I've got no idea.

That's a sign you need to start playing with your project compiler settings - are you using COMDAT folding or other optimizations?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

That Turkey Story posted:


I'm going to go on a rant for a second just because. A lot of people look at projects like boost and, before looking at the implementation, say "wow, this is some incredible stuff." Then, when they look at the implementation they throw a fit because in order to do that amazing stuff, you need to write some scary code, frequently using the preprocessor and/or templates in ways that the average programmer does not.

Another good example is the code for the std::vector class itself, which gets my vote for the most difficult to read widely-used class ever.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

GentlemansSleepover posted:

I want to thank everyone in this thread for giving me the push I needed to force all my applications to use encrypted passwords instead of plain text bullshit sitting in the database. I hated doing it that way from the start, but everyone insisted that they needed to be able to read the passwords in plain text so that they could provide them to users if they called in. At the time, it was easier to just do what the customers wanted and give them plain text passwords, but today I'd had enough. I decided gently caress them, I'm not being blamed for this poo poo getting compromised at some point and thousands of users passwords being out in the wild.

Also, I've always been embarrassed to go back even a couple years and look at the crazy poo poo I wrote - now I'm looking at things as I write them and thinking "what the gently caress is wrong with you? There's a better way to do this." and I credit this thread for shaming me into being a better person. Thanks again everyone, I really appreciate it.

You're not supposed to store encrypted passwords, that is only a little better than storing them in plaintext. Use a one-way hash function.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

shrughes posted:

What one-way hash function would you recommend?

perhaps i meant cryptographic when i said one way. SHA-256 hasn't been compromised, may as well go with that. Compute the hash based on the concatenation of salt (possibly time when password was entered + arbitrary string) + user password. That way no one knows the password and they can't plug your database into freerainbowtables.com.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

yaoi prophet posted:

No. Use something like bcrypt or scrypt that's designed to be slow to calculate, to slow down brute-force attacks.

Ugg, I googled this and found http://hashcat.net/oclhashcat-plus

So yep, I am embarrassingly wrong about SHA-256.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.
code:
function b64utob64(s) {
    if (s.length % 3 == 1) s = s + "==";
    if (s.length % 3 == 2) s = s + "=";
    s = s.replace(/-/g, "+");
    s = s.replace(/_/g, "/");
    return s;
}
Missed it by that much!

Adbot
ADBOT LOVES YOU

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Jonnty posted:

I know, whenver I see testAndSet used I always think it's dying to be broken up into two separate functions.

Amateur. TestAndSet should be three functions.

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