{$start} 00:00:00' AND created<='{$end} 23:59:59'
Discover and enjoy a wide range of IT solutions designed to make your digital experience smoother, faster, and more efficient. From software tips to troubleshooting guides, find everything you need in a place. Stay updated, stay secure, and enhance your tech skills with reliable, user-friendly information and resources.
Thursday, March 21, 2013
Friday, March 15, 2013
mysql get last value of row
SELECT Name, Dt, Value
FROM (
SELECT Name, Dt, Value, Name Name2
FROM YourTable
UNION ALL
SELECT '' Name, 'Last_Value', T.Value, T.Name Name2
FROM YourTable T
JOIN (
SELECT Name, MAX(dt) MaxDt
FROM YourTable
GROUP BY Name
) T2 ON T.Name = T2.Name AND T.dt = T2.MaxDt
ORDER BY Name2, Dt, Value
) t
mysql sum each group
CREATE TABLE YourTable (Name varchar(1),
dt datetime,
Value int);
INSERT INTO YourTable VALUES
('A','2013-01-01',3),
('A','2013-01-02',4),
('B','2013-01-04',2),
('B','2013-01-05',8);
SELECT Name, Dt, IF(Name='',summedTotal,Value) Value
FROM (
SELECT @summedTotal:=IF(@prevRow=Name,@summedTotal+Value,Value) summedTotal,
Name, Dt, Value, Name Name2,
@prevRow:=Name
FROM YourTable
JOIN (SELECT @summedTotal:=0) t
UNION ALL
SELECT summedTotal, '' Name, 'Last_Value', T.Value, T.Name Name2, pr
FROM (
SELECT @summedTotal:=IF(@prevRow=Name,@summedTotal+Value,Value) summedTotal,
Name, Dt, Value, Name Name2,
@prevRow:=Name pr
FROM YourTable
JOIN (SELECT @summedTotal:=0) t
) T
JOIN (
SELECT Name, MAX(dt) MaxDt
FROM YourTable
GROUP BY Name
) T2 ON T.Name = T2.Name AND T.dt = T2.MaxDt
ORDER BY Name2, Dt, Value
) t
dt datetime,
Value int);
INSERT INTO YourTable VALUES
('A','2013-01-01',3),
('A','2013-01-02',4),
('B','2013-01-04',2),
('B','2013-01-05',8);
SELECT Name, Dt, IF(Name='',summedTotal,Value) Value
FROM (
SELECT @summedTotal:=IF(@prevRow=Name,@summedTotal+Value,Value) summedTotal,
Name, Dt, Value, Name Name2,
@prevRow:=Name
FROM YourTable
JOIN (SELECT @summedTotal:=0) t
UNION ALL
SELECT summedTotal, '' Name, 'Last_Value', T.Value, T.Name Name2, pr
FROM (
SELECT @summedTotal:=IF(@prevRow=Name,@summedTotal+Value,Value) summedTotal,
Name, Dt, Value, Name Name2,
@prevRow:=Name pr
FROM YourTable
JOIN (SELECT @summedTotal:=0) t
) T
JOIN (
SELECT Name, MAX(dt) MaxDt
FROM YourTable
GROUP BY Name
) T2 ON T.Name = T2.Name AND T.dt = T2.MaxDt
ORDER BY Name2, Dt, Value
) t
Tuesday, February 19, 2013
Monday, January 7, 2013
forgot Mac OS X account password
If you have forgot Mac OS X account password then there is a tricky method which let you create a new administrator account on Mac OS X and through that admin account you can reset password of previous account.
So, let’s see how to create an administrator account on Mac while you lost your Mac passwords. This guide written using Mac OS X Snow Leopard.
Creating new Mac OS X account to recover old account



Follow all the wizard instructions, until you see the following screen to create new account. Fill all entries and hit Continue button.

This will create a new administrator account and automatically log into it.

Click on “Account”s icon

Click on lock icon to enable prev. account “Susan” and reset its password.

Enter the Password of current user account and hit OK button


Enter “New password”, “Password hint” and hit “Reset Password” button to reset account password.

