filesize

MySQL Convert Bytes to Kilobytes, Megabytes, Gigabytes

自作多情 提交于 2019-12-03 17:53:41
问题 I have a logs table that stores various file sizes in bytes. I want to be able to query the database and return the smallest possible float which has been converted to MB GB etc. At present I can return the value in MB but how do I continue to divide further to smallest value and append the unit? SELECT CONCAT( ROUND( SUM( data_transferred ) /1048576, 2 ) , ' MB' ) FROM `logs` Any help would be appreciated. UPDATE: Based on the link voodoo417 provided I updated my query to the following,

find the APK size of installed applications

会有一股神秘感。 提交于 2019-12-03 09:10:15
I am trying to calculate apk file size of the installed applications. Here is the code public class PackageTabActivity extends ListActivity{ private static final String APP_NAME = "app_name"; private static final String APP_ICON = "app_icon"; private static final String APP_SIZE = "app_size"; Method getPackageSizeInfo = null; PackageManager pm ; @Override public void onCreate(Bundle icicle){ super.onCreate(icicle); pm = getPackageManager(); try { getPackageSizeInfo = pm.getClass().getMethod("getPackageSizeInfo", String.class, IPackageStatsObserver.class); } catch (SecurityException e1) { e1

Any way to analyze the size of a SWF built in Flex?

微笑、不失礼 提交于 2019-12-03 08:31:32
I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going. I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested in seeing a report of the sizes of all the classes and resources in my application and it would be a huge bonus if I could also view their dependencies. Not knowing how the code is compiled I'm not sure if this is even possible, but it seems like it should since

iOS IPA file size - xcode-archive vs. xcodebuild command

独自空忆成欢 提交于 2019-12-03 07:55:01
问题 I have encountered a problem where the size of iOS application file (IPA) is different between a file built using XCode-GUI archive action and the one created using a command-line build (xcodebuild command). The size matters because we're getting the following message from Apple: The app binary listed below was 44.6 MB when you submitted it, but will be 51.2 MB once processed for the App Store. This exceeds the cellular network download size limit and would require your app to be downloaded

How to get the file size in bytes with C++17

坚强是说给别人听的谎言 提交于 2019-12-03 06:28:11
问题 Are there pitfalls for specific operating systems, I should know of? There are many duplicates (1, 2, 3, 4, 5) of this question but they were answered decades ago. The very high voted answers in many of these questions are wrong today. Methods from other (old QA's) on .sx stat.h (wrapper sprintstatf), uses syscall tellg(), returns per definition a position but not necessarily bytes . The return type is not int . 回答1: <filesystem> (added in C++17) makes this very straightforward. #include

Batch resize images into new folder using ImageMagick

倾然丶 夕夏残阳落幕 提交于 2019-12-03 04:32:38
问题 I have a folder of images over 4MB - let's call this folder dsc_big/ . I'd like to use convert -define jpeg:extent=2MB to convert them to under 2MB and copy dsc_big/* to a folder dsc_small/ that already exists. I tried convert dsc_big/* -define jpeg:extent=2MB dsc_small/ but that produces images called -0 , -1 , and so on. What do I do? 回答1: convert is designed to handle a single input file as far as I can tell, although I have to admit I don't understand the output you're getting. mogrify is

filesize from a String

南楼画角 提交于 2019-12-03 03:17:55
how can i get the "filesize" from a string in php? I put the string in a mysql database as a blob and i need to store the size of the blob. My solution was to create a temp file and put the string into the temp file. now i can get the filesize from the "string". but that solution is not good... greetings It depends. If you have mbstring function overloading enabled, the only call that will work will be mb_strlen($string, '8bit'); . If it's not enabled, strlen($string) will work fine as well. So, you can handle both cases like this: if (function_exists('mb_strlen')) { $size = mb_strlen($string,

how to get size of file in mb?

好久不见. 提交于 2019-12-03 01:27:01
问题 I have a file on a server and it is a zip file. How to check if the file size is bigger than 27 MB? File file = new File("U:\intranet_root\intranet\R1112B2.zip"); if (file > 27) { //do something } 回答1: Use the length() method of the File class to return the size of the file in bytes. // Get file from file name File file = new File("U:\intranet_root\intranet\R1112B2.zip"); // Get length of file in bytes long fileSizeInBytes = file.length(); // Convert the bytes to Kilobytes (1 KB = 1024 Bytes)

iOS IPA file size - xcode-archive vs. xcodebuild command

若如初见. 提交于 2019-12-02 21:22:54
I have encountered a problem where the size of iOS application file (IPA) is different between a file built using XCode-GUI archive action and the one created using a command-line build (xcodebuild command). The size matters because we're getting the following message from Apple: The app binary listed below was 44.6 MB when you submitted it, but will be 51.2 MB once processed for the App Store. This exceeds the cellular network download size limit and would require your app to be downloaded over Wi-Fi The IPA file built with Xcode is 7MB smaller than the one built with XCodeBuild command. The

Minimizing SVG file size [closed]

依然范特西╮ 提交于 2019-12-02 20:32:00
I am saving map images created in Adobe Illustrator as .svg documents. What are some tips and tricks for making the file size as small as possible? Turn off "Preserve Illustrator Editing Capabilities", which includes an enormous proprietary pseudo-binary blob in your file. GZIP your content (either explicitly, or via your web server settings) when the user agents you intend to view your work support this. SVG is XML, and hence text, and hence quite compressible. Reduce unnecessary numeric precision. (You can do this either with the "Decimal Places" setting when saving from Illustrator, or by