google apps script on form submit update calendar slow response - forms

I am building a simple booking system on google calendar. However, users feel complicated, so I made a google form as a front end to simplify the data entry.
The process is straight forward. It's just form, sheets and then apps script. There is no functional problem.
There is performance issue.
The total time from Form submit to calendar update shown on browser takes in average 30 seconds. The time stamp on execution script shown less than one second to complete the apps script but it take more than ten second to start apps script. It means there is more than ten seconds for google form and sheets to complete and more than ten seconds for calendar to sync.
Any advice to shorten total processing time?
Thanks in advance,
Regards,
Thomason

Related

Is there any tool in Flutter that allows you to perform any function only on the selected day, month, year and time?

I'm developing an application in Flutter for online queries and right now I'm lost as to how to show the user, for example, a message based on the exact time he previously chose. The user can already choose the day, month, year and time, and after he selects them, I can store them as Strings, but I don't know of any tool that can perform some function at that exact moment. What I want to do is that after entering the information of the day and time of the consultation, a notification appears to the user asking him if he wants to join the video call, but only at the time he chose.
I tried to calculate the difference between the chosen date and the current moment, and based on that duration I used the Timer to execute some task after the elapsed time. But I was also in doubt if this function would be executed even if the user had not opened the application, so I don't know if it would really work or not. Previously I also researched dependencies that could help, I found for example the sf_calendar, but from what I observed it only has a system to choose the date and save and display this data on the screen, but it does not allow performing some function on that date.

Pedometer with Daily steps counter using flutter

I am trying to build a basic fitness app using flutter.
The app has two main features:
Daily steps counter
graph of historical data (number of steps each day)
I use the pedometer plugin to retrieve data from the sensors of the phone.
My problem is that the plugin can only send the continuous step counting since the last reboot
that means if the user does not open my app for serval days, I don't know how many steps he walked each day only the total number of steps he did. I thought about letting my app run in the background but it will be a waste of battery
P.s I read Implementing pedometer in flutter article by Masky, but it is not solving my problem.
Thanks for any kind of help :)
Excerpt from: https://hub.packtpub.com/step-detector-and-step-counters-sensors/
The event timestamp represents the time at which the last step was taken. This sensor is especially useful for those applications that don’t want to run in the background and maintain the history of steps themselves. This sensor works in batches and in continuous mode.
Of the returned SensorEvent, the 1st value represents the number of steps since the last boot and it also contains a timestamp which is the amount of nanoseconds elapsed from the time of last device boot.
This site advises to use JobScheduler to "schedule periodic job to retrieve the total step count under suitable interval."
On the first site it explains how to maintain step history in case that's what you want, there's also sample code there.

Fetching 1 minute bars from Yahoo Finance

I'm trying to download 1 minute historical stock prices from Yahoo Finance, both for the current day and the previous ones.
Yahoo (just like Google) supports up to 15 days worth of data, using the following API query:
http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv
The thing is that data keeps on changing even when the markets are closed! Try refreshing every minute or so and some minute bars change, even from the beginning of the session.
Another interesting thing is that all of these queries return slightly different data for the same bars:
http://chartapi.finance.yahoo.com/instrument/2.0/AAPL/chartdata;type=quote;range=1d/csv
Replace the bold number with 100000 and it will still work but return slightly different data.
Does anyone understand this?
Is there a modern YQL query that can fetch historical minute data instead of this API?
Thanks!
Historical minute data is not as easily accessible as we all would like. I have found that the most affordable way to gather Intraday Stock Price data is to develop automated scripts that log price information for whenever the markets are open.
Similar to the Yahoo data URL that you shared, Bloomberg maintains 1-Day Intraday Price information in JSON format like this : https://www.bloomberg.com/markets/api/bulk-time-series/price/AAPL%3AUS?timeFrame=1_DAY
The URL convention appears easy to input on your own once you have a list of Ticker Symbols and an understanding of the consistent syntax.
To arrive at that URL initially though, without having any idea for guessing / reverse-engineering it, I simply went here https://www.bloomberg.com/quote/AAPL:US and used Developer Tools on my browser and tracked a background GET request which led me to that URL. I wouldn't be surprised if you could employ similar methods on other Price Data-related websites.
You can also write scripts to track price data as fast as your internet goes. One python package that I find pretty handy and is ystockquote
You can have it request price data every couple of seconds and log that into a daily time series database.
Yes there is other APIs.
I don't know if it can still help but if you need intraday data, there is a API on rapidapi called (Quotient) which allows to pull intraday (at 1-min level), EOD market (FX, Crypto, Stocks (US, CANADIAN, UK, AUSTRALIA, EUROPE), ETFs and Futures. It also provides earnings, dividends, splits and a lot others informations.

Tracking stock prices and email alerts

I have a google spreadsheet which helps us to track some stocks prices from the NASDAQ and DOWJONES. When I open the spreadsheet the prices automatically refresh via google finance built-in functions.
That is, for instance, the Apple price in a certain cell:
=GoogleFinance("AAPL";"price")
So far so good. Now we have a target buying price for each value and when the price falls below our target price we get an alert. I have written a script so that when this happens it sends me an email notification. Moreover, I have also configured a time-driven trigger which executes the script every 5 minutes.
But WHAT I really need is the WHOLE spreadsheet to open every 5 minutes not just only the script so that the Google finance funcions load and get the updated stock prices.
Is there a way to do that?
Not sure if this is the best approaching for a stock tracking spreadsheet so any ideas will be highly appreciated.
A standalone script will open a spreadsheet but it does not wait for the functions like GoogleFinance to complete so you may need to put in an explicit wait or loop until complete

How to make a demo game in Unity3d?

I have developed a game in unity3d for pc and mac. I want to publish the game with 30 days trial period.
How do I make it? How do I write into the system registry. What things that I should keep in mind while developing this trial version.
Whenever I search in google, I get trial version of unity3d not about how to make a trial game in unity3d.
The following article has a lot of information, but is pretty long.
Writing to Registry
Regarding saving to the registry, only do this if you have a big game and will be writing other values to the registry. If it's just a small indie game, then rather avoid the registry. People don't like it when small indie games write values into their registry, as most developers will never remove that value.
There are 2 ways. You could either make the user "login" to your server every time, also called "Online Validation". This way is more secure, but does require the user to login which is not ideal. You could use the following offline method. Please note that I just thought about this, so there might be small flaws.
Offline Method
You could get the current system date and time. Encrypt the date and time and save it to disk. Then every time the game starts up, get the system date and time again and check this "new" time to the date and time you have stored on disk. This check will more be to make sure the user has not modified the system date and time. Obviously overwrite the date and time every time the game is started, but obviously first check the value.
You'll know if the user has modified their time if the "new" date and time you got is not more than the old stored date and time. You could also get the date and time, just before the game exits. Then when the game starts up again, you can make sure that the current date and time is more than the date and time you stored to disk.
Also get the date and time when the game first starts up and save that. As you can then check exactly how many days until their trial runs out.
What you should keep in mind
Allow the user to keep their saved game (if they can save). So that when the buy your game, they do not have to start all over again.