I send request from asp.net page and then wait for response, calling GetCommand via SetInterval method:
function GetCommand(id, sid) {
getCommandResponse = $.ajax({
type: "POST",
async: true,
url: "../WebServices/TSMConsole.asmx/GetCommand",
data: "{'param' : '" + id + "', 'sid' : '" + sid + "'}",
contentType: "applicatio...
Hi,
I want to select a row from one table in the database using CreateCriteria where I have a know value for a column, not primary key so there will be multiple rows matching. The table contains update information so we have a column that contains a version number for each row based on which along with my primary question gives a singl...
I am trying to implement a large font for sIFR, but it seems to have a ceiling where you cant go any higher. I have adjusted the the variable MAX_FONT_SIZE within the sIFR.as to no avail. Is this possible or is it a limitation with flash?
...
I'm trying to get the MAX on a column which is generated dynamically using the SUM statement. The SUM statement is used together with the 'GROUP by' syntax.
This is the original query, however it needs to be modified to work with grouping, sums and of course MAX.
SELECT SUM(video_plays) AS total_video_plays
FROM `video_statistics`...
Is it possible to use a select statement so that it returns Max and min columns of a child row foreach Parent record?
So foreach parent record that has MANY child records I want to see the Max and Min of those child records for any given column.
How can I do this within a single select statement?
It should read something like: Return ...
Hello all,
I have the following code:
float valueCalculated = (val1 / val2) * 100;
What I want to be able to do is to cap the maximum value of valueCalculated to 100.
I believe I could do this using some sort of if statement, but this would mean many more lines of code. Edit// This is not the case, see the answers below.
Thanks,
...
When I run the following SQL statement:
SELECT MAX(SUM(TIME))
FROM downloads
GROUP BY SSN
It returns the maximum sum value of downloads by a customer, however if I try to find the social security number that that max value belongs to by adding it to the select statement:
SELECT SSN, MAX(SUM(TIME))
FROM downloads
GROUP BY SSN
I get ...
For some reason this code is printing three values for the highest value in the array when I'm trying to print just one (which is 11.3). Can someone please explain to me why it is doing this?
Thanks.
import java.util.Scanner;
public class Slide24
{
public static void main (String [] args)
{
Scanner in = new Scanner(Sys...
Hi Guys..
Wish anybody can help me with this error "Column 'Sales.No_' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."...
I spent few days to understand this error but failed :(
My Query:-
SELECT SH.[No_], SH.[Sell-to Customer No_], SH.[Sell-to Contact No_],
SH.[Sell-to...
This line works correctly in a small test program, but in the program for which I want it, I get the following compiler complaints:
#include <limits>
x = std::numeric_limits<int>::max();
c:\...\x.cpp(192) : warning C4003: not enough actual parameters for macro 'max'
c:\...\x.cpp(192) : error C2589: '(' : illegal token on right side of...
Here's the code:
a = [1,2,3,4]
b = {}
b[1] = 10
b[2] = 8
b[3] = 7
b[4] = 5
print max(a,key=lambda w: b[w])
This prints out 1.
I don't understand how max(a,key=lambda w: b[w]) is being evaluated here though; I'm guessing for each value i in a, it finds the corresponding value b[i] by
saving the current value of i as w in the lambda ...
I have two tables table1 and table2. Table2 is having less number of rows than table1. In these two tables there are two date columns caldate1 in table1 and caldate2 in table2. So now I need to join on these two tables and get the maximum of the two date columns and keep that in new table. But if we inner join on these two tables the tab...
Suppose I have a table with following data:
gameId difficultyLevel numberOfQuestions
--------------------------------------------
1 1 2
1 2 2
1 3 1
In this example the game is configured for 5 questions, but I'm looking for a SQL statement that will work f...
I am not able to get an update to work using Linq to SQL on a VarChar(Max) field. Here is the code I use that is called from a simple DAO class:
public void UpdateContentById(int ContentId, string Content) {
CkEditorDataContext db = new CkEditorDataContext();
CkEditorContent dbContent = db.CkEditorContents.First(c => c.CkeId == ...
Are there any asm instructions that can speed up computation of min/max of vector of doubles/integers on Core i7 architecture?
Update:
I didn't expect such rich answers, thank you.
So I see that max/min is possible to do without branching.
I have sub-question:
Is there an efficient way to get the index of the biggest double in array?
...
I'm trying to solve the "group-wise max" problem in LINQ. To start, I have a database modeled using the Entity Framework with the following structure:
Customer:
---------
CustomerID : Int32
Name : String
Order:
-------
OrderID : Int32
CustomerID : Int32
Total : Decimal
This gives me navigation from a Customer to her orders and an Or...
In my XCode project, I added a Sounds folder to my Resources folder. Into the Sounds folder, I dropped a couple of MP3 files with fairly long names (25-30 chars). I like to be descriptive. However, the following code chokes with an UNCAUGHT EXCEPTION:
fileURL = [[NSURL alloc] initFileURLWithPath:[mainBundle pathForResource:@"really_r...
I am considering audio and MIDI application in Max (or Max for Live, really), but I am totally comfortable in Java, so something like this also seems attractive. Does anybody have any experience with Max? Is it really geared to people who do not code, or is the goofy/friendly looking UI much more efficient than writing straight code in, ...
select sum(value) as 'Value',max(value)
from table_name where sum(value)=max(sum(value)) group by id_name;
The error is: Invalid use of group function (ErrorNr. 1111)
Any idea?
Thanks.
...
Hi.
if i have for example a scores table:
user game score timestamp
1 50 50 date
2 60 40 date
3 70 25 date
4 80 18 date
and i run the query:
select user, game, max(score), timestamp from scores
i will receive the maximum score number that is 20, but the rest of the columns that ...