size

Android activity image background size

别来无恙 提交于 2019-11-28 13:30:49
问题 I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Therefore, what size in pixel should my three images be to be able to fill the screen of the device in ldpi, mdpi and hdpi? Thank you for any response. 回答1: In ldpi -folder, the recommended size is 240x320. In mdpi -folder, the recommended size is 320x480. In hdpi -folder, the recommended size is 480x800.

Get File Size On An FTP in C#

久未见 提交于 2019-11-28 12:03:27
I want to get the size of a file on an FTP. //Get File Size reqSize = (FtpWebRequest)FtpWebRequest.Create(new Uri(FtpPath + filePath)); reqSize.Credentials = new NetworkCredential(Username, Password); reqSize.Method = WebRequestMethods.Ftp.GetFileSize; reqSize.UseBinary = true; FtpWebResponse respSize = (FtpWebResponse)reqSize.GetResponse(); long size = respSize.ContentLength; respSize.Close(); I have tried the following but get a 550 error. File not found / no access. However, the following code works... reqTime = (FtpWebRequest)FtpWebRequest.Create(new Uri(FtpPath + filePath)); reqTime

PHP json_encode size limit?

不羁岁月 提交于 2019-11-28 12:03:23
I'm using a PHP proxy to get the contents of a file. I want to search through that file using the powerfull jQuery options, without having to write all kinds of queries in PHP. Here is my PHP code: $page = file_get_contents( filter_var( $_POST[url], FILTER_SANITIZE_URL ) ); die( json_encode( $page ) ); If the page loaded gets too big PHP will read the entire document, but json_encoding it will only give the first part of the file, not the entire file. I can't find anything about a size limit on json passed data, but apparently there is one. the question: is there a workaround to prevent only

Which icon sizes to use with a JFrame's setIconImages() method?

我怕爱的太早我们不能终老 提交于 2019-11-28 11:57:19
Does anyone know which icon sizes to use with the setIconImages() (PLURAL) method for a jFrame so that my app icons display well on all platforms and in all contexts (e.g., window icon, taskbar icon, alt-tab icon, etc.)? I've found an example that uses a 16px-by-16px and a 32px-by-32px image, but do I need to go any bigger? To test, I have also tried adding 64px and 128px versions to the List passed to setIconImages(), but these do not seem to be used on my Windows 7 machine. However, I cannot test easily on other machines, so am wondering if anyone knows which sizes I should include? Alan

ajax response byte size

青春壹個敷衍的年華 提交于 2019-11-28 11:42:00
I'm using jQuery's getJSONP and I want to log the duration of the call and the size of the response to be able to have some statistics about the usage of my application. This is a cross domain ajax call, so I need to use JSONP, but as the JSONP call is not done with an XMLHttpRequest object, the complete callback from jquery's ajax doesn`t pass the response content. So my question is how to get the response size (content lenght) from a JSONP call. $.ajaxSetup( { complete:function(x,e) { log(x.responseText.length, x.responseText); } } here x is a XMLHttpRequest object for a JSON call , but for

Do certain characters take more bytes than others?

回眸只為那壹抹淺笑 提交于 2019-11-28 11:36:36
I'm not very experienced with lower level things such as howmany bytes a character is. I tried finding out if one character equals one byte, but without success. I need to set a delimiter used for socket connections between a server and clients. This delimiter has to be as small (in bytes) as possible, to minimize bandwidth. The current delimiter is "#". Would getting an other delimiter decrease my bandwidth? It depends on what character encoding you use to translate between characters and bytes (which are not at all the same thing): In ASCII or ISO 8859, each character is represented by one

Confusion in size of a numpy array

白昼怎懂夜的黑 提交于 2019-11-28 11:31:03
问题 Python numpy array 'size' confuses me a lot a = np.array([1,2,3]) a.size = (3, ) ------------------------ b = np.array([[2,1,3,5], [2,2,5,1], [3,6,99,5]]) b.size = (3,4) 'b' makes sense since it has 3 rows and 4 columns in each But how is 'a' size = (3, ) ? Shouldn't it be (1,3) since its 1 row and 3 columns? 回答1: No, a numpy.ndarray with shape (1, 3) would look like: np.array([[1,2,3]]) Think about how the shape corresponds to indexing: arr[0, ...] #First row I still have three more options,

Maximum Thread Stack Size .NET?

那年仲夏 提交于 2019-11-28 10:56:36
What is the maximum stack size allowed for a thread in C#.NET 2.0? Also, does this value depend on the version of the CLR and/or the bitness (32 or 64) of the underlying OS? I have looked at the following resources msdn1 and msdn2 public Thread( ThreadStart start, int maxStackSize ) The only information I can see is that the default size is 1 megabytes and in the above method, if maxStackSize is '0' the default maximum stack size specified in the header for the executable will be used, what's the maximum value that we can change the value in the header upto? Also is it advisable to do so?

Why QVector::size returns int?

六眼飞鱼酱① 提交于 2019-11-28 10:46:44
std::vector::size() returns a size_type which is unsigned and usually the same as size_t , e.g. it is 8 bytes on 64bit platforms. In constrast, QVector::size() returns an int which is usually 4 bytes even on 64bit platforms, and at that it is signed, which means it can only go half way to 2^32. Why is that? This seems quite illogical and also technically limiting, and while it is nor very likely that you may ever need more than 2^32 number of elements, the usage of signed int cuts that range in half for no apparent good reason. Perhaps to avoid compiler warnings for people too lazy to declare

Specifying the maximum string length to scanf dynamically in C (like “%*s” in printf)

北慕城南 提交于 2019-11-28 09:51:54
I can specify the maximum amount of characters for scanf to read to a buffer using this technique: char buffer[64]; /* Read one line of text to buffer. */ scanf("%63[^\n]", buffer); But what if we do not know the buffer length when we write the code? What if it is the parameter of a function? void function(FILE *file, size_t n, char buffer[n]) { /* ... */ fscanf(file, "%[^\n]", buffer); /* WHAT NOW? */ } This code is vulnerable to buffer overflows as fscanf does not know how big the buffer is. I remember seeing this before and started to think that it was the solution to the problem: fscanf