period

ASP.NET MVC: How to Route Search Term with . (Period) at the end

I get a 404 response from .Net MVC when I try to make a request where my search term ends with a . (period). This is the route that I'm using: routes.MapRoute( "Json", "Remote.mvc/{action}/{searchTerm}/{count}", new { controller="Remote", count=10} ); The search works fine wi...

C++ - locale-independent "atof"?

I'm parsing GPS status entries in fixed NMEA sentences, where fraction part of geographical minutes comes always after period. However, on systems where locale defines comma as decimal separator, atof function ignores period and whole fraction part. What is the best method to deal with this issue? Long/latitude string in stored in chara...

How to print a double with a comma

In C++ I've got a float/double variable. when I print this with for example cout the resulting string is period-delimited. cout << 3.1415 << endl $> 3.1415 Is there an easy way to force the double to be printed with a comma? cout << 3.1415 << endl $> 3,1415 ...

Joda-Time: Period to string

I'm using the Joda-Time library with Java. I'm having some difficulty trying to turn a Period object to a string in the format of "x days, x hours, x minutes". These Period objects are first created by adding an amount of seconds to them (they are serialized to XML as seconds and then recreated from them). If I simply use the getHours()...

SQL date,period comparison

Hi I'm having some problem with logic of the comparison of some periods. I have a table in my database that looks like this: Id|startDate |amount of weeks| -------------------------------- A1|2010-01-04 | 3 B3|2010-01-11 | 2 all the startDates start on the same day of the week (Monday) now I need to write an sql where I have 2 para...

Get date from period number in Actionscript.

Hi, I have a table which containt a date, a number for the number of weeks per period, and a year. the user then enters a date and I can calculate the period number from this. But I'd like to do it the other way too: Entering a period number and get the start and end date of the period from this. Unfortunately, I can't seem to get the r...

Compare date-periods using XSLT

Hi there, I have some experience with XSLT but now i've got myself a problem: I need to check if a period between a begin- and enddate completely covers an other period. Here's a part of the xml: <Parent ID="1"> <StartDate>20050101</StartDate> <EndDate>20060131</EndDate> <Child ID="1"> <StartDate>20050101</StartDate> <En...

csv.reader turning commas into periods throwing errors

Here is a sample of the first row: link,Title,Description,Keywords It is made from an excel workbook, I tried saving in all CSV formats (window, ms-dos, and comma delimited list) I even tried saving in 2 txt file formats (window, ms-dos) k... here is the code: csvReader = csv.reader(file('files/my_file.csv', "rU"), delimiter=',') ...

running with Java.exe when period exists in directory name

Hi, I am trying to run the java prog I've built, but I want to run it from a specific directory. When specifying the relative path to the class file I want to run, that path contains a directory with a period in it, and it seems to be tripping java up; So for example I try to run: java -classpath myPath/myPath-1.2.3/myLongPath myPath/m...

php removing item with period from array

I have a products array of widgets. Some widgets have the reserved period symbol in their names. The problem occurs when php meets the period, the rest of the widget name is disregarded. How could I read the widget in as a string literal so that the period symbol will not interfere? unset($products[$widget]); I could replace the p...

Split string into sentences based on periods

Hi all, I have written this piece of code that splits a string and stores it in a string array:- String[] sSentence = sResult.split("[a-z]\.\s+"); However, I've added the [a-z] because I wanted to deal with some of the abbreviation problem. But then my result shows up as so:- Furthermore when Everett tried to instruct them in basic m...

Need help with a SQL query selecting date ranges from a table of period quarters

Hi. I have a table called Periods that looks like this PeriodID | PeriodYear | PeriodQuarter 7 | 2009 | 1 8 | 2009 | 2 9 | 2009 | 3 10 | 2009 | 4 11 | 2010 | 1 12 | 2010 | 2 Each row in the table represents 1 of the 4 quarters of the year (like 3-monthly school terms). E.g. The first row represents Period 1 of 2009 (i.e. the dat...

Any way to convert a JodaTime Period to a decimal number of hours?

I have a JodaTime Period that I've created from two DateTime instants. Is there a good way to convert that Period into a decimal number of hours? For instance, I have a Period that goes from 1pm to 1:30pm on Jan 1, 2010. How can I get that Period as 1.5 hours. In the past I've manually converted using seconds and BigDecimals such as ...

Waiting Period Before iPhone APNs Starts Pushing ?

I am running Push Notification on two test apps. The first test app I got working over a 2 day period. The 2nd test app I tried to implement Push Notification tonight and have been banging my head over it. I am able to swap the certificates and the 1st app receives notifications, but when I use the .pem for the 2nd app, nothing happens. ...

Determining the time frame given by a pattern

A date can be formatted using a e.g. SimpleDateFormat(formatPattern, locale). Is it somehow possible to determine the time period (in seconds) that is represented by formatPattern given a date? E.g. if we have Date date = new Date(1286488800); String formatPattern = "yyyy"; is it possible to determine the length of the year (in second...

Dealing with periods and dates without using cursors

I would like to solve this issue avoiding to use cursors (FETCH). Here comes the problem... 1st Table/quantity ------------------ periodid periodstart periodend quantity 1 2010/10/01 2010/10/15 5 2st Table/sold items ----------------------- periodid periodstart periodend solditems 14343 2010/10/05 2010/10/06 2 Now...

Bug in jodatime Period?

How come this test I wrote fails in jodatime 1.6.2? Is it a bug? @Test public void testIfJodaTimePeriodsHandlesPeriodTypesOtherThanMinutesAndHours() { long twentyDaysInMillis = TimeUnit.MILLISECONDS.convert(20, TimeUnit.DAYS); Period twoWeeks = new Period(twentyDaysInMillis, PeriodType.weeks()); Assert.assertEquals(2, twoWeeks.ge...