|
C# but if you can offer a solution for SQL it is OK too
|
|
|
|
|
To do this in SQL, CROSS APPLY might help:
DECLARE @Data TABLE
(
TimeLogged datetime2(0) NOT NULL,
Action varchar(5) NOT NULL
);
INSERT INTO @Data
VALUES
('20140903 12:50:15', 'start'),
('20140903 13:45:25', 'idle'),
('20140903 13:56:06', 'Start'),
('20140903 16:30:35', 'idle')
;
SELECT
D1.Action,
Sum(DateDiff(second, D1.TimeLogged, D2.TimeLogged)) As DurationInSeconds
FROM
@Data As D1
CROSS APPLY
(
SELECT TOP 1
TimeLogged
FROM
@Data As D2
WHERE
D2.Action != D1.Action
And
D2.TimeLogged >= D1.TimeLogged
ORDER BY
TimeLogged
) As D2
GROUP BY
D1.Action
;
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
this seems very useful but i am not very good at sql. how can i use my table in this query?
|
|
|
|
|
Since you didn't post any details about the structure of your table, I had to make up an example. You'll want just the SELECT block; replace @Data with the name of your table, and replace TimeLogged and Action with your column names.
SELECT
D1.NameOfYourActionColumn,
Sum(DateDiff(second, D1.NameOfYourTimeLoggedColumn, D2.NameOfYourTimeLoggedColumn)) As DurationInSeconds
FROM
NameOfYourTable As D1
CROSS APPLY
(
SELECT TOP 1
NameOfYourTimeLoggedColumn
FROM
NameOfYourTable As D2
WHERE
D2.NameOfYourActionColumn != D1.NameOfYourActionColumn
And
D2.NameOfYourTimeLoggedColumn>= D1.NameOfYourTimeLoggedColumn
ORDER BY
NameOfYourTimeLoggedColumn
) As D2
GROUP BY
D1.NameOfYourActionColumn
;
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
it seems to work,
thank you very much
|
|
|
|
|
|
Who's zip file is it?
Give up, you don't stand a chance.
Regards,
Rob Philpott.
|
|
|
|
|
|
Jennifer Lawrence's
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
There is a tool I've heard about, but have not yet been able to verify if it really works.
It's called Ultimate CrIP Zacker, or something.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Sorry but you're NEVER going to get help with this in any legitimate forum such as CP.
We have no idea who this ZIP file belongs to and we're not going to post any information that can be used to crack it as we're not going to be party to stealing someones information, even if it isn't you that's doing it. It could be some other schmuck who's Googling around trying to find information on how to do it themselves.
|
|
|
|
|
With that argumentation, we should REALLY stop explaining how sql-injection works.
Ban the bobby tables comic!
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There's a significant difference between giving a detailed explanation of how to pick a lock, and explaining to someone that if they leave their door open, someone will come in and steal their stuff.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Glad you agree the comic should be banned.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
But I don't.
In this analogy, "detailed instructions for picking a lock" is equivalent to "here's how to brute-force a password".
"Unlocked door => stolen stuff" is equivalent to "you've got a well-known and easily exploitable security vulnerability in your code, here's how it works, and here's how you fix it".
It's hard enough to get some people to take SQLi seriously. If you're not allowed to explain how it works, and you just have to rely on saying "bad stuff will happen", nobody will pay any attention until it's too late.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: But I don't. I know
A password on a zip-file is not a lock. It's not a door in a house - it'd be more someone elses locked box, inside your house.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I don't see it that way.
A SQL Injection question is more about telling the programmer (and I use that term lightly!) how to defend against the attack and produce higher quality code.
This is just a brute force, "crack a password so I can break in and get the data" question with no benefits to the quality or strength of his non-existent code.
|
|
|
|
|
I disagree.
I'm pretty sure that the first thing you should be told when you start any computing course is exactly how to perform an SQL injection attack, with examples, and encouraged to try it out as often as possible. Free T shirts with the instructions on would be good.
That way, the problem would die. Because no systems would dare be left open to it, and no tutor could possibly ignore it or not know about it enough to teach students the Right Way to do things. Because there is the problem: tutors who don't know enough, and don't teach about security in any meaningful way.
Forget seatbelts in cars to reduce injuries in an accident, reduce the number of damn accidents by making drivers aware of how dangerous they are!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
It's explained on the Wikipedia, and there are links to software that implements such.
I would link to the wikipedia, but I'm afraid that some members will ask for a book-burning.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I gave OP the name of a program that will do what he wants.
If he'll get the words straightened out of course.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Hi,
I have VS2013 and VS2008.
now i only have Recent and Pinned List just for VS 2013.
How can i have that for VS 2008 version also.
In other workd :
pin it to whatever version of VS you have
|
|
|
|
|
jojoba20 wrote: How can i have that for VS 2008 version also. You need to manually add the items to VS2013.
|
|
|
|
|
but i wanna ho have VS2008 project into jump list vs2008 and
VS2013 projects to jump list VS2013 .
not in VS selector.
thanks in advanced!
|
|
|
|
|
jojoba20 wrote: i wanna ho have is not English, but I assume you are trying to say "I want to have". However, the remainder of your question makes no real sense so I cannot offer any suggestions.
|
|
|
|
|
hello friends, some here know how i can, populate checkboxlist from database, and populate second checkboxlist with values selected in first checkboxlist, first control should be populate second, I work at asp.net c#, thanks for all, thanks for read this, thanks for all your help.
|
|
|
|