|
But THREE is more descriptive....
|
# ¿ Mar 21, 2008 18:07 |
|
|
# ¿ Apr 28, 2024 07:13 |
|
duz posted:$_REQUEST wouldn't work for this because it goes $_GET -> overwritten by $_POST -> overwritten by $_COOKIE. That code is $_POST -> overwritten by $_GET. http://us2.php.net/manual/en/ini.core.php#ini.variables-order
|
# ¿ May 2, 2008 17:33 |
|
duz posted:Yes, the default is GPC which is what I used. I figured anyone who writes code like that doesn't know how to edit the php.ini (or isn't allowed to). I think you put too much faith into idiots not putting too much effort into finding the wrong solutions for their own problems.
|
# ¿ May 2, 2008 21:56 |
|
Scaevolus posted:I bet he means an APL keyboard. And I have to learn APL. Wish me luck.
|
# ¿ May 17, 2008 06:15 |
|
schnarf posted:If this is in the FFT where I think it is, then this isn't uncommon. It's probably being used for doing an inverse FFT if necessary. This is because the inverse FFT is almost exactly the same as the forward FFT, you just flip the sign of the imaginary part, I believe. Except: cos(-sign*2*pi/(4.0)) = 0 sin(-sign*2*pi/(4.0)) = -sign when sign = -1,1
|
# ¿ May 30, 2008 22:27 |
|
Incoherence posted:Programming contest solutions tend not to be known for their elegance. I've seen some elegant solutions at programming competitions: code:
|
# ¿ Jun 26, 2008 02:40 |
|
OneEightHundred posted:One of my earliest programs was Tic-Tac-Toe. I never finished it because it was taking too long to code all of the possibilities. That's actually pretty funny because I misspelled "forty" as well which led to the same problem. We didn't get that stupid bullshit about MS though. Those competitions were so pathetic. We beat the second place team by 50% the first year. One retarded group gave up an hour into it and played a flash based version of DDR. quote:Programming competitions should be viewed as nerd social events and really not much else, for exactly the reasons outlined here. Minus the social part, yeah. I didn't go to them to meet people. It was a lot more fun crushing their hopes and dreams....
|
# ¿ Jun 26, 2008 21:33 |
|
rotor posted:Demented and sad, but social. Oh please, they all played WoW, so they thought they were good at computers with the associated egos. The one team gave up 30 minutes into it to play some flash version of DDR.
|
# ¿ Jul 4, 2008 04:50 |
|
rotor posted:I missed u too. protip: never go on vacation with small children, it sucks. But what would you do if you need to feast?
|
# ¿ Jan 7, 2009 05:04 |
|
zergstain posted:Oh, and hexadecimal, if the client computes the hash, and you get to the hashes, you can just send the hash and login. If it's too sensitive to send the password as plaintext, use SSL. Wouldn't something like this work? I remember doing it like this a long time ago. In case it's not obvious I don't code much in PHP or JS. php:<?php $key = rand(); //probably use something better $_SESSION["key"] = $key; echo '...<input type="password" name="password"><input type="hidden" name="key" value="'+$key+'">...'; ?> code:
php:<?php $password_hash = //get from database $key = $_SESSION["key"]; if(md5($password_hash+$key) == $_POST["password_hash"]) { echo "Yay, yuou're logged in!"; } ?>
|
# ¿ Jan 10, 2009 06:17 |
|
zergstain posted:That doesn't really look like it could help much, I think it would be possible to edit the html and js so you could just paste the stolen hash and click login, and keep it so the session cookie would be valid. $_SESSION["key"] would be changed each time the login form is generated. I'm sorry if that wasn't clear. You don't even have to use sessions, I was just doing it as an example. And yes, MD5 is weak, SHA-1 or SHA-2 would be better, I just recall seeing a JS implementation of MD5 years ago. Would it be possible to break it in this instance? Possibly, if you could intercept the hash as it was being transmitted to the client. ohgodwhat fucked around with this message at 08:21 on Jan 10, 2009 |
# ¿ Jan 10, 2009 08:19 |
|
zergstain posted:I have some web developer extension at work, and it looked like I could edit the html in RAM with it. But actually, I'm not sure what's stopping the hacker from saving the relevant stuff to disk since I believe when you submit the form and the browser requests the action url, the cookies for that domain would be sent. As long as the form wasn't reloaded from the server, the key would still be valid. It doesn't matter how much they edit it, the $key is only good for one request, so if they have the password hashed with that key, they can't use it again. quote:If I need to login again, I can reload the page from the server, then copy and paste the new challenge value in the proper place in my saved page. Do you type in the password again too? ohgodwhat fucked around with this message at 05:25 on Jan 11, 2009 |
# ¿ Jan 11, 2009 05:22 |
|
That wouldn't even work in Python, although I don't know about Perl.
|
# ¿ Jan 26, 2009 20:43 |
|
Zombywuf posted:Now just got to hope the book doesn't suggest email regexes like '[a-zA-Z0-9_]+@[a-z]+\.(com|org)'. What would be the correct email regex?
|
# ¿ Feb 12, 2009 00:05 |
|
I was thinking more along these lines: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
|
# ¿ Feb 12, 2009 00:40 |
|
Am I just a bad programmer or is something like this bad:code:
|
# ¿ Aug 19, 2009 05:18 |
|
Zakalwe posted:output(i) returns a reference to the i'th element of an internal array I'd guess. If so I'd personally overload[] and use output[j] = device_read(j) myself; It's a stylistic choice. Yep, that's what it does. It just looks wrong. This whole project is kind of a pain, I'm trying to write a plugin for an obscure OSS scientific computing program which has no documentation. I got it working after flailing about for a bit, but that was only the beginning!
|
# ¿ Aug 20, 2009 03:29 |
|
Is that a programming competition or something? High schoolers trying to program produces some real horrors, like the team that had to print "One Two Three ... Nine Hundred And Ninety Nine" and decided a massive for-switch loop would be appropriate, for every single number. It took them all day and it still didn't pass. That year, as the only person actually programming on my team, we came in first place against other teams of three, beating second place by 50% on score. I suck at programming now and I sucked more then, too.
|
# ¿ Sep 14, 2009 03:14 |
|
Mustach posted:http://root.cern.ch/drupal/content/cint I had to use it for a brief period of time. It was interesting...
|
# ¿ Jan 15, 2010 02:16 |
|
Otto Skorzeny posted:The getuid one took me a couple minutes to see Is it because of the geteuid == 0? I really know nothing about this kind of stuff...
|
# ¿ Feb 10, 2010 21:29 |
|
Bozart posted:I'm not quite sure you realize this yet, but Zombywuf of course knows more about the domain you're working in than you ever will. You should be thankful for his condescension.
|
# ¿ Feb 16, 2010 08:17 |
|
GrumpyDoctor posted:While I certainly share your concerns about the quality of the work, I'm curious to know if you've ever taught introductory programming, and if you have, what your experience was, because in my opinion, the particular way that some people just don't "get" it is, quite frankly, bizarre. That's pretty much the case in any introductory course though, it isn't just programming, and it's still funny.
|
# ¿ Mar 4, 2010 03:48 |
|
Zombywuf posted:Well yes, profit is the most important thing in the world. Oh wait, that's only if you're a sociopath. Who said anything about profit? A technically perfect game that is never released is nothing compared to an imperfect game that millions can enjoy. Certainly Minecraft can be improved, but for the work of one man, I'm not going to complain.
|
# ¿ Jan 7, 2011 18:08 |
|
Hey, not really defending poo poo coding, just arguing that poo poo coding isn't always about profit. It sucks that your netbook can't play 3D games but neither can mine, suck it up.
|
# ¿ Jan 8, 2011 06:34 |
|
Aleksei Vasiliev posted:Notch is literally de-improving the game when he releases patches. He adds bugs that are bad enough to make the game Not Fun. What is it about Minecraft that makes you so angry? I don't think I've seen someone argue with such fervor against how a game is developed. Could we get back to Coding Horrors instead of For/Against Minecraft 'spergin?
|
# ¿ Jan 8, 2011 16:18 |
|
http://sourcesale.com/projects/2357-Encryption-Static-Library I haven't seen the source code for it, but the description is bad enough. This is supposed to be a form of encryption? quote:The library gets a password from an array and uses it to create a much bigger array. Then it gets a byte from the data to be encrypted and adds that with a value within the larger array. To use this for file encryption I recommend using the while loop and loop through the file sending data to the library one byte at a time until the file ends.
|
# ¿ Feb 21, 2011 18:07 |
|
Well what else would you return!
|
# ¿ Jul 12, 2011 21:28 |
|
Factor Mystic posted:From reddit I feel like this has to be a subtle troll since 64.99*100 is equal to 6499 which is equal to 6498.9... arguments around which usually lead to huge amounts of drama anyway.
|
# ¿ May 22, 2012 04:02 |
|
"Hey guys, I'm not very good at C, but you're doing it all wrong, could you change it to be more like what I learned about in my introductory programming class?" These people
|
# ¿ Jun 20, 2012 22:49 |
|
Carthag posted:There's a proposed genealogy data exchange format being developed by FamilySearch, a mormon company, and (surprisingly?) it will support gay marriages You'd think they'd generalize it to handle polygamy?
|
# ¿ Oct 25, 2012 20:10 |
|
ymgve posted:Personally, I'd use 4999-01-01 instead. So even if someone for some reason tries to add dates together, it still won't overflow. But what if they try to add three or more of them together???
|
# ¿ Feb 4, 2013 20:08 |
|
Munkeymon posted:Lucky bastard. Have you used Parallels to run a Windows program on a Mac or tunneled an X session over ssh? It's like that but on a different machine you don't control and it's Enterprise Grade Software so you can be assured it's terrible (or was back when I had to use it). Ah, but what about X tunneling over SSH to Windows, where you then have to copy and paste text into gedit if you wanted to transfer something to the server? Oh and then you need to transfer binary files this way because SCP and its ilk are a security risk?
|
# ¿ Mar 2, 2014 07:48 |
|
ToxicFrog posted:As in, you can ssh into the system, and X forwarding is enabled, but sftp is disabled? I was connecting from Windows, there was no tar, and I don't know if putty can be used like that. Steve French posted:Or maybe just rsync or scp Yeah, if they were available. It's not like this isn't a solved problem as long as IT isn't paranoid.
|
# ¿ Mar 3, 2014 18:49 |
|
What's city.population rescue 0? I don't know Ruby, but it sounds like a divide by zero waiting to happen.
|
# ¿ Mar 7, 2014 00:51 |
|
Jewel posted:Really?? How? Doesn't "A Very Big Number", no matter how big, even if indefinitely big, multiplied by 0 give 0? 0 multiplied by anything is zero, I don't see why that should be undefined? What's 0/0? What's 0*1/0?
|
# ¿ Mar 7, 2014 04:41 |
|
I have stared into the code of non technical interns, and the code has stared back into me. Why have functions that can take parameters when you can just make a class called "input" which takes a bunch of user input from the console when it's initialized, and then derive classes from that which then implement functions that use the instance variables to figure out what to do? That's helpful.
|
# ¿ Apr 12, 2014 01:02 |
|
I had to install Node.js at work today, because ipython for some reason needs it to turn its files into static html. It was either that or a documentation generator that required pywin32, because spitting out html files really needs specific parts of the Windows API. I have to hope there's a better way, or at least some reason why this is necessary.
|
# ¿ May 16, 2014 05:16 |
|
HardDisk posted:Can't you hook up something like Jinja2? Yeah, let me go rewrite ipython nbconvert, instead of just installing node.js.
|
# ¿ May 17, 2014 00:37 |
|
SurgicalOntologist posted:For me, it has a backup implementation it used when I didn't have node. But then I installed node so I don't remember what it was. The output looked the same though. Yeah, pandoc I think, which wouldn't work without pywin32 either, and which for *reasons* I can't install. It just seems so asinine to me that ipython, which is otherwise a pretty decent project, would go about this bit in probably the most inconvenient way.
|
# ¿ May 17, 2014 17:49 |
|
|
# ¿ Apr 28, 2024 07:13 |
|
And no one ever found out about it!
|
# ¿ May 18, 2014 19:12 |