Abhishek Gupta

The Sun won’t set at NIT Durgapur !

How To Convert Video File in Linux through command line

Posted by abhiitechie on August 30, 2009

Get the ffmpeg package first from the repo by

sudo apt-get install ffmpeg

Then follow the following command lines to get going


3gp to avi : ffmpeg -i source.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 destination.avi

flv to 3gp : ffmpeg -i source.flv -s 176×144 -vcodec h263 -r 25 -b 200 -ab 64 -acodec mp3 -ac 1 -ar 8000 destination.3gp

flv to mp4 : ffmpeg -i source.flv -vcodec h264 -r 25 -b 200 -ab 128 -acodec mp3 -ac 2 -ar 44100 destination.mp3

avi to mp4 : ffmpeg -i source.avi -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 320×240 destination.mp4

mp4 to 3gp : ffmpeg -i source.mp4 -s 176×144 -vcodec h263 -r 25 -b 12200 -ab 12200 -ac 1 -ar 8000 destination.3gp

avi to 3gp : ffmpeg -i source.avi-s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -r 25 -ab 32 -y destination.3gp

mpg to 3gp : ffmpeg -i source.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -ab 32 -y destination.3gp

Enjoy !

Posted in linux, Personal | Tagged: , , , , , , , , , | 6 Comments »

All about QFlicks

Posted by abhiitechie on August 16, 2009

Hi people , this post is all about a project which I started roughly a month ago by the name of “QFlicks”. It was named so because the graphics library I chose to use is the popular Ot and the  application is a movie collection cataloger which scans the disk for media files and gets film informations (duration, plot, cover ,rating ,poster cover , casts  etc) from the popular Amazon’s http://imdb.com or the Internet Movie Database . It also allows the user to filter his possessions based on movie titles,genre,ratings  , seen or unseen etc.

The later versions of the software will witness subtitle downloader extention and many more.

Here are the basic features which I plan to inmplement in version 1.0

  • Scanning user-chosen directories to find media files (films in a first time)

Status : Done

How : Used a recursive OS walk algorithm to extract movies from all folders , sub-folders , sub-sub folders etc.

  • Extracting film titles from file names (tough one if files are not properly named)

Status: Done

How: Using Neural Network algorithms and and basic Regular Expression.

  • Create a list of these names in a database get films information (duration, plot, poster cover , rating , casts etc) from imdb

Status : Done

How: Used a library named IMDBPy as imdb.com does not provide and API (Another example of Amazon’s miserness). The database used is MySQL which experienced developers feel is a wrong choice for desktop.

  • display films list and information of the selected one

Status: Done

  • basic settings handling

Status: More or less done until someone comes out with bugs

  • Filtering based on genre , title ,rating seen or unseen etc.

Status: Not Done

To Do: Learn multiple substring search in SQL ( SQL sucks , I hate it)

  • Clean and simple gui

Status : The Gui is simple but not clean and hangs as I have not implemented the Multi-threading

To Do : Learn Multi-threading and make the network call fuctions run in separate threads in the background and also need to implement customized Progress Bars for UI

Plugins (towards upper versions):

  • subtitle downloader
  • playlist manager
  • automatic new files inclusion (directory survey)
  • music album and video series handling

Tools Used:

  • Python as the Programming Language
  • Qt as Graphics Library
  • QtDesigner for the Gui
  • SVN as versioning program
  • MySQL as database software
  • IMDBPy as the library
  • GPLv3 licence

Here is the screen-shot of my Work :
Screenshot
The sourceforge Link for the project is :

Get the source from the Repository :

Current OS Support :
Gnu/Linux with Qt >= 4.5 and MySQL >= 5.0

Newbies who don’t know how to use SVN or are facing problems with code can mail me at
mailto: abhii.cse.nitdgp@gmail.com

The project is likely to see its first release on 24th of August 2009

Posted in mysql, Personal | Tagged: , , , , , , , , , , , , , , , | 3 Comments »

“Kya Apke toothpaste me Namak Hai ?”- I love facebook

Posted by abhiitechie on August 9, 2009

I was onto my usual facebook quizzes when my eyes fell on my friend Govind’s status which asked

“Kya Apke Toothpaste me namak hai ??”

This was enough to provoke something like this (see below) with the help of some more contributors namely my friends Alok Sharma and Piu Chatterjee .

Here is the list of the worst television advertisements ever…….

