|
This script has been in daily use since 07/13/05:code:
code:
"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...
|
# ¿ Feb 27, 2009 03:03 |
|
|
# ¿ Apr 30, 2024 04:48 |
|
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.
|
# ¿ Mar 31, 2009 05:15 |
|
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.
|
# ¿ Aug 5, 2011 21:13 |
|
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. quote:classify(table_name) quote:singularize(word) 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.
|
# ¿ Sep 10, 2011 23:45 |
|
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.
|
# ¿ Oct 25, 2011 05:25 |
|
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.)
|
# ¿ Nov 14, 2011 12:53 |
|
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. 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.
|
# ¿ Nov 22, 2011 17:57 |
|
Why I hate strings in c++ on win32 platform...quote:// Convert from string to ULONGLONG.
|
# ¿ Dec 13, 2011 19:20 |
|
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.
|
# ¿ Dec 31, 2011 13:23 |
|
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?
|
# ¿ Jan 13, 2012 18:12 |
|
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.
|
# ¿ Jan 29, 2012 15:10 |
|
Aleksei Vasiliev posted:Why the hell does Twitter need constants for both years and solar years? 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?
|
# ¿ Feb 2, 2012 14:09 |
|
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.
|
# ¿ Feb 4, 2012 16:09 |
|
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.
|
# ¿ Feb 4, 2012 19:38 |
|
pokeyman posted:I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. 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.
|
# ¿ Mar 13, 2012 00:20 |
|
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."
|
# ¿ Apr 7, 2012 09:58 |
|
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.
|
# ¿ Apr 11, 2012 01:10 |
|
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.
|
# ¿ May 6, 2012 15:25 |
|
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. Oh goddammit, this explains why Group By suddenly got annoying in grad school.
|
# ¿ May 7, 2012 14:04 |
|
narbsy posted:Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP What the gently caress?
|
# ¿ May 11, 2012 03:28 |
|
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.
|
# ¿ May 11, 2012 03:39 |
|
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.
|
# ¿ May 29, 2012 15:28 |
|
Bohemian Cowabunga posted:So can we bitch about lovely teachers here?.. 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.
|
# ¿ Jun 4, 2012 19:06 |
|
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.
|
# ¿ Jun 4, 2012 22:22 |
|
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.
|
# ¿ Jun 11, 2012 14:55 |
|
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.
|
# ¿ Jun 14, 2012 00:12 |
|
Jabor posted:In InnoDB, the primary key is also used as a clustering key. 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.
|
# ¿ Jun 14, 2012 23:22 |
|
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. 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.
|
# ¿ Jun 15, 2012 12:46 |
|
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. 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...
|
# ¿ Jun 20, 2012 00:38 |
|
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...
|
# ¿ Jun 22, 2012 20:54 |
|
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?
|
# ¿ Jun 30, 2012 23:04 |
|
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.
|
# ¿ Jul 1, 2012 19:10 |
|
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).
|
# ¿ Jul 2, 2012 20:51 |
|
bucketmouse posted:E: Probably the wrong thread for this. Visual Studio is terrible anyways. That's a sign you need to start playing with your project compiler settings - are you using COMDAT folding or other optimizations?
|
# ¿ Aug 2, 2012 04:27 |
|
That Turkey Story posted:
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.
|
# ¿ Sep 21, 2012 12:54 |
|
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. 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.
|
# ¿ Oct 6, 2012 07:53 |
|
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.
|
# ¿ Oct 6, 2012 08:03 |
|
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.
|
# ¿ Oct 6, 2012 09:37 |
|
code:
|
# ¿ Oct 18, 2012 20:07 |
|
|
# ¿ Apr 30, 2024 04:48 |
|
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.
|
# ¿ Nov 24, 2012 18:39 |