It’s all over the news. Well, something like that. It spiked my interest and I installed Waze on my phone. It looks cute, and for people without paranoia (you will be sharing your location), it can be both fun and helpful. One of the features is that it lists gasstations nearby. Not so spectacular, it’s on Google Maps too you might say. But Waze lists them sorted by distance from your current location including the current fuel prices. So, let’s save ourselves some money, and start using Waze 🙂
I don’t use my local GlassFish much, so of course: I lost the admin password. Here’s a simple method to be able to log in again.
Start asadmin from the $GLASSFISH/bin folder.
asadmin> list-domains domain1 not running Command list-domains executed succesfully.
Next create a domain that does not exist yet. Supply an admin user and password that you can remember!
asadmin> create-domain Enter the value for the domain_name operand> dummy Enter admin user name [Enter to accept default "admin" / no password]> admin Enter the admin password [Enter to accept default of no password]> ****** Enter the admin password again> ****** Using default port 4848 for Admin. Using default port 8080 for HTTP Instance. ... Domain dummy created. Domain dummy admin port is 4848. Domain dummy admin user is "admin". Command create-domain executed successfully. asadmin>
Now go to the config folder of domain dummy ($GLASSFISH/glassfish/domains/dummy/config). There is a file admin-keyfile. Copy this file to the config folder of your original domain, e.g. domain1 ($GLASSFISH/glassfish/domains/domain1/config). Make sure you make a backup of the original admin-keyfile first.
Confirm that you can log in as admin again. If so, you can safely delete the dummy-domain:
asadmin> delete-domain dummy Domain dummy deleted. Command delete-domain executed successfully. asadmin>
This blog is starting to get old 🙂 Next February this weblog will be 10! I think it started with pMachine, then b2Evolution, and after that several versions of WordPress. I know I used some ASP.NET software at first, when the server was still a Windows machine, but “.Text” was not stable enough (reboots made the weblog unavailable), so that’s when I started with PHP-based weblog software and finally ended up with the best one!
Recently I installed a broken-link checker plugin, and that resulted in quite a number of dead links. Some that were links to my own weblog. I “unlinked” most of the external links (so the link is removed), and I am trying to sort out my own links. I restored some pictures already, but disk crashes in the past resulted in some media referred to by the links to be gone. Should have made better backups. Mind the word “should”.
I just renewed my SSL certificates for www.switchbl8.nl, since they were expired. Again, very fast service by the people of Xolphin SSL Certificaten.
After more than a month of waiting for Android 4.2.2 I decided to go for it, and try the alternate route. I downloaded a Generic ES (Spanish) 4.2.2 ROM (read here), and flashed it to my phone. The downloading of the image and installing the flashtool are the timeconsuming tasks, flashing the ROM is a piece of cake. Be sure to not wipe the data and cache partition (untick 2 of the 3 checkboxes) if you want to retain what’s on your phone.
With the new Android I would be easy to acquire root, so DoomLord said. No unlocked bootloader or whatsoever needed. So I downloaded his tool, did what the screen said, and less than five minutes later I had a rooted-phone. Things couldn’t be easier than this.
The solution I’m creating for the client is based on Google Maps, so when I showed them some results, they joked that they wouldn’t be able to sell their product to Microsoft, since it’s not based on Bing Maps.
Replacing the basis with Bing Maps is no problem however. But since the map in this solution is used as an entry to filter the data (you draw the region you want to query), I need a (free form) drawing library of some sort. There is no drawing support in Bing Maps what so ever. The only thing present is the Shape Toolbox module someone created back in 2012, and never maintained/updated. Why is there no support for drawing on the map?
To make things worse, if I wanted to create something myself (I learned a thing or two playing with Google Maps) the mouse event returns X and Y values of the screen, not the coordinates on the map where the mouse event took place, so if I want to create something myself, I need to be recalculate the X and Y values to mapcoordinates every single time. There’s a function for it, but it’s a stupid decision to implement it this way. It should be the other way around, because how often would you really need the X and Y values of the screen?
That was my rant. Grrrr….
I found a script to simplify polygons in Google Maps, basically to reduce the number of nodes the polygon is build up from. It does that by some sort of smoothing algorithm, with a distance parameter. Anything under that distance is smoothed out (read: deleted). It’s a Google Maps V2 script, but I modified it to work with V3.
This is the original: Stack-based Douglas Peucker line simplification routine by Dr. Gary J. Robinson. Let me know if you need the V3 script, but it shouldn’t be a problem to do the modifications yourself.
When I set the tolerance (kink as it’s called in the script) to 10 (meter), my polygons have a node drop from almost 600 to about 30, and still look about the same as what was drawn. I can still optimize the query a little to only use 7 decimal digits on the lats/longs, but for now that’s not needed.
Come to think of it, the amount of smoothing should be linked to the zoomlevel the map is at when drawing the polygon.
Update 18-Aug-2016: The V3 file is this one.
I created a routine (Javascript) to do some free form drawing of a polygon in Google Maps, as opposed to the standard point-per-click polygon that comes with the standard library. Everything works great. The polygon is used to query a database (you’re drawing your filter, so to speak). A simple polygon around Amsterdam however results in a 900+ points polygon, making the query-string over 45K. Wow. That needs some optimization!