size

Get image size when it loads from an extern URL in Javascript

时光毁灭记忆、已成空白 提交于 2019-12-04 21:14:58
I need to know the image size when it loads from an extern URL because the project needs to resize the image div. I need to do something like this: <img id="imglegend'+layername+'" src="url_to_an_extern_host" /> And, using Javascript and JQuery: $('#imglegend'+layername).ready(function(){ var h = $('#imglegend'+layername); // Resize image div container }); But this didn't work. Is it possible to do? Thanks in advance! $('#imglegend').load(function(){ var w = $(this).width(); var h = $(this).height(); alert(w); alert(h); }).error(function (){ $(this).remove();//remove image if it fails to load/

Batch file that returns folder size

陌路散爱 提交于 2019-12-04 20:49:32
问题 I'm having space issues on my Vista machine and need to figure out what's taking up so much space. I would like to write a simple batch file that returns all folders under C: and the size of each folder. The dir command doesn't appear to return folder size. Unfortunately we don't have admin rights and can't install a third party application and we have other users in our group that also need this information. 回答1: I'd have a look at this thread for some clues as to how to achieve the

Resizing a button

不羁岁月 提交于 2019-12-04 20:27:15
问题 I have a "button" that I wish to use all throughout my site, but depending on where in the site the button is, I want it to display at different sizes. In my HTML I have tried (but its not working): <div class="button" width="60" height="100">This is a button</div> And the matching CSS: .button { background-color: #000000; color: #FFFFFF; float: right; padding: 10px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; } I assumed that if each time I call this class I

what is size of empty class and difference between union, structure and class in c++ ?

淺唱寂寞╮ 提交于 2019-12-04 20:14:53
what is size of empty class and difference between union, structure and class in c++ ? My idea: if no static members in them, they should be same because all members are allocated on stack. If they are all empty, they are same. if they have static members, it depends the relative location of the members inside them. right ? thanks C++ Standard standard specify's that the size of an Empty class should be Non-Zero . Usually, it is 1 byte on most systems. In Bjarne Stroustrup's words, the size is non-zero " To ensure that the addresses of two different objects will be different." The size is 1 on

How big is the stack memory for a certain program, and are there any compiler flags that can set it?

允我心安 提交于 2019-12-04 20:11:30
问题 As the title states: Is there any general "rule of thumb" about the size of the stack. I'm guessing the size will vary depending on the OS, the architecture, the size of the cache(s), how much RAM is available etc. However can anything be said in general, or is there any way to find out, how much of the stack, this program is allowed to use?. As a bonus question is there any way (with compiler flags etc. (thinking mostly C/C++ here, but also more general)) that the size of the stack can be

Android camera - Preview size, Picture Size, cropping and distortions

穿精又带淫゛_ 提交于 2019-12-04 19:33:30
My application needs to capture some pictures of a given size (lets say WxH) in a portrait orientation mode. In a general case the size WxH I want is not supported by the camera therefore I will need to crop the captured picture in order to match my specifications. This apparently simple program is driving me crazy for the problem of "good" corrispondence among preview and picture sizes and format. Let me explain: I need a format (let's give some numbers: 800x600) for the output image, and I have to take pictures in a portrait screen orientation. My camera by default is in Landscape mode

Size of memory allocated to a SQLite in-memory database

家住魔仙堡 提交于 2019-12-04 19:15:44
If a create a in-memory sqlite database using syntax below, then what is the size of maximum memory allocated to it? my $dbh = DBI->connect('dbi:SQLite:dbname=:memory:'); What will happen if size of in-memory database becomes greater than max available memory. Suppose I have 1 GB free and the database size become 1.1 GB, then will some data be written to disk or what? Is there a way to change the value of max-memory allocated to a in-memory sqlite database? Samy Vilar It will use virtual memory, yes it will write out to the disk once you've exceeded all your freely available memory, when that

How to find file size in scala?

ぐ巨炮叔叔 提交于 2019-12-04 18:42:20
问题 I'm writing a scala script, that need to know a size of a file. How do I do this correctly? In Python I would do os.stat('somefile.txt').st_size and in Scala? 回答1: There is no way to do this using the Scala standard libraries. Without resorting to external libraries, you can use the Java File.length() method do do this. In Scala, this would look like: import java.io.File val someFile = new File("somefile.txt") val fileSize = someFile.length If you want something Scala-specific, you can use an

App Icon on Device is too small

故事扮演 提交于 2019-12-04 18:39:26
问题 My problem is that the App Icon on my device looks way too small in comparison to the other apps. I read some solution on other questions, like this one Android App Icon size too small but this doesn't seems to be my problem. In the Android Studio you can make a right click on "res" where you can find new --> image asset where you can create such a icon. it creates icons for all the different sizes like mdpi, hdpi and so on. So i thougt that i might display the app icon correctly but it doesn

How to find floppy\\ CD sector size in Linux?

孤街浪徒 提交于 2019-12-04 17:55:25
How can I get the sector size for floppy and CD disks in Linux, via C++ code? Thank you all. clyfe "#include <hdreg.h>" and use ioctl HDIO_GET_IDENTITY to obtain a struct hd_driveid . On this structure, the x->sector_bytes field is the sector size. #include <stdlib.h> #include <stdio.h> #include <sys/ioctl.h> #include <linux/hdreg.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include <cctype> #include <unistd.h> int main(){ struct hd_driveid id; char *dev = "/dev/hdb"; int fd; fd = open(dev, O_RDONLY|O_NONBLOCK); if(fd < 0) { perror("cannot open"); } if (ioctl(fd, HDIO_GET