Retrieved JSON contains [0.0] randomly in the data - blackberry

I've been retrieving json from my web service, with the data containing [0.0] in odd places, such as in the middle of "tit[0.0] le". I'm viewing the info in the console, so I just ignored it as when I actually use it it is not present.
However, I'm currently building a calendar and placing the retrieved events in it. The problem with a particular event is that the [0.0] seems to be lodged in between the timestamp 2012-03-[0.0] 01T00:00:00. It's only happening with this event that the [0.0] is not going away when I use it. Of course, the httpdateparser cant retrieve the date properly, with it interpreting it a day early. I think the [0.0] is the cause.
How do I get rid of the [0.0]? parse it out? I don't think it is actually there...
EDIT:
it looks like the [0.0] are just added by the blackberry console for viewing purposes.
But why is it only on the two events that are not working correctly?
full_date:2012-02-29T00:00:00
full_date:2012-03-01T00:00:00
Both these dates are parsed using the following:
Date date = new Date(HttpDateParser.parse(date_full));
c.setTime(date);
int theMonth = c.get(Calendar.MONTH);
int theYear = c.get(Calendar.YEAR);
int theDate = c.get(Calendar.DAY_OF_MONTH);
For theDate I get feb 28 and 29 respectively. Does this have to do with leap years? I thought Calendar delt with this stuff?

Check the list of valid date formats on the API. I found "yyyy-MM-ddThh:mm:ssTZD" (eg 1997-07-16T19:20:30+01:00) is on it. Maybe you need to append timezone information.
[EDITED]
Adjusting the date comes from web service to the device timezone may fix the problem. When calender.get(property) is invoked it considers device timezone.

Related

Windowing and Watermark in Apache beam : Google dataflow

I have a fixed window of 1 minute. I am considering event time.
beam.WindowInto(window.FixedWindows(300))
When I deploy this code ,is the window created instantly even if I have not published any message .suppose I deployed at 6:30 , is it like the windows are automatically created as 6:30 to 6:35, 6:35 to 6:40 and so on ?
If I publish a message to topic having
event timestamp = 6:31 (unix seconds i.e 10,176589653)
when system time = 6:36
..does it mean the watermark for that specific message is at 6:31 and it will miss the window as system time is at 6:36 and allowed lateness=0 and will be rejected.
Windows are always created using UNIX time 0 as a base, meaning, no matter if you start the pipeline at 6:31, 6:32 or 6:35, the windows would always be [6:30, 6:35), [6:35, 6:40).... Note that this also applies for days, the windows would start at 00:00 UTC.
If you want to change this, there's an offset parameter.

Oracle Report stuck in post processing when trying to generate a report

I am creating a Oracle Report. The report is supposed to take a bunch of input and create the report. It is not working for some specific cases.
The input are as follows
1. Account number
2.org id
3. start _date
4.end date
the report is supposed to generate a report for the org_id(constant) based on the account number and for date between start date and end date.
When the account_number is not provided it will return all the information regarding all accounts.
It works when I give specific account information
It works for specific dates (10-jan-25th jan ,20thjan-31st-jan) with out any account number: i.e. it returns information about all account number for given time period.
but it fails to give me information about 10-jan-31st jan. Which I can not figure out why.
I have tried to get the xml and put it in the template and create a preview,
the preview does not work and gives me the following error:
error: Conf File: C:\Template Builder for Word\config\xdo config.xml Font Dir: C:\Template Builder for Word\fonts Run XDO Start Template: C:\MyFiles\XML_Publisher\lATEST OUTPUT\XXONT_M193_CANCELLED_HOLDS .rtf RTFProcessor setLocale: en-us FOProcessor setData: C:\MyFiles\XML_Publisher\Test\errchk15jan7feb.xml FOProcessor setLocale: en-us
With the longer date range, the XML file might be too big for the output postprocessor. Did you check the size of the XML file?
If this is the problem, you can use our company's Blitz Report, which doesn't have size limitations: https://www.enginatics.com/faq/#how-does-blitz-report-compare-with-oracle-bi-publisher

How to do time comparison between client's system time and date time from internet server (actual local time)

