Announcing GIS Search

Recently I've been putting together a site to complement the Locallucene and Local Solr
projects, www.gissearch.com. The aim of the site
is to provide articles around how to use locallucene and local solr, as well as how to tap into
the GIS world.

The world is local, and many people and companies are attempting to tap in to this. For the average
person, it's not easy terribly easy to get accurate detailed information on how to make GIS work
for you, without spending a fortune on companies offering custom services.

GIS Search is designed to try and break down those barriers. Please take some time to go check
it out, and don't be afraid to click on a few links, (including the ads) ;-)

Thanks
Patrick

Things I lay claim to

There are a things I must lay claim to having created

1. A kick ass chicken BBQ marinade (It's a secret, but damn good)
2. A religion on face book ! (Just check out the religion 'chicken', I was the first, and now there are 11)
3. A phrase that I'm slowly introducing into the place, a parody on the six flags ad
"No flags fun!"

Yes I know, I need to get out more....

Need to get some more hardware

Sitting at my vista desktop, looking at vmware going..... maybe I can develop on it
but I need a linux box, I need more hardware.

To my left is a p3 sony vaio laptop running UBuntu, not enough ram, or disk space for
my needs. Next to that is a dead P4 that a friend of mine built, replacing CPU, mother board,
and ram, would cost less than buying a new machine.

VPS? emm, nah, ram is expensive on those boxes... use my amazon ec2 cluster? Prehaps
I don't have access to their beta persistent storage yet, so I don't want to put my latest
on a volatile system....

I'm going to have to bite the bullet, and pick up something new, bugger, don't want to spend
money right now.

Walking a solr index

Here's a quick snippet of code to walk a solr index, for use with localsolr.
Running this requires obviously changing the code to point to your solr instance, and
also to add all the solr libraries dependencies to your class path.

This is probably going to leave my google adsense showing java for the next 2 months.
Yes google ad's those things that you would hopefully be clicking on if you weren't using
an rss reader :-( oh well, I guess I was never destined to become rich.... :-)


import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map.Entry;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.lucene.document.Document;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.update.DocumentBuilder;
import org.xml.sax.SAXException;


public class Foo {


SolrConfig cfg;
SolrCore core;
String solrBase = "/Users/pjaol/tmp/solr/tmp/apache-tomcat-5.5.26/solr/";
String solrDataDir = solrBase+"/core0/data/"; // your probably not using multicore so you'll have /data/
String solrSchema = solrBase+"/core0/conf/schema.xml";
String solrConfig = solrBase+"/core0/conf/solrconfig.xml";
public static void main(String[] args) {
Foo f = new Foo();
try {
f.init();
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

public void init() throws ParserConfigurationException, IOException, SAXException{
cfg = new SolrConfig(solrBase,"foo", new FileInputStream(solrConfig));
core = new SolrCore(null,solrDataDir , cfg,
new IndexSchema(cfg, solrSchema, null));

SolrIndexSearcher searcher = core.newSearcher("foo");
int mxdocs = searcher.maxDoc();

BufferedWriter writer = new BufferedWriter(new FileWriter("index.xml"));
writer.write("<add>");

for (int i = 0; i< mxdocs; i++){
Document luceneDoc = searcher.doc(i);

SolrDocument sdoc = new SolrDocument();
DocumentBuilder db = new DocumentBuilder(searcher.getSchema());
sdoc = db.loadStoredFields(sdoc, luceneDoc);

Iterator<Entry<String, Object>> it = sdoc.iterator();
SolrInputDocument sidoc = new SolrInputDocument();
while (it.hasNext()){
Entry<String, Object> et = it.next();
if (et.getKey().startsWith("_local")) {
continue;
}
sidoc.addField(et.getKey(), et.getValue());
}
ClientUtils.writeXML(sidoc, writer);
}
writer.write("</add>");
writer.close();
System.exit(0);
}

}



This will create an index.xml file you can use solr's post jar or sh files to reindex back on solr.

Scooters not doing so good

Scooter my 2 year old dachshund hasn't been feeling well recently.
As a puppy he had a lot of digestive problems, every couple of months
he used get diarrhea pretty bad, and we kept going back to the vet.
Each time we got a temporary solution, so I did some investigating and changed
his diet to Royal Canin Dachshund specific food, and it worked miracles.
He's been incident free for the past year.

That is until Wednesday, where it started with diarrhea again, but then Friday, it
was really bad, as he started vomiting as well, the only thing to change was I got
a new bag of his food. I contacted the store, who said they've had no issues, Friday
I contacted Royal Canin, who said the same thing, but recommended that to get
a sample for testing. I was actually impressed how personal they were and willing
to respond and take the matter seriously.

So I took scooter to the vet Friday, and it shuck me a lot, the vet said he was concerned
about the number of incidents that scooter had this problem in the past, and was concerned
that this was a chronic issue. Scooter was dehydrated, so they gave him fluids under the skin,
something to try and stop the vomiting, and then Metronidazole tablets to take home.

The vet said if it continues or reoccurs, he wants to test him for pancreatitis and IBS.
Both of which threw me, I was never really expecting him to have some thing that could be chronic.
He's improving slowly, he's still sick and he wasn't able to control anything, today though he didn't
throw up and there were no accidents. I've spent the day looking after him and trying to clean
up the apartment. Poor little guy, I've got to do all I can to get him back on track.

HDMI Part II

So got my HDMI cable from monoprice.com and plugged it in.
First DVD I played was a Universal studios DVD, the opening sequence put me off.
The logo of the planet with the word universal looked crap, I began to worry.
It honestly looked like something a 5 year old on LSD with crayons would do.
But then the movie started, and everything became right, everything looked superb
it turns out that the universal logo hasn't been updated in years, and the image remapping
was crap on it.

I notice the same thing on a lot of web sites when I browse with my 19'' LCD monitor.
Most logos are designed to be small and look ok at small resolutions.

However back to the main point, the movie, and everything else I put played was superb!
Cheap cables rock, go to monoprice.com, BB monster cables are a rip off.

HDMI What?

While waiting to get the cable drop in my bedroom enabled by comcast, I decided I'll pick up a dvd player for it.
They're cheap as chips these days, I bought one for Samantha a while ago and it cost me like 30 bucks.
So while looking around BB's I saw that there were 3 types, basic cheap ones going out of style, mid-price which all included something called upconversion (I've not heard of it before, it wasn't on the news paper that get's delivered under the rock I've been hiding out in). And then high priced blu-ray.

So the blu-ray version were big bulky, fugly, and just over priced, all new technology is the same. It comes down in price later on, and also vastly decreases in size. Since I got a HDTV I wanted something that would make use of it, so the basic
dvd players were out, leaving the upconversions.

Up Conversion is where a dvd player will remap some pixels to scale and display better, converting a SD display of 750 DPI to HD display 1080dpi (dot's per inch for anyone who's not used a dot matrix printer) ;-)

So I picked up a samsung dvd player, that matches my TV, I think Samantha's rubbing off on me with getting things to match.
Saw that it supported a DVIx output, so asked the sales man does it come with a dvi cable? Nope to use upconversion, I have to use a HDMI cable.... A wha? A HDMI cable, it's what outputs your digital signal to your TV...., hmm ok maybe this is like
buying a printer, where they never supply the flipping USB cable.... A total store driven policy I'm convinced.

So just how much are the HDMI cables? Knowing BB probably not the cheapest, but screw it, if it's not overly expensive it might just be convenient to get it there. The cost? between $60 and $120.

I looked at the guy and said for a cable?, yes it's for HD, picture quality differs according to the type of cable you get...
Really? I mean it's digital, not like your messing with analogue, you just need two connectors and a flipping wire in between. Is there any circuitry in the cable? nope, it's just wire and flipping 2 connectors...

So I said screw that, went home plugged it in with the 3 AVI components, and googled HDMI. Found an article on arstechnica.com saying exactly the same thing I thought, and a bunch of comments agreeing with the author. Shopping for HDMI cables: who do retailers think they're kidding ...

HDMI cables are a rip off, a digital signal does not require high tech connections! One of the recommendations from the site was a site called monoprice.com, where I purchased a HDMI cable for $3.97, and $3.30 for shipping.

I'll update this when I get the cable and can test it out, but thoughts are as long as it's a decent conductor it will be fine.
Poor quality digital signal only comes from broken / cracked wire.

Need to check my cable

Got a new TV for my bedroom, hooked it up to see "weak / no signal"
emm, why aren't all the cable outlets in my apartment working?

I certainly pay enough for it. Well will have to call comcast and get them out to sort it out.
I wouldn't mind getting a dvr as well, but want to see if I can trim down some of the packages.
Do I really need HBO, it's gotten poor since I first got it, I was just so bored of regular cable
I needed something that wasn't censored to hell and back.

I'll just have to see what they say and if it's going to cost me anything, I believe they're supposed
to hook up at least two outlets, and I've got a feeling they hooked up the second outlet in my living room.

Got published (kind of) again.

Received an email today saying that one of my photo's has been picked to be featured
on the US national aquarium's website! It was a small contest, but still a pretty sweet photo
that I was over joyed with being selected.
http://www.aqua.org/pictureit/

winning photo

Screw Capthca

One of the annoying things about this blog are the spam comments I get.
I'm using something called nucleus cms, which is a reasonably popular piece of blog
software.

But the security of it, is a little weak, there was a captcha component to it, that I installed
but couldn't get the gd-libraries to work with (I'll moan about php some other time)
While investigating the code trying to figure out what call to the gd-libs was failing, I figured out
how to hack it. It took all of 30 seconds. (No I'm not posting how)

I mean come on, just because it's a pretty picture doesn't mean it's secure.

So instead, I installed a random question component, I come up with the questions, you have to answer
them to post. Not rocket science to break, but bot's are designed to post to multiple sites, not figure out
all the possible questions I pose on my one, so yes it can be broken, but it's not worth while doing it.

That I consider better than here's a generic way to bypass a few thousand sites all at once.