- 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
...Your math is broken sir. At 1 per second this many images would take about 194 days. Although I think we're pretty certain if this is a real story, the images were generated programatically as mentioned by the many other comments.
Admin
I don't think your solution is working very well: http://s3.imgimg.de/uploads/xa3f2ebc1png.png
Admin
http://www.cheddarmonk.org/palette.png
Admin
Wow pjt, that looks really weird. The image kind of swims.
Admin
Great story, but it sounds potentially ... untrue.
There are a little over 600,000 seconds in 7 days. Either he was able to manually create 28 jpegs/second by hand every second for a full week... or he wrote a script to generate the jpegs. The former is effectively impossible, the latter shouldn't take a week: http://www.imagemagick.org/Usage/draw/#circles .
Or am I missing something?
Admin
(Also, Akismet spam filter is TRWTF.)
Admin
So how was he meant to have generated these images? If it was by hand then, assuming he performed only this task, he would have had to continuously create 28 images per second to have 16 million by the end of the week. On the other hand, if he was using an automated system why did he need to baby sit it all weekend? I suppose some kind of hybrid between the two is possible, or maybe writing the code to automate it took him a long time...
Admin
adf.ly/183291/weronika
Admin
Or, considering we are in 2011, he could have used border-radius. I know, it doesn't work in IE, but IE users aren't human, so we don't care.
Admin
Admin
Is TRWTF that he used JPGs for a single colour image instead of PNGs?
Admin
to add my 2c to the time frame matter, i'm sure most of the time was spent discovering and overcoming limits in the filesystem / FTP / hard disk / network. having millions of files is not normal
Admin
Admin
F3 <!--
Admin
I'm shocked about your assumption, that in GIF the color palette is preset.
Admin
I suppose it's just a blessing they didn't ask him to handle the Alpha channel also.
Admin
OK, lets talk about how you'd do this in real life.
Done; 1 image and about 4 lines of javascript.
Admin
Don't forget to use an optimal packing so you don't waste space.
Admin
A better way would have been to create a background colored png with a circular transparent mask, and then change the div bg color?
Admin
+1 to your comment. -1 to Matthew for not supervising the intern.
Admin
This is a super illustration of why you should question requirements - they probably didn't care whether it was round or square.
Admin
Admin
No images needed. Do it all in CSS (note: current browser releases may need vendor-specific prefixes):
Admin
Admin
TRWTF is that it's 2011 and neither the employees in this firm, nor Alex, nor almost anyone in the comments knew what the eff border-radius is (only 2 comments mentioned it).
Admin
That's a joke right? Can you imagine how big that file would be? Send that over the network a couple million times and see how it does. Hope your ISP offers unlimited bandwidth. Talking out my a** here, but I seem to remember a certain image format supporting an alpha channel. Make a table cell or DIV the backcolor you want, then alpha blend a white circle onto it. You could probably just use a GIF with transparency (which is a 1 bit alpha channel). Except unlike most partially transparent images, the transparent part is the circle, while the area around it is solid.
Don't get discouraged, Timmy. We all have old embarassing code snippets that, 10 years later we're like "Wow, I could do that so much better now." Ask 10 programmers how to do a certain task and you'll get 10 different answers.
How big was the directory with all 16 million images, out of curiosity?
Admin
Without CSS3? Probably should have made a GIF of a square (whatever the page colour was) with a transparent circle in it, then put that in a DIV with the background set to the display colour. Better yet: use PNG, that way you can use alpha blending to smooth the edges. Better again: generate the circle image on the fly, that way you don't need to change the mask every time you use a different page background. The list goes on.
Admin
Fail. Timmy should have made them PNGs! Duh.
Admin
He should've been told to prepare more sets with different background colours :)
Admin
My nae's Jimmy.
Admin
Why isn't there a link to go back to the full article?
For a site filled with a bunch of douches submitting poorly worded and misspelled stories about how other people don't know how to make quality computer programs this site sure is full of its own fail.
Admin
Wait... shoved up at the top, squeezed between the logo banner and an animated banner ad? USABILITY FLAW! Just put the damn link on the headline in the comments page.
Admin
Naaaah no good. It would have been far easier for him to just nest a few thousand one pixel floated divs in a circular pattern and set the background color on each of them.
Admin
A single bit map with that many colors x the number of pixels of each map? are you trying to kill the bandwidth? Do you want to destroy the page load?
Bandwidth may be cheap, but it isn't free.
Admin
There are two good ways to do this. One is by changing the color of a bullet character. The other is a image generated on-the-fly with a transparent background. There's no reason to get fancy; a monochrome GIF works just fine, and since it's palette-based, the only thing that needs to be dynamically created is the palette entry for the foreground color.
<!DOCTYPE html> <html> <head> <script</span> type="text/javascript"> function update(input) { try { var RGB = Math.pow(16, 6 - input.value.length) * eval("0x" + input.value); var f = function(i) { return i > 61 ? 43 | (i - 62) << 2 : (i > 51 ? -4 : i > 25 ? 71 : 65) + i; }; document.getElementById("img").src = "data:image/gif;base64,R0lGODlhMAAwAIABA" + String.fromCharCode(f(RGB >> 20 & 15), f(RGB >> 14 & 63), f(RGB >> 8 & 63), f(RGB >> 2 & 63), f(RGB << 4 & 63 | 15)) + "///yH5BAEKAAEALAAAAAAwADAAAAJyjI" + "+JwO0Ko0yuWjBzvPzq34XVJ4nmSC7nyqQGC2NkHIN0Pd13qe9Q76MAg6+hTmWkIZOwA/MYePqkSqr" + "1is1qt9yu9wsOJ6PiRrEsQ7fO4SXY/RW+FXN6fNPNcG3YVN9l5eL0JCjXU/hziMizsujXgVgAADs="; input.style.outline = ""; document.getElementById("span").style.color = "#" + input.value; } catch (e) { input.style.outline = "dotted 2px red"; } } </script> </head> <body> <form</span> onsubmit="return false;"> Background: <input</span> type="text" name="bgcolor" onkeyup="document.body.style.background = '#' + this.value;" value="FFFFFF"/>
Foreground: <input</span> type="text" name="color" onkeyup="update(this);" value="000000"/> <img</span> id="img" style="height:16px;width:16px;vertical-align:text-bottom;"/> <span</span> id="span" style="display:inline-block;*display:inline;position:relative;height:16px;width:16px;"> <div</span> style="position:absolute;left:-3px;height:16px;width:16px;font-size:64px;line-height:23px;">• <script</span> type="text/javascript">document.forms[0].color.onkeyup();</script> </form> </body> </html>
Admin
pharmacie en ligne avec ordonnance https://kamagraenligne.shop/# pharmacie en ligne france livraison internationale