|
Easy, you just ask each of them to step on the scale.
He said, "Boy I'm just old and lonely,
But thank you for your concern,
Here's wishing you a Happy New Year."
I wished him one back in return.
|
|
|
|
|
Our low-level embedded communication servers use a .INI file for configurable parameters. There is a [send] section, and a [receive] section. The [send] section contains an aptly named SendRetryCount parameter. In one of the drivers, we also need a ReceiveRetryCount parameter. Guess where the programmer chose to place it. If your bet was the [receive] section, you lose. It is of course in the [send] section...
-- Quidquid latine dictum sit, altum sonatur.
http://streambolics.flimbase.com
S. L.
|
|
|
|
|
probably wasn't sure if he was coming or going?
|
|
|
|
|
Clearly the programmer was highly organized and wanted to keep all the RetryCount parameters in the same place
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
WilliamSauron wrote: If your bet was the [receive] section, you lose. It is of course in the [send] section...
Might be he was doing a mirror-coding.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing
select getdate() from sysobjects where id=1
simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
|
|
|
|
|
nasty! did the original programmer not realise that select getdate() would work too?
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
Looks kinda Oracle-ish -- it could be Oracle ported to SQL Server... badly.
I worked for a company that had always used Oracle (on OpenVMS), but one customer wanted SQL Server (6) (on WinNT) so a bunch of PowerBuilder idiots were brought in to write some of the worst code I've ever seen. Data access in the UI?!
|
|
|
|
|
The wonderful thing about standards is that there are so many of them. If I recall, I create a variable (in vb.net) with the name of the SQL get-date function, and then I use that. I forget how I set it, but it was something pretty clunky like "If database type looks like SQL Server, set it to GETDATE() otherwise set to NOW()".
|
|
|
|
|
Hello,
How to get miliseconds form MS SQL Server using ADO and C++ ?
COleDateTime doesn't support miliseconds ...
Best Regards,
Irek
|
|
|
|
|
You can do it sql by using 'DatePart(ms,<dbColumnTime>)' function
|
|
|
|
|
--You can use 'set' instead of 'select'
declare @t as DateTime
set @t = getUtcDate()
-- Testing--
print @t
print DatePart(hh,@t)
print DatePart(mm,@t)
print DatePart(ss,@t)
print DatePart(ms,@t)
|
|
|
|
|
If I remember right, I think Oracle programmers had to do something like SELECT "Hello World" FROM DUAL because it wouldn't allow a SELECT without a FROM.
Could be a recent convert.
|
|
|
|
|
You do remember right, and I was trying to forget.
|
|
|
|
|
Was just asked to convert some VB6 code to C#.
The purpose of the code is to find anagrams. There is a database with a list of words. The input is a string of letters and the code is supposed to spit out any matching anagrams found in the word list.
The idea is to have a 'crossword puzzle' helper tool that can be downloaded from an ad-financed puzzle enthusiasts website, but the client felt it was too slow to use and wondered if C# might be faster.
This is what I found: All possible orders of letters in the input string are derived in a loop, then each one is searched against the database to see if it exists. As you might imagine, with anything except a very short input this yields gazzilions of combinations and takes forever (almost literally) to run.
The first thing I did was a run-once bit of code to sort the letters in each word in the database into alphabetical order, and stick that in as a key field.
To find an anagram, the letters in the input are also sorted into alphabetical order. We then match that to the indexed key field and pull out matching words in the blink of an eye.
The end result runs in milliseconds instead of centuries. Or as the client put it "That C#'s a bit faster than VB6, isn't it?"
Should I now point out that a downloadable C# app is not a good idea? Their user base (presumably little old ladies) would need the net framework on their Win98 PCs, and having downloaded once, they don't need to go back to click on the knitting pattern banner ads. It should run in a browser.
But what do I know? I'm just a stupid girl.
JustAStupidGurl
|
|
|
|
|
Very amuzing
The old algorithm does not hold into account possible typo's. Maybe it can be adapted to also check for every possible combination of 3 wrong characters in each word
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
Or make the input several MB.
It could then produce every possible C# source code file, not to mention every possible poem of that size.
Bound to be a few good ones
JustAStupidGurl
|
|
|
|
|
lol!
Mind if I put that in my collection of epic quotes?
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
|
? You seem reasonably intelligent to me... or was it tongue-in-cheek?
|
|
|
|
|
Please adjust your sarcasm detector
|
|
|
|
|
What do you think?
But then I'm JustAStupidGirl, so you never know.
JustAStupidGurl
|
|
|
|
|
The impressiveness of (for example) a 87,178,291,200-element search space for 14-letter anagrams should have gotten the original author to use less permissiveness in choosing an algorithm. If he could miss such an obvious rectification for the problem, he doesn't deserve to earn any kind of certification in software development.
|
|
|
|
|
JustAStupidGurl
|
|
|
|
|
*Stab*
|
|
|
|