Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- input



  Let browser prompt for storing password when doing AJAX login

In Web 2.0 era, more and more web applications are using AJAX to replace the traditional HTML form element to perform user login. This usually provides a better user experience than form submission. But it also brings a side effect to the end users. That is the browser will not prompt the user whether s/he wants to save the password so that s/he no needs to enter the username/password again when visiting the same site next time. Below is the code snippet which does the AJAX login.  <scri...

   AJAX,Browser,Login,Password     2015-06-04 10:02:46

  Solution to getKeyCode() returns 0 in Java

The getKeyChar method always returns a valid Unicode character or CHAR_UNDEFINED. Character input is reported by KEY_TYPED events: KEY_PRESSED and KEY_RELEASED events are not necessarily associated with character input. Therefore, the result of the getKeyChar method is guaranteed to be meaningful only for KEY_TYPED events.For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED....

   Java,KeyCode,0,KeyListener     2011-06-06 10:38:11

  Remote form submission

Remote form submission is way of submitting HTML forms from local to a particular remote server. This is used by many advertisers, spammers or even hackers to submit bad data to other websites in order to get what they want. They can write some automation scripts to help them do spamming. How can people do remote form submission and how to prevent this kind of attacks? Since a website can be accessed by almost every one, so one can save a local copy of a HTML form of a website through File->S...

   PHP,Security,Remote form submission     2013-07-14 01:04:49

  Learn Emacs: Keyboard Macros

An emacs keyboard macro is just a recording of user input into emacs, which means that most anything you can do in emacs can be recorded as a macro. Read that again. Pretty powerful.Here’s how it works. To start recording, typeC-x (and input the commands in your macro. Then typeC-x )to stop recording. Then typeC-x eto apply the macro once, orC-u 0 C-x eto apply the macro until the bell rings or end of buffer is reachedKeep in mind that you must not ring the bell when defining a keyboard m...

   Emac,Macro,Code,Example     2011-11-10 10:45:47

  Greedy and Nongreedy Matching in a Regular Expression

By default, pattern matching is greedy, which means that the matcher returns the longest match possible. For example, applying the pattern A.*c to AbcAbcA matches AbcAbc rather than the shorter Abc. To do nongreedy matching, a question mark must be added to the quantifier. For example, the pattern A.*?c will find the shortest match possible. COPY // Greedy quantifiers String match = find("A.*c", "AbcAbc"); // AbcAbc match = find("A.+", "AbcAbc"); // AbcAbc // Nongreedy quantifier...

   Regular expression,Pattern match,Greedy,     2011-08-09 12:42:28

  php://input in PHP

When using xml-rpc, server side will get the data from client with php://input method instead of $_POST. Hence today we will discuss php://input. PHP official manual has below explanation to php://input: “php://input allows you to read raw POST data. It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives. php://input is not available with enctype=”multipart/form-data”. Here we und...

   php://input, IO, input     2013-02-25 20:43:00

  Jelly Bean distribution reaches 0.8% in all Android distributions

Jelly Bean (Android 4.1) is a surprise Google I/O conference bringing to us. After three weeks, Google official statistics said Jelly Bean distribution had reached 0.8% in all Android distributions.The latest Android ecosystem data shows Jelly Bean has a very good start, HSPA+ version of Galaxy Nexus can upgrade the system to Android 4.1(Jelly Bean) began in early July. The Ice Cream Sandwich system distribution rose to 15.8% from 10.9%, it became the second largest system version  followin...

   Jelly Bean,Distribution,Share     2012-08-03 15:11:27

  Remove browse button from input type=file

In Web 2.0 era, many websites will ask the user to upload their avatar when creating their profile. In HTML, the input control we should use is input="file". This is a file control provided by the browser vendor and it should be ran in a sandbox for security consideration. Browsers don't provide ways to choose file from local and upload to the remote server without the input="file" control.  There is one annoying part about the input="file", which is a default button named "Choose File" or...

   file,html,browse,remove browse button     2015-07-12 05:17:51

  Features of Google Android 4.1 Jelly Bean

In today's Google IO 2012 in San Francisco, Google announced its new Android system Android 4.1 Jelly Bean. It's a whole new Android OS and many new features are added to it. Let's check out what new features are added to Jelly Bean.1.  Projector ButterIt uses VSync and Tripple buffering to improve the interactivity experience and increase frame rate. It makes Jelly Bean the fastest and smoothest Android ever2. New home screenYou can customize the home screen. You can re-size the home scree...

   Android, Google IO, Android 4.1, Kelly Bean     2012-06-27 12:49:49

  New Android simulator has some big improvements

Message from the Android developer blog, the Android emulator now has a number of improvements and optimizations. It allows developers to develop applications more conveniently.The Android emulator is an important tool for Android developers developing and testing applications. Due to the rapid growth of Android hardware, the simulator has been slightly left behind. The new simulator brings some new functions including support for GPU, the CPU acceleration sensor support, multi-touch input suppo...

   Android, Simulator,GPU,OpenGL     2012-04-10 13:02:31