You mean this bug?
I can't even tell if it's already fixed, will be fixed in FF30 or whatever...
You mean this bug?
I can't even tell if it's already fixed, will be fixed in FF30 or whatever...
@dkf said:
@Strolskon said:So “int my_isdigit(char c) {
return ((c - '0') < 10);
}!
” is a digit?
That one's fun because whether or not it works depends on the compiler. ('char' may be signed or unsigned.)
And we've switched compilers over the years on this project. Guess what one of the differences between them is...
Although converting strings to numbers is a common WTF, this one -- which I found when debugging some code that was giving bizarre unexpected results, and presented exactly as it is in our code -- has some real gems.
Possibly my favorite part is that based on the function names, whoever wrote this code knew that standard library functions existed to do this job, but they decided that they could do a better job of it themselves. Bonus points for defining my_atoi which one would expect to be a reimplementation of atoi(), but in fact does something completely different.
unsigned long my_strtoul(char* str, int base) { int str_size = strlen(str); #define MAX_STR_LEN 8 int ival[MAX_STR_LEN] = {0}; unsigned long ret_long = 0; int i,j; unsigned long tmp_val; if (str_size > 8) { str_size = MAX_STR_LEN; } for (i=0; i<str_size; i++) { if (base == 10) { if (!my_isdigit(str[i])) { str_size = i; break; } } else { if (!my_isxdigit(str[i])) { str_size = i; break; } } } /* end for */ for (i=0; i<str_size; i++) { ival[i] = my_atoi(str[i], base); } if (base == 10) { for (i=0; i<str_size; i++) { tmp_val = ival[i]; for (j = (str_size-1); j>i; j--) { tmp_val *= base; } ret_long += tmp_val; } } /* base 10 */ else if (base == 16) { ret_long = 0; for (i=0; i<str_size; i++) { ret_long |= (unsigned long) ival[i]; if (i != (str_size -1)) ret_long <<= 4; /* shift by 4 bit */ } } /* base 16 */ return ret_long; } int my_isdigit(char c) { return ((c - '0') < 10); } int my_isxdigit(char c) { return ( ((c - '0') < 10) || ((c - 'a') < 6) || ((c - 'A') < 6) ); } int my_atoi(char a, int base) { int i = 0; if (base == 10) { if (!my_isdigit(a)) return -1; } else if (base == 16) { if ( !my_isxdigit(a) ) return -1; } i = a - '0'; if (base == 16) { if ( (a == 'a') || (a == 'A')) i = 10; else if ( (a == 'b') || (a == 'B')) i = 11; else if ( (a == 'c') || (a == 'C')) i = 12; else if ( (a == 'd') || (a == 'D')) i = 13; else if ( (a == 'e') || (a == 'E')) i = 14; else if ( (a == 'f') || (a == 'F')) i = 15; } /* end if (base == 16) */ return i; }
@joe.edwards said:
Hint: 80s movie with a catchy theme song that translates well to midi
Harold Faltermeyer - Axel F.
Do you want see the extreme end result of such taxes / national insurance?
Then come to Germany:
edit: why is this forum appending my greasemonkey script? once for every edit
@BC_Programmer said:
I can think of: either the language itself sucks, or the toolset sucks. I'm simply more inclined to believe the latter.
BorlandEmbercado made some big mistakes:
* No free for open-source edition of every version. A language cannot get popular, if there is no free compiler
* Screwed up Kylix. VCL is an amazing wrapper over the Win32-API, but many people need a Linux version
* Rewriting everything in .NET
* Adding generics too late<script>window.alert = function(m) { if (!confirm(m)) var kill=asdsadapfksaoOPSFKPASKOPFS; }</script>
@blakeyrat said:
harms you either physically or financially
But, guess what, I don't like it. I don't like clicking somewhere once and having that haunt me for a week. Just as I don't like building an identity in forums or posting everything I do on twitter. You probably won't understand "why" but I just don't. I can't explain why I don't like the smell of rotten fish either (not talking about evolutionary explanations).
But every time you see someone here who does anything you don't do you throw a tantrum. You probably are the kind of person who wonders how the hell can gay men be attracted to other men if other men don't have boobs.
I remember I browsed some time with a google account and no third-party content blocker. I clicked an ad once and for several weeks ALL ADS on every page became that ad. Even worse, Youtube kept asking me to watch the same MLP:FiM episode for over a month. No thank you, I'll watch what I want.
I don't consider this so much "WTFy".
When deciding whether a design a good or bad I'd say use these criteria:
1. Does it require lots of redundant code/boilerplate? (This is a problem because it slows down development)
2. Would a single change in the requirements require lots of changes in many different places? (This is a problem because one may forget to change one of these places when implementing such a change)
3. Is there a risk a future developer misuses the design and thereby creates bugs?
4. Is it a well-known pattern? (If not, it is a problem because new developers have to learn the pattern first)
Now let's analyse this design.
1. The redundant code is the app passed to every single application element constructor, and the fact that all dao accesses need to be written app.dao instead of just dao. I'd say this is pretty minor. Note that using a singleton pattern "Application.getInstance().getDao()"is not that much shorter especially as you now need to write the implementation of getDao().
2. Not really. You want to change the dao implementation by another one? Only modify Application. You find out MyFrame has another dependency (in addition to dao)? Just access it through application - no need to modify Application or whatever code instanciates MyFrame.
3. There are two risks here: first Application.dao is writable, so a developer might be tempted to *modify* Application.dao from another place (which is the reason people say globals are "bad" - because they can be modified from a method without the method signature making this evident). This could be avoided by marking dao as final in application, and adding an Application constructor to pass custom dao implementations (for use from e.g. unit tests). Second risk: there's a Singleton pattern at use here (people assume there's only one application instance so that everytime someone writes app.dao they access the dao of the same app, and therefore the same dao as well), BUT people might be tempted to pass a new Application instance. Solution: mark Application's constructors as private (or maybe package private), [OR mark dependencies (dao and others) as static - in that case you no longer need to pass the application instance. This second solution is less good because it prevents you from making unit tests with different dao implementations AND still having dao marked final.]
4. This is not the most usual way of doing dependency injection, which is probably why the first reaction is WTF. But it doesn't IMO have issues itself.
(Using a dao directly instead of having a service layer is another issue that I did not cover above. That MAY be a problem if data has/may have in future integrity/consistency requirements that would need to be implemented in a service, but it is orthogonal to my analysis above - nothing would prevent Application having a public Service attribute, and have the Service itself use a Dao).
(PS I accessed this account through bugmenot - treat this as slashdot's anonymous coward ; I did not write or even read any of Strolskon's other posts)
@pauly said:
I know that FOSStards like to turn on the stupid-act when they sit in front of a Windows machine, but this hosts file thing is too much. Stop acting like you don't know how to change the NTFS permissions on that file.
You want a thread about dicks? Alright then. I'll just drop this here:
It is relatively common for straight men to be attracted to penises.
Hopefully you'll get a nice long thread now.
Bonus: a TED talk about penises.
@Cad Delworth said:
... if you're running a <AnyOS> box (especially a server), you just have to accept that you'll spend a lot of time patching and fixing your way around other people's (largely undocumented) fails.So … fix it,already. :)
FTFY
Found this in a project I have inherited at work:
if (pLine.Length > 4)
if (pLine.Substring(0, 4) == ("and "))
pLine = pLine.Substring(0, 4).Replace("and ", "").Trim() + pLine.Substring(4);
if (pLine.Length > 2)
{
while (pLine.IndexOf("&") == 0)
{
pLine = pLine.Substring(0, 1).Replace("&", "") + pLine.Substring(1);
pLine = pLine.Trim();
}
}
@joe.edwards said:
I think 'worm' is the technical term for a malware infection that requires no user interaction. Yes, there are many that just scan for known vulnerabilities and infect. I've had a fresh Window installation get compromised in the few minutes it took between connecting it to the Internet and connecting to Windows Update.
@Mole said:
@dhromed said:Who gives a goddamn shit.I like your style!
@blakeyrat said:
Do people have these posts queued up waiting to go the instant someone posts on a vaguely related topic?
If you have your own wtf, post it in your own damn thread. Don't hijack mine. Ass.
I am really sorry. I did actually have these screenshots saved from before (from another forum). I saw your post about Steam lying, remembered them, and thought it was acceptable moment to post them, since they are about Steam lying. I feel so stupid now. I apologize for all emotional damages I might have caused.
I hate Steam for so many reasons.
Say you've suddenly lost your internet connection. You want to play an offline Steam game. You think "Oh no! Steam probably won't let me play that game offline!" but you decide to try anyway. You launch Steam and get this:
[img]http://oi44.tinypic.com/2vv88sj.jpg[/img]
"Oh great! It says "start Steam in "Offline Mode", and there's a button that says "START IN OFFLINE MODE", so I can probably start in offline mode! Steam is not so bad after all!".
Fool. You click the button. A window appears: "Connecting Steam account: ...". You get slightly confused. Suddenly:
Yes, they are screwing you over.
How much do (did) you pay per text message anyway? A 2-minute YouTube video is about 10MB (10485760 bytes). A SMS is 140 bytes (about 1/75000th of that). You do the math (and same goes for voice calls). Be grateful they don't charge extra for "long-distance Internet connections" or "search engine usage".
@dhromed said:
@pkmnfrk said:
the bsd ruse was a.......... distactionIT KEEPS HAPENIG
where doing it man
where MAKING THIS HAPPEN
@morbiuswilters said:
@TheRider said:@lolwtf said:
Just you wait until your IDs get up into the quadrillions and you're getting incorrect IDs due to floating point inaccuracy... you'll be glad you used a string instead, that can contain all the digits.Floating point inaccuracy? Wow! Wouldn't that be a bit far-fetched? But Integer overflows, if you want, ok.Easy for you to say. How can I represent user number 1.878798734E-38 without floating point IDs?
Arbitrary-precision arithmetic?
@sprained said:
And even if it were a new version, why would the binary have doubled in size?
Didn't Mac applications double their size for a while to include PowerPC and x86 binaries? I dunno.
@briverymouse said:
@Cassidy said:
Then it dawned upon me that Firefox, Foxit Reader and some other apps do updates independent of the OS.Isn't Windows Update only for Microsoft software? I can't think of any third-party product using it.
@nexekho said:
Oh I just went up a few levels to the homepage and he is not only a master developer, but he has also written a book on sex education.
Well there we go.
And it looks really promising:
Version 1.3
Completed a full review.
You may distribute SexualEducation for commercial purposes.
Added the "Edge sex > Violent fantasies > Playing" section.
Improved "Sexual response" section.
Bug fix: when using browsers like Opera, bookmark targets are correct.
More in the "Erotic talk" section.
Fixed an error in saving the last reading position.
Added the "Erotic massage > Uterus massage" section.
Added the "Edge sex > Violent fantasies" section.
Added a few more details about how to hold ejaculation.
Added the "Things to do during sex > Wild thing" section.
The visual aspect is a little different: some parts of the book (like the headers) are emphasized with background color.
First public release of SexualEducation: version 1 on 20 February 2003.
It's U+2697 'ALEMBIC'.
(Which still doesn't make much sense but whatever)
Why didn't they make the alt text "♥" ? At least that would have made sense.
My current laptop comes with a neat thing called Nvidia Optimus, which basically means it has an Intel integrated graphics card and an Nvidia graphics card. It works great in Windows (and by that I mean I've never actually noticed it, but there's a "Run with graphics processor" submenu when you right-click a .exe file and the games seem to run fine). On Linux... well there's a tool called "Bumblebee" which you can use to disable the Nvidia card (to consume less power) or explicitly run a program on it, or you can just ignore it and run on the Intel card. Luckily I'm not crazy enough to want to game on Linux (I almost got TF2 to run on Wine though).
@nexekho said:
@topspin said:With such shitty drivers, people should probably think twice before adopting WebGL.
Agreed. There's a thousand ways to screw up via 3D APIs when you're not trying to, and you people want these APIs exposed to the fucking internet!?
Just connect a keyboard to it and press the appropriate sequence of keystrokes to disable the firewall!
AI is one of these topics with lots and lots of bullshit, like psychology and others (I hope I don't start a flame war). It "looks easy" from a distance, and people just love to speculate about interesting theories and nice-sounding concepts without bothering to get into the "boring mathematical/programming part" (and they love to share their knowledge on Wikipedia too). That doesn't mean, though, that all of the AI is bullshit. Things like playing chess or video games, theorem-proving, optimization, or simple path-finding are AI, even if not the type of AI that appears in Hollywood movies.
If you want to see a real AI crank, google "mentifex".
@OzPeter said:
@Jaime said:@OzPeter said:I have no problem with starting at the bottom, and at least half the room admitted to not using powershell. But I was flabbergasted at the presenters' "sense of wonderment" in his discovery of grep. If he had said "Here .. with powershell you can do the equivalent of grep" I would have felt different.At this point I'm slapping my forehead, saying to myself "WTF .. did you just discover grep??!?!?!?!?"You've got to start somewhere. Most Windows admins I know can't script anything.
By the way, have you seen this amazing technology called HTML5? You can do all kinds of cool new things: 2D animations, 3D animations, playing video, even storing files locally!
@Rhywden said:
I'm not sure, but is there actually a language which does not require using a function to calculate something like 10x?
Python does that:
>>a = 3 >>10**a 1000
It even has support for complex numbers:
>>(-10)**1.1 (-11.973092164164026-3.89029346894877j)
@Gurth said:
@Sir Twist said:@Strolskon said:
Is there any way you can use, say, Python inline with HTML just like you can with PHP?
Specifically, you want to read this part of the documentation.
Ooh, neat, thanks.
@Jaime said:
Why? The world already has enough frameworks that jam scripting into markup.
Is there any way you can use, say, Python inline with HTML just like you can with PHP? Something that vaguely sort of looked similar to this?
<html> <head> <title> Welcome, <? POST["name"] ?>! </title> </head> <body> <p> <?python if int(POST["age"]) < 18: print("Sorry, you are not allowed to come in") else: print('Please proceed to <a href="page"> our super page</a>') ?> </p> </body> </html>
It might look ugly at first, but I think it's the best solution when you have static pages and need to add a few dynamic details (and might at least drive a few people away from PHP).
@blakeyrat said:
@Buzer said:I assume it means "not having the web page occupy the entire browser window", aka [url=http://en.wikipedia.org/wiki/Multiple_document_interface] Multiple document interface [/url]. It's kinda useful when you want to see two pages at the same time without having to open them in a new browser window. Like this:Opera is still the only browser that allows resizing tabs. I will consider switching when other browsers start supporting it (which is most likely never). It's quite rare to find page that doesn't work on it (then again, there are that kind of pages on each browser).What does "resizing tabs" mean in this context, and why would it require page-level support?
I assume you don't literally mean resizing the tab icon at the top of the window...
@morbiuswilters said:
if you want to drive your car around with the parking brake on, be my guest. I have never worked anywhere that gaves two shits about Opera. At several places I've worked I've directed support to tell Opera users who call in to use a real browser (in nicer language, of course). I've had bosses ask me "Do we support Opera?" to which I reply "I don't know, it's your call. But out of the 20 billion pages we served this month only 7 went to Opera" which is usually met with "Why are we even wasting our time talking about this?"
I used to flame Opera users but then I stopped caring
Riiiiiiiiiiiiiiiiiiiight.....
@boomzilla said:
@morbiuswilters said:@boomzilla said:@Mason Wheeler said:@Thuktun said:If anything looked at those flags in the past, nothing does now; they're currently write-only.OK, my Java# is a bit rusty, but doesn't "static" mean "const" in this context?
Exactly! The problem is really that the log file is a supercooled liquid, and with that many lines it will get thicker at the bottom.
Unless you change the value of index 0.999...
There must be a vaguely relevant yet controversially funny webcomic with minimalist art about all of this...
Filed under: no doubt I'll learn about some other obscure webcomic I've never heard about before that uses stick figures
[url=http://comicjk.com/comic.php/44]Comic JK[/url]?
@Strolskon said:
Fine then, I changed my password to hunter2, please don't steal it.
DISREGARD THAT, I SUCK COCKS
Fine then, I changed my password to hunter2, please don't steal it.
My company have a Groundbreaking Iphone and Google Android App Concept. Looking for someone who can code, design and create it ASAP. We need a tech savvy individual who can create it. We can pay up to $2000 to get it created. But if you do it on contingency, we will give you 15% stake in the company, where [b]we will be charging $9.95 and $29.95 per download[/b]. Our idea is the next Facebook, Twitter, Craigslist.
Does this actually mean they intend to charge $10 to $30 per app download? Because even if they managed to get something good, I don't think even Facebook could charge $30 per download and survive.
@morbiuswilters said:
@Strolskon said:I actually wondered how regexes could be used to solve this.What? You seriously considered regex as a solution? O_o
I have studied SET theory in my regular study. I think we can do your project with ARRAY (corresponding to set) Please tell me some detail of your project.I wonder if he would respond in the same way when asked to make a simple calculator.
"I have studied NUMBERS theory in my regular study. I think we can do your project with OPERATIONS (corresponding to numbers) Please tell me some detail of your project."
@morbiuswilters said:
@boomzilla said:My favorite is the guy who said:I have studied SET theory in my regular study. I think we can do your project with ARRAY (corresponding to set) Please tell me some detail of your project.It's nearly relevant, so it doesn't look like a generic bot, and would appear that he actually thought about the problem. What he thought is probably a mystery best left unsolved.I know: I'll use a regex!
I actually wondered how regexes could be used to solve this. You only need to add a few things before they become turing-complete anyway.
Maybe it's just me, but these forums don't seem to support HTTPS, not even in the important pages like the login or the change password ones. This means that my password is being sent in the clear every time (and the cookies too, but I'll be happy enough if they can't see my password). Being in a shared network with thousands of other people who could probably easily intercept my traffic (ARP poisoning, port stealing, whatever) kind of makes me paranoid about what information I send (try it, you'll be surprised to see how many sites don't give a shit about data encryption, so I would be thankful if this could be fixed (even one of these free [url=http://www.cacert.org/]CAcert[/url] certificates would be appreciated).