How to spread a row over several column in a horizontal react native FlatList? [closed] - react-native

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
I am using a Horizontal FlatList to display several days of weather data in a React Native App.
The top row shows the date. The second row shows the hour of the day.
For each hour of the day, various info, such as wind, temperature etc. is rendered in a column under the hour.
The FlatList header (ListHeaderComponent), the most left column, gives the title of each row.
Is it possible to spread the top row with the date over 24 hours, i.e. over 24 columns?
Intended result:
date. Thu Feb 09. - spread the date cell over 24 columns with a backgroundColor
hour. 00 01. 02. 03. and so on up to 23...
temp. 31. 30. 30. 29 temp for each hour
wind 10. 11. 11. 09 wind for each hour

Related

price rate of change over 12 periods using padas dataframe

dears
I want to calculate the price rate of change by dividing the today's price with price 12 periods ago
"df.close" is the my data where I want to calculate the rate of change.
please guide me
I was unable to try anything because I felt it is the window of 12 days but not a continuous window
I see some similar replies but those are some big codes not relevant to me. I simply need one line to call the price 12 days ago and divide it
thank you.

AnyLogic schedule for arrival rate [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I want to use a schedule for my arrival rate. e.g. I want 33 trucks to arrive randomly between 08:00 and 09:00 and so on.
I added a rate schedule starting 8 till 9 and entered a value of 0.55
So it looked like this https://imgur.com/a/JxjFe4D
But when I started my simulation there were just 24 trucks within this period.
If you want exactly 33 trucks to arrive randomly between 8am and 9am you can do this:
1) create an event that runs cyclically ever day at 8am
2) create a dynamic event called GenerateTruck .
3) put the following code in the action of the event:
for(int i=0;i<33;i++){
double rand=uniform(0, 1);
create_GenerateTruck(rand,HOUR);
}
4) put the following code in the action of the dynamic event
source.inject();//assuming a source generates your trucks
you need to change your schedule type to be "Rate" and set it up as below:
Learn all about it in the AnyLogic help

Pentaho data integration issue with loading a kettle based on some condition

I have a Pentaho Data Integration job which has the following steps:
Generate row step which has an initial date (for e.g. 2010-01-01) and the limit as 10*366 = 3660 rows for 10 years.
Next step has an incrementer to increment the number of days.
Next step uses this information viz. initial date, limit, and the incrementer, to generate dates for each day for 10 years starting 2010-01-01 using javascript functions.
Final step loads a table with the generated dates.
All this works fine.
Now, I have a requirement where I do not want this table to be static with dates for 10 years only. If the max date in the date table is 2 years from today, I want to load dates for 10 more years in the table.
For the above example, with the 1st load loading dates for 10 years from 2010, I should be able to load 10 more years in 2018, the next 10 years in 2028 and so on and so forth.
What will be the best way to achieve this?
How can I:
1) Read the max date from my date table? - I know how to do this.
2) Use the read date to compare against today. And if the max date is within 2 years from today, I populate the table with next 10 years.
I don't know how to do 2 above in Pentaho data integration. Will really appreciate any pointers on a way to resolve this issue.
You need to read the current date (today) in a variable. For example with a Get system info step.
Then you can compare the two fields, max date and today, with a Filter Rows step.
As the previous step may give you more than one row, you need to either use a Unique Row (no field to provide) either a Group by (no group by field).
If any row gets by, then you launch you generate 10 years process. As you cannot have a hop from a step into this second Generate row, you must use a Transformation executor to launch your currently existing transformation.
Now, if your requirement gets a tiny little bit more complex than that, I strongly suggest you to use jobs to orchestrate your transformations.

What is the difference in "Day of year (y)" and "Day (d)" in VBA date functions like DateDiff? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am unable to understand what the difference is between the "Day of year (y)" and "Day (d)" options for the interval parameter in the VBA DateDiff function.
In what circumstances (e.g. for what sample values of d1 and d2) would the following lines give different results?
Debug.Print DateDiff("d", d1, d2)
Debug.Print DateDiff("y", d1, d2)
d is day of month
y is day of year
d is actually well known as day of month. I have to say in 44 years of programming, doing accounting with and without computers, I have never seen day of year used. But in may be a cultural thing. In Australia you get paid and pay your rent fortnightly (every two weeks). None of the programming languages know what a fortnight is. There is also a luna month (4 weeks).
This is what Help says.
To calculate the number of days between date1 and date2, you can use
either Day of year ("y") or Day ("d"). When interval is Weekday ("w"),
DateDiff returns the number of weeks between the two dates. If date1
falls on a Monday, DateDiff counts the number of Mondays until date2.
It counts date2 but not date1. If interval is Week ("ww"), however,
the DateDiff function returns the number of calendar weeks between the
two dates. It counts the number of Sundays between date1 and date2.
DateDiff counts date2 if it falls on a Sunday; but it doesn't count
date1, even if it does fall on a Sunday.
From VB6/VBA/VBS help (same paragraph in all three).
Microsoft Basics use OLE Automation functions. FormatDateTime uses VarFormatDateTime (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221554(v=vs.85).aspx) which calls down into the Windows API for International Features such as GetTimeFormat (eg https://msdn.microsoft.com/en-us/library/windows/desktop/dd318130(v=vs.85).aspx).
For full documentation you need to read the docs at all three levels.
EG VB's Msgbox is a wrapper for the API function Messagebox (https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx). You can pass any of the parameters documented in the API reference or the header files and VB just passes it on. Only a few relevant ones are listed in VB's Help.
Important
Remember that the only guarantee is what is stated in the VB help file. That is the contract - you do what it says and it will do what it says in help. Generally it promises only one thing limited in details. All the above is implementation details. You cannot rely on it. You treat VB statements as if they are a black box. As Windows changes your old programs automatically change with it.

Understanding Fabric Daily Summary Email

We're having trouble understanding the numbers in the daily summary emails we get from Fabric.
A search on SO only shows one somewhat-related question/answer.
Here are the emails from 2 consecutive days:
Our questions are:
Does “Monthly Active” mean over the last 30 days? If so, how can there be a 36% drop in 1 day if the counts went from 101 to 93 (an 8% drop)?
Why does “Daily Active” show a 75% drop if the current day is 1 and the previous day was 0?
Why does “Total Sessions” show a 94% drop if the current day is 1 and the previous day was 0?
Does the “Time in App per User” mean the average for the month or for the prior day? If it's for the month, why would 1 extra session cause the value to change so much? If it's for the day, why does it show “11:33m” even though the Total Sessions was 0?
Sometimes the “Time in App per User” ends in an “m” and sometimes it ends in an “s”. For example, “11:33m” and “0:44s”. Does that mean that “11:33m” is “11 hours and 33 minutes” and “0:44s” is “0 minutes and 44 seconds”? Or does the “11:33m” still mean “11 minutes and 33 seconds” and I should ignore the suffix?
Thanks for reaching out. Todd from Fabric here. The % change is actually % difference vs. what we expected based on the previous behavior of your app. This compensates for day of week etc.
The long session when getting zero, suggests that either the session was live/not reported to us at UTC midnight. The session gets created on session start and the duration gets set at the end.
Thanks!