size

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

 ̄綄美尐妖づ 提交于 2019-12-01 18:22:44
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:self action:@selector(toolButtonsAction) forControlEvents:UIControlEventValueChanged]; [self.view

What does font size -2 mean here?

不打扰是莪最后的温柔 提交于 2019-12-01 17:05:17
问题 I see this from source code of a web site: <font size="-2">@2009 </font> What does it mean when size is negative? 回答1: It means the font size of @2009 should be -2 units (i.e. 2 units smaller) relative to the content around it. 回答2: That is a deprecated style of markup. Nobody should be using it anymore. Back in the old days, before CSS, you could use the <font> tag to control the relative size of text on the page. A "-2" simply meant two sizes smaller than your base font size. Font sizes

What is the memory size of an ArrayList in Java

丶灬走出姿态 提交于 2019-12-01 16:54:57
I have an ArrayList<Obj> and I wish to know how much memory it is using. The Obj is variant so, it is not as easy as multiply the number of elements in the array per the size of an object. Daniel DiPaolo You can use something like Runtime.getRuntime().totalMemory() and its counterpart Runtime.getRuntime().freeMemory() to get an educated guess, but that doesn't account for objects that are GC'ed between calls. bestsss It's the capacity of the java.util.ArrayList multiplied by the reference size (4 bytes on 32bit, 8bytes on 64bit) + [Object header + one int and one references] . The capacity is

Python “in” operator speed

房东的猫 提交于 2019-12-01 16:41:41
Is the in operator's speed in python proportional to the length of the iterable? So, len(x) #10 if(a in x): #lets say this takes time A pass len(y) #10000 if(a in y): #lets say this takes time B pass Is A > B? A summary for in: list - Average: O(n) set/dict - Average: O(1), Worst: O(n) See this for more details. There's no general answer to this: it depends on the types of a and especially of b . If, for example, b is a list, then yes, in takes worst-case time O(len(b)) . But if, for example, b is a dict or a set, then in takes expected-case time O(1) (i.e., constant time). About "Is A > B?",

FileStream Read/Write method's limitation

社会主义新天地 提交于 2019-12-01 15:27:15
FileStream's read/write method can take only integer value as length. But FileStream object returns length in long . In this case, what if file size is larger than integer value (approximate more than 2GB). Then how FileStream's read/write method handle long value. Then you read and write in multiple chunks. The CLR has a limit on the size of any particular object anyway (also around 2GB IIRC, even on a 64-bit CLR), so you couldn't have a byte array big enough for it to be a problem. You should always loop when reading anyway, as you can't guarantee that a Read call will read as many bytes as

FileStream Read/Write method's limitation

纵然是瞬间 提交于 2019-12-01 15:12:53
问题 FileStream's read/write method can take only integer value as length. But FileStream object returns length in long . In this case, what if file size is larger than integer value (approximate more than 2GB). Then how FileStream's read/write method handle long value. 回答1: Then you read and write in multiple chunks. The CLR has a limit on the size of any particular object anyway (also around 2GB IIRC, even on a 64-bit CLR), so you couldn't have a byte array big enough for it to be a problem. You

/proc/[pid]/cmdline file size

扶醉桌前 提交于 2019-12-01 14:10:06
i'm trying to get the filesize of the cmdline file in proc/[pid]. For example porc/1/cmdline. The file is not empty, it contains "/sbin/init". But i get file_size = 0. int main(int argc, char **argv) { int file_size; FILE *file_cmd; file_cmd = fopen("/proc/1/cmdline", "r"); if(file_cmd == NULL) { perror("proc/1/cmdline"); exit(1); }else { if(fseek(file_cmd, 0L, SEEK_END)!=0) { perror("proc/1/cmdline"); exit(1); } file_size = ftell(file_cmd); } printf("fs: %d\n",file_size); fclose(file_cmd); } Regards That's normal. /proc files (most of them, there are a few exceptions) are generated by the

How big is a sonar database?

为君一笑 提交于 2019-12-01 13:36:08
It might looks like a dumb question. In fact it's more like a poll: how big is your Sonar database? I need this to estimate the requirements for a virtual machine to host my Sonar instance. Also: how big is your team? how many additional bytes is used in the Sonar database for every new commit? I will appreciate any help. I'm assuming that you're referring to Sonar from Codehaus , and not SOund Navigation And Ranging . From the installation page : The Sonar web server requires 500Mo of RAM to run efficiently. In terms of data space and as an indication, on Nemo the public instance of Sonar,

Android screen size resolution

断了今生、忘了曾经 提交于 2019-12-01 13:28:38
问题 My app works perfectly in resolution 480x800. If I keep the 480x800 resolution but change the screen size to for example 2.7 inches, 3.7 inches or 5.4 inches it still is perfect. But when I change the resolution to for example 640x1066 all the ImageButtons is too small and in the wrong place in all screen sizes... I have created ImageButtons in all four folders(drawable-l, m, h, xh) but still the buttons is not in the correct size.. <ImageButton android:id="@+id/ib1" android:layout_width=

priority_queue member function

时间秒杀一切 提交于 2019-12-01 13:24:40
没有优先队列的dijkstra不算真的dijkstra 所以我又回来补常识了 <1>priority_queue::emplace <7>priority_queue::top 1 // priority_queue::emplace 2 #include <iostream> // std::cout 3 #include <queue> // std::priority_queue 4 #include <string> // std::string 5 6 int main () 7 { 8 std::priority_queue<std::string> mypq; 9 10 mypq.emplace("orange"); 11 mypq.emplace("strawberry"); 12 mypq.emplace("apple"); 13 mypq.emplace("pear"); 14 15 std::cout << "mypq contains:"; 16 while (!mypq.empty()) 17 { 18 std::cout << ' ' << mypq.top(); 19 mypq.pop(); 20 } 21 std::cout << '\n'; 22 23 return 0; 24 } 25 //Ooutput:mypq contains: