Before you ask, it's a brain. Wearing sunglasses. On a sailboat.
177 stories
·
3 followers

You Know What’s Cyberpunk? The California Sky Right Now! #cyberpunk

1 Comment

“The sky above the port was the color of television, tuned to a dead channel.” William Gibson, Neuromancer

Starting this morning, people in the Bay Area of California began posting pictures of the dark, hazy-orange, smoke-choked sky in the area. Many pointed out that this is the same color sky seen in Dune 2049 and the post-apocalyptic real-world in The Matrix films. Others made allusions to nuclear winter, waking up on Mars, or like it was the end of the world.

As if we needed any more unsettling reminders that we are living in the cyberpunk now. Where is our Neo when we need them?

[Above image, Oakland this AM, Krisztina Lazar. Bottom image, scene from Blade Runner 2049.]

Read the whole story
Share this story
Delete
1 public comment
rraszews
15 days ago
reply
"The sky above the port was the color of television, tuned to a dead channel. Black, with a big floating box that said 'NO SIGNAL'"
Columbia, MD

Constellation Monstrosity

2 Comments and 5 Shares
It's rare to get both astronomers and astrologers equally mad at you, but apparently I've messed up both a bunch of star location databases AND the will of the fates.
Read the whole story
Share this story
Delete
2 public comments
rraszews
17 days ago
reply
The Celestial Centipede
Columbia, MD
alt_text_bot
17 days ago
reply
It's rare to get both astronomers and astrologers equally mad at you, but apparently I've messed up both a bunch of star location databases AND the will of the fates.

CodeSOD: Win By Being Last

1 Comment

I’m going to open with just one line, just one line from Megan D, before we dig into the story:

public static boolean comparePasswords(char[] password1, char[] password2)

A long time ago, someone wrote a Java 1.4 application. It’s all about getting data out of data files, like CSVs and Excel and XML, and getting it into a database, where it can then be turned into plots and reports. Currently, it has two customers, but boy, there’s a lot of technology invested in it, so the pointy-hairs decided that it needed to be updated so they could sell it to new customers.

The developers played a game of “Not It!” and Megan lost. It wasn’t hard to see why no one wanted to touch this code. The UI section was implemented in code generated by an Eclipse plugin that no longer exists. There was UI code which wasn’t implemented that way, but there were no code paths that actually showed it. The project didn’t have one “do everything” class of utilities- it had many of them.

The real magic was in Database.java. All the data got converted into strings before going into the database, and data got pulled back out as lists of strings- one string per row, prepended with the number of columns in that row. The string would get split up and converted back into the actual real datatypes.

Getting back to our sample line above, Megan adds:

No restrictions on any data in the database, or even input cleaning - little Bobby Tables would have a field day. There are so many issues that the fact that passwords are plaintext barely even registers as a problem.

A common convention used in the database layer is “loop and compare”. Want to check if a username exists in the database? SELECT username FROM users WHERE username = 'someuser', loop across the results, and if the username in the result set matches 'someuser', set a flag to true (set it to false otherwise). Return the flag. And if you're wondering why they need to look at each row instead of just seeing a non-zero number of matches, so am I.

Usernames are not unique, but the username/group combination should be.

Similarly, if you’re logging in, it uses a “loop and compare”. Find all the rows for users with that username. Then, find all the groups for that username. Loop across all the groups and check if any of them match the user trying to log in. Then loop across all the stored- plaintext stored passwords and see if they match.

But that raises the question: how do you tell if two strings match? Just use an equality comparison? Or a .equals? Of course not.

We use “loop and compare” on sequences of rows, so we should also use “loop and compare” on sequences of characters. What could be wrong with that?

/**
   * Compares two given char arrays for equality.
   * 
   * @param password1
   *          The first password to compare.
   * @param password2
   *          The second password to compare.
   * @return True if the passwords are equal false otherwise.
   */
  public static boolean comparePasswords(char[] password1, char[] password2)
  {
    // assume false until prove otherwise
    boolean aSameFlag = false;
    if (password1 != null && password2 != null)
    {
      if (password1.length == password2.length)
      {
        for (int aIndex = 0; aIndex < password1.length; aIndex++)
        {
          aSameFlag = password1[aIndex] == password2[aIndex];
        }
      }
    }
    return aSameFlag;
  }

If the passwords are both non-null, if they’re both the same length, compare them one character at a time. For each character, set the aSameFlag to true if they match, false if they don’t.

Return the aSameFlag.

The end result of this is that only the last letter matters, so from the perspective of this code, there’s no difference between the word “ship” and a more accurate way to describe this code.

[Advertisement] Otter - Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!
Read the whole story
Share this story
Delete
1 public comment
rraszews
28 days ago
reply
'there’s no difference between the word “ship” and a more accurate way to describe this code.'

Interestingly also true had the comparison validated all the characters EXCEPT the last one.
Columbia, MD

Five Word Jargon

4 Comments and 5 Shares
My other (much harder) hobby is trying to engineer situations where I have an excuse to use more than one of them in short succession.
Read the whole story
Share this story
Delete
4 public comments
rraszews
86 days ago
reply
Unfortunately, none of them can be sung to the Teenage Mutant Ninja Turtles theme song.
Columbia, MD
Screwtape
87 days ago
reply
"Mathematical Anti-Telharsic Harfatum Septomin"
denismm
87 days ago
reply
My favorite such phrase is only 4 words, unfortunately. “Pulse detonation engine tube”.
jlvanderzwan
87 days ago
... not sure if penis joke or not
denismm
86 days ago
https://en.wikipedia.org/wiki/Pulse_detonation_engine
alt_text_bot
87 days ago
reply
My other (much harder) hobby is trying to engineer situations where I have an excuse to use more than one of them in short succession.

Saturday Morning Breakfast Cereal - Classics

2 Comments and 4 Shares


Click here to go see the bonus panel!

Hovertext:
They also kill a lot of birds and Dorothy is weirdly insouciant about double manslaughter.


Today's News:
Read the whole story
Share this story
Delete
2 public comments
brennen
94 days ago
reply
I read these books in editions that were pretty old ~1989, and have no memory of the wolf massacre. Which you'd think would kind of stand out.
Boulder, CO
rraszews
94 days ago
reply
It's not *bookended* by murders. The second murder happens in the MIDDLE
Columbia, MD

Comic for 2020.06.21

1 Comment
New Cyanide and Happiness Comic
Read the whole story
Share this story
Delete
1 public comment
rraszews
95 days ago
reply
Goofy is the only one of the core Classic Gang to canonically have a child (Everyone else has neices and nephews). Goofy fucks. It's canon.
Columbia, MD
Next Page of Stories