DFA for (0001)*, is it correct - finite-automata

PLease check whether this dfa is correct or not?
Thankyou

No, it is not the correct one. see below image. it is a correct DFA.

Related

Reference for the initial guess of BFGS

I've use $$\frac{y^Ts}{y^ty}I$$ for the initial guess in the BFGS. Now I've been looking for the reference for this guess. Can someone tell me which reference does this comes from?
In section of L-BFGS, Numerical Optimization from Jorge Npcedal, you can find what you want. Best

how to pick the correct NSPropertyListFormat

what is the criteria of choosing the format ?
These are the formats
NSPropertyListOpenStepFormat
NSPropertyListXMLFormat_v1_0
NSPropertyListBinaryFormat_v1_0
Well, you almost certainly don't want the OpenStep format, so that leaves XML or Binary. Do you want it human readable or not?
Just pick NSPropertyListXMLFormat_v1_0
unless you have a reason to pick another one, then you wouldn't be asking this question.

Should I use proper punctuation for single sentence alert/notification popups?

Is it necessary to use a period for single sentence notification boxes? Even though its considered proper grammar to do so, it just looks ugly and feels too formal.
Here are two screenies for comparison (first includes period, second doesn't).
alt text http://wordofjohn.com/files/stack_alert_1.png
alt text http://wordofjohn.com/files/stack_alert_2.png
Can't go wrong with correct grammar
Good grammar shows to your customers that you took time to make a good software even where others might not took time.
This way they can expect the best out of you and your company.
If you are using a full sentence to tell the user what to do, then I think proper grammar is important, although I always stay away from exclamation points, I find them annoying.
It is more preference that anything, but I like to maintain the best grammar possible in any situation.
In both instances you capitalized the first word in the sentence so I would say go with proper grammar
but it really is a preference
I'd vote No.
These alerts are like signposts or roadsigns, they need to present a brief but important message as succinctly as possible.
My reasoning extended - I think it's subjective, and so I doubt anyone's going to have a bad user experience because of the presense or absence of a full stop (period). A question mark might be confusing if it was left out, but a full stop is kind of implicit.
If you use periods at the end of your sentences, then users will know that the string hasn't been truncated (well OK, they won't know that it hasn't been truncated, but it's a good indicator. Plus, as others have said, it shows you went to the trouble to get it right.
I can't remember - what do MS/Apple do?
Let me explain my preference with an analogy.
I used to work at a bookstore where they sold Bibles. Some of them were Cambridge calfskin leather bound deluxe editions that came in special boxes for over US$100.00 each. Some of them were mass market paperback throw-away versions for US$1.99 each. The cheap ones often had glaring grammatical and spelling errors. I don't think this was a coincidence.
Regardless of where my software is going to be used or what it is for, I try to do my best to make sure it gets put (metaphorically) on the high-quality, expensive rack. Every time. Even at the risk of sounding "too formal".
If you are using the string as a normal resource, you (or someone else in your project) could use the text in another context, which would mean you need to keep track of which resources contain a period or not.

What is the logic behind google spellcheck

When I wanted to search a word or some thing in google; If there is some spelling mistake in that word or sentence, google can get back me with correct spell or corrected sentence. Can anyone explain me how exactly this is being done. I will happy if anyone can explain in terms of programming than in terms of database and all those stuff. Thank you.
Combination of string comparison (with dictionary), stemming and popularity match word base on its large user statistic data.
EDIT: there's a wikipedia page that may helps you understand how computer spell check works.

Is there a standard way to name a function which reads from a stream but does not advance the pointer?

I can only think of Peek() and ReadNoAdvance() atm, but I wonder if there are better or standard options.
Thanks.
peek is the standard name, present in various languages.
I've seen ReadAhead(), but I think Peek() is more standard.
When writing parsers I've often also used lookahead.