Various software projects. Jump links within this page follow:
||Newton: MEMS ECAD|
||visitors.php: Web Dev|
Personal use of this material is permitted, though citation is required. However, permission to reprint or republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must be obtained directly from the author. If NEWTON is downloaded a license agreement will pop up, which requires acceptance for download.Newton: MEMS ECAD
|Michael S. McCorquodale, James L. McCann, and Richard B. Brown, "Newton: A Library-Based Analytical Synthesis Tool for RF-MEMS Resonators," Asia and South Pacific Design Automation Conference, Yokohama, Japan 2006.|
|NEWTON in action synthesizing a 10MHz clamped-clamped beam microresonator. The application is platform independent and simply requires a local installation of Perl, Perl/Tk and Mathematica.|
|Scanning electron micrograph of the fabricated clamped-clamped beam microresonator based on the synthesis output from NEWTON.|
I am often asked how I built the (visitors.php) page. It's original and not from a template. Consequently, I needed to conceive an architecture for it. I'm not a professional web developer (just a hobbyist), but the goals of this effort follow:
- To see what could be captured merely from a user visiting this site and w/o permission
- To save those data on the server side in a primitive and custom database
- To recall those entries, sort them and present them meaningfully as follows:
- Capturing and displaying visitor geolocation
- Capturing the time of visit
- Capturing the number of visits from the same visitor
- Sorting the visitor DB to reflect the latest visits and most common visitors
- To plot the locations of visitors on a map
- To have fun coding something that ended up more complex than I thought.
As I considered these goals and possible architectures, I quickly realized the limitations of certain common languages used on the web. Here is a brief summary:
- I could find no other acceptable solution to read and write on the server side than with PHP.
- Realizing the above, I learned that it can be tricky to pass variables between the languages and care needs to be taken in understanding the sequencing in how the code is executed.
- Last, it is easy to pull the IP address from a visitor and place a timestamp, but not much more. Thus I knew I needed some sort of API to geolocate the visitor.
- With the the geolocation, I can map the current user location or any user in the DB with the Google Maps API.
A diagram of the code is shown below:
So with this in mind, what essentially occurs is that when the home page (index.php) is hit, PHP code in that file pulls the IP address from the user and uses the PHP API from (ipgeolocation.io) to geolocate the user. This is a commercially available geolocator with a free developer version limited to 30k hits per month. Moving on, the PHP code opens a local file on the server (hostipdb.txt) and writes to it in a standard format that I defined. If you select the link, you can see the trivial format of the database which is simply a list of sequential entries for each visitor. The (index.php) returns data to the user, but nothing client-specific is visible to the user at this point.
Next, when the user hits the visitors page (visitors.php) the DB is opened by PHP code and entries are parsed and sorted into useful arrays. For example, there are arrays of the IP addresses, city, country, geolocation and date. The PHP code goes on to sort the data from the arrays. I don't know if my sorting algorithm is optimal, but it is a bit elegant and parses out bots, search engines, crawlers and so on while organizing the data from the entries by time of visit and number of visits. In hindsight, I probably could've done the sorting when index.php is hit, which is a change I might make.