|
Not quite profanity but ...
Many, many years ago in a far off galaxy ... I had the displeasure of having to work with a code pre-processor that had some irritating "features".
As an expedient solution to some of those features, I inserted a blank line at the top of a key header file to prevent all sorts of errors. Certain colleagues insisted on "tidying up" this blank line, meaning that errors kept coming back ...
My solution: I inserted a comment below that blank line "If you delete the blank line above I will find you, where ever you are, and break your fingers one by one".
It clearly worked. I even got a phone call several years later (having moved on) asking if it was one of my comments ... and did it still stand!
|
|
|
|
|
I have on occaision used a variable called "Count", but as I was typing - missed out the e "o". Oops.
Usually managed to correct it before commiting the change.
____-=< |>@\/ø!c| >=-____
`````````_`````_`````````
```````o/ \^w^/ \o```````
``````````(o o)``````````
------ooO--(_)--Ooo------
I'm not a complete idiot;
bits of me are missing.
-><-
|
|
|
|
|
Years ago, maybe in the 1980s, at a previous company, we had a problem that manifest itself when the user got impatient and rebooted their computer during a long "Pack" operation (it was kind of an ISAM file). While waiting for the next release to fix the problem, I put out an emergency patch that displayed a distinctive cursor during the pack, so that users could be informed their computer wasn't hung (no pun intended). The cursor looked something like:
PA I CK
really a bit more like an hourglass with PACK written around it. As it happened, most packing operations were very quick and took only 1/10th of a second or so. So this insurance company client of ours had all these sweet little old ladies working there who would get these subliminal flashes of what they took to be a really dirty word - mistaking the "A" rendered in a boxy way with very few pixels for an "R". A defect was submitted saying that our product flashed dirty words at our users and that they were very very upset. The patch was pulled immediately.
|
|
|
|
|
I wonder what downtimes refers to in this context ...
|
|
|
|
|
I once made the misstake of spelling "Sauce" instead of "Source".
I did this in a company library and our entire software was littered with "Sauce", until a bright colleague finally pointed out the spelling mistake.
We had a good laugh about it
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
I see a lot of silly spelling mistakes in a number of libraries, including several DevExpress libraries (Most of those mistakes have been fixed, however).
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
As recently as yesterday, a colleague sent me an email that was supposed to include the word "assign". However, she transposed the last two letters
|
|
|
|
|
In a MySQL table, the start and en time of using a service are recorded. I tried to get the sum of usage per user and day:
SELECT OriginationName, Date(StartTime), count(*), sum(timediff(endtime,starttime)) as duration
FROM ippbxcdr
Group by OriginationName, Date(StartTime)
order by OriginationName, Date(StartTime)
With a start time of '2012-08-21 15:02:29' and an end time of '2012-08-21 15:03:59' , that duration of 1 minute 30 seconds was shown as 130.0000 .
No, no, no: thou shalt not use sum with timediff !
The Lord of MySQL giveth no error message, he punisheth with a wrong result.
|
|
|
|
|
|
Ooouch!!!
|
|
|
|
|
|
¿ Are you sure you haven't multiple records with the same values ?
When you have 100 records with these values......you'll have this result.
|
|
|
|
|
Your punishment is accord to your sins, long live to our migthy and fair MySQL Lord!
|
|
|
|
|
I have renamed your thread appropriately!
|
|
|
|
|
You figured out to use timestampdiff(SECOND, time1, time2)?
|
|
|
|
|
Yes, I found a solution:
SEC_TO_TIME( sum( time_to_sec(endtime)-time_to_sec(starttime))) as Duration
Looks complicated, but it works.
|
|
|
|
|
Maybe time diff is using some sort of fixed place BCD storage scheme.
If you span a year does it produce a value out in the thousands?
Something like:
yyyymmddhhmmss
or
dddddddhhmmss
I worked on a database once where dates were stored like:
yyyymmdd. Everything collated correctly and it was easy to extract the field you wanted.
|
|
|
|
|
Another good reason to buy SQL Server, or ORACLE, etc.
Anyone who relies on MySql to run their vital business infrastructure deserves no less than burning at the stake.
|
|
|
|
|
Michael K Gray wrote: Another good reason to buy SQL Server, or ORACLE, etc.
That's plain wrong. It all depends on the business model and on the app using the database.
Besides, MySQL does have its strengths - it beats any commercial offering from MS or Oracle when 90% of the workload is reads performed by a server with limited hardware (depending on the table type being used).
|
|
|
|
|
We have (for many years now) a worse problem in Or-ache-le.
A query should return 3000 rows. It just returns 1200 and does not generate any error.
A corrupted value in a key terminated the retrieval, but it still returned success.
|
|
|
|
|
I'm a bit surprised there isn't an embedded String.Concatenate call in there as well.
DateTime dt = DateTime.Now;
string year = dt.Year.ToString();
string month = dt.Month.ToString();
string day = dt.Day.ToString();
if (month.Length == 1){ month = "0" + month; }
if (day.Length == 1){ day = "0" + day; }
string DocumentName = string.Format("Application - [{0}] - " + year + month + day, this.Person.RegistrationNo.ToString());
I'm thinking that there is a ToString() call missing just before the final ; too.
Oh - and this one too.
TRIMSDK.Location trimLocation = trimLocation = trimManager.FindLocationFromNickname(string.Format("{0}", this.Person.RegistrationNo.GetValueOrDefault(0).ToString()));
I think I need a Rum!
modified 15-Aug-12 23:47pm.
|
|
|
|
|
RCoate wrote: if (month.Length == 1){ month = "0" + month; }
if (day.Length == 1){ day = "0" + day; }
Now if that had been done with a StringBuilder... I would have been impressed!
|
|
|
|
|
var sbMonth = new StringBuilder();
if (month.Length == 1)
{
sbMonth.Append("0");
}
sbMonth.Append(month);
Awesome! I knew there was another method missing!
|
|
|
|
|
|
Got your insert right here.
var sbMonth = new StringBuilder();
sbMonth.Append(month);
if (month.Length == 1)
{
sbMonth.Insert(0, "0");
}
I'm sure if the genius who wrote this was aware of Insert and string builders, it would have been used.
Can't complain too much. At least the code actually produces the required outcome. I can't always claim that.
|
|
|
|