Is there a way to auto complete a statement in eclipse? If I type
if (condition)
it should, after pressing some key, become
if (condition) {
// putting cursor here
}
I have a db with thousands of domains and data. I want to list only 100 rows of each domain. i can't use LIMIT 100 cause that only limits 100 records but I want
dom1 to list 100
dom2 to list 100
dom3 to list 100
all in one query. This is what I have so far.
SELECT domain COUNT(Key) AS DomCount
FROM table_domain
GROUP BY user,location
ORDER BY domain,DomCount DESC
Could I use a CASE?
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
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
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 am trying to pass some data from one page to another page by using jquery but it dose not working, below is the code which I want to click the text in source page and the destination page will hide the current text.
Source page:
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("a.pass").bind("click", function () {
var url = "Destination.html?name=" + encodeURIComponent($("a.pass").text());
window.location.href = url;
});
});
</script>
</head>
<body>
<a class="pass">a</a><br />
<a class="pass">b</a><br />
<a class="pass">c</a><br />
<a class="pass">d</a>
</body>
</html>
Destination page:
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
var queryString = new Array();
$(function () {
if (queryString.length == 0) {
if (window.location.search.split('?').length > 1) {
var params = window.location.search.split('?')[1].split('&');
for (var i = 0; i < params.length; i++) {
var key = params[i].split('=')[0];
var value = decodeURIComponent(params[i].split('=')[1]);
queryString[key] = value;
}
}
}
if (queryString["name"] != null) {
var data = queryString["name"]
$("p.+'data'").hide();
}
});
</script>
</head>
<body>
<p class="a">a</p>
<p class="b">b</p>
<p class="c">c</p>
<p class="d">d</p>
</body>
</html>
Please Help.
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 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.
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 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.
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 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
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
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.
Hi SO gurus.
I would like to try to automize some recurrent job when i develop asp.net application.
For example, for each <asp:button> I create, I would like to insert the classical code
onomouseover="...something"
onmouseout=" ..something-again.."
Is there a way to automatically add this code "piece" in vs 2008?
Some key combination to add "pre-ready" piece of code?
Thank you
I have a requirement to implement some kind of dictionary object. Something like MyDict<K,V1, V2). For example if I have a Question as Key(k) then Correct answer is V1 . V2 is user selected answer. Is there a collection that would satisfy this requirement in C#. If I have to design my own type, what interfaces should I implement. ICollection and Ilist ?
Maybe not literally but the query below gets an error near user. If i change it to userZ it works. WHY can i not use that name? Is there a way to specific its a field instead of a keyword? (or whatever it is)
create table Post2 (
id INTEGER PRIMARY KEY NOT NULL,
title nvarchar(max)
NOT NULL,
body nvarchar(max)
NOT NULL,
user integer REFERENCES Post1(id));
I have a dictionary of values read from 2 fields in a database: a string field and a numeric field. The string field is unique so that is the key of the dictionary.
I can sort on the keys, but how can I sort based on the values?
Note: I have read this post 72899 and probably could change my code to have a list of dictionaries but since I do not really need a list of dictionaries I wanted to know if there a simpler solution.
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
I have created a table with the following structure-
$sql = "CREATE TABLE followers
(
uid int UNSIGNED NOT NULL UNIQUE,
PRIMARY KEY(uid),
follower_count int UNSIGNED ,
is_my_friend bool,
status_count int UNSIGNED,
location varchar(50)
)";
I need to find the uid of the person with max(status_count+follower_count) and whose is_my_friend = 1
I wrote the following query but I ain't getting the correct uid.
SELECT p.uid FROM (select uid,is_my_friend,max(follower_count+status_count) from followers) p WHERE p.is_my_friend = 1;
NSString string = @"Hardwork";
NSUserDefaults defs111 = [NSUserDefaults standardUserDefaults];
[defs111 setObject:string forKey:@"first_name_textfield"];
Hi,
In my code I'm enable to set this value string for key first_name_textfield.
Why is it,so?
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