This has probably been answer already but I am trying to return the primary key after inserting a record to the database. Does anyone know how this is accomplish after the record has been created?
I have a method like:
public T Get<T>(string key)
{
}
Now say I want to return "hello" if the type is a string, and 110011 if it is type int.
how can I do that?
typeof(T) doesn't seem to work.
I ideally want to do a switch statement, and return something based on the Type of the generic (string/int/long/etc).
Is this possible?
From the docs:
You usually access to-many
relationships using
mutableSetValueForKey:, which returns
a proxy object that both mutates the
relationship and sends appropriate
key-value observing notifications for
you.
So this returns an "intelligent" NSMutableSet which automatically lets the context delete objects when they get deleted from the set, and reverse? Is that a proxy object?
I have been learning the mapreduce algorithm and how it can potentially scale to millions of machines, but I don't understand how the sorting of the intermediate keys after the map phase can scale, as there will be:
1,000,000 x 1,000,000
: potential machines communicating small key / value pairs of the intermediate results with each other? Isn't this a bottleneck?
I have two table
First table
BID Town
1 ABC
2 ABC2
3 ABC
Second Table
PID BID AmountFirst AmountSecond AmountThird Minority
1__ 1___ 1000_____ 1000________ 1000_____ SC
2__ 2___ 2000_____ 1000_______ 2000_____ ST
3__ 3___ 1000____ 1000_______ 1000_______ SC
BID is foreign key in Second table.
I want sum AmountFirst + AmountSecond +AmountThird for individualTown
e.g for ABC town answer should be : 6000 (summation of PID 1 and PID 2)
I want Linq query for this..Please help
Is there any Wordpress API key to integrate with asp.net or any other way to integrate wordpress blog with asp.net?
If yes then how it is work?
Please reply me in brief.
I really appreciate your help.
Thank You.
I have a mysql table of 3 integer fields. None of the fields have a unique value - but the three of them combined are unique.
When I query this table, I only search by the first field.
Which approach is recommended for indexing such table?
Having a multiple-field primary key on the 3 fields, or setting an index on the first field, which is not unique?
Thanks,
Doori Bar
I am using Sqlite database in my app.I Have 3 tables in database(group, category & categorygroup).I want to retrieve the contents from the category table with reference to the primary key of the group table.category group act as a junction table which as both the primary keys of group and category .How can i achieve that.Please help me out,Thanks
I want to fill this table with 10000000 values but first i want only 1000.
I tried this in sqlite database browser but 3 isnt inserted unless i drop everything after it. But more importantly i dont know how to have num go from 1 to 1000.
create table if not exists test1(id integer primary key, val integer);
insert into test1(val) select '3' as num where num between 1 and 1000
I've got a Registry class and there are a few Registry values that I want to access from within that Registry class. (There is a bit of a calculation with these values so I thought I'd just put all that code right in the Registry Class itself).
So we might have something within our RegistryRoutine.cls like:
Function GetMyValue() as integer
Dim R as new RegistryRoutine
<calculations>
GetMyValue=R.GetRegisetryValue (HKEY, key, value, etc.)
End Function
Hi,
I'm a Java developer starting with .Net development using VS.Net 2008. I would love to get the Eclipse style of navigating methods etc by pressing the Ctrl key, hover over a method then click it to got to that method's declaration. Does such a plugin exist for VS.Net 2008?
thanks
Hi, I've two tables:
Product:
ProductID
ProductName
StateLog:
StateLogID
ProductID (Foreign Key)
State (bit)
TimeStramp (DateTime)
I need to find the heighest StateLog.TimeStamp for each StateLog.ProductID there have the StateLog.State = 0
Hi,
I want to define the background for my application in App.XAML. The background was previously defined in another xaml page,which have multiple Grids inside it like following:
<Grid x:Key="GridGeneric" d:LayoutOverrides="Width, Height">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF00172E" Offset="1"/>
<GradientStop Color="#FF004074" Offset="0.433"/>
<GradientStop Color="#FF081316"/>
<GradientStop Color="#FF001D3F" Offset="0.215"/>
<GradientStop Color="#FF002043" Offset="0.818"/>
<GradientStop Color="#FF003B6C" Offset="0.642"/>
</LinearGradientBrush>
</Grid.Background>
<Grid>
<Grid.Background>
<RadialGradientBrush RadiusY="0.973" GradientOrigin="0.497,-0.276" RadiusX="1.003">
<GradientStop Color="#FFB350EE" Offset="0"/>
<GradientStop Color="#001D3037" Offset="0.847"/>
</RadialGradientBrush>
</Grid.Background>
</Grid>
------
-----
</Grid>
Now I want to place the same in my App.xaml like following:
<Style x:Key="backgroundStyle" TargetType="Grid">
<Setter Property="Background">
<Setter.Value>
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF00172E" Offset="1"/>
<GradientStop Color="#FF004074" Offset="0.433"/>
<GradientStop Color="#FF081316"/>
<GradientStop Color="#FF001D3F" Offset="0.215"/>
<GradientStop Color="#FF002043" Offset="0.818"/>
<GradientStop Color="#FF003B6C" Offset="0.642"/>
</LinearGradientBrush>
</Grid.Background>
<Grid>
<Grid.Background>
<RadialGradientBrush RadiusY="0.973" GradientOrigin="0.497,-0.276" RadiusX="1.003">
<GradientStop Color="#FFB350EE" Offset="0"/>
<GradientStop Color="#001D3037" Offset="0.847"/>
</RadialGradientBrush>
</Grid.Background>
</Grid>
---------
---------
</Grid>
</Setter.Value>
</Setter>
</Style>
But While doing this I am getting the following Exception.
Actually I have such a code:
NSString *path = [[NSBundle mainBundle] pathForResource: @"connect" ofType: @"xml"];
NSError *error = nil;
NSString *data = [NSString stringWithContentsOfFile: path
encoding: NSUTF8StringEncoding
error: &error];
NSString *message = [NSString stringWithFormat:data, KEY, COUNTRY_ID];
which reads the connect.xml from resources. But on the formating the string (message) APP quits without displaying any errors. How can I read file.xml from resources to NSString with format?
Is there a simple :) and efficient way or reading very large number of rows sequentially using Zend_Db?
Basically I need to process entire table, row by row. Table is large, primary key sequence is not guaranteed(i.e. not an autoincrement, but is UNSIGNED INT).
What's the best way to approach this?
Environment: PHP 5.2, Zend Framework 1.10, MySQL 5.1
Hiya.
I have an Iterator that I use on a hashmap, and i save and load the iterator.
is there a way to get the previous key in the hashmap with Iterator? (Java.Util.Iterator)
update
I save it as an attribute in a Red5 connection and then load it back to continue working where i stopped.
another update
I'm iteratoring through the keyset of the hashmap
Hiya.
I have an Iterator that I use on a HashMap, and i save and load the iterator.
is there a way to get the previous key in the HashMap with Iterator? (java.util.Iterator)
Update
I save it as an attribute in a Red5 connection and then load it back to continue working where i stopped.
Another update
I'm iteratoring through the keyset of the HashMap
I never use unitests in my apps . I know that exists many technologies for testing .NET based application. (For example NUnit). Which of this tools more comfortable and more understandable to use. Please can you show the good articles where can I find information about unitests and understand key situation where I must use them?
hi,
The key event is not listened by my Flex app. Since it is really simple code, I cannot understand where the problem is...
init() {
stage.addEventListener(KeyboardEvent.KEY_DOWN, escHandler);
}
private function escHandler(event:KeyboardEvent):void {
debugF.text = "ESC pressed";
}
thanks
Hi everyone,
I'm trying to write a dictionay application on C#. There is a scenarios that user selects a text and press a hot-key, I want to pop-up a quick windows that display the search result of the selected word (just like Lingoes does)
How would I do it in C#?
Thanks in advance
Hi I have a table that looks like this
id : productid : featureid
and would have the following data:
(1, 1, 16)
(2, 1, 21)
(3, 1, 25)
(4, 2, 16)
(5, 2, 21)
(6, 2, 27)
where featureid is a foreign key to another table.
I need to select products that have both featureids of 16 and 25, in which case productid 1 but not productid 2
Can someone show me an example of how to format this query.
I have a certain value of date and time say 28-3-2012(date) - 10:36:45(time) . I wish to convert this whole timestamp to nanoseconds with the precision of nanoseconds. As in the user would input the time and date as shown but internally i have to be accurate upto nanoseconds and convert the whole thing to nanoseconds to form a unique key assigned to a specific object created at that particular time.
Could some one please help me with the same..
I need to generate a string of 7 chars that is based on the id of the row. So knowing the id of the image and a secret key, i should get the generated string.
the string must contain chars from "a" to "z" and numbers from 0 to 9.
I have a dir that contains photos like this
dir/p3/i2/s21/thumb.jpg
the generated string is p3i2s21, then is used to calculate the path of the image.
Hi guyz,
I am working on iphone application which contains HTTP Request and Response.
The format of the response is a key/value format compatible with the Java "Properties" stream format.
I want to store the response into a NSDictionay. Could you suggest me any way to do this?
Thank you.
sangee