Hello ,
I would like to query from SQL Server 2000 Database.I have got two tables. They are Purchase and PurchaseDetails. I would like to get product records with Last Purchase ID but I can't query with the following statements.So please help me.
SELECT TOP 100 PERCENT dbo.Purchase.PurchaseID AS LastOfPurchaseID, dbo.PurchaseDetails.ProductID,
MAX(dbo.Purchase.PurchaseDate) AS LastOfPurchaseDate
FROM dbo.Purchase INNER JOIN
dbo.PurchaseDetails ON dbo.Purchase.PurchaseID = dbo.PurchaseDetails.PurchaseID
GROUP BY dbo.PurchaseDetails.ProductID, dbo.Purchase.PurchaseDate,dbo.Purchase.PurchaseID
ORDER BY MAX(dbo.Purchase.PurchaseDate) DESC
is there a way l can compare two columns | fields in django like
Invoice.objects.filter(amountdue_lt=invoiceamount)
where amountdue and invoiceamount are two columns of Invoice object
Thanks
From what I can tell, = and != is supposed to work on strings in OCAML. I'm seeing strange results though which I would like to understand better.
When I compare two strings with = I get the results I expect:
# "steve" = "steve";;
- : bool = true
# "steve" = "rowe";;
- : bool = false
but when I try != I do not:
# "steve" != "rowe";;
- : bool = true
# "steve" != "steve";; (* unexpected - shouldn't this be false? *)
- : bool = true
Can anyone explain? Is there a better way to do this?
If you have 2 Matrices of dimensions N*M.
what is the best way to get the difference Rect?
Example:
2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3
2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3
2 3 4 5 4 3 2 3 <---> 2 3 2 3 2 3 2 3
2 3 4 5 2 3 2 3 2 3 2 3 2 3 2 3
2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3
|
|
\ /
Rect([2,2] , [3,4])
4 5 4
4 5 2-> A (2 x 3 Matrix)
The best I could think of is to scan from Top-Left hit the point where there is difference.
Then scan from Bottom Right and hit the point where there is a difference.
But In worst case, this is O(N*M). is there a better efficient algorithm?
Codesign warning: provisioning is not applicable for product type 'Application' in SDK Device - iPhone OS3.1'; ignoring..
Redownloaded my developer certificate, made a new provisioning profile, still getting this error. Searched the Xcode project and removed all lines referencing a Provisioning Profile, but that didn't seem to remove it from the project settings (went to show package contents, then opened the project file).
Was originally on a different machine then transferred over, if that makes a difference?
Thanks
I tried the example given in http://forums.sun.com/thread.jspa?threadID=780576&tstart=67605
to create if statement dynamically. But it is not working fine. Instead of using "age" variable as integer, i have used string in the below example. I am getting "fail" as answer instead of "success".
Can anyone help me?
/
To change this template, choose Tools | Templates
and open the template in the editor.
/
import java.lang.reflect.*;
import bsh.Interpreter;
public class Main {
public static String d;
public static void main(String args[])
{
try {
String age = "30";
String cond = "age==30";
Interpreter i = new Interpreter();
i.set("age", age);
System.out.println(" sss" + i.get("age"));
if((Boolean)i.eval(cond)) {
System.out.println("success");
} else {
System.out.println("fail");
}
}
catch (Throwable e) {
System.err.println(e);
}
}
}
Thanks,
Mani
We are thinking about combining .NET technology with Java technology (WCF, JBoss/ESB, MOM, WPF, WF) and I need to have a high-level idea of what are the apples and oranges in the .NET 3.5 and Java worlds.
Does anyone know of a good, clear article or better yet a simple chart which answers questions such as:
WCF in the Java world is __
the equivalent of WPF in the Java world is _
the closes thing to JBoss in the .NET world is _
the JVM and CLR are essentially the same except for these differences: ....
in the Java world you don't have the concept of WF/WCF/WPF, instead you have ....
there is no "LINQ" in the Java world yet, but you can use ___
the closest you get to ADO.NET Data Services in the Java world is ....
I'm not looking to debate this so I'm not looking for "fighting points", I just need a neutral what-is-what chart comparing the two worlds.
Building on another SO question, how can one check whether two well-formed XML snippets are semantically equal. All I need is "equal" or not, since I'm using this for unit tests.
In the system I want, these would be equal (note the order of 'start'
and 'end'):
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<Stats start="1275955200" end="1276041599">
</Stats>
# Reodered start and end
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<Stats end="1276041599" start="1275955200" >
</Stats>
I have lmxl and other tools at my disposal, and a simple function that only allows reordering of attributes would work fine as well!
Post a snippet of code from your favorite templating engine, with the name of the engine and a link to its homepage; show off its basic syntax and maybe some neat features about it that makes it unique.
Hopefully this will give people an idea of what's out there and make it easier for them to decide on an engine.
This is similar to my last question; but from a different angle.
http://stackoverflow.com/questions/2792393/see-if-item-exists-once-in-enumerable-linq
Given the following set of items, and lists containing them...
Item 1
Item 2
Item 3
Item 4
Item 5
class Item
{
string Name { get; set; }
}
List<Item> available = new List<Item>()
{
Item 1
Item 1
Item 2
Item 3
Item 5
}
List<Item> selected = new List<Item>()
{
Item 1
Item 2
Item 3
}
I need to make a third List that has everything from "available", except what is in "selected".
However 'Item 1' is in 'available' twice, but only in 'selected' once. Since they are instances of the same item, I am having trouble figuring out the appropriate logic to accomodate this.
The final array should look like...
List<Item> selectable = new List<Item>()
{
Item 1
Item5
}
Please help me to find out error in my SQL query. I have created this query to compare dates
select * from Joinplans jp
where cast(convert(varchar,GETDATE(),103) AS datetime) BETWEEN
CASE(convert(varchar,jp.planstartDate,103) AS datetime) AND
CASE(convert(varchar,DATEADD(DAY,jp.planDays,jp.planstartDate),103) AS DATETIME)
It's giving me the error:
incorrect near 'AS'
I am using SQL Server 2005.
Hai
I have a joomla web site. I have implemented the Djcatalog. But there is no way to enter the category description. I want to enter the category description and will display only at the category page not in the product details page. Is it possible? Or is there is any way to do this?
Hi i'm trying to do a regex that will show all product keys with the value #####-#####-#####-#####-#####
this is the regular expression i have created
[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}
for some reason it just isn't working.
Any help?
I have two arrays A & B. I want to do a compare among the elements of the two arrays.
@a = "abc,def,efg,ghy,klm,ghn"
@b = "def,ghy,jgk,lom,com,klm"
If any element matches then set a flag 0 else 1. Is there any simple way to do this? Please advise.
I have a VBScript that checks for the existance of a file in a directory on a remote machine. I am looking to retrieve the "Product Version" for said file (NOT "File Version"), but I can't seem to figure out how to do that in VBScript.
I'm currently using Scripting.FileSystemObject to check for the existence of the file.
Thanks much.
I have a number of traceroutes that i need to compare against each other but i dont know the best way to do it, ive been told that hash maps are a good technique but i dont know how to implement them on my code.
so far i have:
FileInputStream fstream = new FileInputStream("traceroute.log");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
// reads lines in
while ((strLine = br.readLine()) != null) {
System.out.println(strLine);
}
and the output looks like this:
Wed Mar 31 01:00:03 BST 2010
traceroute to www.bbc.co.uk (212.58.251.195), 30 hops max, 40 byte packets
1 139.222.0.1 (139.222.0.1) 0.873 ms 1.074 ms 1.162 ms
2 core-from-cmp.uea.ac.uk (10.0.0.1) 0.312 ms 0.350 ms 0.463 ms
3 ueaha1btm-from-uea1 (172.16.0.34) 0.791 ms 0.772 ms 1.238 ms
4 bound-from-ueahatop.uea.ac.uk (193.62.92.71) 5.094 ms 4.451 ms 4.441 ms
5 gi0-3.norw-rbr1.eastnet.ja.net (193.60.0.21) 4.426 ms 5.014 ms 4.389 ms
6 gi3-0-2.chel-rbr1.eastnet.ja.net (193.63.107.114) 6.055 ms 6.039 ms *
7 lond-sbr1.ja.net (146.97.40.45) 6.994 ms 7.493 ms 7.457 ms
8 so-6-0-0.lond-sbr4.ja.net (146.97.33.154) 8.206 ms 8.187 ms 8.234 ms
9 po1.lond-ban4.ja.net (146.97.35.110) 8.673 ms 6.294 ms 7.668 ms
10 bbc.lond-sbr4.ja.net (193.62.157.178) 6.303 ms 8.118 ms 8.107 ms
11 212.58.238.153 (212.58.238.153) 6.245 ms 8.066 ms 6.541 ms
12 212.58.239.62 (212.58.239.62) 7.023 ms 8.419 ms 7.068 ms
what i need to do is compare this trace against another one just like it and look for the changes and time differences etc, then print a stats page.
By what factor does the performance (read queries/sec) increase when a machine is added to a cluster of machines running either:
a Bigtable-like database
MySQL?
Google's research paper on Bigtable suggests that "near-linear" scaling is achieved can be achieved with Bigtable. This page here featuring MySQL's marketing jargon suggests that MySQL is capable of scaling linearly.
Where is the truth?
I wanted to evaluate performance comparisons for various approaches to solving the N queens problem. Mainly AI metaheuristics based algorithms like simulated annealing, tabu search and genetic algorithm etc compared to exact methods(like backtracking). Is there any code available for study? A lot of real-world optimization problems like it consider cooperative schemes between exact methods and metaheuristics.
Hi
I have a problem with text with apostrophe symbol
example i try to test this xml having the symbol is then how can i compare ?
<xsl:for each select="country[nation='India's]">
this is statement showing error
Regards
Nanda.A
What is the best way to compare Objects in JavaScript?
Example:
var user1 = {name : "nerd", org: "dev"};
var user2 = {name : "nerd", org: "dev"};
var eq = user1 == user2;
alert(eq); // gives false
I know that "Two objects are equal if they refer to the exact same Object", but is there a way to check it another way??
Using this way works for me.....but is it the only possibility?
var eq = Object.toJSON(user1) == Object.toJSON(user2);
alert(eq); // gives true
Does java have a built-in method to compare precedence of two operators? For example, if I have a char '/' and a char '+' is there a method I can call that compares the two and returns true/false if the first is greater than the second (e.g. true)?