22 January 2014

Useful Regular Expressions for your Google Forms



Your organization has a few vacant positions and you are planning to use the Google Forms service to prepare a pre-interview questionnaire for job applicants. You have created a form and it has all the standard fields where candidates can enter their name, email address, website URL, phone number, zip code and other essential details.


The form is ready for publishing online but before you make it live, how would you ensure that candidates have entered data in the correct format? And even if the format is proper, is the data itself valid? Can you add a CAPTCHA to Google forms to prevent spam bots? Can you include a profanity filter to block people from submitting entries that include obscene words?


When you are expecting dozens, or even hundreds, of responses in your Google Forms, it is always a good idea to have some rules in place and respondents data should be matched against these rules even before they submit the form. For instance, if your form is asking for a person’s year of birth, they should only be allowed to enter a number between 1900 and 2014.


Advanced data validation in Google Forms using RegEx (regular expressions)

Advanced data validation in Google Forms using RegEx (regular expressions)



Regular Expressions in Google Forms


Google Forms makes it relatively easy to add such advanced date validation rules to individual fields through Regular Expressions (or regex or regexp). Think of them as search patterns and every character entered in a form field is matched against that pattern – the form can only be submitted if the patter and the user-input matches.


Let’s understand this with a real-world example.


Say your Google form expects the user to enter their year of birth. At the time of designing the form, expand the “Data Validation” section below the form field (see screenshot above) and choose Regular Expression from the drop-down. Next select “Matches” in the other drop-down and enter ^(19\d{2}|20[0-1]\d)$ in the input field. The field will now accept input value like 1920, 2010 but would reject other values that fall outside the range.


Regular Expressions for Common Form Fields


A regular expression may appear gibberish but they aren’t so difficult to read and understand if you can know the basic rules of the language. What you see here is a compilation of some useful regular expressions that can be used to validate common form fields like URLs, phone numbers, zip codes, dates, etc.


1. Postal Address – allow only alphanumeric characters, spaces and few other characters like comma, period and hash symbol in the form input field.



