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
Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

ExcessBLarg! posted:

Furthermore, only one user needs a weak password for you to get in. With per-password salts you don't necessarily know which passwords are weak, so you either have to guess which users might have weak passwords, or otherwise iterate through the entire list of users, wasting time on the stronger ones.

I hate to resurrect password chat, but I don't understand this line. Is the idea that your cracker will find

derpPassword1
derpPrettyPrincess

etc and you can figure out that "derp" is the salt pretty quickly, letting you power through the rest?

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Jabor posted:

Basically it means that instead of having to try and break hashes one-by-one, you can hash "derpabc123", and check that hash against the entire list to see if anyone at all has abc123 as their password.

Thanks, I understand now. That's a clever attack.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Fuoco posted:

I saw an ad on my site essentially doing the following:

code:
<script>
document.write('<noscript>Some text</noscript>');
</script>
Using JavaScript to write a noscript element???? :psyduck:

From the outside it looks silly, but it's probably a combination of

AdServer:
code:

fetch $ad.
Output
<script>
document.write('$ad');
</script>

Ad ingestion:
code:

$ad.replace('<', "& lt;")
$ad = "<noscript>$ad</noscript>"

Awful app is making it impossible to output & lt; without spaces. Even tried replacing & with & amp; :eng99:

Volmarias fucked around with this message at 16:51 on Mar 7, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

pokeyman posted:

Whoops, I'm on it.

Very surprised not to see the app come up earlier in this thread.

I have no idea what the internals look like but I think it's pretty well designed as an end user.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
If you instantiate, push, pop, you get an exception because he starts at -1 instead of 0.

You must push a sacrificial element to this implementation. I would recommend pushing it's own reference.

E;f,b...

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Freakus posted:

Also, memory leak: references to popped elements stay around until that spot is re-used.

Aha, good catch. Obviously not a leak in C but he doesn't know Java at all.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Yeah, I'm assuming that he took away things like * which caused compile errors in Java. So it was probably something like

code:
int stack_pop (Stack *stack, void **elem_out) 
{
  if(top == 0) {
    return 0;
  }
  *elem_out = elements[top--];
  return 1;
}
with the expected usage of

code:
void** element;
if(stack_pop(my_stack, element)) {
  // do something with element
} else {
  // oh no!
}
(My C is so rusty ogad I'm probably causing a segfault)

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Ithaqua posted:

Keep in mind, you are learning basically no marketable skills.
You: "I have 6 years of experience in TheirBASIC!"
Employer: "I don't know what TheirBASIC is. I need Java/C/Perl/Python/Brainfuck developers"

This. Unless you really, really need the money, I would gtfo pronto. You will learn only bad habits here, you'll have a giant black hole on your resume, and unless you're a total nitwit you can do better.

Take two weeks and learn some Android. You'll get an immediate pay bump over this job and people will actually be interested in what you've done.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

McGlockenshire posted:

Someone implemented XKCD's StackSort (hover over the comic).

This is magnificent

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

dis astranagant posted:

It doesn't check for sortedness so it reports all kinds of bullshit as sorted if you go past the first result

That's part of the joke :ssh:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Suspicious Dish posted:

You wrote your own OS? Yikes.

Not just that but their own firmware on their own hardware?

You should probably :getout: if that guy isn't on the way out.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Doctor w-rw-rw- posted:

code:
return retflag & 2;

Nope; if retflag is 10, we want to store 0, not 2.

I'm not sure there's a clever bitwise way to do this.
Edit:
retflag = !((retflag >> 2) || (retflag << 30))*2 maybe?

Volmarias fucked around with this message at 22:07 on Mar 20, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Presto posted:

What have I done? :ohdear:

I'm honestly curious if there's a good way to do this using dumb bit twiddling and no ==

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

bucketmouse posted:

The best part about the xor-swap story is that it didn't slip by unnoticed and was reverted quickly.

Anyone have planning horrors? A friend who does rich media site prototypes/mockups forwarded me this.. uh, whatever it is, as provided by the client. Thankfully they talked him down into something sensible with tabs.



Holy hell. :psyduck:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

https://code.google.com/p/go/issues/detail?id=5107 posted:


Reported by pedromor...@gmail.com, Today (92 minutes ago)

Ok ok lets put a nil into things we dont have to do it like

First question for any coder..

Is that all we want to do is explain bits of code, and its runningz what it does..
Hopefully there is a lot of coders looking at it cos we can auto gen documentation..

Now there are a few ways to do this..
The first concept is to..
For the doco manager is to
create the file that explain and do things and a manual

The nexxt concept is to interlink into stuff

What developers want
?
NOrmally the developer is do busy coding u have to interupt It whet


I better explain how this works and all langs work different ways
Java
/* Is Documentated
*/
this(


What GoLand should be


Is a simple commentrty and link
Aas we gonna use gomang.org aaas our voerifier..
Si all the comment we spend our tiimes will come into fuitiion


We expectsimple markup eg
/* This IS IT
*/

Its pissing me off bigtimer.. I waanna wrie code

I think he's upset about javadoc?

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

O Tempora! O Mores! posted:

At my work, one of the projects I'm on is a J2EE web application where a large portion of the dev team outsourced through an Indian consulting firm. Insofar as I can tell, the servlets they pump out work fine, but I keep running across weird code in the JSPs that makes me think they don't understand how Javascript works:
code:
<% boolean someBool = true; %>
<script type="text/javascript">
	// someVar is defined elsewhere in the document
	if (someVar) {
		<% someBool = true; %>
	} else {
		<% someBool = false; %> 
	}
</script>
:cripes:

I'd be charitable and assume that they just made a mental error.

The first time. :catstare:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

MrMoo posted:

It amusing works misinterpreted as cargo-pant cult programming.

All the neo-hipsters want to wear cargo pants to be hip, and fail miserably.

Cargo pants give you a place to put all of your things and there is nothing wrong with that :colbert:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

Creationist science is cargo cult science because it copies the outward manifestations of scientific research (papers, journals, conferences, "universities") with the actual essence of what makes up science.

Creationist "science" isn't really cargo cult science, because the goal isn't to try to duplicate scientific study and discourse; the goal is to create a thin veneer of credibility which they can lay on top of the Bible to say "there is controversy about evolution and the origins of the universe, therefore we should not teach evolution in schools."

Cargo cults are fundamentally about not understanding how something works, and trying to reproduce behaviors by rote ritual. Creationist "science" is fundamentally about lying to people, a lot, for political gain.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

Yeah fair enough. I still think it's a cargo cult because what they seek is the credibility of science and if you read the wedge document you can tell they somehow feel it comes from the papers and conferences.

But that's not what cargo cult is at all. Cargo cult is seeing X cause Y, and then trying to do X a lot hoping it will do Y, such as Pacific island tribes making dirt airfields because they think it will make aircraft come without understanding or knowing WHY aircraft come.

Creation science is trying to dress up the Bible in trappings of scientific rigor and calling it science. It's taking creationist texts and performing ctrl-H to replace "creator" with "intelligent designer."

At the levels of people who can critically think, no one is fooling anyone. This is being done because it's hoped that pseudo scientific things can be used to confuse enough naive, credulous people into saying "but isn't this science too?", not because creation scientists are actually looking for a credible reason to discount evolution.

It's people who don't understand cause and effect, vs literal scam artists who want to keep us at a middle ages level of science.

Volmarias fucked around with this message at 21:30 on Mar 24, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HappyHippo posted:

I guess I should have stuck to programming examples

People who try to make things objectively worse for everyone just for personal gain get me riled up like nothing else. Sorry for the awful digression, let's get back to talking about horrible beep boop button press things :(

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

The Gripper posted:

They do, but then you have to deal with there being no authoritative repository and all the bullshit that comes with that (mostly just verifying that the copy you choose to start from is pristine).


Isn't that part of the reason for signing commits, though? Being able to authenticate them? And doesn't git work on the idea that a commit includes all of its history (recursively)? The Gerrit server can sign a commit before pushing it, meaning that you can at least trust from that commit and back if you trust the signature.

Edit: it looks like they weren't totally up the creek even if that last mirror failed:

quote:

Also, one thing I forgot to mention in the original post: we actually had tarballs of all repositories. We create them every few days, but they are not perfect backups. They’re detailed further in the update post.

Volmarias fucked around with this message at 12:51 on Mar 25, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Hughlander posted:

I'm completely at a lost as to why someone would do that. What happened next? git push --force origin master? Go track down someone's old laptop, merge/rebase the current repo onto an old copy and force push to restore the history! :)

I think someone was trying to reduce the repo size. Git keeps the full history locally, you see, so this is more efficient!

Of course there's repack and prune and compression mechanisms but don't worry your pretty head about that.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Freakus posted:

I don't understand:

code:
mysql> select length('')>0 or '' is null;
+----------------------------+
| length('')>0 or '' is null |
+----------------------------+
|                          0 | 
+----------------------------+
1 row in set (0.04 sec)

mysql> select length(null)>0 or null is null;
+--------------------------------+
| length(null)>0 or null is null |
+--------------------------------+
|                              1 | 
+--------------------------------+
1 row in set (0.00 sec)

mysql> select length('fds')>0 or 'fds' is null;
+----------------------------------+
| length('fds')>0 or 'fds' is null |
+----------------------------------+
|                                1 | 
+----------------------------------+
1 row in set (0.00 sec)

Or was > a typo?

This. It sounds like a godawful way to filter out empty strings, likely copy/pasted from some forum.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

HORATIO HORNBLOWER posted:

Due to downsizing at my work, I have two peoples' jobs now. Half my time is spent on new development and half my time is spent on supporting a horrendous beast of a legacy web application that is considered mission critical for a whole bunch of external customers. This app is huge and an entire book could be written about the horrors that lay within.

One of the things the app does is maintain records about a thing, let's call it a System. Each System has a list of Widgets that are associated with it. Each Widget has a cost, and so the cost of the System is equal to the sum of the costs of the Widgets associated with the system. Pretty straightforward, right? (Calculating the cost of each Widget is fairly complicated but not directly relevant here.)

So, for "performance" the cost of the System isn't directly calculated on demand; when you update a System record, the total cost is calculated and stored in a summary row. Notice I said "when you update a System record." You can update a Widget record associated with a System and change it in such a way that the Widget's cost changes. When you save that Widget record, the JavaScript on the "Edit System" page will recalculate the System cost and display it correctly; but the summary row for the System doesn't get updated. Users for the most part didn't care since they saw the correct total on the page. But when a System Report is generated, it uses the values that are stored in the summary row, so it comes out all wrong.

Apparently this is a long-standing issue, and the official workaround from the previous support team had always been: "Make sure you always update the System record after you update a Widget record, and if you see a total that looks wrong, just go in to the System record and hit Update."

Today, though, this irritated the right person just enough to get me assigned to the ticket. My coworker (the only holdover from the old team) continues to insist the old workaround is the best solution; I'm not buying it. I find the method that gets called when a Widget is updated and it looks roughly like this:

Java code:
System system = SystemManager.getSystem(systemId);
Widget widget = processWidgetDataFromUserInput(...);

WidgetManager.updateWidget(widget);

SystemSummaryManager.updateSummary(systemId, system);
So, all along, this code has been doing exactly what it needs to do, just in the wrong freaking order. SystemManager.getSystem(), of course, retrieves the System record(s) from the database, including the summary data and a list of all the Widgets associated with the System. The summary data was getting updated, alright; with stale data. The fix was to literally move the getSystem() call two lines down. Problem solved forever.

Biggest horror?
  • Allowing the problem to even be possible by storing denormalized data
  • Calculating the summary independently in the UI, leading most users to think everything is correct
  • Dumbass developer who hosed up the code in the first place
  • Mentally retarded support staff who couldn't figure out the world's simplest fix
  • Me, for still working here

Spend two days "fixing" it that you actually spend on making other things with less visibility better.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
The coding horrors I come across every day are the coding question implementations that my phone screen candidates give me.

Is it really so hard to do LinkedList implementations? :negative:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Hard NOP Life posted:

In what language?

Any language the candidate wants; I tell them to use whatever they're most comfortable with. Most choose Java, though I've had a couple do C#.

At this point, I'm pleasantly surprised if the method implementation they write would actually compile.

Volmarias fucked around with this message at 20:15 on Apr 11, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

yaoi prophet posted:

Oh, well that makes sense.

Do non-programming but still software-related horrors count? Because this website is absolutely atrocious.

I love the guy with the bananas.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
No, you don't have to clone the repo to make a branch. Yes, I understand, if you make a commit and then another commit the second commit points to the first commit. Yes, in git you can create a branch that points to an arbitrary commit. Yes, this is a common workflow.

:cripes:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Doctor w-rw-rw- posted:

And people like me. I always git fetch --all then git rebase origin/master master.

I do this too, but mostly because I usually don't want to merge right now but I still want those patches, not because I oppose the philosophical impurity of using git pull or whatever. :spergin::hf::reject::coffee:

Volmarias fucked around with this message at 00:51 on Apr 18, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Progressive JPEG posted:

Sorry that you don't care enough to learn your tools?

Git's pretty good about not throwing away your data even when you screw things up. See eg reflog.

Yeah, I was going to post this. Reflog is great; unless you go into the .git directory and physically mess something up, it's pretty hard to get into a state you can't get out of using reflogs to check out a good state.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Arcsech posted:

Is it a horror if it was made specifically to explore how horrific something could become?

Behold, functional programming in C.

I wonder if they realize that people are going to want to use this in real projects? Are they aware of the horror they have unlocked?

:negative:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Wheany posted:

I'm taking a pretty basic OOP course at the university, and there is nothing special about the lectures. But excercise sessions are pretty fun. This week we had to impelement Conway's game of life (in Java) without using if, switch or try. The idea was to take single responsibility principle to the extreme.

It was a fun excercise IMO, and my partner and I managed to get pretty far by writing a pretty silly/terrible inheritance hierarchy.

During the excercise, we had a quick break for discussion about what people thought about the excercise and one guy said that it was interesting to write good code such as this that does not use ifs.

So beware, "conditional statements considered harmful" might become a thing. (Don't worry, I objected to his statement of the code being good because it does not use ifs)

I notice that there was no mention made of while or for.

code:

boolean ret = someFunc();
for(;ret;;){
  something();
  break;
}

while(ret){
  something();
  break;
}

:colbert:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Suspicious Dish posted:

The horror was *supposed* to be that this guy was amazingly getting around the "single entry, single exit, no goto" rules by using a do...while (FALSE);, but:


Holy gently caress :aaaaa:. I didn't even see that.

Came to complain about do/while, shocked when goons found out that his code was horribly broken. The coding horror here is you, Suspicious Dish.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

FOLLOW ME BRUH posted:

This was the most recent commit. I can't tell if he's learned something over the 9 months he's been doing this, or he's just run out of steam.



:wtf:
:lol: 20k lines added, 15k removed
30k lines added :supaburn:

This is strangely familiar, almost as if a coworker does the same thing and I repeatedly bang my head against a wall trying to make him write good messages.

The only reason we get any good messages now is because we use Gerrit and won't accept his patches if he can't give a reasonable message. Otherwise, we'd get the same 20k lines "fixed" messages.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

nielsm posted:

It's probably a case of just hacking away and pasting in giants chunks of googled code, and once a week or so remembering, "oh yeah that 'source control' poo poo they're forcing me to use..."

Yes, this. There are many source control sins of this developer, but the worst is that he works on multiple things simultaneously, so a patch will have a feature and maybe part of another.

Put it in another patch? Nah, just comment it out with "uncomment later when ready" as a comment next to it.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Edit: nevermind

Volmarias fucked around with this message at 17:03 on May 5, 2013

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Don Music posted:

In a uni programming contest, where you can use any language you like, one student writes in C, and writes like this.

code:
int g[(int)1e6],o=0,n,i,j,k;

#if __LP64__
    int cmp(int*a,int*b){return *a-*b;}
#else
#define cmp main
#endif

int main(int a, char **b)
{
    if (o) return *(int*)a - *(int*)b;
    while(scanf("%i%i",&o,&n)==2&&(o*=1e7))for(k=i=!g;!k&&((i<n&&scanf("%i",g+i))||(qsort(g,n--,4,cmp),i=!g,k=n))||((i<k||!printf("danger\n"))&&(j=g[i]+g[k],(j<o&&++i)||(j>o&&k--)||(!printf("yes %i %i\n",g[i],g[k]))));!k&&i++);
    return 0;
}

I started reading this until I realized that life is too short for this kind of horseshit unless someone is paying me.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dren posted:

Have you ever tried interviewing intra-company candidates who you wouldn't be interviewing if it weren't for the fact that you were doing HR a solid?

Oh, this wasn't a joke about how they were probably just as competent.

For all the guff that Atwood gives/gets, I'm really getting tempted to actually ask fizzbuzz and see what happens.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Jabor posted:

Be careful with fizzbuzz, because it doesn't really help with screening out the degree mill graduates who study those "interview questions" and can regurgitate an answer, but still don't actually know how to program.

You probably want a similarly-trivial programming problem that no-one else uses as an interview question.

My "go to" question is asking them to remove an element from a linked list, where they give the linked list structure beforehand as a convenience.

Is this really so much to ask? I want "can give the correct answer" to be the bare minimum but so many can't even handle that :cripes:

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dren posted:

I've found that you don't have to ask people about code in order to figure out that they can't code. You can weed them out before that. Ask them to explain some projects on their resume, their role on those projects, and describe a code problem they encountered.

This doesn't work, at least not for us. We get people who talk a great game but literally cannot code anything.

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