There's always the bright side and with that, we are now Scripting.One. Get the script complete and tested to run.
Sunday, October 31, 2021
Online Alarm Clock
Tuesday, October 19, 2021
Create Online Quiz
- To create a web based application that could hold multiple exams from different topics/subjects.
- To have an easy setup of questions. Using google sheets as database.
- To have a quick turn around of the results.
- Teachers and proctors can have visibility of the students progress.
Sunday, October 17, 2021
Amazon Reviews Scraper
Monday, August 30, 2021
Perseverance pictures straight to your Gmail
Mars Perseverance Rover is at Sol 186 on Mars. Since it's landing last February 18, 2021, it already roamed 1.97 km (1.22 mi) and spent 4611 hours on an alien planet. I'm going to describe the science and the technical aspect of the Rover. Instead, I will share to you on how to capture the raw images from Mars as captured by Mars Perseverance rover's many camera.
NASA Open API
The images are open for public to view. Stay tune on their Mars Perseverance Multimedia site when it's published. Or, you can always get ahead using NASA Open API. Of course, we'll make use of Google Apps Script to fetch from the API. Run the code on a daily basis. Then email the images properly into our Gmail inbox. Now, that's really cool way to get those images fresh.
Sample email output
Just a caution, the script only allows upto 100 images to be embedded in the Gmail body. It's the html table with rows capped at that number. Beyond that cap, will cause an error. As a remedy, I've added a line where the full html saved into a text file, saved into a my GDrive then attach it to the email notification.
The Script (have fun!):
Friday, August 27, 2021
Google Sheets as API database
API - An application programming interface is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build such a connection or interface is called an API specification [wikipedia].
It's a popular resource for developers in tapping external databases. A staple of every web application consumables. It may sound high-tech. But, the application is a very foundational and with the right approach and basic database knowledge, it is a very powerful tool.
API is most of the time offered for free or premium to developers. Depending on the application and level of data exposure, sometimes this is very expensive. But, for hobbyist and early stage learners. There's ready platform we can take advantage and host your own API.
Here comes Google Sheets
Google sheets it's not just a spreadsheet. Just take off your mind on the Microsoft Suite comparison. Google Apps offers great flexibility in terms of customizing your sheets application. In this article I will show how you make use of sheets as database for your API.
In this application, I will use my existing API integration with NASA API on Mars rover weather collection in Mars. This will not cover the process where I tap the Mars Weather API and pulling them into a spreadsheet. Please see Mars Weather and how to fetch the data for understanding how I was able to pull the resources automatically.
Manifest - available api syntax, definition and URLs [ https://script.googleusercontent.com/macros/echo?user_content_key=Aqvh_KWEIkA2y72sJUDkCq3hU0qyXQJnj2MY29elW17YkqH_9WqrLKEd2A_dpFBZCGVVXo3_52JBGkEeehzmavQ-ppmUFbCam5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnNqjJ-H5eu9M7hqa9rZt3J7OQe700Q-3vo4cEmcA_c3tBQ5jxh7l-ylMvMB8kT3jmtDBYm40MhAYFuROh1Y-nIh_GIAPxO1ID8oZHxDdzmO3C_sCiQ09SOE&lib=MW1B9XzBuEwJYul5IBb74tZFLmJLFTjNj]
Monday, August 23, 2021
IP what is my address
IP what is my?
It's a really weird question. It's like asking a genie for something. Basically asking for an address. This is an age old question in the context of internet history. A very basic information, yet most of us are yet hitting search on Google.
On average, 1 million - 10 million monthly searches for this question. It's a very interesting information considering majority of us went through computer class/lessons. I'm pretty sure this was mentioned many times. And for those are searching for this information, for sure, are well versed enough with these code.
So, what my ip address and how to determine this?
-
Let's start with the simplest approach. On Google search, type "what is my
ip". At the top of the search result is the actual information. This is also
the same address that Google used to return local result using your
location.
-
Then there's the searching through your PC setting.
-
Then there's the command prompt. A very straight forward approach, by the way. A good way to show-off as well. You know just want to impress, how good you are with IT stuff, typing and going into the telnet aspect of identifying your IP Address. On windows, go to Search and type cmd and it enter. Then type Ipconfig in the black screen =). Just look for the blinking cursor =)
- Start Terminal
- Enter the command ipconfig getifaddr en1 at the command prompt. Or...
-
Enter the command ipconfig getifaddr en0
Saturday, August 21, 2021
Ingenuity's flight
It's not news anymore that powered flight was successfully conducted on Mars. First flight was on April 19, 2021 and had logged 12 flights with almost 22 hrs of flight time. That's impressive for an autonomous helicopter on a planet 300 million miles away from Earth. This is not your typical NASA Mars Exploration article. Instead an idea that was influenced with Chrome's Dino Run and a fun side of with Mars Helicopter's Ingenuity as it takes flight in a webpage.
How about we keep it flying?
I'm sharing a project that I've been working to do just as this. I will not create an actual helicopter. Instead, I'll create a web app that could apply the same dynamics as Google Chrome's Dino run. Well...the foundation...for start.
Embed code from github two ways
As a blogger and a programmer at the same time. Bringing your code to the general audience creates sense of pride. It depends on the language, presenting them as close to how it appears in an IDE would be very helpful for the readers. You can always take screens shots and post them on your blog as an image. But, most of the coder out there, that code in an image is not useful. Every coder needs a text based blocks of scripts to copied easily.
So how would you post your script to a blog post and retail the visual text representation just like in an IDE?
Github
It is a popular platform for software developer to host codes. It simply offers the ability to share scripts for multiple developers and offer version controls to managed source code systematically. For mainstream developers, it does that efficiently. But for a blogger, it gives that flexibility, to capture those posted scripts and share it through a blog.
Embed code from github two ways
This involves editing your site in html level. You are reading this article upto this line, for sure you know what I'm talking about.
https://github.com/ - the main site and how to embed your code from this domain. It should look same in the image below. Just incase the actual implementation works on this article.
The script embedded:
https://gist.github.com/ - this approach works similar with above approach. In the main github repository, on url is good for single file repository. In gist, single gist file can hold multiple blocks of codes in different file type (i.e., .html, .js, .css and etc). Below is how you copy your gist url and write on the html level of your article.
The script embedded:
Which is better?Tuesday, August 17, 2021
Hoodies for guys
Monday, August 16, 2021
Power bi and how to organize your measures
Power Bi had gain significant traction in the business analytics space. Microsoft had proven to penetrate the market and successfully, introduced the app into a staple in the office productivity as well. In this article, I will not dwell into the history and the features of the tool. Instead, I will show you how to organize your power bi fields for easy and smooth dashboard development.
Power Bi for dashboard
Yes, it is for that purpose and in the business analytics practice, this is a very useful tool. Seeing the numbers graphically and at a glance had proven efficient in drawing out insight and quick decisions. But, creating those highly interactive charts and graphs, could be harder than thought.
The development could be messy and to produce that summary or data point could involved layers of calculation.
Navigating in the Development phase
Developing a power bi dashboard could be straightforward ( as what Microsoft intends it to be ). Just a heads up though, you could get lost in the sea of data fields as you get to dive in this application. Most times you will have to need to create customer formulas to draw certain calculation. This customize calculation is what we called as Measures.
Measures
There are actually two types and the are;
- Quick Measure - this is a preset formula most of them are self explanatory such as rolling averages.
- Custom Measure - this is an outright creation of the formula. Pretty much same as having one in a spreadsheet.
Dealing with multiple fields on your data can be confusing. At some point, as you created multiple measures, unknowingly you've duplicated some. So, how do you manage this kind of scenario and somehow create an efficient way of navigating your measures.
Two ways to "5S" your measures
- Folders - this is the most effective approach. Containing your measures into a folder see below for the demo
- Simple prefix - this is just a personal labeling approach that I've done which is also effective. Example below shows "#_" as prefix. In this way, I have all measures at the top of the field list. It's helpful for I tend to create more measures when developing PowerBi dashboards.
Saturday, August 14, 2021
Google Apps Script and How to allow web camera access
Tuesday, August 10, 2021
Google Apps Script and how to access NASA API for Mars pictures
Most of us, probably, would get that "front row" passes just to have that first peek. We can't just wait for NASA Mars 2020 and NASA JPL site to prompt us in our newsletter subscription.
NASA APIs } have been generous and let us have that "front row" ticket for free. It is a good way for bloggers and hobbyists alike to play around with code and get that first had snippets of the images that NASA Perseverance rover captured on Mars.
Take note though in the Rover Camera list below, Perseverance is not yet available. But, don't worry, I got you covered on that one.
Abbreviation | Camera | Curiosity | Opportunity | Spirit |
---|---|---|---|---|
FHAZ | Front Hazard Avoidance Camera | ✔ | ✔ | ✔ |
RHAZ | Rear Hazard Avoidance Camera | ✔ | ✔ | ✔ |
MAST | Mast Camera | ✔ | ||
CHEMCAM | Chemistry and Camera Complex | ✔ | ||
MAHLI | Mars Hand Lens Imager | ✔ | ||
MARDI | Mars Descent Imager | ✔ | ||
NAVCAM | Navigation Camera | ✔ | ✔ | ✔ |
PANCAM | Panoramic Camera | ✔ | ✔ | |
MINITES | Miniature Thermal Emission Spectrometer (Mini-TES) | ✔ | ✔ |
Google apps script in the works
If you know JavaScript Google Apps Script will can surely help you make those postcard from Mars delivered at your will. In the NASA API's, resources for Perseverance haven't disclosed yet. But, it is not that difficult to create since we already have the base API URL's in place with the previous rovers. All we need is to be guided with the available cameras in the rover and the latest Sol it captured.
You can view the code on my github link [ NASA Perseverance Rover image resources API ]. Here's a snippets of the code in image format.
The script:
Mars Weather and how to fetch the data
What's the weather on Mars? Aside from drilling holes and collecting samples from the Martian surface, it is vital to keep tabs on the environmental information. I'm sure it's not all sunny all throughout a Martian year. If at all sunny, what could be the temperature and how the atmospheric variation for each Sols. Mars rover have to capture information such as these. It would be helpful to future missions on how the seasons on Mars varies and how could future rovers or even human missions sustain such a fluctuation with minimal disruption.
This is not a technical article of analyzing Mars Weather. Instead, as hobbyist, I'm going to share on how to fetch such information for personal or education purposes. But, before we dive into the "how" here's a short background on the REMS.
How we can take hold of such weather data?
With API we can get these information or data. The question is what API. NASA open API have published for InSight: Mars Weather. With Curiosity REMS, it's not openly shared. But, here, I will show you how. If you'll look into Mars MSL Curiosity REMS page. Inspect the webpage at the right element you will see the API they are currently using to create the weather information posted on the page as shown below.
The API URL is https://mars.nasa.gov/rss/api/?feed=weather&category=msl&feedtype=json. Opening this link will direct you to a page which contains all weather data since Sol 1. That's almost 3000 lines of data, considering is about Sol 3073 on Gale Crater Mars. You can always get down to coding and create ways to fetch those JSON data into usable and structured table. A .csv or directly written into a spreadsheet.
This approach is for script written in Google Apps Script. What's about to be shown are methods on...
- How to fetch the REMS Curiosity data and write accordingly the latest Sol info into a spreadsheet.
- Fetch like an online API where you can pick the information you only need. The API show above is not clearly mapped and no documentation available (found) to properly access the resources. Creating the API for you from the daily fetch done from the main API will be convenient for developers who just want the direct data right away.