Govind Daga Kya aapke toothpaste mein namak hai!!??

about an hour ago · Delete
Alok Sharma
Alok Sharma

Bloody ghatiya advertisement :D
about an hour ago
Richi Parasrampuria
Richi Parasrampuria

Naa.. Mere toothpaste me bi namak nai hai.. :P
about an hour ago
Govind Daga
Govind Daga

@ Abhishek : Canteen theke noon ne ar tooth paste e diye de.. Same effect, provided you use a toothpaste…

@ Alok : You cant use ” :D ” smiley if you dont have namak in your toothpaste… Haan, advertisement to amazingly ghatiya hai… lolz. Makes me go ROFL whenever I see it..

@ Richi : The salt gods are going to curse your teeth~!

about an hour ago
Alok Sharma
Alok Sharma

The ad creates such hype…!u see…if u eat healthy everyday…stay healthy…wtf toothpaste mein namak…do u think our ancestors had namak in their toothpastes??or moreover…toothpaste bhi tha kya… :D ……!!
about an hour ago
Govind Daga
Govind Daga

+ it makes you think that if you do “aaaah” with your face on the cheek then a beautiful girl might come into the room or wherever you are…!! Chor log!!
about an hour ago
Abhishek Gupta
Abhishek Gupta

kya aapke toothpaste me namak hai???!!!

few months later…
kya aapke toothpaste me kaali mirch hai???

about an hour ago · Delete
Abhishek Gupta
Abhishek Gupta

Student sleeping. Wakes up with a start. Cries out loudly,
Grandmother enters.
Granny : “Beta kya hua?? Koi bura sapna dekha??”Kid: Haan daadi, maine dekha, ke mere daaton main bahut dard hain aur main exam nahi de pa raha hoon….”
Granny : Beta, pareshan mat ho. Hamare desh main sadiyo se namak ki madad se daaton ka khayal rakha jaata hain. Tu
bhi namak se apne daat saaaf kar, tujhe kabhi dard nahi hoga
about an hour ago · Delete
Govind Daga
Govind Daga

jyada future mein gaya to we would be using Biryani to clean our teeth~!
about an hour ago
Abhishek Gupta
Abhishek Gupta

tata sky ad………ispe laga dala to life jhingalala
about an hour ago · Delete
Govind Daga
Govind Daga

Plane scene..
Passenger has something that is too much for his gums. Cries out loudly.
A *very pretty lady* comes in with a mic andh a camera crew.

Lady: Kya aapke masooron mein dard hai?… Read More

about an hour ago
Govind Daga
Govind Daga

Tata sky ads ka mera fav line : “Blllooodddiii Picckturee Qwallttyy!!”
about an hour ago
Abhishek Gupta
Abhishek Gupta

the thing to be noticed here is that it is a Plane scene … very inovative
about an hour ago · Delete
Govind Daga
about an hour ago
Abhishek Gupta
Abhishek Gupta

duniya ke sabhi dentist sirf issi toothpaste ko hi is temaal karte hain “indian dental assosiation dwara pramanit”=====pepsodent !!! Is there really an Indian Dental Association
about an hour ago · Delete
Govind Daga
Govind Daga

That is indeed a very good question~! And id it is, they discuss about which toothpaste is the best… Yawn~!
about an hour ago
Abhishek Gupta
Abhishek Gupta

Pepsodent Toothpaste :: raat bhar kitaanoo ke sath..dhisum dhisum dhisum dhisum
about an hour ago · Delete
Govind Daga
Govind Daga

People may buy these fancy products but for me it is : Dabur Lal Dant Manjan and they always have a free gift..
about an hour ago
Abhishek Gupta
Abhishek Gupta

kya aap close up karte hai?
……aap close up kyun nahi karte hain? (all in nasal tone)
about an hour ago · Delete
Govind Daga
Govind Daga

And believe me on this one : There is a brand, most prolly Colgate powder, that “SUNIEL SHETTY” endorses… Who on Earth would but that?????????????????????? ?
about an hour ago
Abhishek Gupta
Abhishek Gupta

I got this from net :
Tata Indicom: With Ajay Devgan in double roll! And the dumbwitted kajol too

‘Firangi log aaye hain, bijeneshh laaye hain!
Chineesshhh, Japaneeshh, Thank you pleasssh, Badtameesh!’ :pound:

