size

File Upload Size Validation

北城以北 提交于 2019-12-06 03:56:28
问题 Validations are a big problem, as if i validate in php it has all the functions etc i need to make it work.. But it uploads the file first on a temporary location and then checks, which sucks. If someone uploads a file of 100mb he has to wait for the time just to get no error, but just some internal php screw up hanging the page. One Way: JS //file is id of input file alert(document.getElementById('file').files[0].fileSize); This works in firefox, safari, chrome i guess too, NOT: In opera,

Scale image until either X or Y is the same as the container and then crop the rest

烈酒焚心 提交于 2019-12-06 03:19:46
问题 I am loading images in multiple places where the site theme will have them displayed in different sizes. I experimented with the CSS properties and found that I could scale the image using the height and width parameters and crop the image using position:relative and overflow:hidden. What I want to do though is a combination of that. To scale the image down until the width is the width of the container element or the height is the height of the container element (which ever comes first). Then

Does Firebird BLR contain the related field sizes?

我只是一个虾纸丫 提交于 2019-12-06 02:28:46
Firebird and InterBase keep a compiled form of stored procedures and triggers in BLR (tokenized) format. But I do not really know the structure of BLR. Is field size the part of the BLR? Would I get some problems when a stored procedure contains two fields (source and destination), and later I'll change the size of these two fields? For example they were varchar(50) long, but now I change them to varchar(100) with system table updates. What will happen? Would it only copy 50 characters, or all (100)? Or does BLR contains only object links (tables and fields)? I will try to demonstrate with

VC++: How to get the time and date of a file?

强颜欢笑 提交于 2019-12-06 02:05:25
How do I get the file size and date stamp of a file on Windows in C++, given its path? You can use FindFirstFile() to get them both at once, without having to open it (which is required by GetFileSize() and GetInformationByHandle() ). It's a bit laborious, however, so a little wrapper is helpful bool get_file_information(LPCTSTR path, WIN32_FIND_DATA* data) { HANDLE h = FindFirstFile(path, &data); if(INVALID_HANDLE_VALUE != h) { return false; } else { FindClose(h); return true; } } Then the file size is available in the nFileSizeHigh and nFileSizeLow members of WIN32_FIND_DATA , and the

delphi - calculate directory size API?

和自甴很熟 提交于 2019-12-06 01:51:43
Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. PS: I know how to calculate a directory size by using findfirst and findnext and sum all file's size. Getting the size of one directory is a pretty big problem, mostly because it's something you can't define. Examples of problems: Some filesystems, including NTFS and most filesystems on Linux support the notion of "hard links". That is, the very same file may show

I want to get the video size in MB from videoview from internet path

99封情书 提交于 2019-12-06 01:24:13
I'm trying to get the video file size and display it in the layout before starting the video. I have tried many thing but it wont work video_player_view = (VideoView) findViewById(R.id.videoView2); media_Controller = new MediaController(this); dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm); int height = dm.heightPixels; int width = dm.widthPixels; try { video_player_view.setMinimumWidth(width); video_player_view.setMinimumHeight(height); } catch (Exception e) {} video_player_view.setMediaController(media_Controller); video_player_view.setVideoPath(path);

How to make Edittext size stay put? Android

北战南征 提交于 2019-12-06 00:50:02
I know the attribute which makes the text "disapear" on the left part of the Edittext to maintain a single line, (singleLine="true"). But my issue is when I fill the edittext before the view is displayed... in this case, my edittexts are all going out of the screen... any ideas? thx! This is what is get when fill the empty Edittext. Everything stays put, and the text is vanishing on its left side Screenshot and when I prefill from my DB Screenshot here is the code of the edittext : <EditText android:id="@+id/InscripChampNom" android:layout_height="wrap_content" android:textSize="14px" android

Android bitmap image size

[亡魂溺海] 提交于 2019-12-06 00:30:26
问题 I am downloading images from web and i use Gallery widget to display the images. If the downloaded image size is huge, my application crashes with the below log. "E/GraphicsJNI( 3378): VM won't let us allocate 5591040 bytes" I want to scale down the downloaded image size only when the image size is more to an extent that it will crash the app. I have written the code to scale down the image size but i am not sure how to find the bitmap size so i can decide on whether to scale or not

Android and calculating the size of a one-line string in a given font and font size?

耗尽温柔 提交于 2019-12-05 23:19:13
问题 Is there an API method for calculating the size (i.e. width and height) of a string displayed on one line and in a given font and font size? 回答1: Paint p = new Paint(); p.setTypeface(TypeFace obj); // if custom font use `TypeFace.createFromFile` p.setTextSize(float size); float textWidth = p.measureText("Your string"); // you get the width here and textsize is the height. 回答2: Paint mPaint = new Paint(); mPaint.setTextSize(/*put here ur size*/); mPaint.setTypeface(/* put here ur font type */)

How to Get Mac Desktop size

只谈情不闲聊 提交于 2019-12-05 22:55:20
How do I discover the size of the Desktop (or screen size) of the Mac? For the screen size use -[NSScreen frame] on an instance received through e.g. +[NSScreen mainScreen] or -[NSWindow screen] . To get the visible part without the dock and menu bar, use -[NSScreen visibleFrame] . Keep in mind that the full desktop can stretch over multiple screens. 来源: https://stackoverflow.com/questions/4489290/how-to-get-mac-desktop-size