size

JFrame : Getting actual content size

北城余情 提交于 2019-12-01 03:54:52
I have created a JFrame, and attempting to get it's size is giving an incorrect result, compared to what I expect. I have determined that it is including the operating system borders around the edges, and the title bar. How can I get/set the real size which I have available for rendering? The size you are getting is the size of the content and the size of the insets . If you use Jcomponent.getInsets() , you can find the size of the content with simple subtraction. Your question is confusing: JPanels don't have title bars or window borders, they are abstract containers that are INSIDE JFrames.

How to find Object's size (including contained objects)

早过忘川 提交于 2019-12-01 03:44:52
I want to estimate the size taken up by an object. To get the object's size I can just use To do so I might use Instrumentation.getObjectSize(myObject) , but this will give me a "shallow" size. I want to get the size of the Object, including the sizes of the objects it references. My thought is that I need to get the size of the object, then go through all the object's fields that are not static or primitives and get the size for the objects that they point to and do this recursively. Of course, I don't want to count an object size a few times, or get stuck in a loop, So I'll have to remember

How to increase the size of an array in java?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 03:35:07
I want to store as many elements as desired by the user in an array.But how do i do it??,If i were to create an array,i must do so with a fixed size. Every time a new element is added to the array and the array becomes full,i want to update its size by '1'.I tired various types of code..but.it did not work out.It would be of great help if yall could give me some solutions regarding it..in code if possible.Thank You Instead of using an array, use an implementation of java.util.List such as ArrayList . An ArrayList has an array backend which holds values in a list, but the array size is

Pyqt how to get a widget's dimensions

纵然是瞬间 提交于 2019-12-01 03:09:39
I am currently developing an application in which i cannot use modal windows (due to some application constraints). However, in some cases i would like to simulate a popup window. To do so i dynamically create a widget that has the centralwidget as parent and i use the move() method to place it where i want. I would like to know if there is a way to get a widget's dimensions at a given time (considering the mainWindow can be resized at any time) so that i will be able to center the placeholder popup (a simple widget) at the middle of the centralwidget. Thank you You can use frameGeometry or

Why do the sizes of data types change as the Operating System changes?

被刻印的时光 ゝ 提交于 2019-12-01 02:59:52
问题 This question was asked to me in an interview, that size of char is 2 bytes in some OS, but in some operating system it is 4 bytes or different. Why is that so? Why is it different from other fundamental types, such as int ? 回答1: That was probably a trick question. The sizeof(char) is always 1. If the size differs, it's probably because of a non-conforming compiler, in which case the question should be about the compiler itself, not about the C or C++ language. 5.3.3 Sizeof [expr.sizeof] 1

Where can I look up the definition of size_type for vectors in the C++ STL?

假如想象 提交于 2019-12-01 02:49:36
问题 It seems safe to cast the result of my vector's size() function to an unsigned int . How can I tell for sure, though? My documentation isn't clear about how size_type is defined. 回答1: Do not assume the type of the container size (or anything else typed inside). Today? The best solution for now is to use: std::vector<T>::size_type Where T is your type. For example: std::vector<std::string>::size_type i ; std::vector<int>::size_type j ; std::vector<std::vector<double> >::size_type k ; (Using a

Changing Console Window's size throws ArgumentOutOfRangeException

时光总嘲笑我的痴心妄想 提交于 2019-12-01 02:13:19
I am trying to set the size of the Console Window in a c# console application. I get an ArgumentOutOfRangeException with this message: The value must be less than the console's current maximum window size of 41 in that dimension. Note that this value depends on screen resolution and the console font. I am using this to set it: Console.WindowHeight = 480; How do you set the Console window's size properly? Soner Gönül From MSDN of Console.WindowHeight property: The height of the console window measured in rows. As you can see, these are not pixels . Just remember, these values can change

Whats the size of an SQL Int(N)?

Deadly 提交于 2019-12-01 02:12:30
Simple question. I have tried searching on Google and after about 6 searches, I figured it would be faster here. How big is an int in SQL? -- table creation statement. intcolumn INT(N) NOT NULL, -- more table creation statement. How big is that INT(N) element? What's its range? Is it 2^N or is it N Bytes long? (2 ^ 8N)? Or even something else I have no idea about? It depends on the database. MySQL has an extension where INT(N) means an INT with a display width of 4 decimal digits. This information is maintained in the metadata. The INT itself is still 4 bytes, and values 10000 and greater can

Android: How to change the Size of the RadioButton

为君一笑 提交于 2019-12-01 02:07:40
I have many RadioButton s in my app. The RadioButtons are too big for me. Is there any way to make them smaller? Can't be done, the radio button is a built-in control component and as such its size is fixed. One quick hacky solution is to scale the button down: <RadioButton android:scaleX="0.5" android:scaleY="0.5" /> This works great for going smaller. For going larger, this tends to cause some clipping from the container View, so you'll likely have to hardcode the height/width of the RadioGroup to fit the scaled buttons. The button drawable can also get noticeably pixelated the larger you go

Ambiguous behaviour of .bss segment in C program

点点圈 提交于 2019-12-01 02:05:12
问题 I wrote the simple C program (test.c) below:- #include<stdio.h> int main() { return 0; } and executed the follwing to understand size changes in .bss segment. gcc test.c -o test size test The output came out as:- text data bss dec hex filename 1115 552 8 1675 68b test I didn't declare anything globally or of static scope. So please explain why the bss segment size is of 8 bytes. I made the following change:- #include<stdio.h> int x; //declared global variable int main() { return 0; } But to