Born. Living. Will quite likely die some day.
877 stories
·
4 followers

Client: So I was thinking about it, and I really think you’re limiting yourself when you use your...

1 Comment

Client: So I was thinking about it, and I really think you’re limiting yourself when you use your computer and not our software. You should think about using our computers.

I use Adobe Creative Cloud. He uses the 1999 Corel Draw.

Read the whole story
Cthulhux
4 days ago
reply
Client has a point. You could actually buy and possess Corel Draw.
Fledermausland
Share this story
Delete

Obsolete Technology

3 Comments and 7 Shares
And I can't believe some places still use fax machines. The electrical signals waste so much time going AROUND the Earth when neutrino beams can go straight through!
Read the whole story
Cthulhux
123 days ago
reply
Some banks still use COBOL software instead of JavaScript web applications. No wonder there are financial crises all the time!
Fledermausland
XPav
123 days ago
The idea that JavaScript web apps will prevent financial crises is..... wow.
duerig
123 days ago
At least it is better than COBOL. Wait. I guess that is a low bar. Hahaha. But to be real for a second, this does make me wonder what the high frequency traders are programming in. Maybe C for raw speed. So the next financial crisis might come to us courtesy of a buffer overflow.
rraszews
123 days ago
About 12 years ago I applied for a job writing Matlab code for a futures trader.
PeterParslow
123 days ago
Back in the 80s, I was surprised that the guy next to me was programming a missile launch system in Basic
Share this story
Delete
2 public comments
JayM
123 days ago
reply
Oh how true. :(
Atlanta, GA
alt_text_bot
123 days ago
reply
And I can't believe some places still use fax machines. The electrical signals waste so much time going AROUND the Earth when neutrino beams can go straight through!
ManBehindThePlan
123 days ago
There is certainly a case for "technology apt for the requirement". As long as maintenance costs don't eat you alive...

Eclipse Searches

4 Comments and 10 Shares
There were traffic jams for the eclipses in 1970 and 1979, and that was *before* we had the potential for overnight viral social media frenzies.
Read the whole story
Cthulhux
158 days ago
reply
Damn those eclipse releases.
Fledermausland
Share this story
Delete
2 public comments
satadru
158 days ago
reply
Shit.
New York, NY
kazriko
158 days ago
I'm going to be taking a somewhat alternate path to getting into the eclipse path, I don't want to get anywhere near one of the main roads to Casper.
alt_text_bot
158 days ago
reply
There were traffic jams for the eclipses in 1970 and 1979, and that was *before* we had the potential for overnight viral social media frenzies.

When not to use a regex

1 Comment

The other day, I saw Learn regex the easy way. This is a great resource, but I felt the need to pen a post explaining that regexes are usually not the right approach.

Let’s do a little exercise. I googled “URL regex” and here’s the first Stack Overflow result:

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)

source

This is a bad regex. Here are some valid URLs that this regex fails to match:

  • http://x.org
  • http://nic.science
  • http://名がドメイン.com (warning: this is a parked domain)
  • http://example.org/url,with,commas
  • https://en.wikipedia.org/wiki/Harry_Potter_(film_series)
  • http://127.0.0.1
  • http://[::1] (ipv6 loopback)

Here are some invalid URLs the regex is fine with:

  • http://exam..ple.org
  • http://–example.org

This answer has been revised 9 times on Stack Overflow, and this is the best they could come up with. Go back and read the regex. Can you tell where each of these bugs are? How long did it take you? If you received a bug report in your application because one of these URLs was handled incorrectly, do you understand this regex well enough to fix it? If your application has a URL regex, go find it and see how it fares with these tests.

Complicated regexes are opaque, unmaintainable, and often wrong. The correct approach to validating a URL is as follows:

from urllib.parse import urlparse

def is_url_valid(url):
    try:
        urlparse(url)
        return True
    except:
        return False

A regex is useful for validating simple patterns and for finding patterns in text. For anything beyond that it’s almost certainly a terrible choice. Say you want to…

validate an email address: try to send an email to it!

validate password strength requirements: estimate the complexity with zxcvbn!

validate a date: use your standard library! datetime.datetime.strptime

validate a credit card number: run the Luhn algorithm on it!

validate a social security number: alright, use a regex. But don’t expect the number to be assigned to someone until you ask the Social Security Administration about it!

Get the picture?

Read the whole story
Cthulhux
159 days ago
reply
... unless the standard library uses regex, that is. ;-)
Fledermausland
Share this story
Delete

Screenshots

4 Comments and 8 Shares
For the final exam, you take a screenshot showing off all the work you've done in the class, and it has to survive being uploaded, thumbnailed, and re-screenshotted through a chain of social media sites.
Read the whole story
Cthulhux
189 days ago
reply
Should be mandatory for pseudo-political Twitter users.
Fledermausland
Share this story
Delete
3 public comments
Covarr
189 days ago
reply
My boss says screenshots are proof
Moses Lake, WA
infogulch
189 days ago
I am so, so sorry.
alt_text_bot
189 days ago
reply
For the final exam, you take a screenshot showing off all the work you've done in the class, and it has to survive being uploaded, thumbnailed, and re-screenshotted through a chain of social media sites.
rickhensley
189 days ago
reply
This is the story of my job...
Ohio

poppoppop

1 Comment

Read the whole story
Cthulhux
193 days ago
reply
Creepy, but perfectly understandable.
Fledermausland
Share this story
Delete
Next Page of Stories