- 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
Significance may very and can be subjective, but a single call to a function vs 25 calls to a function makes a known difference. I would say the difference in processing something a single time vs 25 times is significant. Now, since it was for the automated test team, speed significance may not matter much. If this is something that was going into a production site, it does matter - especially since it appears the function is being called for every element --- so on calls to RAND alone (aside from array creation and string operations) your additional overhead is 24 * N repeated dynamic elements per item processed.
Admin
Sure. Context is everything. Ultimately, it's 99% made up. We know this because it's on the front page.
Admin
Admin
Only if it's xxx hot!
Admin
Admin
There's a difference between code complexity and algorithm complexity. Selection sorts have horrible algorithm complexity (O(n^2) but they're very easy to code in any language, minimize memory use, and minimize writes.
It should be contextually obvious exactly which meaning of "complexity" blakeyrat meant.
Admin
Yeah, I was :moving_goal_post:. That was partly just to yank his chain; however, like I also said, my original statement was that complexity and efficiency are usually directly linked, and a few counter-examples won't disprove that.
Admin
Quicksort isn't stable, nor is it very efficient unless done in-place (which @Captain's code doesn't do; it also doesn't guard against the evil edge cases). Bubble Sort isn't even as good as Insertion Sort, even though they're both O(n2) and similar in complexity of code.
Sorting is pretty much a solved area now. The best is probably Timsort, but it's a bastard complex algorithm by comparison with the other common ones.
https://en.wikipedia.org/wiki/Timsort
Admin
You probably have better telepathy than us. :tropical_fish:
Admin
But... but... we're the Devs Who Say NIH!
Admin
If there's two possible meanings, and one is complete nonsense and the other is entirely cogent, then -- jokes aside -- why would you ever assume the former was the intended meaning?
Admin
I wouldn't, but I also wouldn't be surprised when blakey later yelled at me because he meant something completely different.
Admin
Because :trollface:, of course.
Admin
Blame TDWTF for choosing a font size and weight that makes lowercase i and l indistinguishable when bolded. Looks like they chose "OpenSans" and relied on browser rendering of bold styles instead of using one of the heavier weight variants of the font like OpenSans Semi-Bold or OpenSans Bold 700
https://www.google.com/fonts/specimen/Open+Sans
Admin
Unable to reproduce. Bolded looks just fine:
[image]In fact, the gap between the body and the dot in the i is actually more pronounced in the bolded version than it is in the regular version:
[image]And before you ask, yes, my browser knows how to load fonts, and did load it correctly, and that's the default rendering and default size.
Oh, and based on the CSS, it looks like they are using heavier weight variants for bold, not just relying on the browser rendering.
Admin
Continuing the discussion from Random Ruby:
Continuing the discussion from Random Ruby:
No they aren't. They're using the same font face regardless of bold or not. The font clearly is rendering differently than the 700 weight variant on the Google hosted page at the same font size.
Oh, and OSX renders antialiasing differently than Windows. The Google provided alternate font face for 700 weight variant renders much better at the font size used.
DWTF (15px with bold tag): [image]
Google Fonts (700 weight adjusted to 15px): [image]
The Google Fonts rendering (same browser, same zoom level) of the 700 weight variant is more legible than the base font face with browser bold applied. The dot on the i is more circular, whereas TDWTF rendering squashes the dot and causes the gap to be harder to perceive.
Admin
Looks fine here on FF/Linux, too.
Admin
Chrome: [image] Looks the same to me.
Firefox: [image] Looks the same to me.
Hell, look, I'll even dig up the ol' Internet Exploder to give it a go at it: [image] Hey look, it even got it right.
Ah. Well, sounds like your computer's broken.
Admin
I think Steven's solution is not good. Sure, it's quick and easy. However, only 37,234 iterations later (~0.0037% of whole range) you will have 50% chance for your first collision. That's just horrible.
Admin
In C++14 you can write 1'000'000'000