- 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
Oh Saint Frist, I pray to thee.
Admin
"Today's submitter not only works in PHP, but they also freelance: the bottom of the bottom of the development hierarchy."
I don't see how insulting every interactive media graduate in the western world is going to help site traffic ;)
Admin
if it is on their expense I see a lot of potential
Admin
I'd like to say: I have been surfing italian websites for about 20 years and I have never found one which prints out the saint patron of the day. This website must be about some church community or something like that.
Admin
I was waiting on the Wikipedia page to be reformatted and thus listing all 365 saints.
Admin
Looks like it’s time to vandalize a certain Wikipedia page.
Also what happens if the sever’s connection to Wikipedia is slow. The file should be cached with an automatic process to update the cache with some sort of method to reject the file if too much of the data changes
Admin
easy solution,
rewrite that javascript and php in $most_popular_language_of the_day and you are all good. sine clearly the problem here is php
Admin
I don't know the Wikipedia terms of use specifically but this would be against the terms of use for most websites.
Admin
Waiting for a saint "Go f*ck yourself" showing up on the Wikipedia page - and on the "big, obscure website"...
Admin
"... see, 'Snow White' was just a nickname and her rea..." NO!
Close, but no cigar. A much better translation would be: "July 18: saints Sinforosa and seven others"
Critically, there is no definite article (Italian "i", English "the"), which changes the meaning of the phrase in the same exact way for both languages.
Admin
As a database programmer, I see a way for this to be much more efficient from the end-user (and local web-server) point of view. Split the process into to two tasks. Daily (over-night) task: Check the last update time on the it.Wikipedia.org page. If it earlier than the last time this process successfully updated the database, then stop and try again tomorrow. Otherwise, scrape and parse the Wikipedia page, putting the cleaned data in a (server) local database. Upon successfully reading and storing all the info, update the successful timestamp and log a successful update. If the scrape and parse process somehow failed, log that result and leave the database in the state you found it (Rollback Transaction). On-Demand task (called by PHP): Check the server-side database (not Wikipedia) for the per-formatted data and present that to the user.
Much easier, less error-prone, faster response time for the user, more billable hours for the database programmer. Okay, so some people don't feel that last point is an advantage, but I do.
Admin
I'm not very familiar with PHP so please excuse my ignorance.
"if(year<1900)year=year+1900;"
What is he trying to do here? The only way this would work is if for some bizarre reason, date.GetYear returns only the last 2 digits of a year prior to 2000. Is that what dates in PHP do?
Admin
@Jay That's not PHP that's javascript. date.getYear() returns the local year - 1900 but it's deprecated date.getFullYear() should be used instead.
Admin
Thanks! I got the language wrong but the functionality almost right. It looks like he's anticipating that the logic behind date.GetYear will be fixed some time before the year 3800 AD.
Admin
Oh joyful cause of so many "year 19100" bugs about 18 years ago :p (i'm pretty sure some websites out there are still in the year 19118)
Admin
I seem to have a memory that IE suddenly started returning "2000" in that year for getYear, where everyone else did 100. This is where I had assumed the Gorillaz song "192000" came from...
Admin
Seeing as the function only returns date_month, I'm wondering why they're manipulating the year at all.
Admin
PRIMO!
Admin
192000 - that makes sense. I saw that date on some websites on Y2K day (1/1/2000). That was the only unpatched glitch I saw.
Admin
In the spirit of this site, Shirley you mean "PIMRO!"
Admin
More bucks for the database coder (it's done in PHP, isn'it?) is not the problem.
The problem is the total lack of enterpriseyness.
Admin
Poor sant'Ilaro only gets a day once every ~ 4 years!
Btw does this mean we can cripple Italy with a malicious script embedded in Calendario dei santi?
Admin
So let me see ... hmmm ... TRWTF is using the variable name "year" and not "anno", correct?
Admin
I've seen PHP development like this. I had forgot about it until I saw this. I've also seen things like once to migrate a project to another country, client, brand, etc a reverse proxy was used to sed replace things like domain names that had to switch, strings to translate, etc.
Admin
So TRWTF is WaaD? (Wikipedia As A Database)
Stick it all in a database on the server (much easier to access), then have a daily or weekly job that fetches the Wikipedia page, validates that it is formatted as expected (and reports errors somewhere that will be noticed in less than a year!), then repopulates the database.
Admin
(reposted without italics tags, what a wonderfully WTF choice for filtering spam!)
So TRWTF is WAAD? (Wikipedia As A Database)
Stick it all in a database on the server (much easier to access), then have a daily or weekly job that fetches the Wikipedia page, validates that it is formatted as expected (and reports errors somewhere that will be noticed in less than a year!), then repopulates the database.
Admin
Is there no saint for February 29th?
Admin
pretty sure this site traffic is composed mainly of people who can laugh at themselves just as much as at others
tl;dr: don't take the jokes personally