- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Sweet home Alabama.
Admin
I had to write an essay on South African anteaters when I was at school.
I didn't bother -- I decided it was too much like aardvark.
Admin
AL is Annual Leave everywhere I've worked.
Admin
Empoyee nr. 666 here Does this site now leak my confidential information?
Admin
I'm kind of worried why one has 32 entries in leavedays, and the other has 30.
Admin
Annual leave makes more sense than my first guess, which was he went to Alabama.
Admin
Or it could be the empty days are the day of leave they have accumulated, (i.e., how many days they can take) and as they take them, they get filled with ... well ... something. Or maybe they're used for formatting the page when the record is displayed. Who knows.
Admin
AI'm not sure anything can explain having 32 values... Maybe a leap year, where August is the leap month?
Admin
Maybe they want the index of the value to match the day of the month, so the first value--at index 0--is an unused placeholder. For this, they need 32 values.
Admin
Holy duplicate data Batman. What happens when 'employee' and 'drillkey.empcode.employeeid' don't match? How about 'comp' and 'drillkey.empcode.companyid'?
Admin
Medium-sized insectivore with protruding nasal implement
Admin
I dunno, maybe in this case it means that on that day, the employee was in Alabama.
Admin
A possible way is that we have several processes with slightly different interpretations. The spec probably allows an array of any size under it and the application used to generate the data enters empty strings for each month-day. Then they have something to enter the "leave" data in, however it does an insert instead of an update, but it does it at the specified array position.
Finally, the reader doesn't care about the array size because it just looks at the array position of each data point that isn't empty.
The first entry may have had a mistake made so they just changed the old value into an empty string before inserting the new value.
Admin
This is probably generated by a REST API and is now how the data is stored in the database. It's common for REST APIs to denormalize some data for convenience.
Addendum 2021-10-12 11:47: s/now/not/
Admin
Don't see any problem with this. (I assume it's JSON.)
It's test data. If it's JSON, it can be used to populate your favorite ORM model. Presumably, the actual LOB system can handle that ORM model. ANd presumably it can handle the differently lengthed array, presumably by padding. I mean, this is test data. It's not humongously useful test data, because it only covers two cases. But I've seen worse, and you can always ask for more test data.
Seriously. I'm working with "test data" that has things I'm expected to calculate with no documentation and not even a representative persisted model (which I asked for, two weeks ago).
This trivial little blip would be heaven for me.
Admin
I think what was me happening is some code talk. The empty string ends a set of information for a day. A non-empty string, e.g. "AL" (administrative leave / annual leave / allowed leave) apparently triggers some new substructure, which is closed by an empty string, and then the entire day is closed by another empty string. With enough data, you could suss out the pattern, but it would be worlds easier if you could get at what's the documentation or the code that's generating that coded array. I guess you could ask Mr. Goldfish, but good luck getting him to remember anything! Heyyoooo!
Admin
That was apparently typed by different halves of my brain at different times.
Admin
Aaron must have sold one of his days to Alice...
Admin
Given this is just some "test data", is it possible this is partially hand-crafted? E.g. they generated a couple of examples. Then because they wanted to show an example with someone with leave, so they inserted an "AL" in randomly for Alice. For Aaron, they originally overwrote one of the items with "AL", then deleted it because they realised they wanted that one to be an example of no leave being taken.
Admin
Nonono, AL is short for "Alice", it's the abbr that will be shown in the managers' month overview screen.
Admin
TRWTF is that Duncan took a guess and implemented something that may or may not be correct. And in a few years someone will post Duncan's code here :).
Admin
It turned out to be more often correct than the previous process, which was asking managers to guess from memory, or rely on manually-maintained leave calendars in the wiki. Because the managers didn't always have access to the payroll system themselves ...
Admin
Nope. The "test data" in question was a subset of an actual response (because of course this monstrosity didn't have a non-production sandbox). I anonymised it before submission ... and no, I never did manage to get an answer for why the number of strings didn't match the number of working days.