about an hour ago · Delete
Abhishek Gupta
Abhishek Gupta

I am loving facebook very much
about an hour ago · Delete
Govind Daga
Govind Daga

We need to have FACEBOOK ads too…. lolz. Facebook toke Creative Director niye nebe~~!! lolz… Hamare ko bhi job wob dilaiyega!!
about an hour ago
Abhishek Gupta
Abhishek Gupta

Kya Lux Cozy wakai Lucky hai chachoo” A boy asks Sunny Deol…
and suddenly some SAMOSAz come…….

Kuch Bhi…Kahin Bhi :

about an hour ago · Delete
Govind Daga
Govind Daga

Are woh SUNNNNNY DEOL hai bhai~~!!
What about : Sawd Sugandh ka raja….. Badshah Masala!!!
59 minutes ago
Abhishek Gupta
Abhishek Gupta

and how about Zandu Kesari Jeevan
51 minutes ago · Delete
Govind Daga
Govind Daga

Belmont Academy of Style!!!!!
50 minutes ago
Alok Sharma
Alok Sharma

Sanjay dutt and TMT sariya :D

and do u think amitabh eats dabur chyawanprash???..or navratan cool cool oil??

49 minutes ago
Govind Daga
Govind Daga

If he were to be using those actually he would have been charging 50 times more…
48 minutes ago
Alok Sharma
Alok Sharma

Ye to bada toing hai….;)…now for god’s sake…wtf is this toing???
48 minutes ago
Piu Chatterjee
Piu Chatterjee

i dont like salty toothpastes…i love the taste of close-up and pepsodent…!!!! :P *sheepish grin*
48 minutes ago
Govind Daga
Govind Daga

The SALT GODS!!!!
*Yeh to bada toing hai* ——– ULTIMATE!!!!!!!
46 minutes ago
Alok Sharma
Alok Sharma

Lol……!!!…feels like raymond…the complete man…since 1925…so before that,u can imagine-never was a complete man ever….:D…
45 minutes ago
Abhishek Gupta
Abhishek Gupta

kya apke pass hai…meter wala pen?
45 minutes ago · Delete
Govind Daga
Govind Daga

Sabki Pasand — Manikchand!!!
44 minutes ago
Alok Sharma
Alok Sharma

Ye andar ki baat hai….lux andarwear;)…wear a chaddi baniyan and girls go gaga over u…and u beat so many hatta katta ppl…..
43 minutes ago
Abhishek Gupta
Abhishek Gupta

@Alok :
‘toing’ may have something to do with the tensile strength of the elastics used in underwears
43 minutes ago · Delete
Govind Daga
Govind Daga

*Toing might also be…..*

** Munh mein Rajnigandha, kadamon mein duniya **

41 minutes ago
Alok Sharma
Alok Sharma

……..bsnl’s ads….-ultimate!!2mbps superspeed…bsnl is all we need:D….bloody weed!!!…..
41 minutes ago
Piu Chatterjee
Piu Chatterjee

*toing* is a verry subtle yet wierdly cheap was of describing what sex appeal the males exude after they wear tham blasted briefs!
p.s – i do not like the briefs advertiesment billboards staring down at me from the streets!!!! :O
40 minutes ago
Alok Sharma
Alok Sharma

Lycra…do u have it???
39 minutes ago
Govind Daga
Govind Daga

@ Piu : They are not staring at you… They are staring at……
38 minutes ago
Alok Sharma
Alok Sharma

Ganesh sattu!!!
37 minutes ago
Govind Daga
Govind Daga

Boroplus and Kareena Kapoor : Dulhe ke yaar thoda Boroplus lagale… What people would do for money !!!!
36 minutes ago
Alok Sharma
Alok Sharma

Jab ghar mein ho sun…tan tana tan…..god…there should have been another tan at the end for rhyming pleasure atleast!!
33 minutes ago
Alok Sharma
Alok Sharma

Imagine kishan kumar in an ad…wid all the glamor babes around….raymond-the complete man!!!…….
31 minutes ago
Abhishek Gupta
Abhishek Gupta

Cheetah bhi peeta hai
30 minutes ago · Delete
Govind Daga
Govind Daga

Chup chup ke kyun ladkiyon ki cream lagaye…??? :P
29 minutes ago
Alok Sharma
Alok Sharma

Bru-sip lick hmmm……..is that really coffee????
29 minutes ago
Abhishek Gupta
Abhishek Gupta

