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
the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





A non-profit I do some work for had a webpage donated to them by a volunteer that looked like it was deployed in 1996. After multiple people walked away rather than try to work with the volunteer I got asked to take a look at it. Where a form appears on the page is instead this:

code:
<!-- CONTENT CONTAINER -->
  <div id='contentContainer' class='interactivePage'>
    <div id='contentBlock'>
      <!--
        All NAME REDACTED Interactive Pages are protected by password, and Secure Socket Layer Encryption.
        All code contained within them is protected by copyright.
        All attempts to bypass this security will be prosecuted to the fullest extent of the law.
      -->
    </div>
  </div>
<!-- CONTENT CONTAINER -->
So then, in the javascript, I find an eyeframe that's loading this (except it goes on for about six pages):

code:
PAR=window.parent;SYS=PAR.SYS;if(SYS){var v_file=g_page.substr(g_page.lastIndexOf('/')+1);
var v_nameArr=v_file.split('.');
var g_parent=SYS.c34317b7e1dbca8c615e3e8881734c00(v_nameArr[0]).parent;
if(g_parent&&typeof exec!='undefined'){g_parent.exec=exec;}}
if(typeof g_messColor!='undefined'){SYS.messColor=g_messColor;SYS.SIDHIS=new Array();
for(var i=0;i<g_sessHist.length;i++){SYS.SIDHIS[i]=g_sessHist[i];}}
2function submitForm(p_arr,p_page){var vPage=(p_page)?p_page:g_page;
var e208e29dbee8c7f3994a32f56e0be770=document.createElement('form');
e208e29dbee8c7f3994a32f56e0be770.method='post';
e208e29dbee8c7f3994a32f56e0be770.action=vPage;
for(var i=0;i<p_arr.length;i++)
{e208e29dbee8c7f3994a32f56e0be770.appendChild(formItem(p_arr[i].id,p_arr[i].value));}
var vBody=document.getElementsByTagName('body')[0];
vBody.appendChild(e208e29dbee8c7f3994a32f56e0be770);
e208e29dbee8c7f3994a32f56e0be770.submit();}
3function formItem(e8920696c8b3f148933d436606327e19,e03bb7688e58920a3532ef6fb0354013)
{var c22dbb8e41fd27f2d5c707a8f4551253=document.createElement('input');
c22dbb8e41fd27f2d5c707a8f4551253.type='text';
c22dbb8e41fd27f2d5c707a8f4551253.id=e8920696c8b3f148933d436606327e19;
c22dbb8e41fd27f2d5c707a8f4551253.name=e8920696c8b3f148933d436606327e19;
c22dbb8e41fd27f2d5c707a8f4551253.value=e03bb7688e58920a3532ef6fb0354013;
return c22dbb8e41fd27f2d5c707a8f4551253;}

the talent deficit fucked around with this message at 01:32 on Apr 2, 2008

Adbot
ADBOT LOVES YOU

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





So that javascript monstrosity I posted? It gets better. The variable names are generated each time you load the page. That's right, they change. I'm also now in contact with the author of the 'framework' and some of the things he's said lead me to believe this is for security. To, y'know, protect the integrity of the form. Check out some of these other quotes:

quote:

...the REDACTED environment; which is hundreds of times faster than XML and totally secure

quote:

I can provide all the services of a web 2.0 environment with a great deal more efficiency

quote:

...applications are deployed on two different sites. The ‘Static’ pages as I call them...

quote:

Internet explorer’s bugs make it some pages fall apart at the larger sizes but they promise to have those fixed in version 8 which is supposed to be out this fall...

quote:

I have objections to large slow loading graphics. They waste unnecessary processing time and band width and slow down all the applications running on the server.

Also, and this is my favorite, he's using phpincludes as the storage backend.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





biznatchio posted:

Now that's comedy right there.

I assume the redacted environment has nothing to do with XML being just a data format.

The REDACTED is just the name of his framework. He keeps making bizaare comparisons. Like his framework is more secure than Apache. Except he's running it on Apache...

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





tef posted:

Aside: couldn't you just run one erlang vm per core before this to get smp like behaviour?

Yes, but Erlang does dirty tricks with shared memory that don't work with multiple vm processes.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





MononcQc posted:

AFAIK, the only shared memory you have is for atoms, which are stored in a global table that doesn't get garbage collected (this is being worked on by the Ericsson guys at the moment) and binary data over a certain size. The rest is never shared across other processes (even ets tables) because it would require some kind of stop-the-world garbage collection that would gently caress up the soft real-time requirements of the language. Shared-nothing allows them to individually GC processes when they're done or after they hit a certain size without messing with the rest of the world.