Now log off and log in to your prev. account “Susan” and you can delete the account “TrickyWays” that we have created to recover prev. account “Susan”.
So, let’s see how to create an administrator account on Mac while you lost your Mac passwords. This guide written using Mac OS X Snow Leopard.
Creating new Mac OS X account to recover old account
Step 1
Restart system and hold “Cmd + S” keys from keyboard until it shows Terminal.Step 2
Now type the following commands one after one and press “Enter” button after each command to execute it individually/sbin/mount -uawrm /var/db/.applesetupdonerebootStep 3
“Reboot” command will restart the Mac and you will see the “Welcome wizard” after beautiful welcome messages animation.Follow all the wizard instructions, until you see the following screen to create new account. Fill all entries and hit Continue button.
This will create a new administrator account and automatically log into it.
Reset old user account password
Now you can reset the password of your old Mac OS X account using this new account, here is the process.Step-4
Click on “Apple icon” and then “System Preferences”Click on “Account”s icon
Step-5
Here you can see all Mac OS X user accounts are listed, new account “TrickyWays” that we have created and “Susan” the old one that we want to recover.Click on lock icon to enable prev. account “Susan” and reset its password.
Enter the Password of current user account and hit OK button
Step-6
Now your prev. account is enabled for changes, select that and hit the “Reset Password” buttonEnter “New password”, “Password hint” and hit “Reset Password” button to reset account password.
Now log off and log in to your prev. account “Susan” and you can delete the account “TrickyWays” that we have created to recover prev. account “Susan”.
Monday, November 19, 2012
Get and set with C#
You don't need to use set or get. You could write functions named setFoo or getFoo instead of using a property Foo:
But that's a real pain -- you'd rather write
So instead C# has properties:
Inside the setter, the keyword 'value' is the variable containing the value that is getting assigned to the property Y.
The pattern of having properties directly backed by fields is so common that in C# 3, shortcut syntax was added.
There are a few reasons to use properties, instead of public fields. One is that properties can be virtual. Another is that you can make the setters for a property private. Another is that properties have a 'special' meaning to things that inspect classes at runtime. There are frameworks for conveniently talking to databases and for reading and writing objects to and from XML and all sorts of other things -- and they automatically look at the object's properties (and not private fields or other things) to see how to do their job.
class Point {double x, y;public Point(double x, double y) {this.x = x;this.y = y;}public double GetX() { return x; }public void SetX(double x) { this.x = x; }public double GetY() { return y; }public void SetY(double y) { this.y = y; }}
But that's a real pain -- you'd rather write
pt.Y = 3; and be able to write things like pt.Y += 5; , instead of pt.SetY(pt.GetY() + 5); .So instead C# has properties:
class Point {double x, y;public Point(double x, double y) {this.x = x;this.y = y;}public double X {get { return x; }set { x = value; }}public double Y {get { return y; }set { y = value; }}}
Inside the setter, the keyword 'value' is the variable containing the value that is getting assigned to the property Y.
The pattern of having properties directly backed by fields is so common that in C# 3, shortcut syntax was added.
class Point {public Point(double x, double y) {X = x;Y = y;}public double X { get; set; }public double Y { get; set; }}
There are a few reasons to use properties, instead of public fields. One is that properties can be virtual. Another is that you can make the setters for a property private. Another is that properties have a 'special' meaning to things that inspect classes at runtime. There are frameworks for conveniently talking to databases and for reading and writing objects to and from XML and all sorts of other things -- and they automatically look at the object's properties (and not private fields or other things) to see how to do their job.
Friday, November 16, 2012
Free Javascript Obfuscator and Free PHP Obfuscator
Free Javascript Obfuscator
http://www.javascriptobfuscator.com/default.aspxFree PHP Obfuscator
http://www.pipsomania.com/ best_php_obfuscator.do
http://www.mobilefish.com/services/php_obfuscator/php_obfuscator.php
http://www.mobilefish.com/services/php_obfuscator/php_obfuscator.php
Subscribe to:
Posts (Atom)