size

Average and maximum size of directories

不羁的心 提交于 2019-12-01 20:54:18
I have a directory and a bunch of sub-directories like this: - directory1 ( sub-dir1 , sub-dir2 , sub-dir3 , sub-dir4 , sub-dir5 ...........and so on, hundreds of them...) How do I find out what is average size of the sub-directories? And how do I find what is the maximum size of the sub-directories? All using Unix commands... Thanks. If you only have directories and not files in directory1 , then the following two "commands" should give you the size (in bytes) and name of the largest directory and the average of their sizes (in bytes), respectively. $ du -sb directory1/* | sort -n | tail -n 1

size of executable files?

允我心安 提交于 2019-12-01 20:48:17
I created a very small code to add two integers and save the result in another variables, both in assembly language and c language. code in assembly cost me 617 bytes but code in C took 25k bytes!! why there is a huge difference? Also how can I view the assembly symbolic instructions for C code I wrote? High level languages have a certain amount of overhead. While in assembly all you have is exactly what you say. The overhead you are seeing in this case is likely the static binding of standard components, such as printf . Likely an include statement added these. If you want to see what your

Can you set a permanent size for a JPanel inside of a JFrame?

这一生的挚爱 提交于 2019-12-01 20:37:56
My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java swing library... take a look Image Java is automatically expanding each JLabel to fit the screen. I want it to just be those blue squares (water) and the black border and not that gray space. Is there a way I can just set the size of that JPanel permanently so that I don't have to go through changing the size of the JFrame a million times before I get the exact dimension so that the gray space disappears? I also would

string根据特殊字符分割字符串

折月煮酒 提交于 2019-12-01 19:57:54
std::string test_str = "year,mon,day,hh"; std::vector<std::string> res = splitwithstr(test_str, ','); for (int i=0; i<res.size(); i++) { std::cout << res[i] << std::endl; } std::vector<std::string> splitwithstr(std::string &str,char ch) { std::string tmpstr = str+ch; std::vector<std::string> res; if (str.size()<=0) { return res; } size_t pos = tmpstr.find(ch); size_t size = tmpstr.size(); while (pos!=std::string::npos) { std::string child_str = tmpstr.substr(0, pos); if (child_str.size()>0) { res.push_back(child_str); } tmpstr = tmpstr.substr(pos + 1); pos = tmpstr.find(ch); } return res; }

How to change the font size of the text on a UISegmentedControl?

荒凉一梦 提交于 2019-12-01 19:44:46
问题 Following is the code for initializing my UISegmentedControl . - (void)initializeToolButtons { NSArray *buttonTitles = [NSArray arrayWithObjects:@"ANNEXET", @"HOVET", @"GLOBEN", "ALL", nil]; toolbuttons = [[UISegmentedControl alloc] initWithItems:buttonTitles]; toolbuttons.segmentedControlStyle = UISegmentedControlStyleBar; toolbuttons.tintColor = [UIColor darkGrayColor]; toolbuttons.backgroundColor = [UIColor blackColor]; toolbuttons.frame = CGRectMake(0, 0, 320, 30); [toolbuttons addTarget

Long Vector Not Supported Yet Error in R Windows 64bit version

大城市里の小女人 提交于 2019-12-01 19:26:16
问题 I'm trying to test what the memory limitations in the current R version is. runtest <- function(size) { x <- "testme" while(0<1) { x <- c(x, x) size <<- object.size(x) # size of x when fail } } By running runtest(size) in the console on my laptop, I get the following error: > runtest(size) Error: cannot allocate vector of size 4.0 Gb In addition: Warning messages: 1: In structure(.Call(C_objectSize, x), class = "object_size") : Reached total allocation of 7915Mb: see help(memory.size) 2: In

Max 9000 characters in Android TextView?

淺唱寂寞╮ 提交于 2019-12-01 18:55:53
I have items with a lot of text, mostly around 8500 to 9500 characters. I want to display that in a scrollable textview, but when put the text in a TextView, it seems to be truncated to a max of 9000 characters, while a (the original) String object can hold more. Is there a way to extend this number? Absolutely no parameters on restricting the size of the TextView has been set. Thanks in advance. Here is a link which basically says: The answer is "how much memory can you allocate?" Of course the system needs to allocate resources to measure and typeset and render all of that text. If it's too

java之Collection

情到浓时终转凉″ 提交于 2019-12-01 18:54:08
Collection 1.List ArrayList源码分析 package java.util; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; import sun.misc.SharedSecrets; public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable { private static final long serialVersionUID = 8683452581122892189L; /** * 默认初始化容量 */ private static final int DEFAULT_CAPACITY = 10; /** * 空数组 */ private static final Object[] EMPTY_ELEMENTDATA = {}; /** * 空数组 */ private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; /**

centos LVM扩容

陌路散爱 提交于 2019-12-01 18:28:50
centos LVM扩容 #创建物理卷,将新增磁盘加入到物理卷。 [root@Template ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created ##查看物理卷。 [root@Template ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 vg_template lvm2 a--u 39.51g 0 /dev/sdb lvm2 ---- 20.00g 20.00g ##查看物理卷信息。 [root@Template ~]# pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name vg_template PV Size 39.51 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 10114 Free PE 0 Allocated PE 10114 PV UUID A6Ai9a-LdqF-GbCn-p0DF-3V3X-j3h1-KfvlI4 "/dev/sdb" is a new physical volume of "20.00 GiB" --- NEW Physical

Why BSS segment is “16” by default?

泄露秘密 提交于 2019-12-01 18:25:59
As per my knowledge, segmentation for c program is: High address |---------------------------| |env/cmd line args vars | |---------------------------| | stack segment |--> uninitialized auto vars |---------------------------| |---------------------------| |---------------------------| | heap segment |--> dynamic allocated memory |---------------------------| | BSS segment |--> uninitialized static/global vars |---------------------------| | data segment |--> initialized static/global vars |---------------------------| | text segment |--> initialized auto vars/exec instructions |---------------