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
Jonnty
Aug 2, 2007

The enemy has become a flaming star!

Mustach posted:

It's things like this that remind me that Larry Wall actually has a good head on his shoulders.

but has a horrible moustache on his face

Adbot
ADBOT LOVES YOU

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

Jonnty posted:

but has a horrible moustache on his face
Touché.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

tef posted:

if only he hadn't spent the last 10 years working on the second system perl

To be fair, he lost his job and had a tumor yanked out of his stomach, two things which would kind of put a hold on anybody's plans. Then there's the little problem of not having the 1.0 VM until last freaking year.

I want to use Perl 6. Maybe I'll get the chance in the next decade...

NotShadowStar
Sep 20, 2000
The idea of OSS was that ideas and progress wasn't to be upheld by the decisions of a central authority like upper management of big companies or draconian project dictators.

Whoops, sorry about your cult of personality.

ColdPie
Jun 9, 2006

NotShadowStar posted:

The idea of OSS was that ideas and progress wasn't to be upheld by the decisions of a central authority like upper management of big companies or draconian project dictators.

Whoops, sorry about your cult of personality.

:rolleyes:

tef
May 30, 2004

-> some l-system crap ->

NotShadowStar posted:

The idea of OSS was that ideas and progress wasn't to be upheld by the decisions of a central authority like upper management of big companies or draconian project dictators.

Whoops, sorry about your cult of personality.

hurp

this is why python 3 has taken 10 years

Zombywuf
Mar 29, 2008

NotShadowStar posted:

The idea of OSS was that ideas and progress wasn't to be upheld by the decisions of a central authority like upper management of big companies or draconian project dictators.

No, you're thinking of NDAs. We are talking about RMS's brainchild here, draconian central authority was designed in, not out.

If you don't like how Larry does Perl 6, make your own, with blackjack and hookers.

izagoof
Feb 14, 2004

Grimey Drawer
How to handle forgotten passwords:

code:
$scrambleName = scrambleStrg($username."~~~".$password);
$htmlScrambleName = urlencode($scrambleName);
$email_content = "$username:\n\nPlease click this link to get help with your password:\n<".BASE_URL."wayward/index.php?helpArg=$htmlScrambleName>";
(send the forgot password email, user presumably clicks link, ends up on wayward/index.php)

code:
$unScrambleBuff = urldecode(unScrambleStrg($_GET['helpArg']));
$loginArray = explode("~~~",$unScrambleBuff);
$query="SELECT id FROM people WHERE username='".$loginArray[0]."' AND password='".$loginArray[1]."'";
(and then update the password and all that crap)

Behold, scrambleStrg, unScrambleStrg, and initRand.

code:
function initRand ()
{
   static $randCalled = FALSE;
   if (!$randCalled)
   {
       srand((double) microtime() * 1000000);
       $randCalled = TRUE;
   }
}

function scrambleStrg($str) {
	initRand();
	$len = strLen($str);
	$indices = array(7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,);
	$letters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	//$letters = "0123456789";
	$passBuff = "";
	for ($i=0;$i<=$len;$i++) {
		for ($j=0;$j<$indices[$i];$j++) {
			$passBuff = $passBuff.$letters{rand(0,strLen($letters)-1)};
			//$passBuff = $passBuff.$j;
		}
		$passBuff = $passBuff.chr(ord($str{$i})+1);
	}
	return $passBuff;
}

function unScrambleStrg($str) {
	initRand();
	$indices = array(7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,7,3,5,6,4,);
	$passBuff = "";
	$i = 0;
	while (strLen($str) > 0) {
		//echo "str: ".$str."<br>";
		$str = substr($str, $indices[$i], strLen($str));
		$passBuff = $passBuff.chr(ord(substr($str, 0, 1))-1);
		$str = substr($str, 1, strLen($str));
		$i++;
	}
	$passBuff = trim($passBuff);
	//echo "strlen($passBuff): ".strlen($passBuff)."<br>";
	return $passBuff;
}
Also, the passwords are stored in plaintext on the db.

Kidane
Dec 15, 2004

DANGER TO MANIFOLD
code:
	//$letters = "0123456789";
I love it.

Lysandus
Jun 21, 2010
Just came across this comment:

code:
//Battery status constants.  DON'T gently caress WITH THESE VALUES.
Way to stay professional ex-dick that left this mess for me.

A very bad man
Mar 31, 2010

Mustach posted:

It's things like this that remind me that Larry Wall actually has a good head on his shoulders.

Let me remind you about his article 'Perl, the first postmodern computer language' - http://www.wall.org/~larry/pm.html


Larry Wall posted:

How does Perl put the focus onto the creativity of the programmer? Very simple. Perl is humble. It doesn't try to tell the programmer how to program. It lets the programmer decide what rules today, and what sucks. It doesn't have any theoretical axes to grind. And where it has theoretical axes, it doesn't grind them. Perl doesn't have any agenda at all, other than to be maximally useful to the maximal number of people. To be the duct tape of the Internet, and of everything else. You've heard the joke, I'm sure. How is duct tape like the Force? It has a light side, and a dark side, and it holds the universe together.

Saying your language is humble null and voids it from being humble. My balls are humble. What the gently caress does this even mean? What is a theoretical axe? What is wrong with him? Why does Perl make me so mad?

A very bad man
Mar 31, 2010

McGlockenshire posted:

To be fair, he lost his job and had a tumor yanked out of his stomach, two things which would kind of put a hold on anybody's plans. Then there's the little problem of not having the 1.0 VM until last freaking year.

I want to use Perl 6. Maybe I'll get the chance in the next decade...

Duke Nukem Forever is getting released, I guess anything is possible.

Contra Duck
Nov 4, 2004

#1 DAD
Here's one I found today. By no means the worst that this thread has ever seen but definitely something that could be simplified. (names have been changed)
code:
    public Boolean getAaa()
    {
        Boolean bbb = getBbb();

        if (BooleanUtil.isTrue(getCcc())
                && BooleanUtil.isTrue(bbb))
        {
            return Boolean.TRUE;
        }

        if (BooleanUtil.isTrue(getCcc())
                && BooleanUtil.isFalse(bbb))
        {
            return Boolean.FALSE;
        }

        if (BooleanUtil.isFalse(getCcc()))
        {
            return Boolean.FALSE;
        }

        return Boolean.FALSE;

    }

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Unless it solves k-SAT or something, I think having something named BooleanUtil might be a horror just by itself.

Contra Duck
Nov 4, 2004

#1 DAD

Plorkyeran posted:

Unless it solves k-SAT or something, I think having something named BooleanUtil might be a horror just by itself.

It's just there to avoid NullPointerExceptions in cases where the Boolean is null which actually was a possibility in this case. The fact that it's using a homegrown 'BooleanUtil' class instead of the perfectly good apache-commons BooleanUtils class is probably is a horror though!

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
For the first semester in a few years, I'm the GTA for one of our Java programming course. I don't know how, but even though I've been using Java for years now, I manage to discover new things about it that are awful.

Like how an outer class can still access private fields inside an inner class:

code:
public class Outer {
    public void foo() {
        Inner inner = new Inner();
        inner.bar = 5;  // this is legal!
    }

    private class Inner {
        private int bar;
    }
}
I mean I guess I can understand the rationale behind allowing that, but it's counter to everything I would expect based on how access rules in C++/Java-style languages work, so it just took me by complete surprise when I saw it work. I'm pretty sure that field would be inaccessible in C++, and I bet in C# as well.

Isn't it more work for the compiler author to make that special case than to just have it do the expected thing in all cases? gently caress this language.

NotShadowStar
Sep 20, 2000
I'm completely a Java hater but I could go either way on that. Inversely, imagine the confusion that someone could have if they're used to accessing private members without issue, but then accessing a private class is inaccessible. Especially if they're understanding that classes are just objects anyway, if the language doesn't suck. Java probably sucks.

Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog
The inner field is not accessible in C#.

HFX
Nov 29, 2004

Smugdog Millionaire posted:

The inner field is not accessible in C#.

This may be that Java accessors modifiers do not behave as they do in most languages. You should also consider Java's age, their resistance to breaking legacy code (and then doing it anyway), and JVM fault designs because of early versions.

HFX fucked around with this message at 18:48 on Oct 20, 2010

POKEMAN SAM
Jul 8, 2004

HFX posted:

This may be that Java accessors modifiers do not behave as they do in most languages. You should also consider Java's age, their resistance to breaking legacy code (and then doing it anyway), and JVM fault designs because of early versions.

Honestly, I'd rather have it the Java way instead of making things internal in C# just so that I can access a nested class's private field for special construction without exposing it to the entire namespace.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:

Ugg boots posted:

Honestly, I'd rather have it the Java way instead of making things internal in C# just so that I can access a nested class's private field for special construction without exposing it to the entire namespace.

Just make the class private, if you're exposing an inner class, chances are that it shouldn't be an inner class in the first place.

Zhentar
Sep 28, 2003

Brilliant Master Genius

Ugg boots posted:

Honestly, I'd rather have it the Java way instead of making things internal in C# just so that I can access a nested class's private field for special construction without exposing it to the entire namespace.

Having to type an extra character to say what I mean is such a burden. Why can't the compiler just detect what I mean and ignore what I say?

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

Flobbster posted:

I'm pretty sure that field would be inaccessible in C++,
It would be inaccessible, but this is because there is nothing special about inner classes in C++ — neither they nor the "outer" class have any additional privileges for the other. It's just another type in a namespace.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
That's not actually true; inner classes are members of their enclosing class and therefore have the normal access privileges for members, which they extend transitively to their members. But the reverse definitely holds, which is usually obnoxious and just forces your iterators to friend their containers.

rjmccall fucked around with this message at 23:12 on Oct 20, 2010

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Yeah, I was too extreme. I forgot that nested classes can access protected members.

POKEMAN SAM
Jul 8, 2004

Zhentar posted:

Having to type an extra character to say what I mean is such a burden. Why can't the compiler just detect what I mean and ignore what I say?

What are you even talking about? I don't mean for the class's fields to be available throughout the namespace. Setting a field in a nested class as internal in C# isn't the same as setting it to private in Java...

Zhentar
Sep 28, 2003

Brilliant Master Genius

Ugg boots posted:

What are you even talking about? I don't mean for the class's fields to be available throughout the namespace. Setting a field in a nested class as internal in C# isn't the same as setting it to private in Java...

Oh, sorry. I misunderstood what you were complaining about there.

Opinion Haver
Apr 9, 2007

code:
def __init__(self,a):self.a=a # AYN RAND WUZ HERE

Argue
Sep 29, 2005

I represent the Philippines
So we're near the end of this deathly contract with the client whose devs did all that pipe-delimited parsing code I posted earlier. Seems that they only commit on occasion, opting instead to wait until they've made giant changes before they commit. Without any unit tests, naturally. One guy doesn't even commit his changes at all and just applies them before the final deployment. Also, the three of us contractors asked for SVN credentials, and they gave us a single username and password. "Don't worry, that's what everyone uses."

Now we had some problems with a piece of code not being in the repo. Surprise surprise, it was that guy. They asked us how we could possibly know that, and we said we looked in the logs and didn't see the commit he claimed he made.

"Oh."

"Don't you guys know how to use SVN?"

"It's just right-click, commit, right?"

"...so when we told you guys that you should tag version so-and-so and you said ok, you didn't have any idea what we were talking about?"

"Nope."

"And when we asked you to look at our diffs and you agreed, did you know what a diff was?"

"Nope."

:negative:

They're also blaming us for not noticing the threading issues in everyone else's code that only came out after we started suggesting and implementing load tests.

cliffy
Apr 12, 2002

I can top that.

I'm currently working on a project that doesn't use source control and 10+ developers just go to town on a single directory of code. Things break regularly, as they should when active development is going on, and the result is multiple people get blocked whenever that happens. Instead of, you know, each developer having their own environment and doing merges into a repository like sane people.

Suicide seems preferable to this hell, and I hear it is painless too.

Zombywuf
Mar 29, 2008

cliffy posted:

I can top that.

I'm currently working on a project that doesn't use source control and 10+ developers just go to town on a single directory of code. Things break regularly, as they should when active development is going on, and the result is multiple people get blocked whenever that happens. Instead of, you know, each developer having their own environment and doing merges into a repository like sane people.

Suicide seems preferable to this hell, and I hear it is painless too.

I see your single directory, and raise you a single user account on a shared server. With a single IMAP account to handle customer enquiries on a server that didn't support multiple concurrent connections.

I don't work there any more though.

tef
May 30, 2004

-> some l-system crap ->
Luxury, why in my day we had one great big file that we emailed around as a word attachment where we got the printoffs signed off by a man who was only available once every 34 years

tef
May 30, 2004

-> some l-system crap ->

cliffy posted:

Suicide seems preferable to this hell, and I hear it is painless too.

Start using git/mercurial locally, and beat the other devs into using it, with a hammer.

Vino
Aug 11, 2010
If they don't understand Subversion (which has an arguably easy to use Tortoise interface) then I doubt they would comprehend git/merc much less use it properly.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

tef posted:

Luxury, why in my day we had one great big file that we emailed around as a word attachment where we got the printoffs signed off by a man who was only available once every 34 years

you familiar with catalyst?

i was talking on #moose last week and this was literally how jonathan rockway described the review process of the book he wrote that packt published

:smithicide:

Blotto Skorzany fucked around with this message at 00:19 on Oct 30, 2010

Vanadium
Jan 8, 2005

Vino posted:

If they don't understand Subversion (which has an arguably easy to use Tortoise interface) then I doubt they would comprehend git/merc much less use it properly.

I had much easier time coming to terms with the whole decentralised thing than with svn, probably it was easier to just create a throwaway repository to play around in. v:shobon:v

tef
May 30, 2004

-> some l-system crap ->

Vino posted:

If they don't understand Subversion (which has an arguably easy to use Tortoise interface) then I doubt they would comprehend git/merc much less use it properly.


Using git/hg is easier locally without having to find a server to run it on. You can also have ad-hoc versioning between the developers who all use the toolkit.

Basically, it is a lot easier to start using for your own sake.

OddObserver
Apr 3, 2009
You don't need a server to use SVN locally.

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

tef posted:

Luxury, why in my day we had one great big file that we emailed around as a word attachment where we got the printoffs signed off by a man who was only available once every 34 years

http://www.youtube.com/watch?v=Xe1a1wHxTyo

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

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

OddObserver posted:

You don't need a server to use SVN locally.
Setting up a local svn server is a hell of a lot more work than "git init".

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