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
Captain Capacitor
Jan 21, 2008

The code you say?

sXe.spengler posted:


It could only service one request per second per XL AWS instance.

It also required one server per request per second.

They used a root-level process to parse cookies with a raw python eval().


Amazon AWS posted:

Extra Large Instance

15 GB memory
8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each)*
1,690 GB instance storage
64-bit platform


:gonk: :psyduck: I..what...how?

*Approximately 2.0+Ghz per compute unit

Captain Capacitor fucked around with this message at 12:09 on Feb 3, 2012

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Captain Capacitor posted:

:gonk: :psyduck: I..what...how?

This is how
code:
#!/usr/bin/env python

import cssutils
from datetime import datetime

css_str = "a { color: red; }\n" * 1000
start = datetime.now()
cssutils.parseString(css_str)
end = datetime.now()
print end - start
code:
~/code$ ./css.py 
0:00:02.439396
No this code has nothing to do with what sXe.spengler posted, except to demonstrate how amazingly slow some people can make computers run.

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock
Let's combine Python and semicolon talk in one post - here's a fun experiment: Get some booze. Search for semicolons in your Python source code. Take one shot for each unnecessary end-of-line semicolon you find.

tef
May 30, 2004

-> some l-system crap ->
In one project ~2500 lines I found 0 semicolons. In the 12000 line one, I found import traceback; traceback.print_exc(); three times. I blame debugging.

Your move :smugdog:

Brecht
Nov 7, 2009

Zombywuf posted:

No. It's still a major semantic change for what could be a spec of dust on your screen. I don't want to use a language where a bottle of screen cleaner is a debugging tool.
There are probably lots of good reasons to resist a language 'feature' like this, but "resemblance of semantically-meaningful character glyph to dust particle" just isn't one of them.

shrughes
Oct 11, 2008

(call/cc call/cc)
You people are hysterical. Why don't you complain about the subtraction operator, that's indistinguishable from a dust particle too.

tripwire
Nov 19, 2004

        ghost flow
My new language uses only unprintable characters to get around the problem

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

tripwire posted:

My new language uses only unprintable characters to get around the problem

APL?

pseudorandom name
May 6, 2007

Zombywuf posted:

No. It's still a major semantic change for what could be a spec of dust on your screen. I don't want to use a language where a bottle of screen cleaner is a debugging tool.

code:
if (something);
    return true;

baquerd
Jul 2, 2007

by FactsAreUseless
If you can't keep your screen clean, you get what you deserve.

duck monster
Dec 15, 2004

tef posted:

In one project ~2500 lines I found 0 semicolons. In the 12000 line one, I found import traceback; traceback.print_exc(); three times. I blame debugging.

Your move :smugdog:

I didn't actually know semicolons where allowed.

shrughes
Oct 11, 2008

(call/cc call/cc)

Zombywuf posted:

No. It's still a major semantic change for what could be a spec of dust on your screen. I don't want to use a language where a bottle of screen cleaner is a debugging tool.

I think you're being a bit unfair, because all that missing a semicolon does is give you a compile error. That's much more benign than the C example exhibited above.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Now what we need is a language that uses colons sometimes as terminators and semi-colons other times. Oh and tickmarks and single quotes.

The Gripper
Sep 14, 2004
i am winner

Scaramouche posted:

Now what we need is a language that uses colons sometimes as terminators and semi-colons other times. Oh and tickmarks and single quotes.
How about a language where whitespace is significant, and tabs and spaces are treated differently?

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

The Gripper posted:

How about a language where whitespace is significant, and tabs and spaces are treated differently?

How about a language that is only whitespace?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The Gripper posted:

How about a language where whitespace is significant, and tabs and spaces are treated differently?

Impossible. No one would ever be productive in such a language, and even if they could they certainly could not enjoy such a language.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Thermopyle posted:

Impossible. No one would ever be productive in such a language, and even if they could they certainly could not enjoy such a language.

You take that back! COBOL is great for processing tabular data!

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Jesus I read that Whitespace wikipedia and checked out some of the other 'esoteric programming languages'. The worst probably being LOLCODE http://en.wikipedia.org/wiki/LOLCODE

code:
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
   UP VAR!!1
   VISIBLE VAR
   IZ VAR BIGGER THAN 10? KTHX
IM OUTTA YR LOOP
KTHXBYE

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Welcome to the jungle, Scaramouche:

http://esolangs.org/wiki/Main_Page

geonetix
Mar 6, 2011


If you talks esoteric language, you have to mention Malbolge. It took only two years for the first program to appear when the language was invented. And oh god, it has a "crazy operation".

And here is "Hello world!" in malbolge, stolen from wikipedia:

