Recent Notes

Displaying notes 61 - 70
Created by James on September 21, 2012 12:18:10    Last update: September 21, 2012 12:23:07
When one element overlaps another, which one gets the event when you click on it? The top one, of course! Not so for IE. If the top element is transparent, the click falls through on areas in the bottom element where there's "content". Try the simple HTML below. When you click on the letter "A", the bottom DIV gets the event in IE. <!doctype html> <html> <head> <style ... There's a CSS property pointer-events which controls click through behavior in case of overlay, but it doesn't have any effect in IE.
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 20:35:10    Last update: September 18, 2012 20:35:10
The " border-width " CSS property returns empty string: $('input').css('border-width'); // returns "" You have to give a specific border in order to get the width: $('input').css('border-left-width'); $('inp...
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 voodoo on September 17, 2012 15:02:15    Last update: September 17, 2012 15:02:15
Start gdb with the executable and coredump: $ gdb <path to executable> core While in the debugger, use the following commands: (gdb) where ("shows a summary of the stack") ... Example debug session from Debugging Under Unix: gdb Tutorial : Use backtrace (or bt ) to see the callstack: (gdb) backtrace #0 Node<int>::next (this=0x0) ... Inspect the value of item_to_remove at address 0xffbef014 (the value is 1): (gdb) x 0xffbef014 0xffbef014: 0x00000001 (g... Note: The program must be compiled with the debug switch -g in order to see the source code. More resources: Linux software debugging with GDB Debugging with gdb
Created by Fang on July 25, 2012 12:52:40    Last update: September 14, 2012 13:37:57
Summarized from official JAX-WS documentation : Sending and Receiving SOAP Headers To send a SOAP header: HelloService helloService = new HelloService(); ... To receive a SOAP header: List<Header> inboundHeaders = bp.getInboundHeaders... Message logging On the client side, set system property: com.sun.xml.ws.transport.http.client.HttpTransport... On the server side, set system property: com.sun.xml.ws.transport.http.HttpAdapter.dump=tru... Propagation of Server-side Stacktrace Propagation of Stack trace is on by default. The whole stacktrace (including nested exceptions) is propagated in the SOAP Fault and the complete exception stacktrace is visible to the client as cause of SOAPFaultException . To turn off stack trace propagation, set this system property on the server: com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptu... Update: At least on the client side, the property name has been changed to: com.sun.xml.internal.ws.transport.http.client.Http... The messages are dumped to stdout . For...
Created by voodoo on September 13, 2012 20:18:15    Last update: September 13, 2012 20:18:15
Allocate 2-dimensional array with one malloc/calloc. Example1: #include <stdio.h> #include <stdlib.h> i... Example 2: #include <stdio.h> #include <stdlib.h> s...
Created by voodoo on May 22, 2012 12:26:41    Last update: September 12, 2012 19:09:22
My program core dumped but there was no core file. The problem was that the core file size was 0: $ ulimit -a core file size (blocks, -c... Use ulimit to enable it: $ sudo bash # ulimit -c unlimited Actually, you can update the limit for yourself without root. You can put the ulimit command in .bashrc .
Previous  2 3 4 5 6 7 8 9 10 11 Next