shrink

How to get the first n elements of a std::map

青春壹個敷衍的年華 提交于 2019-12-04 05:37:45
Since there is no .resize() member function in C++ std::map I was wondering, how one can get a std::map with at most n elements. The obvious solution is to create a loop from 0 to n and use the nth iterator as the first parameter for std::erase(). I was wondering if there is any solution that does not need the loop (at least not in my user code) and is more "the STL way to go". You can use std::advance( iter, numberofsteps ) for that. Universal solution for almost any container, such as std::list, std::map, boost::multi_index. You must check the size of your map only. template<class It> It

jQueryUI sortable on table rows shrinks them while being dragged

北战南征 提交于 2019-12-03 19:11:15
问题 This issue of table rows shrinking while dragged in the sortable function troubles me for a long time. Any answer? (Q&A) P.S. in order for sortable to work at all on tables you MUST use TBODY around the table rows you wish to sort and then call the sortable function on the containing TBODY. 回答1: .ui-sortable-helper { display: table; } 回答2: All you need to do, is to give a specific-pixeled width to the table cells. How can we do it without knowing the table cells' content? simple: $(document)

Shrink image without affecting the quality in objective c

妖精的绣舞 提交于 2019-12-03 13:25:33
问题 How to shrink the image without affecting the quality programmatically. After capture the image I want to reduce the size of that image without changing the quality in objective-c. 回答1: Here is the code I have used compress the image Code : -(UIImage *)compressImage:(UIImage *)image{ NSData *imgData = UIImageJPEGRepresentation(image, 1); //1 it represents the quality of the image. NSLog(@"Size of Image(bytes):%ld",(unsigned long)[imgData length]); float actualHeight = image.size.height; float

Shrink image without affecting the quality in objective c

此生再无相见时 提交于 2019-12-03 03:34:41
How to shrink the image without affecting the quality programmatically. After capture the image I want to reduce the size of that image without changing the quality in objective-c. Janmenjaya Here is the code I have used compress the image Code : -(UIImage *)compressImage:(UIImage *)image{ NSData *imgData = UIImageJPEGRepresentation(image, 1); //1 it represents the quality of the image. NSLog(@"Size of Image(bytes):%ld",(unsigned long)[imgData length]); float actualHeight = image.size.height; float actualWidth = image.size.width; float maxHeight = 600.0; float maxWidth = 800.0; float imgRatio

Shrink header height by scrollTop value

扶醉桌前 提交于 2019-12-02 16:11:18
问题 Howdey! Simple problem: I've a fixed header, the height shrinks down based on the window scrollTop -value to the half of its height. What I have so far: HTML <div id="header"> <img src="http://yckart.com/ph?text=scroll down" alt> </div> CSS body{padding-top:200%} /* not really needed */ #header { position:fixed; top:0; left:0; right:0; height:200px; color:#eee; background:#222 } #header img {height:100%; width:auto} JS var header = $('#header'), headerH = header.height(); $(window).scroll

Letting a Batch file Minimize a DOS window?

北城以北 提交于 2019-12-01 22:30:29
So i'm kinda into MS-DOS and such again, but i came to ask myself, How can i minimize a DOS window? Any kind would be ok, minimalize, shrink to a tiny blue block. I just can't seem to find a way to let it work on my Windows XP computer, is realy evrything excluded in XP?! One thing you could do is create a windows program that will find the title of the cmd window you are running in and in that program minimize it. In Win32 you would use the FindWindow command to get a window handle, then CloseWindow to minimize it. Something like this totally untested program: int main(int argc, char** argv)

SQL - shrink database log file

丶灬走出姿态 提交于 2019-12-01 07:15:42
问题 I am trying to shrink my database log file. I have tried to run: USE databasename BACKUP log databasename WITH truncate_only DBCC shrinkfile (databasename_log, 1) I get the error message: Msg 155, Level 15, State 1, Line 3 'truncate_only' is not a recognized BACKUP option. Am I missing something? 回答1: SQL Server 2008 no longer allows the NO_LOG / TRUNCATE_ONLY options. To truncate your transaction log, you either have to back it up (for real) or switch the database's Recovery Model to Simple.

How to shrink navigation menu when scrolling down?

和自甴很熟 提交于 2019-11-29 00:03:25
问题 For a new site I am developing I would love to shrink the navigation menu when the user scrolls down. Something similar to what you can see at the IBM site: http://www.ibm.com/us/en/ I couldn't find any jQuery implementation or tutorial around (I am sure I must be searching the wrong keywords) So if someone can point me in the right direction it will make me really happy. Thanks in advance! 回答1: Here you go man: $(function(){ var navStatesInPixelHeight = [40,100]; var changeNavState =

How do I shrink my SQL Server Database?

烂漫一生 提交于 2019-11-27 10:33:47
I have a Database nearly 1.9Gb Database in size, and MSDE2000 does not allow DBs that exceed 2.0Gb I need to shrink this DB (and many others like this at various client locations). I have found and deleted many 100's of 1000's of records which are considered unneeded: these records account for a large percentage of some of the main (largest) tables in the Database. Therefore it's reasonable to assume much space should now be retrievable. So now I need to shrink the DB to account for the missing records. I execute DBCC ShrinkDatabase('MyDB') ...... No effect. I have tried the various shrink

How do I shrink my SQL Server Database?

半城伤御伤魂 提交于 2019-11-26 17:57:19
问题 I have a Database nearly 1.9Gb Database in size, and MSDE2000 does not allow DBs that exceed 2.0Gb I need to shrink this DB (and many others like this at various client locations). I have found and deleted many 100's of 1000's of records which are considered unneeded: these records account for a large percentage of some of the main (largest) tables in the Database. Therefore it's reasonable to assume much space should now be retrievable. So now I need to shrink the DB to account for the