Miss Palanpur… Radha Ms. Palanpur ban gai… kitne saare gaavon se log aae the.. Ab toh ye filmein bhi karegi… Kuch meetha ho jaaye…
28 minutes ago · Delete
Alok Sharma
Alok Sharma

Hum chlormint kyun khaatey hain???now if no one knows the reason,stop eating!!why beat the ones who eat:D
27 minutes ago
Govind Daga
Govind Daga

WHAT ABOUT THE TOILET CLEANING ADS?????? esp. the ones by infamous Aman Verma… :D
27 minutes ago
Govind Daga
Govind Daga

@ Alok : =))
26 minutes ago
Alok Sharma
Alok Sharma

Meetha hai khaana aaj pahli tareekh hai……???now what really is that??!!
25 minutes ago
Govind Daga
Govind Daga

Tide hai to White hai… **Swwwwwoooooosssssshhhhh**
24 minutes ago
Alok Sharma
Alok Sharma

Kal raat…kal raat maine precaution nahin liya….UNWANTED 72….
23 minutes ago
Govind Daga
Govind Daga

‘eeeeeeeeeeeeeeeeeeeeeeeeeeeeee’
22 minutes ago
Alok Sharma
Alok Sharma

Tedha hai par mera hai…..is that really kurkure u r talking abt????????
22 minutes ago
Govind Daga
Govind Daga

“Paragon lagu babuji” — Pairon ke liye Paragon!!!
21 minutes ago
Alok Sharma
Alok Sharma

Set wet….and the styles they show r like eeeeeeeeeeuk!!!just wid hairstyle ladki mil jaayegi????
20 minutes ago
Govind Daga
Govind Daga

Fair and Lovely Ayurvedic: A woman becomes supermodel after her father gives ayurvedic treatment. Why did the father not give her the same treatment earlier?
18 minutes ago
Alok Sharma
Alok Sharma

Best ad-and really nice-mentos-dimag ki batti jala de-the donkey monkey thing!
17 minutes ago
Abhishek Gupta
Abhishek Gupta

Swagat Baniyaan:: A bearish kind of man…I call him that coz of hair on his body , wears swaagat and a lady in backgroundg says ”Peheniye Swaagat Shriman”
16 minutes ago · Delete
Govind Daga
Govind Daga

Best is the Naukri.com wala ad : HARI SADU : H for Hitler, A for arrogant, R for Rascal, I for Idiot…. Now SADU…
15 minutes ago
Alok Sharma
Alok Sharma

Santan dosh…sautan ka lafda…business problems…health samasyaen…call karein baba pasha…fee only 100rs….
13 minutes ago
Abhishek Gupta
Abhishek Gupta

Voltas AC : India ka AC , Korea ka nai
12 minutes ago · Delete
Alok Sharma
Alok Sharma

That’s nice!true
12 minutes ago
Alok Sharma
Alok Sharma

Walk when you talk..
11 minutes ago
Alok Sharma
Alok Sharma

Chocolate axe??????just by spraying any deo???girls are so cheap???literally??
9 minutes ago
Govind Daga
Govind Daga

The English Guru ads…. Man have sat through the entire ads….. :P
8 minutes ago
Alok Sharma
Alok Sharma

Haldiram prabhuji ke????kya;)
7 minutes ago
Govind Daga
Govind Daga

lolzzzzz…..
7 minutes ago
Govind Daga
Govind Daga

Jab hasin ke mauke aate hain… fatfatya kyun aap chalate hain.???
6 minutes ago
Abhishek Gupta
Abhishek Gupta

safffedi tujhe salaam..safedi tujhe salaam.
3 minutes ago · Delete
Govind Daga
Govind Daga

26 comments to 100~~!!!
2 minutes ago
Abhishek Gupta
Abhishek Gupta

hey put this to your blog , titled Worst Tele-Ads
about a minute ago · Delete
Govind Daga
Govind Daga

Yeah… Was thinking about it… And credits to the contributors too… :P
14 seconds ago


All this went on for about an hour and half till we decided – lets stop and make this PIECE OF ART available to AAM JANTA through my blog.

Credits : Govind , Me , Alok and Piu

CopyLeft – All rights unreserved

Credits :

1. Govind Daga (Initiator)

2.Abhishek Gupta

3.Alok Sharma