code:
 ('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
 `CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>

No Safe Word
Feb 26, 2005

geonetix posted:

If you talks esoteric language, you have to mention Malbolge. It took only two years for the first program to appear when the language was invented. And oh god, it has a "crazy operation".

And here is "Hello world!" in malbolge, stolen from wikipedia:

code:
 ('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
 `CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>

The best part is that it took a heuristic search program to "find" the first program.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Here's a Malbolge program demonstrating a functioning loop, with ensuing discussion:

http://99-bottles-of-beer.net/language-malbolge-995.html

Dicky B
Mar 23, 2004

I'm a fan of brainfuck. It is actually worth learning if you are the kind of person who enjoys pen and paper puzzles. Writing a simple program in brainfuck is like solving a sudoku or something.

FLEXBONER
Apr 27, 2009

Esto es un infierno. Estoy en el infierno.
I actually had to write a program in chef while I was an undergrad. To get full credit, your program had to also be a recipe that could be followed to yield an actual, edible product, and your program's output had to be in some way related to the food the recipe made.

I'm sad Ian Bogost doesn't really teach anymore :(

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

No Safe Word posted:

The best part is that it took a heuristic search program to "find" the first program.
I sort of prefer the approach used for the 99 bottles of beer program: treat Malbolge as a form of cryptography rather than a programming language.

xarph
Jun 18, 2001


Poop Delicatessen posted:

I actually had to write a program in chef while I was an undergrad. To get full credit, your program had to also be a recipe that could be followed to yield an actual, edible product, and your program's output had to be in some way related to the food the recipe made.

I'm sad Ian Bogost doesn't really teach anymore :(

Please, PLEASE tell me you have a successful example.

Unless it has something to do with your username, in which case you can keep it to yourself.

ToxicFrog
Apr 26, 2008


Dicky B posted:

Writing a simple program in brainfuckBefunge is like solving a sudoku or something.

Think you had a typo there. :v:

tractor fanatic
Sep 9, 2005

Pillbug
Esolang has a page about a Brainfuck variant that combines Brainfuck and Core Wars

http://esolangs.org/wiki/FukYorBrane

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

tripwire posted:

My new language uses only unprintable characters to get around the problem

Mine too, except in mine all the keywords are unprintable instead.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Scaramouche posted:

Now what we need is a language that uses colons sometimes as terminators and semi-colons other times. Oh and tickmarks and single quotes.

Maple uses colons and semicolons as statement terminators. If you use a semicolon then the result (if any) of the computation performed by the statement is displayed. If you use a colon then it is not displayed.

Except that if you have statements nested inside a control structure, the result of computation will be displayed if the value of the global variable printlevel is large enough (that is: at least as large as the number of control structures inside which the statement is nested). In theory you can set printlevel to a high number and then optionally suppress output using the colon as a statement terminator... but in my experience, when output is allowed using printlevel it will sometimes appear even for statements that end with a colon. Why this happens, when it happens and how to stop it are all a mystery.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Context: this post.

Let's start with what I called "stooge maps". They wanted an ordered set of key-value pairs in JSON. How did they choose to represent it?

code:
[
  { 'foo': 3 },
  { 'bar': 10 }
]
The linear lookup power of a list, combined with the API usefulness of a hash map! Here's the code that built it, and yes, that whole file is a horror.

And of course, it's a pain to parse:

code:
function parseStoogeMap(stoogeMap) {
    var obj = {}, keyOrder = [];
    for (var i = 0; i < stoogeMap.length; i++) {
        var key, value, pair = stoogeMap[i];
        for (key in pair)
            break;
        value = pair[key];
        obj[key] = value;
        keyOrder.push(key);
    }
    return { obj: obj, keyOrder: keyOrder };
}
Of course, they couldn't use jQuery or GWT (as I explained in the post linked above, they were afraid of running out of support. Rolling their own stuff meant that the engineers would know the codebase better. Bah.)

They have their own module system, of course, but it's not what you think. I have no idea why things are even divided into modules when everything still writes to the global namespace and they all cross-reference each other (even the base module code makes reference to registerModule and raiseEvent, which is in another file)

We had a system where we needed fancy tooltips. I don't have CVS access any more, but the code looked like:

code:
function createCallout(calloutID) {
    var html = new StringBuffer();
    html.append('<div id="callout_').append(calloutID).append('">');
    document.getElementById('calloutFactory').innerHTML = html;
    var tbl = new StringBuffer();
    tbl.append('<table class="callout_outer_table" id="callout_"').append(calloutID).append('_outer_table">');

    // ... snip more innerHTML manipulation to set up the
    // callout's layout with fancy tables ...

    tbl.append('</table>');
    document.getElementById('callout_'+calloutID).innerHTML = tbl;
    document.getElementById('calloutFactory').innerHTML = "";
}
I decided to spend an afternoon rewriting that code for my sanity.

The Gripper
Sep 14, 2004
i am winner

Suspicious Dish posted:

Rolling their own stuff meant that the engineers would know the codebase better. Bah.
I always love hearing this line. If a small group of developers can document code/code usage better than tens of thousands of people using an open-source library can, more power to them!

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
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.

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.

ufarn
May 30, 2009

hieronymus posted:

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.
A system like jQuery is great not necessarily in its implementation, but because you know that literally millions of people have already tested it - and prefer to do so.

Funking Giblet
Jun 28, 2004

Jiglightful!

hieronymus posted:

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.

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.

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).

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
At least with jQuery, it's pretty likely that anyone new on your team will already know it. If I was interviewing at a place and they said "We don't use jQuery, we wrote our own jQuery analog," I'd be very wary about taking the position. Reinventing the wheel is rarely beneficial.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ithaqua posted:

At least with jQuery, it's pretty likely that anyone new on your team will already know it. If I was interviewing at a place and they said "We don't use jQuery, we wrote our own jQuery analog," I'd be very wary about taking the position. Reinventing the wheel is rarely beneficial.

It's funny how the way that gets said communicates everything. If someone said "gently caress jquery, it's worthless, we have our own gear", then yeah I'd be wondering what's up. But that same person, when they didn't just finish a four hour bug hunt that ended up being due to jquery, might say "jquery's great but we kept running into problems A and B, so we took the parts that work and made it our own", which sounds thoughtful.

Adbot
ADBOT LOVES YOU

qntm
Jun 17, 2009

Suspicious Dish posted:

code:
[
  { 'foo': 3 },
  { 'bar': 10 }
]

This is so elegant in its horribleness. I love it.

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