Is there a way in Groovy to get the duration between two Date objects? The duration format I'm looking for would be something like: 2 days, 10 hours, 30 minutes...
Thanks
I have a table like this :
Name Mar1 Mar2 Mar3 Total
xxx 80 80 80 240
yyy 60 70 50 180
aaa 85 65 75 225
I wanted to find the rank of the student based on total. I using SQL Compact 3.5 . As we have rank() function in sql server do we have something with which we can find the students rank??? When I used "select Total,rank() over (order by total desc) i1
from stmarks " it's giving error as
"
Major Error 0x80040E14, Minor Error 25501
select Total,rank() over (order by total desc) i1
from stmarks
There was an error parsing the query. [ Token line number = 1,Token line offset = 21,Token in error = over ]
"
Do Sql Compact support rank() over or is there any another way???
Hi
I would like to zip a bunch of files (.exe and .dll) before I overwrite them with the new build. Is there a simple way to zip files without using some sort of dll?
Just creating a folder with the build number / date time stamp will also work great. How do I pass parameters from the cruise control build process into my Powershell script that will do the work then?
Is this a sustainable way to do things?
Thanks
My problem is since an enum in objective-c essentially is an int value, I am not able to store it in a NSMutableArray. Apparently NSMutableArray won't take any c-date types like an int.
Is there any common way to achieve this ?
typedef enum
{
green,
blue,
red
} MyColors;
NSMutableArray *list = [[NSMutableArray alloc] initWithObjects:
green,
blue,
red,
nil];
//Get enum value back out
MyColors greenColor = [list objectAtIndex:0];
I am working with DateTime, trying to get date in the format like this:
03.05.2010-04.05.23 that is: dd.MM.yyyy-HH.mm.ss
I'm using DateTime.ParseExact to try to achieve this (maybe wrong)
So far I have:
var dateInFormat = DateTime.ParseExact(DateTime.Now.ToShortDateString(), "dd.MM.yyyy.HH.mm.ss", null);
But can't quite get exactly what I want. Basically I want to keep the 0, for example time is 05:03:20 PM I don't want it to show like 5:3:20 PM
Any ideas?
For example:
void Date::month(unsigned int inMonth) {
assert(inMonth <= 12);
_month = inMonth;
}
If this is not good practice, what is the correct way to go about this?
I want to remove a cookie I set. If I do this by giving it a expiration date sometime in the past it gets marked as "expires: at end of session". I've noticed that other sites manage to delete the cookie immediately somehow. For example when you logout here on stackoverflow the "user" cookie disappears right away. How?
Hi,
I need to create a new data frame that excludes dams that appear in "dam1" and
"dam2" columns on the same fosdate (fostering date). I tried df <- df[df$dam1!=dam2,] but could not work. dam1 and dam2 are dam or mother id's.
my df:
fosdate dam1 dam2
8/09/2009 2Z523 2Z523
30/10/2009 1W509 5C080
30/10/2009 1W509 5C640
30/10/2009 1W509 1W509
1/10/2009 1W311 63927
The new data frame that I need to get is:
dfnew:
fosdate dam1 dam2
30/10/2009 1W509 5C080
30/10/2009 1W509 5C640
1/10/2009 1W311 63927
Thanks,
Bazon
Hi, i have an application deployed in Air, written in AS3 that client wants to install and test, i have developed a simple license app, but he is pushing for a full license witch he said he will fully paid on next monday.
How would you create a procedure in AS3 to deactivate application next monday? How secure will it be? will simply changing machine date will bypass this?
hi
i have added a rule to my form but i can't understand why it does not work!!
http://www.pipelabitta.it/form/
This is an example page: the rules is that the check box must be checked and there must be a valid date.
From firefox console i can see it returns true or false as i need but the validation does not get triggered.
Why is that?
Thanks Vitto
My Items table contains items with each item has a specific date. I want to generate a report that displays items between two different dates. For example, I'd put two timedatepicker controls so the user selects From: 24/9/2009 To: 19/3/2010 and then press a button to generate a report of items between these dates.
I'm using Report Viewer control btw not crystal report.
I've got a bash script that reads input from a file like this:
while IFS="|" read -r a b
do
echo "$a something $b somethingelse"
done < "$FILE"
The file it reads looketh like this:
http://someurl1.com|label1
http://someurl2.com|label2
However, I'd like to be able to insert the names of variables into that file when it suits me, and have the script process them when it sees them, so the file might look like this:
http://someurl1.com?$VAR|label1
http://someurl2.com|label2
So $VAR could be, for example, today's date, producing an output like this:
http://someurl1.com something label1 somethingelse
http://someurl2.com?20100320 something label2 somethingelse
I have the following LINQ that I would like to also order by file creation date, how is this done?
taskFiles = taskDirectory.GetFiles(Id + "*.xml")
.Where(fi => !fi.Name.EndsWith("_update.xml", StringComparison.CurrentCultureIgnoreCase))
.ToArray();
I have a web application running on LAMP with a testing server and a production server. Is there a standard practice for keeping the data on the testing server in sync with the production server? The data on the testing server gets out of date pretty quick and I feel like there must be an easier way than just dumping the production server and copying it onto the testing server every so often. It's not important that the data is in total sync, just that the testing server represents the production enviornment as accurately as possible.
Hi,
Assume I have an entity Foo in the DB.
I am parsing some files and creating new Foo objects and would like to check if the parsed Foo object exists in the DB (using a unique attribute). If it exists already update it otherwise save as a new object.
What is the best approach?
Could I simply set the id and version in the new Foo object?
Or would I be better off loading the Foo object from the DB and copying over the properties from the parsed file?
Thanks.
How can I insert all dates in an year(or more) in a table using sql
My dates table has following structure
dates(date1 date);
Suppose I want to insert dates between "2009-01-01" to "2010-12-31" inclusive.
Is there any sql query for the above?
Say, we have a table created as:
create table notes (_id integer primary key autoincrement, created_date date)
To insert a record, I'd use
ContentValues initialValues = new ContentValues();
initialValues.put("date_created", "");
long rowId = mDb.insert(DATABASE_TABLE, null, initialValues);
But how to set the date_created column to "now"? To make it clear, the
initialValues.put("date_created", "datetime('now')");
Is not the right solution. It just sets the column to "datetime('now')" text.
Guys,
This is a quick one, i wanna parse a date that comes in this format "Sun May 23 22:00:00 UTC+0300 2010"
Is this a valid UTC DateTime? And how to parse it?
This code for parsing my xml and appending via jquery seems to work great in every browser but Chrome (Mac only, the windows version of chrome works fine) and explorer. I'm not aware of any glaring issues in the code so I thought some fresh eyes might help. Anyone know what could be causing IE and Chrome on the mac to not append?
<script type="text/javascript" charset="utf-8">
$(document).ready(function()
{
$.ajax({
type: "GET",
url: "sitenav.xml",
dataType: "xml",
success: parseXml
});
function parseXml(xml)
{
$(xml).find("GoogleAnalytics").each(function()
{
$("li#google_analytics").append('<ul><li>' + $(this).find("NavHeader").text() + '</li></ul>');
});
}
});
</script>
Hi,
I have an SQL table like this : sales(product,timestamp)
I want to display a chart using Open Flash Chart but i don't know how to get the total sales per hour within the last 12 hours. ( the timestamp column is the sale date )
By example i will end up with an array like this : array(12,5,8,6,10,35,7,23,4,5,2,16) every number is the total sales in each hour.
Note: i want to use php or only mysql for this.
Thanks
latest jquery 1.4.2 downloaded from jquery.com comes with Sizzle.js also.
How and what benefit i can take from included Sizzle.js?
/*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 13 22:33:48 2010 -0500
*/
I have a DAE model that is parsed into several parts. I am able to deal with them separately, such as changing their material or colour but I am having problems adding click or hover listeners over the children.
For example, lets say I have a model of a kitty where each facial feature is a child. I want to be able to hover or click the features and have a window pop up explaining the feature.
I've tried parsing the model and adding listeners but it doesn't seem to work.
Thanks in advance!
L
I recently played with MongoDB in Rails using Mongoid. I like the ability to define attributes for models within the model file (as opposed to in migrations):
class Person
include Mongoid::Document
field :name, :type => String
field :birthday, :type => Date
end
For projects that cannot use a schema-less database, does a similar feature exist? Any gems or plugins that generate schemas from a similar syntax would be greatly appreciated.
Thanks.
Hi,
Consider there are 3 different centers across the country,which have their different holidays schedule.Now i want to find that the current date is the business day or not(eliminate saturaday ,sunday and Holidays).
tell me,Which one is feasible? Can i store the details of the holiday with description in 3 separate tables for 3 different centers or in a 3 separate file? is it possible to read the file using PL\SQl?
Hi have some forms that I want to use some basic php validation (regular expressions) on, how do you go about doing it? I have just general text input, usernames, passwords and date to validate. I would also like to know how to check for empty input boxes. I have looked on the interenet for this stuff but I haven't found any good tutorials.
Thanks