Born. Living. Will quite likely die some day.
879 stories
·
5 followers

Reverse Cowgirl?

1 Comment
facebook cowgirls - 7066515968

Maybe she shouldn't be so proud of being a cowgirl.. in the city...

Submitted by: Karl

Tagged: facebook , cowgirls
Read the whole story
Cthulhux
6 days ago
reply
A good whisky lasts longer though.
Fledermausland
Share this story
Delete

Crypto coin company ‘disappears with millions’, ...

1 Comment and 2 Shares
Crypto coin company ‘disappears with millions’, leaving one-word message: ‘Penis’

Aber nicht doch, Fefe, das ist alles voll seriös mit diesen Krypto-Währungen! Keinesfalls sind das Schneeballsysteme!

Read the whole story
Cthulhux
19 days ago
reply
Aber da ist ein Zertifikat dran, also kann es gar keine Betrugsseite sein!
Fledermausland
CWagner
18 days ago
Crypto Firma haut mit paar Millionen ab, Banken lösen Wirtschaftskrise aus. Nach fefe logik müssen wir eh erstmal das Banksystem abschaffen, dann kan man sich um Kleinigkeiten wir Crypto kümmern
Cthulhux
18 days ago
"Dann muss man auch ... verbieten" ist keine valide Lösung.
Share this story
Delete

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
34 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
154 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
153 days ago
The idea that JavaScript web apps will prevent financial crises is..... wow.
duerig
153 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
153 days ago
About 12 years ago I applied for a job writing Matlab code for a futures trader.
PeterParslow
153 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
153 days ago
reply
Oh how true. :(
Atlanta, GA
alt_text_bot
154 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
153 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
188 days ago
reply
Damn those eclipse releases.
Fledermausland
Share this story
Delete
2 public comments
satadru
188 days ago
reply
Shit.
New York, NY
kazriko
188 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
188 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
189 days ago
reply
... unless the standard library uses regex, that is. ;-)
Fledermausland
Share this story
Delete
Next Page of Stories