This is part of a series of posts that I wanted to do around late October last year, I finally got to it.
When I was doing an assignment in Internet Programming last semester, we were given the task of using the Google Maps API. This assignment also required the use of custom markers, and to have Info Windows that are displayed upon clicking the multiple custom markers.
The Google Maps API example for InfoWindows was useful in displaying only one info window (a window with additional information if a marker is clicked), and this led me to thinking I could instantiate a new InfoWindow and add an event listener to it.
Something like this:
However, this led to the InfoWindow only displaying information about the last item in the array of objects, no matter which marker I clicked.
After a bit of head scratching and Google-fu, I then realized I had stumbled onto an issue caused by closures.
Recently on a side project I’ve been working on I decided that I wanted to create a repository… 2 weeks later. This was because initially I felt I didn’t have much code to begin with, no point keeping a version control of code that hasn’t been written yet.. right?
By the time I decided to initialize a git for it, I decided I wanted to keep track of when I started, so I can have a gauge of the duration it took for me to develop the program, at least on whatever free off work hours I could find. Searching online didn’t lead me to the answers right away, so here’s how to create a commit back in time.
Recently on Stackoverflow a user posted a question regarding Java’s String.split() method, one that beginners are regularly exposed to in order to extract data within strings.
The user stumbled upon this when trying to test code in another machine, which happened to be running a different version of Java. Java 8 has changed the implementation of
split() from having an empty string being added into the string array on first null element, to not adding an empty string into the array.