size

WPF: How to display an image at its original size?

耗尽温柔 提交于 2019-11-27 11:24:12
I have a problem with displaying images in WPF. Here's my code: <Button HorizontalAlignment="Left" Grid.Column="1" Grid.Row="5" Margin="0,5"> <Button.Content> <StackPanel Orientation="Horizontal" Margin="10,0"> <Image Source="/images/user_add.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" /> <TextBlock Text="添加" /> </StackPanel> </Button.Content> </Button> I have an image with original size 32*32, but when I ran the above code, the image will stretch to fill all the space, beyond its original size. I also set the "Stretch" property to "None",

creating array without declaring the size - java

隐身守侯 提交于 2019-11-27 11:20:36
问题 i've digging around about the same issue but i couldn't find the same as i had i want to create an array without declaring the size because i don't know how it will be ! to clear the issue i'd like to give you the code that i'm looking up for public class t { private int x[]; private int counter=0; public void add(int num) { this.x[this.counter] = num; this.counter++; } } as you see the user could use the add function to add element to the array 10000 times or only once so it's unknown size

Size of pointers: Dependent factors

扶醉桌前 提交于 2019-11-27 11:20:36
问题 I am finding difficulties in understanding the factors on which the size of pointer variables in C is dependent on. I checked few references, the only information I got until now is pointer size is dependent on the processor architecture .I would like to know the following details Please explain more on how the architecure impacts the pointer size. In general, if the pointer is of x bits then 0 to 2^(X)-1 number of address locations should be there.I am losing track while relating the number

Java JTable setting Column Width

≡放荡痞女 提交于 2019-11-27 11:04:12
I have a JTable in which I set the column size as follows: table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.getColumnModel().getColumn(0).setPreferredWidth(27); table.getColumnModel().getColumn(1).setPreferredWidth(120); table.getColumnModel().getColumn(2).setPreferredWidth(100); table.getColumnModel().getColumn(3).setPreferredWidth(90); table.getColumnModel().getColumn(4).setPreferredWidth(90); table.getColumnModel().getColumn(6).setPreferredWidth(120); table.getColumnModel().getColumn(7).setPreferredWidth(100); table.getColumnModel().getColumn(8).setPreferredWidth(95); table

What is the difference between getWidth/Height() and getMeasuredWidth/Height() in Android SDK?

久未见 提交于 2019-11-27 10:50:23
The Android Documentation says that there is two sizes for a view, the measured dimensions and the drawing dimensions . The measured dimension is the one computed in the measure pass (the onMeasure method), while the drawing dimensions are the actual size on screen. Particularly, the documentation says that: These values may, but do not have to, be different from the measured width and height. So, my question is: what could make the drawing dimension be different of the measured dimension? If the onMeasure(int,int) method respects the layout requirements (given as the parameters

How to create a DataFrame of random integers with Pandas?

三世轮回 提交于 2019-11-27 10:49:54
I know that if I use randn , import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(100, 4), columns=list('ABCD')) gives me what I am looking for, but with elements from a normal distribution. But what if I just wanted random integers? randint works by providing a range, but not an array like randn does. So how do I do this with random integers between some range? Anand S Kumar numpy.random.randint accepts a third argument ( size ) , in which you can specify the size of the output array. You can use this to create your DataFrame - df = pd.DataFrame(np.random.randint(0,100

Set element width or height in Standards Mode

丶灬走出姿态 提交于 2019-11-27 10:37:55
问题 Is it possible to set width or height of HTML element (ex. <div> ) in JavaScript in Standards Mode? Note the following code: <html> <script language="javascript" type="text/javascript"> function changeWidth(){ var e1 = document.getElementById("e1"); e1.style.width = 400; } </script> <body> <input type="button" value="change width" onclick="changeWidth()"/> <div id="e1" style="width:20px;height:20px; background-color:#096"></div> </body> </html> When user presses the change width button, the

How to Get True Size of MySQL Database?

ε祈祈猫儿з 提交于 2019-11-27 10:03:22
I would like to know how much space does my MySQL database use, in order to select a web host. I found the command SHOW TABLE STATUS LIKE 'table_name' so when I do the query, I get something like this: Name | Rows | Avg. Row Length | Data_Length | Index Length ---------- ---- --------------- ----------- ------------ table_name 400 55 362000 66560 numbers are rounded. So do I have 362000 or 400*362000 = 144800000 bytes of data for this table? And what does Index Length mean? Thanks ! ron_dobley From S. Prakash, found at the MySQL forum : SELECT table_schema "database name", sum( data_length +

Can I make Eclipse on Ubuntu look more compact? [duplicate]

浪子不回头ぞ 提交于 2019-11-27 09:19:36
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Gigantic Tabs in Eclipse on Ubuntu Back when I was using Eclipse on Ubuntu 10.04 LTS, I found that the tabs and bars used a bit too much vertical spacing, which made the interface a bit too spacey for my taste. However, I didn't find a good way to make this right, and I learned to work with it. But now, after installing Ubuntu 12.10 (or actually Linux Mint 14 Cinnamon), it has gotten even bigger, the vertical

size of array in c

China☆狼群 提交于 2019-11-27 09:13:19
a simple question that bugs me. Say I have an array defined in main like so int arr[5] . Now, if I'm still inside main and I set int i = sizeof(arr)/sizeof(arr[0]) then I is set to be 5, but if I pass the array as a function parameter and do the exact same calculation in this function, I get a different number. Why is that? At first I thought its because in a function arr is a pointer, but as far as I know arr is a pointer inside main too! Also, if I do something very similar only I initialize the array dynamically, I get weird results: int *arr = (int*) malloc(sizeof(int) * 5); int length =