- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I think your problem is less to do with your ability (or that of others) but in the wording you use. It may be wise to get someone to read your CV and remove inapropriate words.
Good look with your search for employment. Have you tried <FONT color=#0000cc>Official Tourette Syndrome (UK) Association </FONT>
Admin
You use quotation marks but that passage appears nowhere on either of the pages you link to. I think it's pretty safe to assume you're just trying to steal credit from me with some underhanded quoting shenanigans or you're just incompetant. In either case, you have proven nothing.
sincerely,
Richard Nixon
Admin
At last someone who finally got my point.
Admin
Some 20 years ago a friend wrote a date utility in COBOL for all kinds of conversions, arithmetic, etc. It performs 19 different functions with 23 input and output fields. His goal was to minimize the number of instructions executed at any cost. The longest path through the program is around 400 machine language instructions.
He made a table of 1231 entries for days of the year using MMDD as index. In COBOL you can redefine parts of a field as other field, so it takes zero instructions to extract MMDD from YYYYMMDD. Many other common calculations were pre-calculated into tables. It has over 8000 lines of hand-coded data, under 500 lines of code.
To judge something you have to know the definition of "quality" that was in use at the moment. For his goal of lightning speed it's pretty phenomenal quality and an amazing example of focusing on one quality attribute.
Admin
Then, in America, how does a blind person VERIFY and COUNT the bills that come out of an ATM?
They are all the same size and shape!
{Yes, I have worked with the blind; there are many 'degrees' of legally defined blindness that do not include complete loss of sight. And the signature was meant to be read tongue-in-cheek, not literally }
Admin
Richard Nixon,
I like your location (Earth). Whenever I fill out a standard form that requests RACE, instead of checking one of the supplied boxes I write-in HUMAN.
Admin
I didn't say you can't. I just said I don't think it's a good idea. I'd qualify that a bit further and say "unless the point of your app is to determine holiday dates". There is a logic, but it's pretty individual per-holiday, for each new holiday one would potentially need to determine and write new logic, etc. One would also need to be cognizant of international differences.
Admin
No, I won't be your boyfriend!
sincerely,
Richard Nixon
Admin
If an application relies solely on calculated holidays, chances are that it will run into serious troubles. Political decisions like "dec 8 is a holidays, but shops are open anyways" quickly lead to more and more change request and software changes. Not to mention "inofficial" holidays.
On the other hand, if there is database table with the holidays, it's pretty easy and safe to use the same calculations to insert the default values into that table, and let an admin do some corrections if necessary.
Admin
gargh!
Admin
The software world doesn't need you. And it doesn't need me, either. It doesn't need us and it doesn't want us.
99% of software companies have no need of good programmers or architects, because they have no need of good software.
Today's business model is not the traditional capitalist model, wherein you create the best product at the best price. Today's business model is to manipulate the market any way you can. Sole source contracts, bundling deals, corporate warfare, raping pension funds --- those are the skills that make a business successful.
When you base your business on such things, the quality of the actual product is irrelevant, as long as it's not so bad that it lands you in court. So there's no need for good software. There's no need for maintainable software. Therefore, there's no need for good programmers.
Also, good programmers often require that the rest of their team do its job well, so they're not only unneeded, they're highly inconvenient. They are an enemy of inertia.
I call this "turd in a box" economics.
It's probably obvious why this kind of business is harmful in the medium to long run, but it's the current reality nonetheless.
Admin
It turns out that computers are actually very good at mathematics and boolean logic as well. It also turns out that moving numbers between CPU registers and memory cache is really quite fast. Who knew?
(It might be useful to have the data precalculated in the database IF you want to use it as part of queries on other data that's in the database, though.)
Admin
VERIFY: That's easy. ATMs only dispense $20 bills.
COUNT: I'll let you figure this one out... :rolleyes:
Admin
In Vegas casinos they only dispense $100 bills.
Admin
As stated, they give out 100's in Vegas. Also, many ATMs will dispense 10's as well if you ask it for, say, $30.
Admin
> Man, I want to work for that company. You only have to work for 2 days and then you get 5 holidays!!
Except that you have to work every single weekend, and worse, every single holiday! You do get (non-holiday) M-F off, but you can't really hang out with your friends.
Admin
Sam's right here. And I'm not saying so just because he has a good, trustworthy sounding name, although this is certainly a point in his favor.
The fact is that determining holiday dates is a sort of one way equation. It's not difficult (although it can be tedious to do by hand: eg, Easter) to figure out what holidays fall on which days. But doing so is essentially a one way equation: given a list of dates, it can be a huge pain in the rear to figure out which holidays fall on those days. Example: April 13 2006 will be Passover. Without looking, what about April 13 2007? Or the day after that? Or even in that week?
In most applications, the question isn't "When is Boxing Day," the question is "do I have to go to work tomorrow?" And that's why table lookups make more sense than just computing them all on the fly.
(Answer: in 2007, Passover falls on April 3.)
Admin
<FONT face="Courier New">No need to calculate Easter. You just join to tblEaster:</FONT>
<FONT face="Courier New">"NNNNNN....NNNNYNNN...NNNYNNN.....N"</FONT>
<FONT face="Courier New"> | |</FONT>
<FONT face="Courier New"> | V
<FONT face="Courier New"> V Easter (Canada)</FONT>
Easter (US)</FONT>
Admin
5's, 10's and 20's stock many ATM's here in Seattle. Although, with some math, one could figure how many bills ought to arrive out the slot without looking at their values. Ask for $65, it seems like there ought to be four bills. No need for eyes there. Unless one of the supplies is empty in the machine, in which case you might get two 10's in place of a 20. The driving-a-car part remains a mystery, though.
Ray Charles used to demand payment in specific bills so he could count them himself.
Admin
A small pedantic point about peoples statements of the table naming:
Holiday
ETYMOLOGY: Anglo-Saxon haligdæg holy day
Thus every weekend dedicated to the sabath could be considered a holy day. Might not explain Saturday, but we are half way there.
http://www.chambersharrap.co.uk/chambers/chref/chref.py/main?query=Holiday&title=21st&sourceid=Mozilla-search
Admin
Entering some goofy table like this WTF is not easy either.... create the formula once and it is good for all time.
Admin
Well that seems pointless, unless he requested all 1's.
Admin
>Cool! Can you show me the formula for Easter next?
In VB.Net
Public Function EasterDate(ByVal p_year As Integer) As Date
Dim _days As Integer = (((255 - 11 * (p_year Mod 19)) - 21) Mod 30) + 21
Dim _dtMarch1 As New DateTime(p_year, 3, 1)
EasterDate = _dtMarch1.AddDays(_days _
+ Convert.ToInt32(_days > 48) _
+ 6 - ((p_year + p_year \ 4 + _days + Convert.ToInt32(_days > 48) + 1) Mod 7))
End Function
Admin
All ones baby!
Admin
I ate in a cafeteria once where the cashier was blind - he asked what was on your tray, he punched the numbers on the register, you told him what bills you were handing him, everything else was trays in the cash drawer. All honor system, and it worked.
Of course, this was a courthouse cafeteria while I was on jury duty, so the only people he really had to worry about was the lawyers ...
Admin
One cool thing about it though is that if you scroll up and down real fast with the mouse-wheel, you get an optical effect a little like a barber-shop pole.
Now if only you could store the 'N's in red, it would work real well.
Admin
Yes, he requested all ones. Watch the movie "Ray." It's good.
Admin
Easter is a single day (Sunday), preceded the Friday prior with Good Friday, and followed by Easter Monday. And it's fairly standard that everyone in the world follows the same date for Easter, none of this Easter (US) stuff...
Now, if you're talking about Thanksgiving, to which Canada observes in October, and the US in November...
Admin
Actually the Eastern and Western churches calculate Easter differently.
Admin
Ever heard of the orthodox church? It uses the Julian calendar for Easter calculation. BTW, not everyone in the world considers Easter as a holiday.
Admin
I don't even know how to respond to this one .... I tried about 20 different replies and I suppose I just have to give up ... but thanks for making my friday with that great quote! (the part I bolded)
I will print it out and keep it as a guideline for what to store in databases and what not to .... I had never thought of it that way! :)
Admin
REALLY?! Oh my gosh! Are you sure? Has the news media been alerted? Quick - someone get Dan Rather on the phone, THE WORLD MUST KNOW!
Tell me Mr. Anonymous Genius - what holidays are celebrated universally by everyone in the world?
sincerely,
Richard Nixon
p.s. This place needs a bouncer to keep the riff-raff out. Perhaps the guy that beats people up for using Hungarian notation could handle the task.
Admin
HIT THE UNPRINT BUTTON JEFF! I'VE GOT AN ADDENDUM!
If the requirement for data going into the database is that it must be used as part of a query on other data, how does the first piece of data get selected to go into the database? After all, if there's no data in the database, anything you add can't be used as part of a query on other data. Thus, databases should be empty at all times. Use XML files but disguise them with .js extensions so no one knows that that is where your data is. Q.E.D.
I need a nap.
sincerely,
Richard Nixon
Admin
By the way, Reed, suppose that we decide that in your system, you will calculate all holidays using a formula, since computers are all fast and neat like that. Not being the clever algorithm master that you are, I will "hack together" my system and put the data in a table. Let's say we need to cover from 1/1/1970 to 12/31/2070.
Let's assume we never have to join to the table or do any kind of querying, we just need to be able to write a function: IsHoliday(date) which returns a boolean. So this satisfies your definition of when you should store data in tables (only when "you want to use it as part of queries on other data").
Here is my function, in peusdo-code:
bool IsHoliday(@Date)
{
Return (SELECT IsHoliday FROM Holidays WHERE Date = @Date)
}
Can you do me a favor and post your function?
Now, let's discuss maintaining our functions.
Let's assume that HR informs you that July 3rd will be a holiday this year, in addition to the 4th, since the 4th falls on a Tuesday. (that happened to us). They just made this decision last week, so it is not in my table or in your formula.
For me, I will just update my silly little table to accomodate this.
Please let me know how you will adjust your cool "formula".
Looking forward to seeing your code. And don't forget, you need to cover all holidays from 1/1/970 to 12/31/2070 in your formula.
Admin
Richard -- normally I prefer sticking a fork into my eyes rather than reading through your posts, but I really enjoyed that one !!! Well done. :)
(How's that for a backhanded complement?)
have a good weekend.
Admin
A new era of peace has dawned! Take care buddy.
sincerely,
Richard Nixon
Admin
The solstices and equinoxes are/were acknowledged by virtually every civilization.
Admin
With a magnet. Of course that means direct access to the hard drive...
Admin
No they don't....some dispense $10 bills. I also saw one a few years ago that dispensed $5 bills.
As for counting bills of different denomination, some blind people I know can actually feel the difference in the shape of the ink. I personally can't tell the difference, but my fingertips aren't exactly all that sensitive.
As an aside, most blind people fold each type of bill differently once they know what type it is.
Admin
Thanks for playing Maurits but I'm sorry that is not the correct answer. My point was that the poster I was replying to had pointed out that not everyone in the world celebrates Easter. He did not say that "not every civilization or culture celebrates Easter."; nay, he pointed out quite insightfully (or incitefully) that not everyone celebrates Easter. The challenge I then threw down on the table, as a rhetorical question which you apparently missed, was to name a holiday celebrated universally by everyone. It can be said of every single holiday that not everyone celebrates it. Your example of the solstices and equinoxes is invalid because I do not celebrate, observe, or acknowledge those events. As point of fact, I do not have believe the sun exists as it has been described in accepted scientific texts.
Long story short - that guy was a chin-slapping dimwit for stating that not everyone celebrates Easter and the world would be a better place if he were caged. I'm sorry that I caught you with my trap. You were not the inteded target. Have a great day!
sincerely,
Richard Nixon
Admin
Fun fact: In Canada, bills of differing denominations are not only printed in different, bright, funny colours, but also come with braille markings stamped in one corner that last for about an hour after being crumpled into your pocket.
Admin
If only boolean used W for NULL... W..T..F
Admin
Right; it depends on the ATM.
Braile on ATM's doesn't mean that a totally blind person can use ATM's like a sighted person can use ATM's. But that's not the point; the point is that the braile makes it easier for a blind person to work out a method for using an ATM. Many accomodations for the blind (or deaf, or wheelchair-bound, etc.) work like this; it's not about making everyone the same, it's just about giving everyone the tools to get by somehow.
A blind person can pretty much always get around better in an area with which he/she is familiar. (Consider that to use an ATM you first have to find it; and then, you have to either be able to read the screen or be familiar with the particular machine so you know which buttons to push.) If he knows that "there is an ATM here, and this particular machine only dispenses $20's", then he's on the right track. If using a machine that dispenses multiple denominations, he might take a risk based on knowing what it normally dispenses for a give request. (Do you verify your bills after every transaction? Most people take some risk some of the time.) Worst case, he can have someone count the bills for him. (Maybe he's not alone; or maybe in certain circumstances -- like in a bank lobby -- he's willing to ask someone for help.)
"But if he has someone with him, why not have that person use the ATM?" Well, the easiest reason to understand (but not the only one) is that the person he's with (or the person whom he asks for help) might be someone he'll trust with the $100 he figures he just withdrew, but not with his PIN.
Admin
In China, the bills have raised areas AND are of different sizes. The bigger denominations are bigger. Other countries also have bills of different sizes.
Sincerely,
Gene Wirchenko
Admin
More importantly - was there a misspelling in the 'All Your Base' meme as you claimed? You see, you made a statement about a misspelling with your typical grandiose authority. Yet, I find you to be wrong. From this, I have concluded that you don't know what you're talking about 80% of the time.
To conclude - is this statement on Chinese bills in the 20% or the 80%?
sincerely,
Richard Nixon
Admin
The problem is the US designed their bills in the late 1800s when a blind person had no chance of earning cash of his own anyway, so nobody bothered to make the currency useable to the blind. Today that is acknowledged as a mistake, but it is hard to correct. US bills are everywhere. In many unstable countries US bills are preferred to local currency (I think that was more turn in the days of the Soviet Union). Switching the US is hard, but switching other countries is near impossible.
There are advantages to the US sticking with the current bills, even though they are badly designed in many ways.
Admin
The U.S. does change its bills periodically. A quick web search indicates to me that the current design mostly came about in 1929 (which is a bit more recent than the late 1800's, but still early enough that it's not surprising if the blind weren't considered). But then in the late 50's they added "In God We Trust" (presumably a Cold War move); and in 90 they added the security thread.
I've heard talk about adding subtle color to bills (though if it's yet been done I haven't noticed -- but then again, I am color-blind). They've changed the images in various ways in the past decade or so.
So certain changes obviously aren't that hard, even with the broad circulation of U.S. bills. (Especially for common denominations where a given bill doesn't "live" that long anyway.) You don't see certain changes (like texture or size variation), though. This may be due in part to a large installed base of cash drawers and vending machine bill acceptors. But I suspect it has more to do with inertia. Folks are used to what they're used to, which is at least part of the reason for the repeated failure to broadly circulate $1 coins.
Admin
http://www.assa.org.au/edm.html
Quite easy no ?
Admin
http://www.smart.net/~mmontes/butcher.html
Admin
It is actually perfectly reasonable to put holidays in a table, especially when the holiday rule is not determined by Gregorian calendar.
The rule of determining holiday in my city is rather complicated, given that the some holidays are determined by a Gregorian calendar, some determined by Chinese calendar, 3 days by Easter rule, and even one of them determined by solar term.
To make things more complex, these holidays often observes on the same day or overlaps with Sundays. In such cases an extra holiday is given to compensate the overlapped holiday.
Given the complexity of the rules, there is no practical way to determine the holidays using algorithmic ways...