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
Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Factor Mystic posted:

:smug:

The WOW64 hacks are actually on-topic :(

Adbot
ADBOT LOVES YOU

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Incoherence posted:

Clearly the third option is FileNotFound.

I'm surprised it took this many posts to reach that.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
From some old LaTeX code I wrote:
code:
% it rotates variables by 90 degrees
No, I don't know what that means.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

pseudorandom name posted:

code:
FizzBuzz()
	New num
	For num=1:1:100 Do
	. Write:((num#3'=0)&(num#5'=0)) num
	. Write:num#3=0 "Fizz"
	. Write:num#5=0 "Buzz"
	. Write !
	. Quit
it's Perl and VB and COBOL and Fortran :cry:


Content: I'm in the process of rebuilding an ASP/Access website with a modern one built on ASP.NET MVC and SQL Server. This function more or less sums up the original programmer. Really great guy, I mean no offense to him by posting this here, but this is definitely babby's first CMS:
code:
function getdate(iDate)
	set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlHttp.open "GET",URL & iDate,"False"
	xmlHttp.send()
	if xmlHttp.Status <> "200" then ' 200 = Good result
	  'ok We Got a Problem here no response from cafepress
	else
	  xmlText = xmlHttp.responseText
	  StartContent = instr(xmlText,"<body")
	  EndContent = instr(xmlText,"</table")
	  xmlText = Mid(xmlText,StartContent,(EndContent-StartContent))
	end if
	'Process Text for
	xmlText = right(xmlText, len(xmlText)-7)
	xmlText = xmlText & "</table><br>"
	xmlText = replace(xmlText,"<td>Title</td><td>Length</td>","<td>Title</td><td></td>")
	Response.Write xmlText
end function
No, that function does not actually contact CafePress.

Also almost the entire website is shoehorned into one single database type. Not one table with hundreds of columns, but the "article" table was repurposed to do almost everything. Article summaries can be image URLs, article subtitles can be category names, article text can be a link destination. There's nothing really horrifying about this code, just some perplexing design decisions :psyduck:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

shrughes posted:

and a reliance on compiler optimizations that change big-O properties of the code

Wait, what?!

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Maybe someone specified "dark green" and the developer just picked the default implementation and left the separate declaration in case it needs to be changed? :shobon:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
The real horror is that you KNOW that at some point it has the information in discrete enough components to emit well-formed XML. In fact, it may have done that at one point in its lifetime.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Janin posted:

"DSL" is what Ruby people call libraries

If this is true then my god this is the biggest horror in the thread

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Monkeyseesaw posted:

We need a language where the only data type is a string and when you do non-string operations like arithmetic it converts it to some internal representation, does the bit shuffling, and returns the result as a string. All functions are simply extending the string type.

But you still have to explicitly declare your variables as strings JUST TO MAKE SURE.

Extend INTERCAL to support Unicode :pseudo:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
code:
typedef std::stack<Job *> JobQueue;

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

w00tz0r posted:

"Forward compatibility is easy, all Microsoft products are completely forward compatible. I can write a program on Windows Vista and have it run on Windows 95. The only thing that broke forwards compatibility is UAC."
If I'm not mistaken this is true for VB6 :3:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
http://forums.silverlight.net/t/240580.aspx/1?126+000+lines+of+code+System+OutOfMemoryException

quote:

Hi,

I do have a question. In my MainPage.xaml.cs file, I am on the 126,000:th line now coding. Sometimes when I compile I get this below exception that tell about OutOfMemoryException.

I wonder if this depends on the big amount of code. I have 3.5 GB of RAM and there is 1.5 GB Free RAM when I compile. My XAML contain of approx: 15,000 lines of code.

Source file 'D:\Documents and Settings\A\My Documents\Visual Studio 2010\Projects\thisProj\thisProj\MainPage.xaml.cs' could not be opened ('Exception of type 'System.OutOfMemoryException' was thrown.')

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
This one threw me for a couple of days :downs:

code:
public Butt Foo(long id)
{
    return Foo(id);
}

public Butt Foo(long id, IButt butt = null)
{
    // do stuff
    return someButt;
}

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Yep the C# compiler accepted it just fine. Initially there was only one signature, the first, so I didn't catch the mistake brewing when I refactored it to add the second form.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
What's that quote again about informally-specified, bug-ridden LISPs?

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

tef posted:

also use WHILE .. ENDWHILE etc http://php.net/manual/en/control-structures.alternative-syntax.php

PHP is designed for use as a templating language. Ergo, it is useful to cut down on the number of braces in views where possible, as they add unnecessary clutter. A Good Feature.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

bucketmouse posted:

I found out today that Games' favorite cool OCD internet guy had published code. It's kind of terrifying and kind of :unsmith:

http://pastebin.com/yRmTM36Y

Documenting magic numbers automatically makes him a better programmer than some I've worked with.

code:
else if (CurrentSpeed < 140000) { CurrentSpeed = 140000; } // extended maximum; 7/5
else if (CurrentSpeed < 141421) { CurrentSpeed = 141421; } // sqrt(2); 6 semi-tones higher

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Wheany posted:

Don't loving start.

If I get to define a strict coding style I will mandate the use of U+180E, MONGOLIAN VOWEL SEPARATOR, as the only valid indentation character.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Internet Janitor posted:

One of the strangest behaviors I have observed in lab courses is a behavior I call "soup programming", in which students read a problem description, add several loops, conditionals and variables to a procedure body and then proceed to spend half an hour rearranging those elements to try to get the result to compile, as if programming were a matter of selecting the correct ingredients and stirring. Usually when I help students who are doing this I tell them to step away from the keyboard and try to explain the problem and their approach to solving it verbally- if you can't explain something to a person you can't explain it to a computer.

I found that students like that often would take that same approach to math and physics problems too. :sigh: I turned down a couple of offers to become a CS tutor because I knew that kind of person would do nothing but frustrate me.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Welp, I'm off to document a class with 181 public methods. :toot:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Manslaughter posted:

You guys are so lucky, you actually have things in your exception blocks :smith:

At my last job we had:

code:
catch(Exception ex)
{
    throw ex;
}
or

code:
bool method(int foo, out string errorMsg)
{
    try { ... }
    catch(Exception ex)
    {
        errorMsg = ex.Message;
        return false;
    }
    return true;
}
Now with both of those in use you had no idea where anything came from.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Found this at the top of one of our core ETL scripts recently.

Perl code:
unless(-d "/mnt/net/foo/bar/homedirs/someuser")
{
    die "No home directories are available!";
}
As you might expect, someuser was indeed responsible for that block. Job security!

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

Fergus Mac Roich posted:

I wonder if anyone does horrible things with the C Preprocessor while writing in languages that aren't C, as in running a non-C source code file through gcc -E as part of a compilation step.

I once built a static HTML site using the preprocessor. I was crunched for time and didn't have time to learn something like Jekyll.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
http://www.audioasylum.com/forums/pcaudio/messages/11/119979.html

quote:

found that a function called memcpy was the culprit, most memory players use memcpy and this is one of the reasons why memory play sounds worse ie digital sounding. Fortunately there is an optimised version of memcpy from http://www.agner.org/optimize/, using this version removes the hard edge produced by memcpy. the other thing I did was to close the file after reading into the buffer.

also most players use malloc to get memory while new is the c++ method and sounds better.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

NihilCredo posted:

EDIT: in totally unrelated news, is this attribute normal for Angular?



My (admittedly outdated) recollection is that ng-init is an override for initializing values that for some reason can't be done inside a controller. Using it to provide configuration at the root of the application smells of a poor application architecture.

Adbot
ADBOT LOVES YOU

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
Who even needs a debugger? Just write your code correctly the first time. :dukedog:

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