[a-zA-Z\d\s\-\,\#\.\+]+

2. ZIP Code – the regex allows ZIP codes in standard formats and it matches both US and Indian pincodes.



^\d{5,6}(?:[-\s]\d{4})?$

3. Date – accept date input in the mm/dd/yyyy or mm-dd-yyyy formats.



((0[1-9])|(1[0-2]))[\/-]((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[\/-](\d{4})

Also see: Get Google Form Data by Email


4. Email Address – the regex below should match most common email address formats, including Gmail aliases that accept the “+” sign but there’s no perfect solution.



[a-zA-Z0-9_\.\+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-\.]+

5. URL (Web domain) – this is useful for fields that require the user to enter their website address and it even matches the upcoming TLDs like .directory or .restaurant. The other regex matches YouTube URL including those using the youtu.be domains.



https?\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}
https?\:\/\/(www\.)?youtu(\.)?be(\.com)?\/.*(\?v=|\/v\/)?[a-zA-Z0-9_\-]+

6. Character Limit – the default text box in a Google form allows users to input any number of characters but you can impose a limit with the help of regular expression. Here we limit the input to 140 characters much like Twitter.



[\w]{1,140}

7. Phone Numbers – these are often a series of numbers preceded by an optional “+” sign and the area code may be inside brackets.



\+?\(?\d{2,4}\)?[\d\s-]{3,}

8. Price (with decimal) – if a form field requires users to enter a price of an item in their own currency, this regex will help. Replace the $ sign with your own currency symbol.



\$?\d{1,3}(,?\d{3})*(\.\d{1,2})?

9. Complex Password – only accept a string that has 1 uppercase alphabet, 1 lowercase alphabet, 2 digits and 1 special character. Also the minimum allowed length is 8 characters.



(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9].*[0-9])(?=.*[^a-zA-Z0-9]).{8,}

10. CAPTCHA – Google forms do not offer CAPTCHAs but you can create one using regex. Here’s a simple captcha that requires users to answer a simple question – what is 2+2?



^(4|[Ff][Oo][Uu][Rr])$

Also see: Regular Expressions for Gmail Search




This story, Useful Regular Expressions for your Google Forms, was originally published at Digital Inspiration on 22/01/2014 under Google Forms, Internet

Google Glass Movies, Android Malware, LogMeIn Logs Out [Tech News Digest]



fbi-agents-mulder-scully

Today in Tech News Digest, the FBI doesn’t want you Glassing in movie theaters, Beats Music launches, Android malware is on the rise, Music Timeline reveals changing tastes, LogMeIn goes pay-only, and Spotify steals our hearts. Google Glass At The Movies This sentence horrifies me for many reasons: “The MPAA then contacted Homeland Security, which oversees movie theft.” http://t.co/9qniid3Dfa — Ali Sternburg (@alisternburg) January 21, 2014 If the experience of one man in Ohio is anything to go by, Google Glass is likely to be banned from movie theaters. The unnamed man was, according to his account on The Gadgeteer...


Read the full article: Google Glass Movies, Android Malware, LogMeIn Logs Out [Tech News Digest]



Online Reviews Are Useful, With Common Sense Applied [We Ask You Results]



we-ask-you-logo

A huge number of websites now offer reviews, written by both professionals and ordinary folk, on everything you can imagine. You yourself may even have contributed a review of something you love, hate, or are indifferent towards at some point. But what does the MakeUseOf readership think about online reviews? This was the subject of last week’s We Ask You discussion, the results of which are presented below for your reading pleasure. Opinions About Opinions We asked, Do You Value Online Reviews? We had a great response to the question, with dozens of you considering us worthy of a little...


Read the full article: Online Reviews Are Useful, With Common Sense Applied [We Ask You Results]



21 January 2014

3 Projects To Use Computer Downtime While Re-Installing Windows



installing-windows

It’s creeping up on you like the dark and suddenly you notice it has happened again: It’s time to re-install Windows! When the lack of speed becomes unbearable, you can try to speed up Windows with a RAM upgrade or by removing the malware you might have picked up. The most thorough way to bring your computer back to speed, however, is to re-install the operating system; or restore, refresh, or reset Windows 8. Or maybe it’s not a speed issue at all, but you regret upgrading to Windows 8.1 and just found out that the only way to downgrade...


Read the full article: 3 Projects To Use Computer Downtime While Re-Installing Windows



Save Money On Textbooks This Semester By Renting With BookRenter



Books HD

The spring semester is upon us, and that means it’s book renting season again. This semester, don’t get ripped off by the inflated prices at your university bookstore. Instead, try renting your books from BookRenter. There are some tried-and-true tips for saving money on textbook rentals, but renting online is one of the first things you should learn to do as a freshman. Thankfully, BookRenter‘s website is simple, easy to use, and they have a wide selection of textbooks with fast shipping. From now until February 28, get 5% off 3 or more book rentals through this promotional link. Plus,...


Read the full article: Save Money On Textbooks This Semester By Renting With BookRenter



Post-Holiday Cleanup: 5 Recycling Tips You Can Takeaway From The Web



after-christmas

We’re a few weeks past Christmas and a lot of us may still be reeling from all of the clutter that accumulated over the holidays. You might be swimming in a sea of gifts that you don’t really want or plan to keep. (First world problems!) How can you clean up the post-holiday mess without being wasteful? Start the New Year with a clean environmental conscience. Here are some easy ways to repurpose your holiday mess in ways that will benefit someone else without extra cost to you. Sort Your Possessions The first thing you want to do is go...


Read the full article: Post-Holiday Cleanup: 5 Recycling Tips You Can Takeaway From The Web



Doing Data Science in the Cloud With ScraperWiki



scraper-wiki

If you’ve got the mental chops, a flair for programming and storytelling, and an eye for design, you can do worse than getting into data science. It’s the new big thing in technology; highly trendy and highly paid, with data scientists being sought by some of the largest companies in the world. ScraperWiki is a company that has long been associated with the data science field. For the past few years, this Liverpool based startup has offered a platform for coders to write tools that get data, clean it and analyze it in the cloud. With a recent refresh and...


Read the full article: Doing Data Science in the Cloud With ScraperWiki



Windows 7 Comeback, Yahoo On Top, iPhone 6 Phablet [Tech News Digest]



windows-7-smoke

Today in Tech News Digest, Windows 7 makes a comeback, Yahoo beats Google, Apple plays hardball with Samsung, the iPhone 6 is rumored to be a phablet, Feedly throws new features at us, and the Jamaican bobsled team go crowdfunding. Windows 7 Back By Popular Demand The success of Windows 8 is exemplified by HP offering Windows 7 on certain new PC’s and marketing and advertising it — Pratik Patel (@ppatel) January 21, 2014 HP is actively marketing new computers with Windows 7 as the default operating system. This is despite Windows 8 being the current version of Windows, and...


Read the full article: Windows 7 Comeback, Yahoo On Top, iPhone 6 Phablet [Tech News Digest]



Windows 7 Comeback, Yahoo On Top, iPhone 6 Phablet [Tech News Digest]



windows-7-smoke

Today in Tech News Digest, Windows 7 makes a comeback, Yahoo beats Google, Apple plays hardball with Samsung, the iPhone 6 is rumored to be a phablet, Feedly throws new features at us, and the Jamaican bobsled team go crowdfunding. Windows 7 Back By Popular Demand The success of Windows 8 is exemplified by HP offering Windows 7 on certain new PC’s and marketing and advertising it — Pratik Patel (@ppatel) January 21, 2014 HP is actively marketing new computers with Windows 7 as the default operating system. This is despite Windows 8 being the current version of Windows, and...


Read the full article: Windows 7 Comeback, Yahoo On Top, iPhone 6 Phablet [Tech News Digest]



Add Search Shortcuts on your Android and iOS Device



How do you search a popular website, say Twitter or YouTube, on your mobile phone? You would launch the browser, open the corresponding website and then use the search box inside that site. Or you would use the mobile app, if you have installed one.


There’s an alternate way as well. You may consider installing search shortcuts on the home screen of your mobile phone and they will help you perform searches on your favorite website with fewer steps.


Search your favorite websites with fewer steps

Search your favorite websites with a tap



Let’s dive right into an example.


Open the Safari browser on your iPhone (or iPad) and click here to open the search shortcut for Wolfram Alpha. A pop-up dialog will open but since we are installing the shortcut, hit the Cancel button to close that dialog. Now tap the Share icon in Safari and choose “Add to Home Screen” to add that search shortcut to your home screen.


The next time you want to search Wolfram on your phone, tap the Wolfram shortcut available on your home screen, enter the search terms and it will take you directly to the search results on the Wolfram website. That’s just one tap.


You can similarly add search shortcuts on your Android device using the newer version of Chrome browser. Open any of the search shortcuts listed below, “cancel” the pop-up dialog and then choose the “Add to homescreen” option under the main menu to place a shortcut on your homescreen for quick access.


Search Shortcuts for Android and iOS


Here are some ready-to-install search shortcuts for some popular websites that you may add to the homescreen of your Android or iOS device.



  1. Twitter Search

  2. YouTube Search

  3. Google I’m Feeling Lucky

  4. Wolfram Alpha

  5. Google Image Search

  6. Bing Search

  7. Amazon Search

  8. Google+ Search

  9. Wikipedia Search

  10. Facebook Search


Write your own Search Shortcuts


A search shortcut is essentially a little piece of JavaScript, much like a bookmarklet, that accepts input through a pop-up dialog and redirects the user to the search results page.


Writing one is easy. For instance, here’s the code for the Google I’m Feeling Lucky shortcut that automatically transports you to the first search result (useful when you don’t remember the exact URL of a site).



<!-- Page Title -->
<title>Feeling Lucky</title>

<!-- Touch Icon - This will show up on the home screen -->
<link rel="apple-touch-icon" href="lucky.png" />

<script>
var u = "http://ift.tt/1iiBXav;;
<!-- Show the input dialog -->
var q = window.prompt('What are you looking for?','');
if(q) {
/* If the user has entered input, redirect to search results */
u = u + "/search?&btnI=I%27m+Feeling+Lucky&q=" + escape(q);
window.location.href = u;
} else {
/* If the user hits cancel, show helper text and do nothing */
document.write("Add me to your home screen");
}
</script>

All you need to know is the URL of the search results page and use it in line #13.




This story, Add Search Shortcuts on your Android and iOS Device, was originally published at Digital Inspiration on 21/01/2014 under Android, IPad, IPhone, Search, Internet

Which Operating System Should You Choose For Your Next PC



os

Buying a new PC? You have more operating system choices than ever. Windows is still popular, but Macs are now surprisingly affordable compared to higher-end Windows PCs. Google also offers Chromebooks that are simple and cheap, and Linux laptops are an option, too. You could even use an Android tablet or iPad with a keyboard as a laptop replacement. But which should you choose when it’s time to buy a new computer? We’ll give you an overview of all your choices, along with their advantages and disadvantages. Here’s a spoiler: There’s no one best option for everyone. Windows You probably...


Read the full article: Which Operating System Should You Choose For Your Next PC



20 January 2014

Write Mobile Apps For Any Platform With Intel XDK



xdk-featured

Intel isn’t really a company you often associate with mobile app development. Whilst you almost certainly have an Intel chip chugging along in the computer you use to read this, their ventures into the mobile world weren’t as successful as they might have hoped, with few manufacturers deciding to use the Intel Atom chip in their Android devices. Seemingly, this hasn’t deterred them. They just threw their hat back into the mobile ring again with the Intel XDK IDE. This free development environment allows you to write applications using HTML5, Javascript and CSS3 and then test them against multiple devices....


Read the full article: Write Mobile Apps For Any Platform With Intel XDK



Write Mobile Apps For Any Platform With Intel XDK



xdk-featured

Intel isn’t really a company you often associate with mobile app development. Whilst you almost certainly have an Intel chip chugging along in the computer you use to read this, their ventures into the mobile world weren’t as successful as they might have hoped, with few manufacturers deciding to use the Intel Atom chip in their Android devices. Seemingly, this hasn’t deterred them. They just threw their hat back into the mobile ring again with the Intel XDK IDE. This free development environment allows you to write applications using HTML5, Javascript and CSS3 and then test them against multiple devices....


Read the full article: Write Mobile Apps For Any Platform With Intel XDK



Write Mobile Apps For Any Platform With Intel XDK



xdk-featured

Intel isn’t really a company you often associate with mobile app development. Whilst you almost certainly have an Intel chip chugging along in the computer you use to read this, their ventures into the mobile world weren’t as successful as they might have hoped, with few manufacturers deciding to use the Intel Atom chip in their Android devices. Seemingly, this hasn’t deterred them. They just threw their hat back into the mobile ring again with the Intel XDK IDE. This free development environment allows you to write applications using HTML5, Javascript and CSS3 and then test them against multiple devices....


Read the full article: Write Mobile Apps For Any Platform With Intel XDK



Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



super-mario-action-figure

Today in Tech News Digest, Nintendo admits the Wii U has failed, Chrome extensions are loaded with adware, the China Operating System is revealed, Paramount dumps 35mm film, Windows 8 is condemned as the new Vista, and Amazon wants to become the Nostradamus of online shopping. Nintendo Wii U Failure, Future Should Nintendo go software only? I’m on the fence. Seems inevitable. But: Atari & Sega. http://t.co/fSAOrhfqpi — Chris Dixon (@cdixon) January 20, 2014 Nintendo has admitted the Wii U is a complete and utter failure, announcing an operating loss for the current financial year and lowering its sales forecasts...


Read the full article: Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



super-mario-action-figure

Today in Tech News Digest, Nintendo admits the Wii U has failed, Chrome extensions are loaded with adware, the China Operating System is revealed, Paramount dumps 35mm film, Windows 8 is condemned as the new Vista, and Amazon wants to become the Nostradamus of online shopping. Nintendo Wii U Failure, Future Should Nintendo go software only? I’m on the fence. Seems inevitable. But: Atari & Sega. http://t.co/fSAOrhfqpi — Chris Dixon (@cdixon) January 20, 2014 Nintendo has admitted the Wii U is a complete and utter failure, announcing an operating loss for the current financial year and lowering its sales forecasts...


Read the full article: Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



super-mario-action-figure

Today in Tech News Digest, Nintendo admits the Wii U has failed, Chrome extensions are loaded with adware, the China Operating System is revealed, Paramount dumps 35mm film, Windows 8 is condemned as the new Vista, and Amazon wants to become the Nostradamus of online shopping. Nintendo Wii U Failure, Future Should Nintendo go software only? I’m on the fence. Seems inevitable. But: Atari & Sega. http://t.co/fSAOrhfqpi — Chris Dixon (@cdixon) January 20, 2014 Nintendo has admitted the Wii U is a complete and utter failure, announcing an operating loss for the current financial year and lowering its sales forecasts...


Read the full article: Wii U Fails, Google Chrome Fails, COS Fails, Windows 8 Fails [Tech News Digest]



Feedly Launches URL Shortener For Sharing What You Read With RSS



Feedly-Update-Article-Search-Custom-Sharing

Feedly has come out with a new URL shortening service that it hopes will foster more sharing and also promote its own RSS reader service. You can recognize it as feedly.com/e. A default URL shortener built into the popular reader application will also help Feedly users pack in more when they share something via Twitter. The feature is available for both free and pro customers of the service. You can activate it from Preferences and switch it off if you don’t want Feedly to gather link sharing analytics from your activity. Respecting the right of publishers to their content, the...


Read the full article: Feedly Launches URL Shortener For Sharing What You Read With RSS



19 January 2014

POLL: How Much Free Space Did You Manage To Get From Dropbox?



dropbox-space

Last week we asked you about CES, and gave you a chance to tell us what was your favorite new gadget this year. Personally, I thought this CES was pretty exciting, but it seems that most of you don’t agree. Nevertheless, one cool gadget did come out on top, and by quite a margin. There were 12 options in this poll, including the option to vote for “other”. To save you from having to read through an endless list of results, I’ll focus on those that did significantly better than their counterparts: Out of the 229 votes on this poll,...


Read the full article: POLL: How Much Free Space Did You Manage To Get From Dropbox?



What Is Creative Commons, And Should You Use It?



cc-unlock

While writing out your next academic paper, you look online for various images which are appropriate for what you’re talking about. Once you find something you like, you simply copy and paste it because, hey, who’s stopping you? More than likely, doing this is technically illegal. Not only that, but it applies to most content that you can find online — including posts/articles and videos. To make things easier on both content creators and consumers, Lawrence Lessig created the suite of Creative Commons licenses, a set of copyright licenses which clarify what you can do with content licensed with one...


Read the full article: What Is Creative Commons, And Should You Use It?