|
Jul 08
|
A very light, simple and easy to use address picker using Google Maps API v3 and jQuery, you may use this widget to embd in you web forms if you want user to input address or/and latitude/longtitude.

A very light, simple and easy to use address picker using Google Maps API v3 and jQuery, you may use this widget to embd in you web forms if you want user to input address or/and latitude/longtitude.
There are certain wrong ways using JavaScript/jQuery to get the width/height of dynamic loaded image. Here are some reasons why your codes won’t work:
Let me show you the WRONG ways: (WRONG)get width/height after setting html content
var html = '<img src="URL" />;
$('#my_div').html(html);
var width = $('#my_div img').width(); // may return 0
(WRONG)get width/height in “load” event handler
var html = '<img src="URL" />';
var img = $(html);
html.load(function(){
// return 0 if image is loaded from browser cache
var width = img.width();
});
$('#my_div').html(img);
And now, comes the right way… The Exact way
var html = '<img src="URL" />';
$('#my_div').html(html);
var ni = new Image();
ni.onload = function(){
var width = ni.width;
}
ni.src = img.attr(URL);
Historically, a C program has been composed of the following pieces:
Figure 7.6 shows the typical arrangement of these segments. This is a logical picture of how a program looks; there is no requirement that a given implementation arrange its memory in this fashion. Nevertheless, this gives us a typical arrangement to describe. With Linux on an Intel x86 processor, the text segment starts at location 0x08048000, and the bottom of the stack starts just below 0xC0000000. (The stack grows from higher-numbered addresses to lower-numbered addresses on this particular architecture.) The unused virtual address space between the top of the heap and the top of the stack is large. Figure 7.6. Typical memory arrangement
Note from Figure 7.6 that the contents of the uninitialized data segment are not stored in the program file on disk. This is because the kernel sets it to 0 before the program starts running. The only portions of the program that need to be saved in the program file are the text segment and the initialized data. The size(1) command reports the sizes (in bytes) of the text, data, and bss segments. For example: $ size /usr/bin/cc /bin/sh
text data bss dec hex filename
79606 1536 916 82058 1408a /usr/bin/cc
619234 21120 18260 658614 a0cb6 /bin/sh
The fourth and fifth columns are the total of the three sizes, displayed in decimal and hexadecimal, respectively. —— All text copy from Advanced Programing in the Unix Environment. |
Categories
Links |
Recent Comments