Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on September 06, 2007 03:11:40    Last update: January 31, 2013 12:13:45
The built-in function SYSDATE returns a DATE value containing the current date and time on your system. For example, UPDATE ACCOUNT SET LAST_MODIFIED = SYSDATE; updates the LAST_MODIFIED column to the current system time. select to_char(sysdate, 'MM-DD-YYYY HH24:MI:SS') N... prints the current date & time.
Created by magnum on December 25, 2012 15:14:42    Last update: December 25, 2012 15:14:42
The C function strtok tokenizes a string when you call it repeated with a NULL pointer. It should be mentioned that it destroys (alters) the original string. #include <stdio.h> #include <stdlib.h> #incl...
Created by James on September 20, 2012 15:08:15    Last update: September 21, 2012 11:55:58
The idea is simple: duplicate the input field and position one on top of the other. The top one will take the input, while the bottom one will serve the placeholder. The top one will have a transparent background so the value of the placeholder field will show through. The placeholder field is disabled so that it's value is not submitted with the form. Here's the code: (function($) { $.fn.placeholder = function(... But in practice, it's tricky. Notice that I used 'background-color': 'rgba(255, 255, 255, 0)' for the background transparency. This is because 'background-color': 'transparent' does not work for IE9. Even though the input is on top of the placeholder, the placeholder always gets the event when you click on the field. That might be...
Created by James on September 20, 2012 10:22:58    Last update: September 20, 2012 10:22:58
This is a simple jQuery placeholder plugin that can be used on both text and password fields. I've been using the Mathias Bynens plugin for a while and it has been quite useful. I decided to create my own plugin because of two problems: The interaction between the Mathias Bynens plugin and jQuery validation can be quite intricate. Placeholder text is lost once the input field gets focus. This can be a problem when I want to auto-focus on a field, say user id on a log in form. I must mention that although it worked for me, this plugin has not been thoroughly tested. Feel free to provide feedback if you see problems. (function($) { $.fn.placeholder = function(... Since it uses absolute positioning, you...
Created by James on September 18, 2012 20:46:12    Last update: September 18, 2012 20:46:12
There's no easy way in jQuery (like one or two lines) to copy all CSS properties (inline, inherited, native, etc.) from one element to another. Such as, create a <p> element that has the same CSS as an existing <div> element. Upshots provides a simple jQuery plugin that seemed to work. I copy the code below. $.fn.copyCSS = function(source){ var dom = ...
Created by James on September 18, 2012 12:14:13    Last update: September 18, 2012 20:28:46
This is an example of IIFE (Immediately Invoked Function Expression) from jQuery Plugins Authoring : (function( $ ) { $.fn.myPlugin = function() {...
Created by magnum on September 11, 2012 12:10:03    Last update: September 11, 2012 12:10:46
Sample code for UDP client and server in C. The server simply echos back the client message. The client stays in "receive" loop to demonstrate the connection-less nature of the UDP protocol. Server code: #include <stdio.h> #include <stdlib.h> #incl... Client code: #include <stdio.h> #include <stdlib.h> #incl... Try it out: Start the server with: ./udpserver 8888 Send message to server: ./udpclient localhost 8888 "Hi, it's me! " Server console displays: Received from 127.0.0.1:41776: Hi, it's me! UDP is connectionless. Send a message from a second client to the first client: $ ./udpclient localhost 41776 "From client 2" First client console displays: $ ./udpclient localhost 8888 "Hi, it's me! " Re... It should be noted that the distinction between client and server is blurry. The only major...
Created by James on August 27, 2012 10:01:07    Last update: August 27, 2012 10:01:07
Some ways to get the tag name of a jQuery object: Use the prop() function: $('<a/>').prop('tagName'); $('<a/>').prop('node... Get tagName from the DOM element: $('<a/>').get(0).tagName nodeName from the DOM element seems to do the same: $('<a/>').get(0).nodeName; Use the is() function: $('<a/>').is('A'); $('<a/>').is('a');
Created by voodoo on August 17, 2012 14:16:06    Last update: August 17, 2012 14:16:06
This C function compares a string against a list of words and returns TRUE if every word is found in the string in the order listed in the word list, FALSE otherwise. #include <string.h> #include <stdio.h> i...
Created by voodoo on August 16, 2012 14:55:21    Last update: August 16, 2012 14:55:21
Option 1: use the function tolower : /* lower case Z */ char c = tolower('Z'); Option 2: logical or with ' ' : /* lower case Z */ char c = 'Z' | ' '; /...
Previous  1 2 3 4 5 6 7 8 9 10 Next