What dirty tricks did you have in mind?

E: maybe it's time to start a new Erlang megathread

Messages are just a pointer to the sending process' heap. If the message is just matched against, there is no copy. Even when there is a copy, it's often deferred until GC time. Exceptions exist, as always.

Warning, this is as of R11, things are probably different by now.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rt4 posted:

But we're talking about web apps here, right? To me, a web crash means that particular file that was running ended prematurely; the user gets an error page. Everyone else using it should come out fine (unless they trigger the same error).

How could a restart ever fix that? Or are these guys really writing such terrible apps that they just make the whole computer unusable?

In rails case, it was farming out requests to a sea of app servers that were single threaded. Restarting one only killed that request, other requests were unaffected. It's not a good architecture, but it's not as bad as it sounds.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





quote:

Somewhat typical of PHP’s API, there are actually thirteen different built-in array sorting functions. The manual page for sort says that most of those functions use quicksort, which means they’re all unstable. Prior to version 4.1.0 some of the sorting algorithms were stable, but that was changed for “efficiency reasons”. (It seems that the usort function was previously implemented as a bubble sort, the only case of that I’ve ever seen in a serious production language)

From here

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Aleksei Vasiliev posted:

If you wrap your lines at 80 characters I literally hate you irl

gently caress you i code in a terminal all the loving time :(

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Zombywuf posted:

CouchDB as far as I can tell is a specialisation of "I know javascript so I will use that."

CouchDB is a fantastic storage/distribution engine that, regrettably, has been seized by developers and community hell bent on turning it into an end to end application platform.

That said, you could do worse if you are writing micro applications that need to be portable in the data availability sense

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Hammerite posted:

How long would it really take them to hack together a web service to receive requests, check that they are acceptable and translate them into database queries? It doesn't sound like they have a great many things they need it to do, and they don't need to make it do anything very elaborate, because they're doing all the presentation work in the app. Just spit out JSON or something.

It would take half an hour in django or sinatra or whatever. Maybe a little longer if you wanted to parse the SQL requests so you didn't have to modify the client.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Scaramouche posted:

Don't feel too bad, shrughes is basically a jerk. It's kind of his thing.

Yeah, but rust legitimately owns, often for exactly the reasons that were criticized. (Immutable variables own).

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Zombywuf posted:

So you get wildly different behaviour from a fleck of fly poo poo in your code? Different things though look different. If you want your function to return nil put a special return nil keyword at the end of it, not ;. ; at the end of a line has a meaning in a huge number of languages, using the same syntax to make a thing that looks like it fulfils the same function but actually does something different is a very bad thing. What's next, + and - being defined as the malloc and free operators?

you can explicitly return nil if you want (ret ();)

quote:

That syntax appears to declare the type twice on the same line. Why is the type declared twice on the same line?

there's no type coercion between integer types in rust, 5u != 5. nor does uint == uint8, uint16 or uint32.

quote:

What is the type of ()?

nil.

quote:

Why is failing to compile with a type error not an option?

because patterns are not required to be exhaustive. this is like asking why asserts can't be staticaly checked.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Zombywuf posted:

So why can the type of the variable being assigned to be inferred?

it's inferred from usage. globals are accessible from outside the compilation scope, and must be explicitly defined

quote:

That I think wins the thread for most tautologist answer.

you're going to have to explain how a compiler can infer whether input will lie in a specified domain

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Janin posted:

Rust is statically typed, so the compiler already knows the full input domain, and whether there are any unmatched portions of it for any given alt expression.

no it doesn't. tell me how to statically check this:

code:
fn main(args: [str]) { 
  alt args[1] {
    "janin" { io::println("you're an idiot") }
    "zombywuf" { io::println("so are you") }
  }
}

Look Around You posted:

That said I still have some confusion about the ; thing and the () for nil thing, but overall they're pretty minor. (the problem I have with () for nil is that in rust specifically tuples need to have arity strictly greater than 1, so an empty tuple for nil doesn't really make much sense to me.)

the semi colon performs two functions in rust. one is as a statement terminator:

code:
fn() -> () { };
let x = foo();
the other, less obvious use, is as a sort of expression concatenation operator:

code:
{
  foo();
  bar();
  baz()
}

{ foo(); bar(); baz() }
in blocks (the things in braces) that have no explicit ret, the last expression (baz() in the preceding example) is implicitly converted to a ret statement. this is useful for things like alt blocks, if blocks, etc.

