GMLib 1.5.3 InfoWindow issue of GMPolygon - infowindow

Since the 16th of may, my InfoWindows of my GMPolygons pop up in the middle of the Atlantic Ocean (rLat = 0, rLng = 0). I understand now this has to do with the experimental version of Google Maps Api (now v3.28, 3 days ago v3.27). How can i use GMLib 1.5.3 with the released version 3.27 ?

Related

Why AlphaVantage doesn't provide recent data [duplicate]

I am trying to get the latest Intraday prices from Alpha Vantage API. Currently it is Friday, 9:16PM Eastern European Time. I am trying to get Tesla stock. Markets are still open. However, The API call returns me yesterday's data only. What could be the problem?
ts = TimeSeries(key='API_KEY', output_format='pandas')
data, meta_data = ts.get_intraday(symbol='TSLA',interval='1min', outputsize='full')
print(data.head(5))
print(meta_data)
1. open 2. high 3. low 4. close 5. volume
date
2020-04-16 16:00:00 746.06 746.830 745.530 745.6800 83342.0
2020-04-16 15:59:00 746.57 746.715 745.090 746.1958 53268.0
2020-04-16 15:58:00 746.90 747.465 746.490 746.6250 36746.0
2020-04-16 15:57:00 747.52 747.760 746.827 747.2147 25910.0
2020-04-16 15:56:00 747.95 747.990 746.800 747.2800 33869.0
{'1. Information': 'Intraday (1min) open, high, low, close prices and volume', '2. Symbol': 'TSLA', '3. Last Refreshed': '2020-04-16 16:00:00', '4. Interval': '1min', '5. Output Size': 'Full size', '6. Time Zone': 'US/Eastern'}
1. open 2. high 3. low 4. close 5. volume EMA
I had the same problem and wasn't able to solve it yet. But in my case only some stocks are not up to date. For example 'IBM' is up to date but 'TSLA' and 'AAPL' not. I also have written an email to the technical support 2 days ago. If I ever get a response with the explanation I will write you. I have checked this not only with the python module also with the direct API call.
My code:
https://github.com/SebNik/TradingBot
I also noticed this and contacted Alpha Vantage. I got this response:
Thank you for reaching out! For Nasdaq-listed securities such as MSFT, the data is refreshed daily at 4:30pm ET on our API platform.
So looks like real-time data is not provided for Nasdaq-listed items. This could be the issue here.

How do I convert milliseconds to days, hour, minutes

