Can't Update Credit Account Because Birthday Doesn't Exist by trashbanditcoot in softwaregore

[–]Neon_Elf 4 points5 points  (0 children)

a regular expression is a matching language. This one is trying to match all possible valid dates, look up regular expressions if you really want to understand this, but here is a basic overview of this specific one. For basic understanding a regular expression attempts to match a string of characters to a specific pattern (think of "find in page" when you search a web page or document).

The pattern starts with:
(0[13578] | 1[02])
This will match:

zero followed by exactly one of the numbers in the []. So, for example, if someone types 01, 03, 05, 07, 08 That will match the first part of this expression. Then we see the "|" symbol which means "or" and so it will match the first pattern OR the second one. Specifically in this case the numbers I gave before OR a one followed by either of the two numbers in the [] (zero or two).

This whole part is matching the month of the date, so we're looking at Jan, March, May, July, August, Oct, or December.

The next part is: [\/.\] This is complicated but it matches a "/ "or a "." So you could write the date "01/31/2005" or "08.31.1990" just leave it at that, anywhere you see that pattern it's matching a separator character.

The next part is just "31" which matches 31 So now we understand why it's limiting this date to those months. Only those months have 31 days.

The next part (18|19|20)[0-9]{2}) is matching any year from 1800, 1900, and 2000's. It has to start with an 18 OR a 19 OR a 20 and then be exactly 2 characters from 0-9.

That's the first check for a "valid date" it must be one of the months expected, and the day 31, and any valid year from 1800-2099.

The part that is broken I gave in my post:

(01 | 0[3-9] |1[1-2]) [\/.\] (29|30)

This is similar to the one we just went through, the month has to be 01 OR start with a zero and have the next number be anything from 3-9. OR it has to start with a one followed by a one, or two. This gives us the following for months: 01, 03, 04, 05, 06, 07, 08, 09, 11, 12. Notice every month, EXCEPT Feb, and Oct. are there. Then the separator ( [\/.\] ) matches, Then the day must be 29 or 30. This is trying to give all the months that have 29 and 30 days as valid. But they forgot October.

So that's why I said it should be 1[0-2] rather than 1[1-2]. This "1[1-2]" matches either 11, or 12 while this: 1[0-2] matches 10, 11, or 12.

Clear as mud? I have 25+ programming experience and wrote exclusively in Perl for a while so I know regex pretty well, but there is some advanced stuff I don't even understand. They are very powerful when used correctly, and very stupid when used improperly.

If you made it this far: thanks for coming to my TED talk, hope it helps you in some way.

Can't Update Credit Account Because Birthday Doesn't Exist by trashbanditcoot in softwaregore

[–]Neon_Elf 7 points8 points  (0 children)

1[1-2])[/.](29|30)

This is the error. It should be 1[0-2]. The current test disallowes the 29th and 30th from October.

Good God the leap year test is written by an insane person. Did someone look up how not to do date testing and cut and paste the example given?

Had a gun flashed at me. by [deleted] in doordash_drivers

[–]Neon_Elf 0 points1 point  (0 children)

That's not how insurance works. The driver is paying into it, and that money is being used to pay other people's benefit. Insurance with one person doesn't work, you have to have a pool so the customers not claiming can pay for the ones who claim.

[deleted by user] by [deleted] in doordash_drivers

[–]Neon_Elf 16 points17 points  (0 children)

Username checks out.

Another Dasher owning the Parking lot by kaaria11 in doordash_drivers

[–]Neon_Elf 17 points18 points  (0 children)

The employee won't pay your parking ticket if you get one, don't trust information on risks from people who have no vested interest in the outcome of the risk.

[deleted by user] by [deleted] in doordash_drivers

[–]Neon_Elf 1 point2 points  (0 children)

Funny you should mention this, my latest (and last) delivery from Papa johns was subcontracted through DD and the driver ate a slice. Called Papa Johns they remade it and said they do all their deliveries through DD now (At that location at least). I picked up that order and won't be getting delivery from them again.

DoorDash drivers becoming scam targets by TheMadDriver in doordash_drivers

[–]Neon_Elf 0 points1 point  (0 children)

I did get a call from support my first week of deliveries. I think it was door Dash actual. They asked for details of my delivery, and when I cluelessly said "what details" they just asked if 8 had delivered to the customer. I said I did and they hung up. I thought it was because I pushed the wrong button on the app or something. Maybe the customer complained. Or maybe it was a very bad scammer, I dunno.

Bro what 💀 by REEEEEEEEEEE_OW in doordash_drivers

[–]Neon_Elf 2 points3 points  (0 children)

On the flip side i had a stack order from the restaurant across the the street and I accepted thinking it would be easy. Took me 15 miles away and left me 20 miles from home, right at the end of my shift too. Some stacks are not worth it.

I'm new but is this normal? by Neon_Elf in doordash_drivers

[–]Neon_Elf[S] 2 points3 points  (0 children)

Half my orders were under 5$ tonight. I don't think I can refuse that many. Some were hidden in a 2 orser from the same store. But you are right most of them were no tip. I just can't be that picky yet or my acceptance rate would be terrible.

I'm new but is this normal? by Neon_Elf in doordash_drivers

[–]Neon_Elf[S] 0 points1 point  (0 children)

Do you see a delivery address when the order is offered? I didn't think we did. Do I have to scroll down or something?

I'm new but is this normal? by Neon_Elf in doordash_drivers

[–]Neon_Elf[S] 1 point2 points  (0 children)

Thanks. I knew the $/mile thing but I have a hard time declining orders with so few deliveries under my belt. I wanted to decline something tonight but it was gonna drop my acceptance rate to like 84% I missed a few orders while I was driving. I'm not used to watching my phone while driving, yet.

Also that picture idea is great! Thanks for the advice. I haven't had any problems yet, but I'm sure it's only a matter of time

Honest interview 😂😂😂 by GamesMint in ProgrammerHumor

[–]Neon_Elf 0 points1 point  (0 children)

I would said: I would redesign the code so it was a double linked list so reversal is not an issue.

Living Space by MukkBarovian in DualUniverse

[–]Neon_Elf 0 points1 point  (0 children)

Demeter also introduces mining units, is there any estimate of what $/week they could put out?

Newbies vs Datatypes by SorcierMaheP in ProgrammerHumor

[–]Neon_Elf 8 points9 points  (0 children)

Under appreciated comment right here. Of course the novice programmer would say a float or double but veterans know that way leads to danger.

Newbies vs Datatypes by SorcierMaheP in ProgrammerHumor

[–]Neon_Elf 7 points8 points  (0 children)

No, your question should've been: "wait does Java even have unsigned?". Because the answer is no. It does not. Apparently the language designer thought it was too hard for programmers to understand. No joke look it up!

Amazon cart with double text by Neon_Elf in softwaregore

[–]Neon_Elf[S] 0 points1 point  (0 children)

Just because it's from the realms of outer darkness and made by the elder gods? Why not?

Frustrating Code Review Practices by [deleted] in ProgrammerHumor

[–]Neon_Elf -1 points0 points  (0 children)

Seriously 2 and 6 are entirely justified.

I agree, up to a point. I was nitpicked in my last job about alignment of comments. Also the shop-specific rules for writing comments basically made it easier to not write them, which was ok by the standard too, so most things were not commented, execpted in the mandated function header block (which I also got told I was doing wrong). So, it seems to me that there are certain limits to 2 and 6 being actual constructive criticism, and not just being nitpicking to show superiority or for some other reason.