I am trying to validate the system time of client’s computer with the actual time (internet time). If for some reason the client’s time settings are not correct or the time and timezone don’t match the local time, I want to notify them to sync the time with their local time in order to use the application. If my question is not clear then this is something that I am trying to mimic, https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Incorrect-System-time-warning-when-starting-an-Autodesk-360-application.html
How can I do this time comparison/validation in dart?
The main question is IMHO what accuracy you need.
You can just query a NTC and report if there is a discrepancy. If the server is synchronized with such a time server, there shouldn't be a problem.
You can also add an API to your server that returns the server time.
Then you read the time from the local system and from the server and check the difference
bool compareTime() {
var serverTime = await getTimeFromServer(); // not yet existing method to fetch the date and time from the server
var clientTime = new DateTime.now().toUtc();
var diff = serverTime.difference(clientTime).abs();
if(diff > const Duration(seconds: 5)) {
print('Time difference too big');
} else {
print('Time is fine');
}
}
Ensure that the time returned from the server is UTC as well, otherwise you're comparing apples with pears.
If you're running server-side, you can shell out to ntpdate -d pool.ntp.org and read the output, parsing the last line. If the time offset is small enough, you're good.
For browser apps, see the StackOverflow at Getting the current GMT world time for a few options.

All-day events in ICS feed published incorrectly by Exchange 2010

I am using the calendar publishing feature of Exchange 2010 to subscribe to a shared calendar on iOS and OS X. My calendar has many all-day events. On iOS and OS X they are incorrectly displayed as 24 hour events that block the entire day:
On Google Calendar they show 12.00am in the title, but otherwise Google does a better job of formatting the calendar:
I have discovered from these posts that Exchange would seem to incorrectly export all-day events in ICS feeds:
iCal feed all day events blank out entire day
ICS feed imported to Google Calendar shows (12:00am) in title for all day events
(Alternatively, Outlook incorrectly creates all-day events on an Exchange calendar.)
One of the offending entries in the ICS produced by Exchange is this:
BEGIN:VEVENT
DESCRIPTION:\n
SUMMARY:Test2
DTSTART;TZID=GMT Standard Time:20150123T000000
DTEND;TZID=GMT Standard Time:20150124T000000
UID:BC80DA81-93EF-4E89-831A-587C797949C4
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20150314T164745Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:Somewhere
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
Apple and Google (unsurprisingly) ignore the MS specific instruction X-MICROSOFT-CDO-ALLDAYEVENT:TRUE. According to other posts on the subject the DTSTART and DTEND should just contain date, without a time component.
As it stands this is very frustrating and it basically makes the ICS feed impossible to use, at least on iOS and OS X. Is there a way to fix this? Or a workaround?
Thank you.
The solution of the problem is not difficult. In the VEVENTs with
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
change the date-time values to only date values in the DTSTART & DTEND lines
DTSTART;TZID=GMT Standard Time:20150123T000000
DTEND;TZID=GMT Standard Time:20150124T000000
and correct the DTEND-date to the day before to this:
DTSTART;TZID=GMT Standard Time:20150123
DTEND;TZID=GMT Standard Time:20150123
Now every thing will work fine.

Single Sign-on - PingfFederate - How to set the date?

I noticed when PingFederate(PF) sends the date it is off by a day from my Rails app. It appears that the PF date is the one off by a day. For example in the PF SAML response I get:
<saml:Assertion ID="pEaf1kce93SpAxfIpuohOv6QP-T" IssueInstant="2014-05-03T03:15:20.020Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
and
<saml:Conditions NotBefore="2014-05-03T03:10:20.021Z" NotOnOrAfter="2014-05-03T03:20:20.021Z">
whereas in Rails I get
Time.now = 2014-05-02 20:15:19 -0700
which makes me think that I need to set the date in PF. Note that PF is running on the same computer that the Rails app is running on.
Is there a way to set the date in PF?
The time is off as well. Is there a way in PF to set the time too?
SAML assertions are always in UTC. Which is what PingFed is using. Set your Rails application to use UTC as well.
I don't see why you think that the time is off. Your time from Rails is 2015 and -7. That means in UTC, it's tomorrow at 0315 - when it was issued. PingFed is setting an allowance of +/-5 minutes, so the SP should not accept it before 0310 or after 0320.
Your server and PingFed are correct so far...

Resources