a valid criticism would be that two similar but different bits of syntax use the same glyph, but i think that is probably because the rust developers saw the criticism erlang got for it's varied expression terminators and chose to hew as close as possible to algolish languages.

the talent deficit fucked around with this message at 08:23 on Jan 31, 2012

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Jabor posted:

I'm pretty sure the compiler can work out that the str type can contain more than two possible values, and thus that in the absence of a default case the code is missing something.

the default case is not required, which is the point. that is a perfectly valid (and sensible) rust program.

the compiler has no idea whether that alt block will receive a valid string. it can only possibly be a runtime error.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Janin posted:

GHC does exactly this. If there are unmatched cases, it prints them (as a warning, though, not an error). You could easily do the same thing for Rust.

It's trivial to detect non-exhaustive patterns, I never claimed it wasn't.

I was refuting the claim that non-exhaustive patterns should be a type error and not a runtime error.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





there's nothing really wrong with that code, it's a virtual machine. they're all that ugly, and dense and terse is nice in that situation.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Contero posted:

What do people think about Yaml? I haven't actually used it in a project yet, but it seemed nice enough.

yaml is awesome until you look at the spec and realize how hosed up and horrible it can get. all so you can omit `{}`, `[]` and `"`

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Janin posted:

Speaking as someone who's written three JSON parsers, no, the JSON encoding of astral characters has no virtue. It exists that way only to more closely resemble Javascript, which is not a goal any sane person should strive for.

Python's handling is much better. It has fixed-width for both BMP and astral, by using \u for BMP and \U for astral.

\uFF5E -> always 6 characters
\U0001D11E -> always 10 characters

javascript dates to a time before the extended plane existed. it only has escapes for the extended plane because netscape ran on some obscure platforms where transport streams were required to be 8 (or even 7!) bit clean. you should be thankful those escapes even exist

as for your complaints about json allowing forms that aren't valid javascript, you're wrong. apart from u+2028 and u+2029 (which aren't even invalid javascript; they just cause problems when json is treated as executable code and not data) all json is also javascript

encoding detection isn't even in the scope of the discussion. if you can't determine the encoding of your javascript you can't execute it anyways. crockford's detection algorithm is just a heuristic that happens to work because of the structure of json and utf-x

(USER WAS PUT ON PROBATION FOR THIS POST)

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture






This isn't necessarily as bad as you think. They could have recently disallowed certain characters and might just be lazily forcing password changes when you login if your pass contains those characters. If they sent you this without you logging in though, that's terrible.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture






xml is my xtc

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Hughlander posted:

Is the last mile IPv6 really that impossible? (Seems like a networking horror to me!)

Yes? As long as you have a single customer using IPv4 only equipment you need an IPv4 network for them. How do you propose to have everyone in the world upgrade to IPv6 equipment?

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Wheany posted:

Commented-out code gets deleted on sight.

I have a bunch of code that is ugly for performance reasons that's preceded by commented out prettier versions because idiots kept replacing the ugly versions with the pretty version as if I hadn't tried it that way to begin with.

Other than that you are correct.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Ithaqua posted:

Why leave the code there at all? Put a comment at the top of the block of ugly code that explains why it's ugly, remove the pretty code. Problem solved.

There's comments that explain why it's ugly but people are still always like, 'here i rewrote this as a list comprehension/with a fsm/using a struct'.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Gazpacho posted:

I think the point is that if the tools are not loving up other people's systems but are loving up yours that points to a particular cause other than the tools.

Macports and fink legitimately destroy systems. Homebrew is better, but only because it does less. I do all my development now on 'disposable' vms. Vagrant helps

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Isilkor posted:

If their rules say "commits must be signed off by X or Y", and a good and valid PR gets rejected for whatever reason, the correct solution to that problem is convincing X or Y to revise the decision and accept the PR. Not pushing it anyway, rules be damned.

If you don't like the rules, get them changed.

Literally the very first comment after @bnoordhuis (X) shamed Isaac is Y saying he signed off on it. @bnoordhuis was just pissy he said no and someone else said yes.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





If I encounter true/false being used as ints that's an automatic rejection in code review. I don't care how elegant or whatever it is, it's a terrible idea.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





branch at the commit just before the one you want to revert, cherry pick the commit you are trying to partially revert, checkout/reset the file you wish to revert then interactively merge

Adbot
ADBOT LOVES YOU

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





QuarkJets posted:

Hi there don't mind me just naming my software after a disfiguring illness that nobody wants

fun fact, the illness was named after the software

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