@morbiuswilters said:
ITT: Hijackers hijack a hijacked thread by talking about hijacking.Hi, Jack!
@morbiuswilters said:
ITT: Hijackers hijack a hijacked thread by talking about hijacking.Hi, Jack!
@boomzilla said:
@Severity One said:You mean, someone like a lowly IT specialist, such as the OP?@SEMI-HYBRID code said:And for these people, Word is one of a few of their BASIC tools, they spend anywhere between 20 and 60% of their time in it, yet they don't have an idea of how to use the most basic functions, AND YET, they can get away with saying they're qualified for their job.Well, you could have your legal documents drafted by a secretary instead of a lawyer, but I'd advise against it.
It's the same reason why they don't (or shouldn't) let developers talk to customers.
Your thought process seems backwards. Obviously, the lawyer's job is to create the content of the document, but shouldn't you use a lower cost source of labor (e.g., a secretary) to handle the formatting and junk?
I remember a former neighbor of mine who bought a computer "to manage his letters", as he said. When, one day, he showed me his computer to fix some unrelated problem, I noticed what his letter management consisted of: He wrote his letters by hand on letterhead paper, then used a scanner to digitize them (into .jpgs, of course), and them sorted his letter-scans into folders on the desktop. When I asked him about the usefulness of his proceedings, he said, this way he still had an archive of his letters in case they burnt down in a fire.
Then I proceeded to suggest he could also use the computer to *type* the letters, instead of *scan* the hand-written letters. I was met with a blank stare.
@delta534 said:
The only real reason I can see allowing the Console class in a DLL is because the only way to get stdout, stderr, and stdin is through the Console class.As far as I'm concerned, the only good solution to this issue is not to use Console directly from inside DLL code, but to pass in the stdout, stderr and/or stdin streams as parameters to the corresponding DLL methods that need to write stuff to some output device. Then it is the callers job to make sure an output device is available and initialized as needed. And whether that is a Console window or a log file, then, doesn't matter in the slightest way. The DLL should not rely on the operating system to do stuff like this for it. I completely support blakeyrat in his position.
@Douglasac said:
@this_code_sucks said:But what do I say to those Mac enthusiasts that I have to work with who got a Windows laptop like everybody else, but who then proceeded to complain to their boss until he orders them a Mac and now the Windows laptop just lies in a corner and they keep lamenting to us others about how much Windows sucks and how they would never touch that other laptop with a ten foot pole. Windows is so unintuitive and their Mac is so much better. I'd really like to shove them their Mac up where it's dark.How can that be true? You really think a company could stay in business based on clever marketing and a gulable sub-populace even if they lack a competetive product?Well, considering after every time I've used an Apple product, I've come away thinking "What kind of masochistic idiot would want to use this crap?", I would say it's far to assume that I at the very least think this. OS X rarely behaves in a sane and logical manner, the iPhone is a fragile piece of crap, the iPad is a giant iPhone, iOS is limited and also rarely makes sense (random example: the weather app icon always implies that it's 73oC and sunny, yet the Calendar icon always shows today's date), and so on.
@JoeCool said:
I once worked with a guy who got filthier as the week went by, but was clean every Monday. I'm guessing he showered every Sunday night whether he needed it or not.He did need it. No doubt about that.
@ubersoldat said:
heeheeFor the first time in my life I agree with MS on something... block XML out, you'll live a happier life.
Mandatory hint: But only XML is enterprisey enough!
or: if your problem is too complex, add XML
@JimLahey said:
The "and the quality is good" is the key here. Without code reviews, nobody knows what the quality actually is. If he really wants quality, he needs to do code reviews to find out. If he doesn't want the juniors to feel bad about their work, then just do the code reviews all alone in your little room -- and maybe create a quality statistics to show your boss where the quality standards are (not)."We don't do code reviews" said my new boss when I started. "We've got developers of very mixed abilities here and I don't want the juniors to feel bad about their work. I don't particularly mind how people do their work as long as it gets done and the quality is good".
Well, according to Wikipedia, MFT solves real problems (as has been mentionned in another comment) and, as such, is far from being a WTF. Organizations may implement it in a WTF-y way, though. I have personally implemented and maintained (as part of a team) Java middleware software that used Connect Direct to transfer files between various heterogeneous computers (among which were z/OS mainframes, Solaris, AIX, Novell, Windows boxes). Connect Direct, being a complex software and thus unavoidably having its own set of WTFs, did help solve the communication problems nicely.
So, if you could give us more context, we might be in a better position to judge whether your particular environment is a WTF or not.
@morbiuswilters said:
@da Doctah said:Me too. I even painted entity-relationship models with it - and liked it (but maybe I am simply a masochist...)I used Visio once.
It made me want to rape and kill.
I don't know about programming against its API, but I've used Visio quite a bit (as well as many other graphing and modeling tools) and I've found it to be the best, by far.
This is obviously an object-centric paradigm where methods are conceptually invoked BY an object, not ON them. getID() doesn't mean that you, the consumer are getting the ID, it means that the object itself is getting the ID from your property store.TRWTF is that the caller needs to provide the properties to the method as a parameter. This means that the caller already knows all those properties and could do the ID extraction itself. Instead, the getId-method should be called without a parameter, knowing implicitly where the properties in question are stored, such as in some global variable that is lazily initialized as needed. This way, there is no need for the caller to bother about them properties, and the getId() method can "magically" produce that number. Don't we all love magic?
@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.
@morbiuswilters said:
Wait.. you're doing VoIP over dialup on a fax line? That.. seems WTFy.Ahem, things are a bit more complicated than that. And I'm not sure if you really care. But just in case: A friend of mine, living in germany, has a phone company who provides internet and two landline numbers for him, one intended as a regular land line and listed in the phone directory, the other intended to be used for telefax, but that number is not currently listed. Both are implemented not as actual landlines, but as VoIP instead. My friend doesn't use his second number for anything so he gave it to me to use it where I live, in Switzerland. I have it therefore configured on my VoIP box. Now our "international" calls are completely free.
But he is the only person to know about and call that number. That is why all other calls to that number must be illegal advertisement calls.
I was puzzled, though, how any call center could know about and call that number. So, I asked one of those unsolicited callers. And the reply was that they didn't dial numbers from the phone directory, but that instead they had a dialling computer who dialled random numbers until someone would pick up the calls. That is how they get to call unlisted numbers. Wow! Now, if *that* isn't illegal, I don't know what is!
I don't know how we got from bad-newsletter-management to telephone-abuse, but my contribution to the latter is this: I recently began to receive numerous unsolicited advertisement calls on my unlisted fax number, that I currently don't use for faxing but rather only for international VoIP calls. But anyway, nobody "officially" knows that number, and therefore, any advertisement call on that number must be illegal. I installed an answering machine message that goes something like this: "Hello. The fact that you are calling this unlisted number probably indicates an illegal advertisement call. Please provide your name and the name and address of your employer after the beep, so I can sue you". I very rarely get calls on that number now...
This seems to be a recurring pattern. When one of my users complained about not enough space on her limited exchange mailbox, I went over to her and proceeded to right click her Deleted Items folder. When I was about to click "Empty Deleted Items folder", she shouted "What are you doing! This is my archive of important stuff!". I gave her a blank stare, and then proceeded to explain that that is not how the system is supposed to be used. She preferred to delete other stuff instead and kept using her "archive folder" the way she always did for at least another three years.WTF!!!
So, you see, you are not the only one.
@TGV said:
Special advantage: The storage capacity of /dev/null is huge! No need to keep buying bigger hard disks.@pkmnfrk said:
Other places to store mission-critical documents:
- Z:\\temp
- 3.5" floppies
- Recycle bin
- unsaved documents open in your favourite document editor
- \\qa01\ciserver\data
Special hot tip for Linux users: try /dev/null. It's super safe!
@KattMan said:
They got where they are by having a kick ass marketing team.Well, they convinced most of the graphic design folks out there. Now the rest of us have to cope with those graphic designers. Sigh.
Oh, so "downloading" really means "having a new certificate created for the IP address of the current client on-the-fly and download it, overwriting any pre-existing certificate"?
I don't understand. Why would their testing (i.e. downloading and installing) invalidate the certificates? Or making it impossible for you to do the same?
@Anketam said:
Why, just restore the deleted debug built dll of project A from backup and you're back in business. We'll take care of the circular reference problem later, once we have time for such nice-to-have improvements.I encountered a fun dependency issue once when I tried to do a rebuild all on a coworker's solution and it did not work. Upon investigation I found project A depedent on project B, project B dependent on project C, and project C dependent on the debug built dll of project A. Rebuild all wiped out debug built dll of project A and thus caused a chain reaction of dependency failures. When I tried to explain to him the issue, it took far too long for him to understand why it was wrong.
@token_woman said:
Reminds me of this conversation I had a few years ago. Standard count-the-WTFs territory:Wow! I'm in awe!
Boss: What are you up to?
Me: Just fixing the deb packages we use to install our software. They had no dependencies defined, despite having many actual dependencies. So I'm putting them in.
Boss: No! No! Don't do that! Never do that!
Me: Why not?
Boss: Because I had a terrible experience with that, once. Customer had a problem, so I logged on and did a few things to try and fix it, including uninstalling package X that our package depended on. So I did and Boom! Out went ours with it.
Me: Erm ... it must have warned you ...?
Boss: Do you think we have time to READ what spews out of the terminal? Sheesh! Job to do, anyone?
Me: OK, well, it can't have been the end of the world. So you just reinstalled it, right?
Boss: Reinst- ... what? No, I couldn't just "re-install" it. I'd lost all the code I'd written on there - all the edits I'd made, over the years, to the files contained in the package.
Me: Oh.
Although I've been there before. But it was my home server only, and it concerned some open source LCD display driver software package. And I didn't know my ass from my elbow at the time. The experience helped to distinguish, though.
@morbiuswilters said:
Exactly; 99% of developers should not have access to production.I'll raise that to 100%. It is not the task of a developer to push anything to production. There should be unit testing / integration testing / acceptance testing / management decision / operations personnel (you know the whole story). Otherwise, chaos ensues. Well, maybe for very small shops with less than a dozen employees.
You are assuming that the guy knew that NULL was an acceptable value in the database. He probably thought that the corresponding column is defined as NOT NULL, in which case his code is perfectly valid for caching that data.
Otherwise, yeah, statusWasRetrieved is definitely helpful.
@pkmnfrk said:
But then you won't break out automatically after a second if the "mutex" hasn't released yet.Oh! I didn't realize that. Thanks for filling me in.
Come to think of it, users must really enjoy the fact that web requests never take longer than one second. Or that they start to fail in strange ways if they take longer than that.
@SandGroper said:
int i = 0; while (request) { Thread.Sleep(100); i++;if (i > 10) break; }</pre></blockquote> But why the complicated wait? A much simpler waiting loop would have sufficed.
while (request) { Thread.Sleep(100); }I only hope the request variable was defined as volatile, or else the wait would be forever. At least in Java. Don't know how C# would handle this.
But, yeah, I find it fascinating how a multi-user system is serialized to a crawl. Gives me ideas.
@TheCPUWizard said:
However when a mistake is found at any point in the chain, my first step is to always add a unit test that catches this mistake (before making any changes to the codebase). The development of this test quite often reveals other conditions which could leat to other issues, and those tests are added also.Please, can I marry you and bear your children?
I mean, aren't you two fighting at too high a level here? Programming needs to be done with a brain, not with implementing the latest fad. And how can development be done any better than with what you describe (write a test that catches a bug before tackling the bug itself)?
@morbiuswilters said:
I'm sick of this fucking industry. I'm going to switch to a field where "engineering" doesn't mean "I saw some guy talk about it once at a conference and now I just do it blindly, ad nauseum, until the next fad catches on."Please, can I marry you and bear your children?
Oh yes, I once noticed too that USB plugs do fit in the Ethernet socket. I situation just waiting for misunderstandings like this to happen.
The missing power *is* something even a manger should be able to solve, though. Alas...
@mott555 said:
Where exactly does that code register event handlers? I'd be very curious to know.It registers handlers for the events every time the loop runs. Assuming this is C#, then you'll have the same handler registered to the same event many times and it will only go up each time the loop runs. Eventually, when the event happens the handler will run thousands of times sequentially.
@airdrik said:
@Thuktun said:When having to deal with exceptions, I tend to want to throw up... throw "it" up the stack :-)@TheRider said:That's not as much of a WTF as you suggest. If that's the logging framework you're stuck with using and you really need it to log a stack trace, then that's how you'd need to do it.WTF 3: Creating an exception for the purpose of logging it, not throwing it. Well, the Logger doesn't have an error-method without an exception-parameter. Therefore, one must be created, obviously!
Except that there is no stack trace because the exception didn't get thrown up the stack (or the stack trace only has one item which is the point where the exception was created which is no more helpful than the logged error message). The only reason for creating the exception is because log.error only has one override and that is the version that takes a String (the message) and an exception (and considering everything else here will probably throw an NPE if you try to just pass null for the exception)
@morbiuswilters said:
@airdrik said:Isn't that what the fillInStackTrace() method is for? But, I must confess, I never really understood the real purpose and use of that method.Except that there is no stack trace because the exception didn't get thrown up the stack (or the stack trace only has one item which is the point where the exception was created which is no more helpful than the logged error message).Bwahahaha!! Where do you people get this shit from??
Found this in the code base I am currently working on. Enjoy:
The field:
private boolean checkFileOnServer = true;
The initialisation:
private void readProperties(Config config) { ... if (!config.getProperty("CHECKFILEONSERVER").equalsIgnoreCase("")) { String checkFile = config.getProperty("CHECKFILEONSERVER"); checkFileOnServer = checkFile.equalsIgnoreCase("true"); } ... }
WTF 1: equalsIgnoreCase() with an empty String
WTF 2: Ignoring the method Boolean.valueOf(...)
The application:
if (client.checkFile(fileToReceive)) { logger.info("the file " + fileToReceive + " is on the server"); } else { final XYZException ex = new XYZException("The File " + fileToReceive + " was not found on the server !"); logger.error(transferType + ", File not found on Server", ex); } final byte[] fileData = client.retrieveFile(slog, fileToReceive); ByteArrayInputStream bIn = new ByteArrayInputStream(fileData);
WTF 3: Creating an exception for the purpose of logging it, not throwing it. Well, the Logger doesn't have an error-method without an exception-parameter. Therefore, one must be created, obviously!
WTF 4: Even if the file wasn't found, it is still retrieved. This is called optimism, a trait that I am sometimes missing.
WTF 5: Important to know: Creating a ByteArrayInputStream with a null parameter leads to a NullPointerException.
The implementation, part 1:
public boolean checkFile(final String remoteFileName) { try { if (checkFileOnServer) { Vector files = sftpChannel.ls(remoteFileName); if (files.size() > 0) { return true; } else { return false; } } else { return true; } } catch (SftpException e) { // do nothing } return false; }
WTF 6: if checkFileOnServer=false, then checkFileOnServer() returns true
WTF 7: Exceptions are ignored
WTF 8: Using Vector when that class has been replaced with List/ArrayList for almost a decade.
The implementation, part 2:
public byte[] retrieveFile(final LogSession slog, final String fileToReceive) throws LoggerExcpetion { if (sftpChannel.isConnected() && checkFile(fileToReceive)) { try { ByteArrayOutputStream bOut = null; BufferedOutputStream bfOut = null; try { bOut = new ByteArrayOutputStream(); bfOut = new BufferedOutputStream(bOut); sftpChannel.get(fileToReceive, bfOut); bfOut.flush(); bfOut.close(); bOut.flush(); bOut.close(); byte[] retrievedFile = bOut.toByteArray(); if (slog != null) { log.info(slog, "file " + fileToReceive + " successfully retrieved"); } return retrievedFile; } catch (Exception ex) { disconnect(); } } catch (Exception ex) { // do nothing } } return null; }
WTF 9: We are only logging when successful! Jippie! The developer may have thought like this: The Logger may throw an exception, therefore we only risk logging if all else went well. Otherwise, we might destroy our potentially good case. Or you pass slog==null, then that danger is averted as well.
WTF 10: If the file does not exist and checkFileOnServer=false, this results in an NullPointerException
WTF 11: If the file does not exist and checkFileOnServer=true, there will also be a NullPointerException. But the Log says, the file exists.
WTF 12: If retrieveFile() results in an Exception, another NPE results, but one doesn't know what the reason is, because exceptions are being swallowed.
WTF 13: If all is well, the Logger may throw an exception and fuck it all up.
What would we call this pattern? The unconditional checkfile exception condition idiom?
@lolwtf said:
@snoofle said:I am also wondering how many records "1BB records" is. One ByteyByte? One Billion Bytes? One BiByte? One Baby-Baby? One Whatever?So, over 443 records? Oddly specific choice of number.has over 1BB records in the table.
@barrabus said:
@Jaime said:I think you a verb there!BTW, you'll never guess what "vaginal simulator" would be used for.I heard about this guy who had one of those before, he accidentally the whole thing!
@db2 said:
^^ This!How to fix dialog box banner blindness:
"The filename you have selected already exists. If you wish to overwrite the existing file, type the fifteenth word in this paragraph. If you wish to cancel and select a different filename, type the seventh word in this paragraph."
Typing anything else will, naturally, play pornographic audio very loudly.
@Cassidy said:
It looks like I am going to be a "dev-t", as it is called. That means I am a developer focusing on building testing tools and frameworks for continuous integration, unit and integration tests. The intention is to exhibit as many software weaknesses as can be detected by automated tests. So that the formal testers, which are actually just manual testers clicking around on the UI, will have a less difficult job. I am actually looking forward to this because I have been doing lots of JUnit tests on unit/integration/simulation test levels (where the latter means that systems external to the software under test are being simulated or emulated instead of actually available due to cost issues) and I think I can be coaching the "real" devs a lot by doing this.Discuss.
@pygorex said:
an instant CLASIC!<!--THIS SCRIPT CHECKS THE MONTH AND TRIGGERS THE [b]CLASES[/b] ACCORDINGLY-->
@galgorah said:
A DBA at a former workplace (at a major bank) was just like that. He really had the DB2 database under control, and he was a great help for us developers to improve our SQL if it didn't perform. He questioned our table designs, but he accepted good reasoning on our part. He didn't like denormalized designs, but would accept them if performance dictated them.@erikal said:
I am the eternal possum. And I can assure that while certainly elusive, I definitely exist@galgorah said:
erikal: I'm a devloper and a dba. As DBAs we do need to understand at a deep level how the schema effects performance. We also need to understand SQL code at a deep level. Your SQL actually has an impact on the performance of the server as a whole. I spend a lot of time showing developers how to write and maintain efficient code, how to analyze an execution plan, etc. Sounds like Snoofle's dbas Don't really understand things. Unfortunately many dbas don't truly understand normalization and go way out into left field, like in this case! A good dba is 50% sysadmin and 50% developer. I find myself as a dba often querying the dmv's to gather permance metrics and to troubleshoot memory, io, and cpu issues.
You describe the ideal DBA/database driven application developer here. You do not exist, so what are you? Alien?
Several times I send him a query asking him if he could improve its performance. He usually responded within hours with better formulated statements or suggestions for improved indexes that would improve performance by factors of 100.
It was a pleasure to work with him. I still miss him. Ahhh! Good times! I would still marry him anytime... :-)
@Zemm said:
Who is Shirley?I'm about to change to a $1/month plan for my netbook, Shirley it can't be more expensive in the USA for mobile data!?
@AndyCanfield said:
What AndyCanfield is saying.I quibble with your use of the phrase "independent of time zone". Indeed, your explanation refers to "1970-01-01T00:00:00+0000". That's GMT at the tail end there, that "+0000". A 'now' Unix timestamp may be the same all over the world (independent of time zone) because they all are dependent on the same time zone (GMT).
In the bug I had, I called mktime( 0, 0, 0, ThisMonth, ThisDay, ThisYear ) and was surprised to get an integer which was not a multiple of 86400. The remainder, when divided by 86400, gave me 17 hours, which is 24 - 7, and I recognized that 7 hours East of GMT is my time zone (ICT). That's when I realized my error.What I was incorrectly expecting was the number of seconds since 1970-01-01T00:00:00 ICT.
I had to change to gmmktime. In effect I am lying to gmmktime telling it that ThisMonth, ThisDay, and ThisYear are GMT, when in fact they are not, they are ICT. Then I keep subtracting 86400 until I get a Monday. The whole purpose was to find out the date of the most recent Monday.
The first line of my post was that all timestamps should have time zone in them. You mention "number of seconds since 1970-01-01T00:00:00+0000". There you have one; a timestamp with a time zone in it ("+0000"). Timestamps without an explicit time zone lead to confusion.
Well, calculations involving time and timezones are, in fact, very nasty.
I just recently realized that the result of executing the following SQL statement on an oracle database depends on what timezone your client software runs in:
select * from SOME_TABLE where CREATED_AT < systimestamp
where CREATED_AT is defined as a TIMESTAMP data type. The reason is that SYSTIMESTAMP is not of type TIMESTAMP (which is defined as containing date-and-time), but rather of type TIMESTAMPTZ (which is defined as a date-and-time-and-timezone), and the statement execution parser implicitly coerces these two data types to the more specific one (TIMESTAMPTZ), and, to that purpose, converts the CREATED_AT field to a TIMESTAMPTZ using the timezone of the client session.
That behavior was rather unexpected, and it cost me a few days of debugging and searching and RTFM to figure that out.
My corollary is that type TIMESTAMP should never be used, or you need to make sure that all timestamps are stored in UTC, so you can convert that easily to any other timezone. I figure it is much easier to always use TIMESTAMPTZ -- then you at least know what timezone you are talking about.
@deathy said:
Can I have your babies?My fix...
...awesome course of action of original poster
I don't think I ever had a project fully specified at startup time. We were lucky if the vague requirements were replaced with precise ones half-way through. I think that is the exact reason why waterfall projects are doomed from the start, and why they invented agile processes to be able to cope with "moving targets".
...and why does a logger need to have an asynchronous database thread?
@Daid said:
@zelmak said:Not quite. The classpath tells the class loader where it might find the compiled code for any class it should load. Classloaders are more used to group classes and also to permit unloading of classes if they are no longer used.Aren't classloaders designed to get around that? (I'm not a Java guy)point the classpath to that directory (or write a script that generates appropriate classpath based on the content of the directory)
@Anonymouse said:
/me starts a slow clap@Zemm said:
I'm a fan of coitus.Coitus ergo sum?
As far as I know, and as far as politician's promises are concerned, they are always void after the election.
@pjt33 said:
@Weng said:This is great. But can you do the same thing for Folders instead of Database Tables?!?Hell, AFAIK it's a royal pain in SQL Server. I did it once. It was a NIGHTMARE.Did this not long ago.CREATE VIEW [dbo].[V_FooHierarchyAscending] AS -- The query optimiser should be able to do a good job with this if you join against DescendantId WITH FooHierarchy AS ( SELECT Foo.Id AS AncestorId, Foo.Id AS DescendantId, 0 AS Separation FROM FooUNION ALL SELECT Foo.ParentId AS AncestorId, H.DescendantId, H.Separation + 1 FROM FooHierarchy H INNER JOIN Foo ON Foo.Id = H.AncestorId ) SELECT * FROM FooHierarchy
GO
@El_Heffe said:
I'd prefer a groundhog pillow.@RichP said:
A woodchuck pillow on alot of mattresses.@serguey123 said:
@Xyro said:
@Justice said:@serguey123 said:With my alot of sleep.@blakeyrat said:Loudly!@boomzilla said:Soundly?@cconroy said:How do you people sleep at night.@Justice said:I don't know, but I maybe the woodchuck knows.@Xyro said:How many alots are considered a lot of alots?@DCRoss said:This is alot. It's not a lot, but it is alot.@aliquot said:I've seen this alot, but not that one.Yeah, I see that alot.I see the alot too.and a woodchuck pillow?
Woodchuck pillow, but it's soft, and wouldn't have much impact, so I won't.