Does setWidth(int pixels) use device independent pixel or physical pixel as unit?
For example, does setWidth(100) set the a view's width to 100 dips or 100 pxs?
Thanks.
I have an int* of rgb data,width, height, and scanlinestride where i would like to create an NSImage.
i have looked around and found that i need to use NSData?
what is the ideal way of doing this?
for(int i = 1;i<100;i++)
string strI = i.tostirng();
in here, if i is 1 then strI is '1'
But I want to get '01'
or '001'
it looks quite easy. but there's only article about datetime.tostring("yyyy-MM-dd") :(
we have a large table (5608782 rows and growing) that has 3 columns Zip1,Zip2, distance
all columns are currently int, we would like to convert this table to use varchars for international usage but need to do a mass import into the new table convert zip < 5 digits to 0 padded varchars 123 becomes 00123 etc. is there a way to do this short of looping over each row and doing the translation programmaticly?
I want to convert an int to a string but if it is a single digit I want to add a leading 0
Is that one of the built in format options? or do I have to do it manually?
g++ compiler complains about conversions between related types (from int to enum, from void* to class*, from const char* to unsigned char*, etc.). Compiler handles such convertions as errors and won't compile furthermore. It occurs only when I compile using Dev-C++ IDE, but when I compile the same code (using the compiler which Dev-C++ uses) such errors (even warnings) do not appears.
How to mute errors of such types?
Hi Experts,
I have a list of int values some thing like below (upper bound and lower bounds are dynamic)
1, 2, 3
4, 6, 0
5, 7, 1
I want to calculate the column values in vertical wise like
1 + 4 + 5 = 10
2 + 6 + 7 = 15
3 + 0 + 1 = 4
Expected Result = 10,15,4
Any help would be appreciated
Thanks
Deepu
ipString is a String representation of an IP address with spaces instead of dots.
String[] ipArray = ipString.split(" ");
String ip = "";
for (String part : ipArray){
if (part != null){
ip += part
}
}
ip = ip.trim();
int ipInt = Integer.parseInt(ip); // Exception is thrown here.
Exception in thread "main" java.lang.NumberFormatException: For input string: "6622015176".
Could someone explain why this exception is being thrown?
Would (1) int a; new Object[] {a} be the same as (2) new Object[] {new Integer(a)} ?
If I do the 1st one, will (new Object[]{a})[0] give me an Integer?
thank you
Is it possible to constraint a method so that it receives only int, double, long or other numerical types that has the usual numerical operations ( such as +,-,*,/) defined?
Whenever I test my app.. it binds the data from Note class and displays it if it isn't a string. But for the string variables it wont bind. What am I doing wrong?
Inside my main:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ListBox x:Name="Listbox" SelectionChanged="listbox_SelectionChanged" ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Width="800" MinHeight="60">
<StackPanel>
<TextBlock x:Name="Title" VerticalAlignment="Center" FontSize="{Binding TextSize}" Text="{Binding Name}"/>
<TextBlock x:Name="Date" VerticalAlignment="Center" FontSize="{Binding TextSize}" Text="{Binding Modified}"/>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
in code behind:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
MessageBox.Show("enters onNav Main");
DataContext = null;
DataContext = Settings.NotesList;
Settings.CurrentNoteIndex = -1;
Listbox.SelectedIndex = -1;
if (Settings.NotesList != null)
{
if (Settings.NotesList.Count == 0)
{
Notes.Text = "No Notes";
}
else
{
Notes.Text = "";
}
}
}
and
public static class Settings
{
public static ObservableCollection<Note> NotesList;
static IsolatedStorageSettings settings;
private static int currentNoteIndex;
static Settings()
{
NotesList = new ObservableCollection<Note>();
settings = IsolatedStorageSettings.ApplicationSettings;
MessageBox.Show("enters constructor settings");
}
notes class:
public class Note
{
public DateTimeOffset Modified { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int TextSize { get; set; }
public Note()
{
MessageBox.Show("enters Note Constructor");
Modified = DateTimeOffset.Now;
Title = "test";
Content = "test";
TextSize = 32;
}
}
g++ compiler complains about conversions between relative types (from int to enum, from void* to class*, from const char* to unsigned char*, etc.). Compiler handles such convertions as errors and won't compile furthermore. It occurs only when I compile using Dev-C++ IDE, but when I compile the same code (using the compiler which Dev-C++ uses) such errors (even warnings) do not appears.
How to mute errors of such types?
Hi,
I begin my NHibernate mapping. In major cases I use int type but for some entities I need to persist million of objets. Is long type for identity will be the best choice ?
In C, what is the difference between these two?
float myF = 5.6;
printf( "%i \n", (int)myF ); // gives me "5"
printf( "%ld \n", floor(myF) ); // also "5"?
When is one preferable over the other?
hello mates i am trying to store value from dropdown list to an integer but i am getting an exception Input string was not in a correct format.
int experienceYears = Convert.ToInt32("DropDownList1.SelectedValue");
please help.
Hi folks,
Quick question. I want to change the color of an int based on the value being positive or negative, using css if possible.
Any ideas??
Thanks again!
Given a List<int> myValues which I know to be ordered, what is the quickest way to determine if X is in the given list?
Do I really have to write my own binary search?
For example:
import random
x = random.randint(1, 6)
y = 2
new = x / y
...
now, lets say x turns out to be 5.
How can I catch if it's an int or a float before doing other things in my program?
Hello
I want to use a datatype to represent sizes like 3bits or 12bits.. can anyone tell me how can I implement this in c++
and is there any code like this, which can help me define size in bits
int i:3;
thanks in advance ..
Hi ,
i have employee table and its empid length is INT 3 ,
But it accepting more then 3 character ....
How it is possible
(THIS IS TESTED IN PHPMYADMIN)
Does it make sense to use UUID as primary key in MySQL?
What would be pros and cons of using UUID instead of regular INT, beside trouble of hand querying?
hey,
I have two-dimension array
List<List<int>> boardArray
How can I enumerate throw this array to check that it contains other value than 0 ?
I think about boardArray.Contains and ForEach ,cause it return bool value but I don't have too much experience with lambda expression :/
Please help :)