I tried to do this:
long Plptime = player.getStatistic(Statistic.PLAY_ONE_TICK)*50L; //from ticks to ms(1 tick (20 each sec) by 50 gives aprox the ms)
SimpleDateFormat formatter = new SimpleDateFormat("dd 'days,' HH
'hours and' mm 'minutes'", Locale.getDefault());
Date date = new Date(Plptime);
String result1 = formatter.format(date);
But when it messages the String to the player (minecraft by the way), the hours and days start on 1 while the min start on 0, for example right when someone just joins his playtime will be 01days 01 hours 00 min. Any solutions? Thanks
Java 9 or later
Let’s first declare a couple of helpful constants.
private static final int TICKS_PER_SECOND = 20;
public static final Duration ONE_TICK = Duration.ofSeconds(1).dividedBy(TICKS_PER_SECOND);
Now do:
int ticks = player.getStatistic(Statistic.PLAY_ONE_TICK);
Duration plpTime = ONE_TICK.multipliedBy(ticks);
String result1 = String.format(Locale.ENGLISH, "%02d days %02d hours and %02d minutes",
plpTime.toDays(), plpTime.toHoursPart(), plpTime.toMinutesPart());
System.out.println(result1);
This prints a string like
00 days 17 hours and 08 minutes
Possibly the number of ticks per second (20) is already declared as a constant somewhere in Bukkit, I don’t know. If it is, take that one rather declaring your own.
Java 6, 7 or 8
The toXxxPart methods I used were introduced in Java 9. Without them we need to calculate the individual parts like this:
long days = plpTime.toDays();
plpTime = plpTime.minusDays(days);
long hours = plpTime.toHours();
plpTime = plpTime.minusHours(hours);
long minutes = plpTime.toMinutes();
String result1 = String.format(Locale.ENGLISH, "%02d days %02d hours and %02d minutes",
days, hours, minutes);
The result is the same as above.
Question: How can that work in Java 6 or 7?
The Duration class that I am using is part of java.time, the modern Java date and time API
In Java 8 and later and on newer Android devices (from API level 26, I’m told) java.time comes built-in.
In Java 6 and 7 get the ThreeTen Backport, the backport of the new classes (ThreeTen for JSR 310; see the links at the bottom).
On (older) Android use the Android edition of ThreeTen Backport. It’s called ThreeTenABP. And make sure you import the date and time classes from org.threeten.bp with subpackages.
What went wrong in your code?
Why the hours seem to start at 1 (not 0): It’s your time zone. When you create a Date from your milliseconds, you get the point in time that many milliseconds after the epoch defined as 00:00 UTC on Jan 1, 1970 (which conceptually is quite misleading when the question was when a player joined). If your time zone was 1 hour ahead of UTC in the winter of 1970 (like Central European time, for example), it was already 1 o’clock at the epoch, so the hours count from there.
And since it was January 1, the day is given as 1, of course. Curiously, if you had been in a time zone west of GMT (America/Los_Angeles to give just one example), the date would still have been December 31, 1969 in the first hours after the epoch, so the newly joined player might appear to have been there for 31 days, 16 hours and 00 minutes, for example.
Links
Oracle tutorial: Date Time explaining how to use java.time.
Java Specification Request (JSR) 310, where java.time was first described.
ThreeTen Backport project, the backport of java.timeto Java 6 and 7 (ThreeTen for JSR-310).
ThreeTenABP, Android edition of ThreeTen Backport
Question: How to use ThreeTenABP in Android Project, with a very thorough explanation.

IOS Charts - Values on X-Axis not formatted correctly in portrait mode

I'm in the process of integrating "IOS Charts" into my latest app. Everything is fine but formatting of XAxis isn't running properly in portrait mode on IOS (see Screenshot). Landscape mode is fine. Chartsdata contain 290 entries with date / numeric value. Some formatting is obviously done but not enough. (see screenshots)
I am working with Xcode 8 / Swift 3 / latest build from CocoaPods (version 3.0.0 of Charts) / IOS 10
Here is my only code relating to Xaxis, where "Charty" is my LineChartView
Charty.xAxis.granularityEnabled = true
Charty.xAxis.granularity = 10
Charty.xAxis.labelPosition = .bottom
Charty.autoScaleMinMaxEnabled = true
Try below code while it is in portrait mode.
lineChartView.xAxis.spaceBetweenLabels = 4
lineChartView.xAxis.wordWrapEnabled = false
spaceBetweenLabels will help you to align things on xAxis.

Windows 8 RT DateTime.FromOADate

Recently started porting an application from Windows Phone 8 to Windows 8 RT, and faced strange problem: can't find a way to convert DateTime structure to double OLE date.
Earlier, there were methods DateTime.FromOADate and DateTime.ToOADate to do this, but now they are not available.
...
double oaNow = System.DateTime.Now.ToOADate(); //ToOADate undefined
...
What can be wrong?
For whatever reason this was not included in the RT targets. It doesn't do anything particularly special, it it appears it could be portable.
You can probably duplicate the functionality in your own method by looking at the Reference source for the .NET Framework.
Try
double oaNow = System.DateTime.Now.Subtract(new DateTime(1899, 12, 30)).TotalDays;
According to the documentation
An OLE Automation date is implemented as a floating-point number whose integral component is the number of days before or after midnight, 30 December 1899, and whose fractional component represents the time on that day divided by 24. For example, midnight, 31 December 1899 is represented by 1.0; 6 A.M., 1 January 1900 is represented by 2.25; midnight, 29 December 1899 is represented by -1.0; and 6 A.M., 29 December 1899 is represented by -1.25.

iPhone Date Picker rolls over to 2010 on December 27th?

So I implemented a UIDatepicker in one of my applications for scheduling and autodialing teleconferences... everything is pretty much ready to go except, while testing I noticed that when the date rolls over from December 26th to December 27th, the year changes to 2010.
I even rolled it forward to 2011... and it changes when December 25th changes to the 26th.... but wait... in 2012, it correctly rolls over on December 31 - January 1... and then its back to 29th-30th in 2013. Is there some kind of astronomical phenomenon I am not aware of going on or does Apple run on some crazy Heechee calendar I don't know of? The calendar app works correctly...
The most likely explanation is I am missing something so obvious that I will slap myself when I realize it. But hey, I haven't slept in... wow I don't remember if its been two days or three. Take pity and help me out here.
UPDATE: So maybe it wasn't something simple. Still looking for an answer here! Am I really the only person who has experienced this?? I'll bet when the end of December rolls around, more people will hit the same roadblock.
UPDATE2: Anyone? Still looking, still not finding...
UPDATE3: Still haven't found a solution. Come on! This is an interesting puzzle!
UPDATE4: Still no answer found. I have submitted the app and it is now in the appstore. Would still like to see this problem solved so I can update the app.
There may be this problem, that when you are on the last week of the month and the week has fewer than 7 days left in current month, then perhaps the API treated the week as the first week of the next month. Since december of 2012 has already 7 days in its last week there is no problem in that month.
I was getting the same problem here, and I solved it.
- (int) currentWeekOfMonth
{
return CFCalendarGetOrdinalityOfUnit (
CFCalendarCopyCurrent(),
kCFCalendarUnitWeek,
kCFCalendarUnitMonth,
[self absoluteTime]);
}
my requirement is to show week number and for this i calculate the week number of first week of month and the add this to the total number of week in month.
int currentWeekNumberInYear = [_calendarInfo currentWeekOfYear];
int currentWeekNumberInMonth = [_calendarInfo currentWeekOfMonth];
currentWeekNumberInYear = currentWeekNumberInYear-currentWeekNumberInMonth +1;
currentWeekNumberInYear = currentWeekNumberInYear<0 ? (NSInteger)[_calendarInfo weeksInMonth] ==5 ?49:48 : currentWeekNumberInYear;
I hope it will be useful to you.
Turns out its the Date format string used to set up the NSDateFormatter that was causing this for me.
"yyyy" corresponds to the 4-digit year, while YYYY corresponds to the year starting from the Sunday of the 1st week of year. Why anyone would want this is anyone's guess, and it would really help if Apple provided a link to their list of format specifiers, but there you go.
Just make sure your format string has the year component in lowercase and it should be sorted.
This post on TUAW describes a similar problem in PhotoBooth on Mac OS X:
http://www.tuaw.com/2009/12/29/beware-photo-booth-time-stamps-its-a-bug-not-a-feature/
One commenter agrees with vikas that it's an end-of-week issue.