4.Piu Chatterjee

Posted in Personal | Tagged: , , , , | 2 Comments »

At Sun IEC , Bangalore

Posted by abhiitechie on May 20, 2009

Sun’s India Engineering Center (IEC) occupies most of the Divya Shree Chambers building off Langford Road in Bangalore. I kept on telling everybody that is near M.G Road but in reality it is nothing like that

3316002336_d2c5157ec5_o

3316002746_94295b70e0_o

3316001660_e79dc6a0e8_o

Lunch (always a major preoccupation with me) is provided at the 5th-floor canteen, which gets very crowded around 12:45,hence sometimes we need to book the conference room to have our lunch . There’s a buffet of both Vegetarian and its non counterpart for a reasonable sum of Rs 35 /- (Very very cheap as per Bangalore standards but just a bit expensive as per Kolkata standards.)

3315174305_65773309d6_o

 

3315174149_f8813881a2_o

For a change we can order fresh fruits , as I saw for some ladies who prefered them for the dieting routine.

IMG_3622

The Sun break rooms have a great selection of teas, including elaichi (cardamom), masala (what Americans call chai spice), and ginger. Plus a selection of other hot drinks – cocoa, instant coffee, and flavored mixes that I haven’t quite understood yet.

tea

There’s a machine dispensing hot water and hot milk to mix these with. There is also brewed coffee, chocolate powder,tomato soup mix and powdered,badam milk and many more .

12-05-09_0900

Now coming to the important part that is WORK . The very first day I got my Badge ready for which there was a photo session sort of arrangement at the ground floor near the data-center . For the first time in my life I felt very important .

For those of you who don’t know what a Badge is , I will like to tell that it is card like thing with my photo and other details and chip and a magnetic strip .It comes to use at the security gates where we need to show it a sensor and only then the door opens .Besides this is used when we need to use a Sun Ray machine ( Runs on Solaris 10 and has a SPARC architecture) , it is inserted into a slot inside the machine.

11-05-09_1802

Its is a really nice environment around to work with caring and loving seniours and and lots of respect for every employee . The working time is flexible ,by flexible I mean there is no fixed working schedule and timing or anything like that . When you are done with your work you can can go home and sleep and if its like you prefer to work nights then you can work in the office during the nights. 

So I am kind of enjoying the experience as a Sun Intern and another news I have just heard that Sun IEC Bangalore will be celebrating its 10th birthday by throwing a huge party at a hotel called OTERRA at Electronic city and we are invited . So my next post will be on IEC 10 years of Engineering Excellence.

11-05-09_1820

Posted in Personal, sun | Tagged: , , , , , , , , , , , , , , | 11 Comments »

JavaOne Coming to the OSUM Community

Posted by abhiitechie on May 18, 2009

As it is very difficult for everyone  to make the trip to San Francisco to attend JavaOne. That’s why special arrangements has been made to bring JavaOne to the Open Source University Meetup (OSUM) Community.  OSUM has scheduled a series of webinars which are previews of hands-on labs that will be conducted at JavaOne.

Check the OSUM events calendar for the complete schedule and RSVP today.

Posted in sun | Tagged: , , , , , , , , | Leave a Comment »

Viewing your server(Remote Desktop) with browser using VNC Java Applet

Posted by abhiitechie on May 18, 2009

VNC consists of two components. A server, which runs on the computer you want to remotely access, and a viewer, which runs on the computer you are sitting in front of. There are two important features of VNC:

  • The server and the viewer may be on different machines and on types of computer. The protocol which connects the server and viewer is simple, open, and platform independent.
  • No state is stored at the viewer. Breaking the viewer’s connection to the server and then reconnecting will not result in any loss of data. Because the connection can be remade from somewhere else, you have easy mobility.

So to get started with VNC you need to run a server, and then connect to it with a viewer. First of all, you have to download and install the software on the platforms you want to use.

VNC software requires a TCP/IP connection between the server and the viewer. This is the standard networking protocol on LANs, WANs, broadband and dialup ISP. Each computer has a unique IP address and may also have a name in the DNS. You will need to know the IP address or name of the server when you connect a viewer to it.

The VNC servers also contain a small web server. If you connect to this with a web browser, you can download the Java version of the viewer, and use this to view the server. You can then see your desktop from any Java-capable browser, unless you are using a proxy to connect to the web. The server listens for HTTP connections on port 5800+display number. So to view display 2 on machine ‘snoopy’, you would point your web browser at:

http://snoopy:5802/

The applet will prompt you for your password, and should then display the desktop.

Posted in java, Personal | Tagged: , , , , , , , , , , , | 2 Comments »

Roumen Strobls Leaving Sun Microsystems Inc.

Posted by abhiitechie on May 18, 2009

He is the man behind all those brilliant screen casts and blog posts and loads of tutorials for both Netbeans and OpenSolaris. Finally he has decided to leave Sun but he will still stick on to Java and work for JavaOne

Here is what he writes in his blog http://blogs.sun.com/roumen/entry/leaving_sun)

“I have decided to quit Sun Microsystems. I spent amazing 5 years at Sun and I am very grateful for all I’ve learned with the company. Working on both NetBeans and OpenSolaris adoption was real fun so I leave with very mixed feelings.

I am going back to Java developer business and will be going to Java One with my new employer, so you will find me in the Java One pavilion area if you want to say hi. I wish my Sun colleagues good luck with their new adventures!

P.S. Thanks for all the beans.

Wish you all the best Sir . Keep enlightening us with your screencasts.

Posted in sun | Tagged: , , , , , , , | Leave a Comment »

OpenSolaris 2008.11 Mini-Book

Posted by abhiitechie on May 17, 2009

The Getting Started with OpenSOlaris 2008.11 mini-books were recentlyOpenSolaris released. They are available in English, Brazilian Portuguese, Spanish, Italian, German, Traditional Chinese, Simplified Chinese, Korean and Japanese.

You might notice that there is a difference between the content of these books. They are composed by three different documents, and only the ones in English, Simplified Chinese and Japanese have them all. All other languages have only one document.

The books have a pretty basic approach, so they are aimed at people who doesn’t have much experience with the OS. This makes them perfect to be indicated during basic courses and presentations.

It seems that the 2008.11 version of these mini-books will be available only in the digital format.

Download:

OpenSOlaris 2008.11 mini-book (English)

Posted in sun | Tagged: , , , , , , , , , , , , , | 1 Comment »

Regular Expressions in Javascript

Posted by abhiitechie on May 17, 2009

Here are some examples of using regular expressions for input validations in javascript.

var input = “hello222″;
var ok = false;

var dob_regex = /^([0-9]){2}(\/){1}([0-9]){2}(\/)([0-9]){4}$/;   // DD/MM/YYYY
var email_regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;  // email address
var username_regex = /^[\w.-]+$/;  // allowed characters: any word . -, ( \w ) represents any word character (letters, digits, and the underscore _ ), equivalent to [a-zA-Z0-9_]
var num_regex = /^\d+$/; // numeric digits only
var search_regex = “/hello/”;
var password_regex = /^[A-Za-z\d]{6,8}$/;  // any upper/lowercase characters and digits, between 6 to 8 characters in total
var phone_regex = /^\(\d{3]\) \d{3}-\d{4}$/;  // (xxx) xxx-xxxx
var question_regex = /\?$/; // ends with a question mark

1. Check that there are at least 3 numeric characters in input
if ( input.match(/d/g) == null ) {
ok = false;
} else if ( input.match(/d/g).length < 3 )  {
ok = false;
} else {
ok = true;
}
2. Check that the input has a minimum of 8 characters
if ( input.length >= 8 ) {
ok = true;
}
3. Check that the input is in a correct date format (DD/MM/YYYY)
if ( dob_regex.test(input) ) {
ok = true;
}
4. Check that the input is in a correct email format (username@example.com)
if ( email_regex.test(input) ) {
ok = true;
}
5. Check that the input matches the specified username format
if ( username_regex.test(input) ) {
ok = true;
}
6. Check that the input contains only numeric characters
if ( input.match(num_regex) ) {
ok = true;
}
7. Search for a specific word in the input
if ( input.search(search_regex) != -1 ) {
ok = true;
}
8. Check that the input matches the specified password format
if ( input.match(password_regex) ) {
ok = true;
}
9. Check that the input matches the specified phone number format
if ( input.match(phone_regex) ) {
ok = true;
}
10. Check that the input is a question (ends with a question mark)
if ( question_regex.test(input) ) {
ok = true;
}

Posted in Personal, web | Tagged: , , , , | 7 Comments »

 
Follow

Get every new post delivered to your Inbox.