size

Dynamically increase/decrease array size

我们两清 提交于 2019-11-30 05:44:06
问题 I'm trying to increase the size of an array dynamically. Is there any standard C or C++ function, which appends additional space at the end of an array or removes it? I know, this is difficult, since it cannot be assured that there is enough space at the end on the heap. But shouldn't this be the job of an operating system? 回答1: The function you're looking for is realloc() in C, which is also present in the C++ STL as std::realloc Though as you mentioned C++, you could also go for an standard

How to deal with form size issues from Delphi 6 and WinXP to Delphi 2007 and Vista/Win7

梦想的初衷 提交于 2019-11-30 05:43:34
I have an application written in Delphi 6 and compiled on Windows XP. Usually I leave 8px free between controls and the edges of forms. When this app runs on Vista or Win 7 this gap is smaller or not present at all. I think this might be because these versions of Windows have thicker form borders. Now I am moving the app to Delphi 2007. In the form designer the forms have lost the bottom and right gaps. How should I deal with this? I have hundreds of forms and don't want to go changing them all. Also, most of our users run the app on Win XP so I don't want to make it look bad in XP. Short

How to get matplotlib figure size

混江龙づ霸主 提交于 2019-11-30 05:43:01
For a project, I need to know the current size (in pixels) of my matplotlib figure, but I can't find how to do this. Does anyone know how to do this ? Thanks, Tristan import matplotlib.plt fig = plt.figure() size = fig.get_size_inches()*fig.dpi # size in pixels To do it for the current figure, fig = plt.gcf() size = fig.get_size_inches()*fig.dpi # size in pixels You can get the same info by doing: bbox = fig.get_window_extent().transformed(fig.dpi_scale_trans.inverted()) width, height = bbox.width*fig.dpi, bbox.height*fig.dpi 来源: https://stackoverflow.com/questions/29702424/how-to-get

Get image size from handler

◇◆丶佛笑我妖孽 提交于 2019-11-30 05:42:37
问题 I'm creating an image editor in JS/PHP, but now I'm having trouble. First of all, I load the image from the database (load a blob with imagecreatefromstring). Then I apply a list of actions to this image. But how can I get the image size from this image handler I have then? Without writing it to a file or use a stream object. How?? 回答1: In case you mean the image dimensions: $width = imagesx($imgHandle); $height = imagesy($imgHandle); See imagesx() and imagesy(). If you mean filesize, that's

Different Layouts For Different Screen Sizes On Android?

浪子不回头ぞ 提交于 2019-11-30 05:30:01
So I made an app using in Eclipse using the Graphical Editor, AbsoluteLayout , fixed pixel values, etc... just bad practice in general. It defaulted to a 3.7in screen . Is there any way to design a separate layout for each screen size and have the program choose which to load based on said screen size? cV2 Provide different layouts for different screen sizes By default, Android resizes your application layout to fit the current device screen. In most cases, this works fine. In other cases, your UI might not look as good and might need adjustments for different screen sizes. For example, on a

350GB SVN repo creates atleast 1MB revision for even a simplest task like branch/tag

半城伤御伤魂 提交于 2019-11-30 05:17:08
问题 This all started when I noticed that my repository size is increasing at a daily rate of 1GB. I did a simple test. Created a branch/tag of an existing folder that had a size of 35KB. I took note of revision number and went to $REPO/db/revs/<K-rev>/rev-number/ and checked the size of the revision. It was 1 mega byte. That sounds fishy. Any ideas on what might be wrong here. My repo is about 350GB in size with about 600,000 revisions. P.S. I have already started a rebuild of the whole

Fit <svg> to the size of <object> container

这一生的挚爱 提交于 2019-11-30 04:59:05
I have this markup: #widget1 { height:100px; width:200px; } <div class="widget" id="widget1"> <object data="foo.svg" type="image/svg+xml" /> </div> I managed to make the <object> element fill up the outer <div> , but the inner foo.svg file has its own ideas how big it is. I need foo.svg (which consists of an <svg> element, of course) to be the same size as <object> and <div> . This is answered (with examples) in the svg primer . tl;dr summary: remove 'width' and 'height' attributes on the svg root, and add a 'viewBox' attribute with the value "0 0 w h", where w and h are the absolute values

TableLayoutPanel sizing

无人久伴 提交于 2019-11-30 02:37:50
问题 I may not be using the right control for what I want. I'm filling a table with controls and I want each column to automatically size to the controls contained within it. For example, a column of textboxes will be wider than a column of checkboxes. I don't want to fiddle with measuring if I can help it, due to the complexities of different OS, different DPI, different fonts, etc. The table can expand horizontally to fit the controls, with a scrollbar. How is this possible with a

MySQL error: The maximum column size is 767 bytes

南笙酒味 提交于 2019-11-30 02:15:44
When I run a program which does something with MySQL, I got this error message: 2015-06-10 15:41:12,250 ERROR app.wsutils 419 INCRON: Error: ('HY000', '[HY000] [MySQL][ODBC 5.2(w) Driver][mysqld-5.7.7-rc-log]Index column size too large. The maximum column size is 767 bytes. (1709) (SQLExecDirectW)') I Googled a little bit, and found this error might be relating to the innodb_large_prefix option. However, I am using MySQL 5.7.7 rc, which has already set innodb_large_prefix to be "ON" (checked in MySQL Workbench), allowing up to 3072 bytes. I am not sure if that is the problem with innodb_large

How to check approximate App store size of app in Xcode

蹲街弑〆低调 提交于 2019-11-30 01:50:47
问题 I used to do it but I haven't done it in a while and i've added to my game. Don't remember where on Xcode I can check the approximate app store size of my app. I plugged in the iPhone into my mac. I clicked on Windows, Devices expecting it to be there but it wasn't. I don't remember. Where on Xcode can I check the approximate app store size of my app? 回答1: The Organizer has this functionality for Archives. So, you'll need to create an archive: Product > Archive (you need the iOS device scheme