I want to validate USA zip codes and I have used these regex:  /(^\d{5}$)|(^\d{5}-\d{4}$)/.test(value); //First /^\b\d{5}(-\d{4})?\b$/.test(value); //Second /^\d{5}(-\d{4})?(?!-)$/.test(value); //Third /^\d{5}(?:[-\s]\d{4})?$/.test(value); //Fourth   I tested , , and  that the USA zip codes start at 1001. Apparently, using either of the regex above accepts "00000" because it has 5 digits?  Ultimately, I want it to accept 4 digits zip code that starts in 1001. Is my regex correct?
I thought people would be working on little code projects together, but I don't see them, so here's an easy one:  Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to use weak validation.  I wrote a little bit about zip codes in a side project on my wiki/blog:    There is also a new, weird type of zip code.     I can do the javascript code, but it would be interesting to see how many languages we can get here.
How to set a custom 4x4 projection matrix in Blender Add default syntax highlighting for the [dart] tag I just approved several edits from a user adding  to questions with the  tag. Apparently , Google Code Prettify has added support for Dart.  I suggest it's time to follow suit and update the default syntax highlighting associated with the  tag. Adding it manually to every question sounds like way too much work, even if I all I have to do is click the "Approve" button. Why a tesselation of the plane by a convex polygon of 7 or more sides is not possible? I read in several places, including Wikipedia, that a tessellation of the plane by a single, convex, $n-$sided polygon is not possible for $n\geq7$. I was not able to locate a proof, or a paper that discusses this. Maybe it is too trivial, but I am not able to figure it out myself.   So I would like to ask you for help. Where can I find a proof for this?  Also, I am interested in the mathematical background behind plane tiling (especially periodic), If you can suggest papers on the topic it would really help. What noun or adjective would one give to a person that is intolerant of stupidity? A person that becomes annoyed, angry, or of very short temper when conversing or interacting with people of a lower intelligence?  For example:       The man is very xyzxyz; his son can't do multiplication very well.     or     She is a(n) xyzxyz. She gets very frustrated when people forget things.   I'm looking almost for a scientific/medical/psychological term. One that would fall into the same kind of group as words like haemophiliac, masochist, nihilist, etc. I was going through the topic "formation of comparative and superlative".       The rule says     When two objects are compared with each other, the latter term of comparison must exclude the former, as in "Iron is more useful than any other metal". If we say "Iron is more useful than any metal", that is the same thing as saying    "Iron is more useful than iron", since iron is itself a metal.   I am finding difficulty to relate the rule with example. Does any skill have a global cooldown? I am new to this game, and will try to optimize my game-play as much as possible. I will do this by making macros for my spells and abilities.  Are there global cooldown on spells and abilities in League of Legends?  Since this is important regarding macros to trigger spell and ability combos.  A Global Cooldown(GCD) is a cooldown which affect most if not all abilities, spells or items when using an ability, spell or item.   In most games it is there to prevent macroing/spamming of multiple instant abilities, spells or items, and usually has a set short duration independent of the ability, spell or items normal Cooldown. There was a reason why I constantly failed physics at school and university, and that reason was, apart from the fact I was immensely lazy, that I mentally refused to &quot;believe&quot; more advanced stuff until I understand the fundamentals (which I, eventually, never did). As such, one of the most fundamental things in physics that I still don't understand (a year after dropping out from the university) is the concept of . No one cared to explain what a field actually is, they just used to throw in a bunch of formulas and everyone was content. The school textbook definition for a field (electromagnetic in this particular case, but they were similar), as I remember it, goes like:  An electromagnetic field is a special kind of substance by which charged moving particles or physical bodies with a magnetic moment interact.  A special kind of substance, are they for real? This sounds like the authors themselves didn't quite understand what a field is so they decided to throw in a bunch of buzzwords to make it sounds right. I'm fine with the second half but a special kind of substance really bugs me, so I'd like to focus on that. Is a field material? Apparently, it isn't. It doesn't consist of particles like my laptop or even the light. If it isn't material, is it real or is it just a concept that helps to explain our observations? While this is prone to speculations, I think we can agree that in scope of this discussion particles actually do exist and laws of physics don't (the latter are nothing but human ideas so I suspect Universe doesn't &quot;know&quot; a thing about them, at least if we're talking raw matter and don't take it on metalevel where human knowledge, being a part of the Universe, makes the Universe contain laws of physics). Any laws are only a product of human thinking while the stars are likely to exist without us homo sapiens messing around. Or am I wrong here too? I hope you already see why I hate physics. Is a field not material but still real? Can something &quot;not touchable&quot; by definition be considered part of our Universe by physicists? I used to imagine that a &quot;snapshot&quot; of our Universe in time would contain information about each particle and its position, and this would've been enough to &quot;de&quot; it but I guess my programmer metaphors are largely off the track. (Oh, and I know that the uncertainty principle makes such (de)serialization impossible — I only mean that I thought the Universe can be &quot;defined&quot; as the set of all material objects in it). Is such assumption false? At this point, if fields indeed are not material but are part of the Universe, I don't really see how they are different from  except for perhaps a more geeky flavor. When I talked about this with the teacher who helped me to prepare for the exams (which I did pass, by the way, it was before I dropped out), she said to me that, if I wanted hardcore definitions,  a field is a function that returns a value for a point in space.  Now this finally makes a hell lot of sense to me but I still don't understand how mathematical functions can be a part of the Universe and shape the reality. Any real-time antivirus for Ubuntu? BitLocker issue. Recovery Key is required on each startup after installing secondary OS I'm using a laptop with TPM module with BitLocker-encrypted internal HDD, running Windows 7. Recently I've installed a Windows 8 on the external, eSATA drive. Windows 8 detected the Windows 7 and correctly replaced the bootloader with dual-boot option.  Unfortunately, I'm now forced to enter BitLocker Recovery Key each time I start the computer. The only workaround I've found was to disable TPM module in BIOS, and suspend BitLocker on the Windows 7 drive.  How to accomplish the following configuration:   Keep the BitLocker running on Windows 7 (internal drive)  Leave the Windows 8 (external, eSATA drive) completely unencrypted  Don't be bugged to enter Recovery Key each time during startup  No matter if the eSATA drive is plugged in, or not   Is it possible? I don't care if TPM is enabled and I just want the Windows 7 drive to be BitLocker-encrypted. I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. Count occurrences of each element in a List[List[T]] in Scala Closed-Form Solution to Infinite Sum How do you spell the following date:  December 6 (AmE)  6 December (BrE)  Do you spell this date as 'December six' or 'December the sixth' in American English?  And in British English, do you spell it as 'Six December' or 'The sixth of December'? JavaScript hard refresh of current page In a ring, I was trying to prove that for all $a$, $a0 = 0$.  But I found that this depended on a lemma, that is, for all $a$ and $b$, $a(-b) = -ab = (-a)b$.  I am wondering how to prove these directly from the definition of a ring.  Many thanks! Can ribosomes read ssDNA? My question is whether translation can be done, either naturally or artificially, through a ribosome reading (single-stranded) DNA directly. If not, I would like to know what allows ssRNA to be translated but not ssDNA. I installed Android studio some time ago using the following suggested method:     To set up Android Studio on Linux:      Unpack the downloaded Tar file,   android-studio-ide--linux.zip, into an appropriate location   for your applications. To launch Android Studio, navigate to the   android-studio/bin/ directory in a terminal and execute studio.sh. You   may want to add android-studio/bin/ to your PATH environmental   variable so that you can start Android Studio from any directory.   Follow the links to install the SDK outside of the Android Studio   directories.   For whatever reason it has become corrupt and insists I must un-install and re-install. I can't for the life of me find how to un-install it however.  I didn't use apt-get so I can't do apt-get remove.  Does anyone have any suggestions? How to colorize an image as in the example? I have seen such an effect being used in many places however I haven't figured out how to replicate it via Photoshop.  I have tried desaturating the image, placing it under a layer of solid colour and then lowering the opacity of the colour. I have also tried a couple of blend modes, to no avail. The effect is nowhere near the same.  Can someone please tell me the effect used on these images? Possible Duplicate:             TL;DR: sudo apt-get install ... saying "Unable to correct problems, you have held broken packages."   The problem  I was trying to get the WebApps feature for PP and QQ following .  I ran the sudo add-apt-repository ppa:webapps/preview command to add the repository, but i got a connection error. Since I know my current ISP gives a shaky connection, I tried again and sure enough, it worked.  Then I ran sudo apt-get install unity-webapps-preview, but I realized we had to update apt-get first, so I hit Ctrl + C to stop it. Then I ran sudo apt-get update which worked w/o a fuss, but when I ran sudo apt-get install unity-webapps-preview again later, it showed an error message. Here's the dump:  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  unity-webapps-preview : Depends: xul-ext-unity but it is not going to be installed                          Depends: xul-ext-websites-integration but it is not going to be installed                          Depends: xul-ext-webaccounts but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I think this might be because of me interrupting the earlier command. It hadn't got a chance to output anything, though — I stopped it pretty fast.  What I tried  Commands  I tried these:-   sudo apt-get install --fix-broken sudo apt-get autoclean sudo apt-get autoremove sudo apt-get -f install   But even after running sudo apt-get upgrade after every try, none of them worked.  Purging  I tried purging the repository, but that didn't work either. First, I got the package using sudoapt-get install ppa-purgeand then tried to purge the WebApps repo usingsudo ppa-purge ppa:webapps/preview`.  Manually installing dependencies  If you look at the error dump carefully, it says:     Depends: xul-ext-unity but it is not going to be installed   Depends: xul-ext-websites-integration but it is not going to be installed   Depends: xul-ext-webaccounts but it is not going to be installed   So I tried installing them manually. I ran sudo apt-get install xul-ext-unity, but got this:     Depends: xul-ext-websites-integration but it is not going to be installed   Breaks: firefox (>= 15.+) but 16.0~b6+build1-0ubuntu0.12.04.1~mfn4 is to be installed   I have no idea what the second part means, but I tried resolving the first. Running sudo apt-get install xul-ext-websites-integration gave:     xul-ext-websites-integration : Breaks: firefox (>= 15.+) but 16.0~b6+build1-0ubuntu0.12.04.1~mfn4 is to be installed   As a last resort, I tried sudo apt-get install xul-ext-webaccounts, but that gave the sane message too:     Breaks: firefox (>= 14.+) but 16.0~b6+build1-0ubuntu0.12.04.1~mfn4 is to be installed   What does Breaks: firefox (&gt;= 14.+) but 16.0~b6+build1-0ubuntu0.12.04.1~mfn4 is to be installed mean?  Research  I tried searching , looking at a couple of , looking at  and searching on AU, but to no avail. Help would be appreciated. How to ignore accent in SQLite query (Android)