Whiskey != whisky.
Posts made by smxlong
-
RE: "We have never employed a developer I actually respected..."
I love hearing bosses badmouth their own employees. It's like calling yourself a retard. "Hey look everyone, I make awful hiring decisions and want this company to fail!"
-
RE: Missing the point
It is called the "for case antipattern", or at least some mild variation on it.
-
RE: Why should I close my HTML tags?
@Cassidy said:
@Quietust said:
What, Timecube?
Yesssssss! That's the fellah!
Thanks a lot -- the above link redirected to AdultFriendFinder.
-
RE: Electrify that server!
I thought carpet in the kitchen or the bathroom was weird. Carpet in the server room? Seriously, what was the reasoning there?
Since it's carpeted, the safest thing to do (static discharge-wise) is to walk barefoot. And besides, you should touch the rack before you touch the thingies in the rack.
-
RE: Your code is bad and you should feel bad
@configurator said:
@Evilweasil said:
You should have complained about the broken state of the code before you touched it.
Sorry, I should have elaborated. It's not about whether or not my code caused the issue or not. My problem is the attitude that if a bug reaches our QA team, someone must be blamed and berated for being a lousy developer and generally a bad person.
Who does the blaming and berating? If it's coming from QA, try saying this: "You're absolutely right. The company should fire all the developers and hire people who are competent. Then, we won't need to employ a QA team anymore."
-
RE: Why is source code stored as text?
You can store things as text.
Or, you can spend the rest of your productive life implementing an unending number of one-off dumper utilities to translate things to text so you can debug shit.
You decide.
-
RE: IDoNothing
@derari said:
@Cat said:
Attributes have a few advantages over marker interfaces.
Attributes are accessed via reflection, which is much slower than a simple instanceof check. Sometimes you need efficiency, not features.
A good example for a marker interface is Java's RandomAccess, btw.
If the relative efficiency between an instanceof and an attribute check actually matters, your design is stupid.
-
RE: IRA limits: contribute dsdsdsd this year!
@Cassidy said:
@RichP said:
So, I could spend several hours over several days every year or so re-installing Windows.
Or you could have imaged it once you'd got your system build complete and used that as a recovery image.
I've never really understood this "yearly reinstall" mentality. I have gamer friends that believe nuke-and-rebuilt cleans out accumulated cruft and returns them back to a faster-running OS; I simply perform regular housekeeping to keep mine clean.
When I bought my current home PC, I was averaging 35 MB/sec from the disk. After two years of use, that had dropped to 11 MB/sec, no matter which file was accessed or what the system load was. Defragmenting the drive did nothing to help this. Reformatting and reinstalling the system restored disk performance back to 35 MB/sec.
This is anecdotal, but I have experienced this at work and at home -- it seems to be triggered by writing a huge number of files (tens of thousands) into the same directory. Filesystem performance goes to shit after that and cannot be recovered. I don't know why.
Most people though do not write tens of thousands of files to a single directory (even in my case it usually isn't something I planned to do).
-
RE: Bit flagging right?
There are some issues but I'm not sure they are WTF-level.
If somebody wants to see if ANY logging is enabled, and does so by checking logLevel & LOG_ALL != 0, this will return true incorrectly if some garbage bit is set (i.e. the 64 bit, which isn't defined to have any meaning)
Chances are that in the past there was a LOG_XXX = 64, which was removed and LOG_ALL was not updated.
Despite the potential problem, I have seen this commonly and don't remember any particular issues caused by such a thing.
-
RE: Interview WTF
@morbiuswilters said:
@ubersoldat said:
On another occasion I went and they gave me a piece of paper, a pen and asked me to write some string handling code... I excused my self and left.
Yeah, what the fuck is up with the code-on-paper thing?? I've definitely encountered it in interviews before and I've always wondered how the leap in reasoning was made that having me write code on paper or whiteboard somehow makes sense.
I had to write whiteboard code four years ago during my last interview. It was a pretty simple function showing how to insert an item in sorted order into an already-sorted linked list. It's a nice little problem because it had an edge case that needs to be accounted for and it's short enough to not flow off the whiteboard.
After I was hired I ended up as a peer of the guy who gave me that interview question. I asked him why he did it, and he said that first, it weeds out the candidates who are straight up lying about being able to program (apparently it's not uncommon). Second, it is valuable to see their reactions. When presented with uncomfortable constraints, does the candidate become upset? Hostile? Does he turn around and call you a moron?
I asked him how many "points" he gave based on the CORRECTNESS of the code written by the candidate. He said it was the least important part of the evaluation. He then brought out a photograph of what I had written on the whiteboard the day I interviewed (scary that he still had this) and pointed out that my implementation in fact had a bug (it wasn't stable, i.e. it inserted new items before old items, not after them, which was a stipulation of the question). He said he had not noticed my mistake until after they'd hired me, and even if he had noticed it at the time it wouldn't have made any difference in his evaluation.
-
RE: Best or worst ever function name?
I once worked on a virtual printer driver called "Golden Jet."
Thinking on it now that project was full of terrible names. I was the culprit who named one of the classes 'CXDGJIPrintOEMUIMXDC.' It made sense at the time.
-
RE: What could possibly go wrong?
This requires a "notification service" between the web site and the user client. Who operates that service and how much does it cost? How will it be paid for? I know... spamvertisements.
-
RE: DPI, image size, cameras, websites, argh?
@morbiuswilters said:
So, to sum up this tiresome thread before I murder you all: smxlong is technically correct about DPI vs. resolution. However, in this particular case (and in most cases, because most people don't know jack shit about DPI vs. resolution) Charleh was correct because the image was going on the web (important context which he left out of the OP).
Since the beginning of my career the only fields I work in are image processing and print technologies. In those fields the term "DPI" is equivalent to "resolution" and the two are interchanged freely. It is a continuing source of befuddlement that laypersons insist on using the term "resolution" to mean "the width and height of something in pixels." When we in the field want to refer to that, we say "the width and height of something in pixels."
-
RE: DPI, image size, cameras, websites, argh?
Thanks for your incorrect assumptions on DPI and what it means. My favourite bit was where you said that changing the DPI of the image means resampling it.
An image has a true physical size given by its DPI. If you change the DPI without resampling, you are changing the physical size of the image. But you aren't being asked to change the physical size of the image, you are being asked to change its DPI. The only way that can be accomplished is to resample.
So when I print the same picture at 600 DPI (tiny) and 120 DPI (massive) using the windows printing wizard, does that mean my printer is resampling my image?
Yes. How else would the image become larger if all you've done is change a few values in the image header? The DPI of the printer is FIXED (it may have more than one possibility but it can't be set to just anything you please). The DPI of the image is not fixed. If the image is printing at different sizes then something somewhere is resampling the image. It could be the print app, it could be the driver, or it could be the printer itself which does it. But it happens somewhere. Printers do not work at arbitrary resolutions.
-
RE: Even more complicated way
Yo dawg, I heard you like databases, so I put a database in your database so you can query while you query.
-
RE: We'll need to refactor this later
@Watson said:
If refactoring breaks the external interface (including unit tests) then you're doing it wrong - the unit tests are there to verify that a refactoring didn't break anything.
Just finished a 3 day intensive course on TDD with Wirfs-Brock and Yoder. They'd call the above statement wrong. The tests are there to give you confidence when you refactor, but that doesn't mean you're not allowed to break the tests. The tests should not be allowed to shackle you to a bad design, that goes against their entire purpose. If you can't do a refactoring that everyone knows is necessary, because the tests are going to break, you're quite awesomely missed the point of having unit tests. Tests are just more code, sometimes they need to change when something else changes.
-
RE: DPI, image size, cameras, websites, argh?
Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of [i]dots per inch[/i]. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because [i]the DPI is correct[/i], vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.
When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.
-
RE: Profiling
Hierarchical bitmaps can get the time down to O(log N) with extremely small constant factors (only a dozen or so instructions required per allocation)
-
RE: Overheard at Work
@Sutherlands said:
Have you heard of UTF-8, UTF-16, or ISO 8859?
Clearly you've never worked with any of those encodings. They aren't fixed-width encodings. For in-memory manipulation of data I can hardly think of worse choices. If I say "write me a function that determines the length of a string," this is suddenly a monumental task. An operation like "give me the 17th character in the string" is a O(n) operation instead of O(1).
-
RE: Job posting buzzword generator
Sounds like they're looking for a Program Manager, i.e. a mid-level business type of role. Filled with buzzwords, yes, but not devoid of meaning. It's a complicated way of saying "We need somebody who can make shit happen."
-
RE: Communication
@fatbull said:
@snoofle said:
We have a generic auto-generated-do-not-modify warning, but apparently it's not enough and the suffix is required
I often mark auto-generated files as read-only (chmod -w or attrib +r).Put it in the filename as well: DefaultConfigs.txt --> DefaultConfigs-AUTOGENERATED.txt
-
RE: Someone may be a bit confused about what a system administrator does...
What a bunch of whiners. I've been asked to literally TAKE OUT THE TRASH before. Yes, my job included surprise janitorial duties.
-
RE: Sometimes I'm forced to agree with Blakey
How hard would it be to install a signal/exception handler, catch the crash, look to see if you're inside a plugin, pop a dialog saying "Plugin X is making your player unstable, would you like to restart the player and disable this plugin?"
If it crashes inside the player itself, possibly due to misbehavior of a plugin, assign the blame to any plugin which was loaded. Plugins accumulate blame to a certain point, then you offer to disable them. Hopefully you've QA'd your app well enough that if it crashes repeatedly it's not a bad bet some plugin is responsible.
-
RE: Useless code...
@blakeyrat said:
@Anonymouse said:
meant a 5+ second wait from clicking anywhere in the UI and the desired effect happening.This was Eclipse, by the way.
Yeah, but what did the conditional breakpoints have to do with anything?
You don't understand why having a conditional breakpoint in a hot spot might slow things down?
-
RE: Useless code...
In projects I've worked on, this sort of thing is usually seen when there used to be some other code there, which was removed at one point. Just imagine the piece of code which is no longer there, and it makes more sense.
The reason the code isn't restructured is usually "I'm nervous that I might be asked to put it back, and I don't want to confuse myself if that happens," which is admittedly a weak excuse but not a WTF.
-
RE: Change Manglement
So, you're blocked. It happens. It's not like somebody is going to die, is it?
-
RE: The Tests Need to Pass
It seems like the real problem is, developers want to make frequent check-ins, instead of a monolithic check-in at the end, which causes MAIN to frequently be broken. The solution is to let them work on branches, and don't hassle them about the status of their own branches. You're just responsible when MAIN breaks.
-
RE: Columny name
I'm feeling proud of my contribution to an Internet meme. I only started it, I didn't develop it, but I'm feeling proud of my contribution to an Internet meme.
-
RE: Nested Redundant try catch blocks
@Sunday Ironfoot said:
using(SqlDataReader reader = //Code to get DataReader)
{
// Some code here
return reader;
}
With this code, won't reader be Dispose'd before the caller gets the return value? This seems analogous to, in C++, returning a reference to a destructed object (i.e. a bad idea)
-
RE: Comment I left in the code today
@Sutherlands said:
@smxlong said:
?
2. It complains about what is there, without suggesting a better alternative."You don't need a second call to the database to get the schema because 1) you already have this information in all the .Net stuff with the first call and 2) it's not used anyway"
Seems pretty clear to me.
Suggesting an alternative involves a bit more than just saying "It can be done." I'm reminded of Q in ST:TNG, who, when asked to help solve the problem of a planet with a decaying orbit, suggested "Simply change the gravitational constant of the universe."
-
RE: Comment I left in the code today
This sort of ranting should be completely verboten in this industry.
1. It's unprofessional.
2. It complains about what is there, without suggesting a better alternative.
3. It gives management more of an excuse to ship more seats to countries where the workers don't bitch like this.And the big one, which I why we never hire people who say crap like this in interviews:
4. If your company is dumb enough to hire one incompetent programmer, it has probably hired many. You're probably one of them.
-
RE: High Five
@Sutherlands said:
Around here, we get up to 10% of our salary as a bonus, distributed over 4 quarters
We had bonuses of around 10%, but a few years ago they stopped paying them and instead gave everyone in the company a 10% raise. Plus side, you don't have to worry if this year will be the year they don't give it out anymore. Minus side, you don't get that psychological effect of a nice blast of money right at the end of the year. I'm sure there's some "evil empire" side to it as well, but it doesn't bother me.
-
RE: High Five
Wow. Around here, we get the whole company in the big room and the managers take turns calling some, or all, of their reports in front of the entire company -- manager then expounds said person's value to the company, with a relevant anecdote usually accompanied with a joke, then hands the person a folder containing a certificate also detailing said accomplishments, along with some nominally valued gift card (usually around $100). Applause follows. Sometimes you get two or three of these in one day, this gets you a very fancy dinner out with the spouse or whatever else you want.
Employees who generate patents get brass plaques, we all refer to these as "pizza boxes" because they hand them out in the cardboard box they get shipped in, which looks exactly like a pizza box.
I try to work at places that don't suck.
-
RE: As seen on ServerFault.com
@RHuckster said:
@smxlong said:
Doesn't sound like an idiot or a criminal to me, just a good auditor.
- Please turn over all your sensitive information to me, some outside idiot.
- (Customer complies)
- Congratulations, you have failed your audit. You are vulnerable to social engineering. Please cut the check for an even $75k.
So he'll keep that facade up to the point the client cancels their account with them and then reports them to the PCI SSC? Yeah, he's a great auditor.
Reported for what, trying to trick them into committing a violation and them falling for it? That sounds like the definition of an auditor's job. Honestly not familiar with PCI, except that it's widely required, but I'd be surprised if an auditor was forbidden from such tactics. What's the point of system security when any idiot with an air of authority can just ask for shit and have it handed over? It'd be great if every company was put to such a test. I bet most of them would fail.
-
RE: As seen on ServerFault.com
Doesn't sound like an idiot or a criminal to me, just a good auditor.
- Please turn over all your sensitive information to me, some outside idiot.
- (Customer complies)
- Congratulations, you have failed your audit. You are vulnerable to social engineering. Please cut the check for an even $75k.
-
RE: Seen in our codebase...
I don't get it. One of the hallmarks of experience is coding in flexibility in areas where you're probably going to need it. Another hallmark is making a clear separation between unrelated things. In this case, the unrelated things are: 1) the numeric quantity and 2) the funky symbol we stick on the front of that quantity when we write it down.
What happens when some doofus manager comes along and decrees "No longer shall we print $100, we shall print USD 100. In fact, everywhere we used to print $, we shall print USD." The programmer who has implemented the code this way has no problem doing that. The programmer who thought building in some flexibility at an obvious point was a bad idea, will suffer.
The WTFs on this site just get weaker and weaker every time...
-
RE: Useful constants
@delta534 said:
The issue of the differing file separators. This code is completely redundant since windows does recognize '/' as a valid file separator.
Windows does. However, bajillions of other things don't. If you're generating paths as output and feeding these to some tool which does something with them, and that tool barfs when it sees slashes instead of backslashes, then it's not relevant what Windows can and cannot handle.
-
RE: Count 'em up
@Xyro said:
@zzo38 said:
@AndyCanfield said:
This arises in the Bible, Old Testament, 2 Chronicles 4:2, where the circular "sea" has a circumference of 30 cubits and a diameter of 10 cubits. Of course that doesn't mean that PI was 3.00000 (which would require major gravitional curvature), but that the cubit measurement itself has a plus or minus one slop factor.
Maybe it isn't circular. Anyways, the value of pi is always the same, regardless of curvature or anything else. Pi isn't only for circles. The circumference of a circle is one thing where the value of pi is used.
It wouldn't change the value of pi, but sufficiently noneuclidean geodesics would change the measurements of the objects such that ratio of the measured circumference to the measured diameter would not be 3.14159265etc. ... Also, were they measuring the outer diameter or the inner diameter?If you measure the circumference of a circle and divide by the diameter and you don't get pi, it doesn't mean pi has changed, it means space must be curved. The constancy of pi is the whole reason you can say that.
-
RE: Useful constants
Compare with this, which I've seen used in many codebases:
[code]
#if OSENV == UNIX
const char slash = "/";
#else / Windows */
const char *slash = "\\";
#endif
[/code]Makes a lot more sense when you realize the thing might change. There's maybe a little bit of WTF here in that COLON and COMMA would probably be better named "SEPARATOR_1" and "SEPARATOR_2" but oh well.
-
RE: Count 'em up
@intertravel said:
@dogbrags said:
(I got into trouble with this all the time in MIDDLE SCHOOL -- measuring a value then putting it down on paper with more precision than I measured -- measuring 11 inches on a ruler, then specifying it as 11.0000 inches. )
I should probably get therapy, because it makes my head explode every time I see newspaper write something like "... 20 miles (32.18688 km) ..." -- if the original measurement was approximated to 1sf, the converted figure should be as well. It's actually less accurate, because it implies an erroneous level of precision.The problem is really a psychological one. The conversion between miles and kilometers is exact, and 20 miles is indeed the same as 32.18688 kilometers. But when a human being [i]sees[/i] a nice round number like 20, he or she normally assumes that there is a certain natural amount of "slop" to it (technically, error, but one doesn't have to know the term to get a feel for it). One assumes that the reason the guy stopped writing down digits is because he became unsure of their values after that point. So it's completely fine to say that 20 miles equals 32.18688 kilometers [i]so long as you keep in mind some natural amount of "slop"[/i] in the measurement. Because most people are unable to remember that consistently, we make up a rule that we keep the same number of digits as we had before the conversion.
But this isn't a law of nature, and it's only a [i]rough[/i] rule in the first place. For instance, a transformation of a quantity that isn't linear, such as taking the log or squaring it, [i]compresses[/i] some ranges of values and [i]stretches[/i] some other ranges of values. To get a true idea of how the error propagates, we need to use calculus, but for common phenomena over small ranges the linear approximation is good enough and the "significant figures" method works quite well.
-
RE: (un)descriptive variable naming
zzz and iiii are kind of dumb. The rest of it looks fine.
-
RE: Unterminated string
@Tessellated Cheese said:
@rudraigh said:
Original developers, a pack of rather swarthy fellows with strange names
I do believe we've found your problem.The problem is racism, right?
-
RE: Why yes, yes I am.
@dogbrags said:
Normally, you catch exceptions for one of two reasons;
1) logging the exception at the point of occurrance; and then you propigate it (rethrow it) so that the correct handler further up the chain can handle it
2) if you can handle the exception at that point and recover from the error
If you can't do either one, then there is no point in catching it. So don't bother; assume that somewhere up the chain is a handler for it. For out of memory exception, it's likely that the program can't continue anyway.
- You want to stick a breakpoint there sometimes.
-
RE: But we don't want to automate it
So, management has ordered that the tests be automated, and your team lead has disobeyed? Sounds like a simple matter of having your team lead removed and replaced with somebody willing to do what they're told.
Also, IT in charge of development? Really?
-
RE: From the washing machine's instruction manual
Extension chord? Extension chord!
-
RE: Still not sure if this is the worst code we have (but it is a good candidate)
Other than some weird formatting with multiple statements per line (which can be okay in some cases, maybe not this one), and a goto that could probably be eliminated with five minutes of thought, what's the big deal? If this is the worst you've got then you're in good shape.