

Personal comments, reivews and suggestions from an I.T./Car/GTD/Home Automation/coder/Local Government kind of guy.
![]() |
Are You Home Yet? The System Knows... |
![]() |
Mobile Status Screen for My Home Automation System |
'** GetLatitude.vbsGet Google Latitude Lat/Lon for the user and log to the Log database 'v1.00 - SWN - 10/29/2011 '** Debugging flag - True to see messages MyDebug = TRUE '** Your information and location to test against '** Google Latitude User ID UserID = "{Your Latitude Code Here}" '** Location Latitude to test against LocLat = 35.32 '** Location Longitude to test against LocLon = -96.92 '** If you are within 1/2 Mile of LocLat/LocLon then If triggers CheckDistance = .5 '** First get the user (YOU) current location from the Latitude JSON feed MyLonLat = GetLatitude(UserID) '** Debug stuff - show it if debugging If MyDebug then MsgBox "Raw Coords: " & MyLonLat '** Split out the Lat/Lon from the results MyCoordsA = SPLIT(MyLonLat) MyLon = MyCoordsA(0) MyLat = MyCoordsA(1) '** Now do a distance check between the points '** Note this uses another free web API, GeoCoder.us to calc this for us '** You could build your own dist compare if you wanted... but why if this is there? '** Distance returned is in Miles so you can convert as desired from there MyDistance = GetDistance(MyLat, MyLon, LocLat, LocLon) '** Show distance if debugging If MyDebug then MsgBox "Distance: " & MyDistance '** Now take action on the distance check results '** Obviously you will have to have some session state here so this doesn't fire on every check '** In my HA system, it sets a Home flag so my code checks if the should be changed and takes action if needed If MyDistance < CheckDistance then '** Do something cool because you're close MsgBox "You are within " & MyDistance & " of your target location." Else '** Do something else because you're not MsgBox "You are OUTSIDE of your target location by " & MyDistance - CheckDistance & " miles." End If '** get the Lat/Lon data from your Google Latitude Feed Function GetLatitude(strUserID) Set objHttp = CreateObject("Msxml2.ServerXMLHTTP") objHttp.Open "GET", "http://www.google.com/latitude/apps/badge/api?user=" & strUSERID & "&type=json&callback=parse", False objHttp.Send html = objHttp.ResponseText Lines = Split(html, "[", -1, 1) Count=UBound(Lines) MyCoords = lines(2) MyCoords = LEFT(MyCoords,INSTR(MyCoords,"]") - 1) GetLatitude = MyCoords Set objHTTP = nothing 'Release the object End Function '** Calc the distance between two lat/lon points and return as MILES Function GetDistance(Lat1, Lon1, Lat2, Lon2) Set objHttp = CreateObject("Msxml2.ServerXMLHTTP") GetLink = "http://geocoder.us/service/distance?lat1=" & Lat1 & "&lat2=" & Lat2 & "&lng1=" & Lon1 & "&lng2=" & Lon2 objHttp.Open "GET", GetLink, False objHttp.Send html = objHttp.ResponseText '** Parse out the information here StartPos = Instr(html,"=") EndPos = Instr(html,"mile") GetDistance = Ltrim(Rtrim(Mid(html,StartPos + 1, EndPos-StartPos-1))) GetDistance = GetDistance * 1 Set objHttp = Nothing End Function
![]() |
PDP-11/34 Main CPU |
(Just an excerpt from the most recent IT Update at the City of Shawnee I wrote. Nothing earth shattering but quite true IMHO)
Just like the caveman used a club and fire, the modern man and women have tools to do the jobs of the day. The computer, and other technology, are simply that… tools of the current time. Yes, we still use clubs and fire, but just like in the caveman days, the ones what knew and used the tools the most effectively survived yet another day and thrived.
It’s pretty hard to think of any position at the City where a computer type device doesn’t come in to play somehow, somewhere… or won’t be in the near future. Meter readers use handheld devices, janitors use email, offices workers spend a majority of their time on a box, Police have laptops in their cars, Fire has iPads in their hands. Water and Sewer plants run on embedded systems, and Cemetery workers use databases and soon GPS and GIS. Garage mechanics lookup manuals and help online, and soon line workers will be using iPads to see their networks of water and sewer pipes.
So when we hear someone say “I don’t know much about computers” I pause and think: “How do you do your job then?” I know, maybe we’re partial to the whole technology thing since that’s our job to keep it all working, but seriously, how do you do your job the most effective and efficient way if you don’t know the tools you use?
If you’re waiting for someone to show you everything you need to know then you’ll always be behind the learning curve. Just look around a little and you’ll see all kinds of help waiting there for you to be proactive with. On the COS Intranet you’ll see Computer Self Help, INCODE Help and Documents, Global Records information, how to add printers, setup email, and more. And once you are using a piece of software, nearly everything you need to know is often lurking behind that HELP button or menu item. If you say you don’t have time to learn, I challenge you that you don’t have time NOT to learn how to be more effective with the tools of the 21st century… technology and computers.
Just don’t use the club or fire I talked about on the Computer.. that doesn’t help.