Tuesday, September 28, 2010

LG 420G No Signal

I just recently bought a LG 420G at Target. After registering the serial number with TracFone.com, it seemed I could get no signal either at home or at work. I filed a complaint and the simple answer was to power off and turn back on. I did this and now the phone (fone ;) ) works.

Wednesday, April 28, 2010

PostgreSQL simple dblink cursor example

In PostgreSQL, dblink works fine to query the contents of a table remotely and insert into a new table. However, sometimes that table is too big to fit into memory. Here is an example function which uses cursors to do just that:

CREATE OR REPLACE FUNCTION get_data() RETURNS void AS $$
BEGIN
PERFORM dblink_connect('dbname=db hostaddr=host port=5432
user=user password=password');
PERFORM dblink_open('curs', 'select * from table');
LOOP
INSERT INTO table
SELECT data.*
FROM dblink_fetch('curs', 1)
AS data();
IF NOT FOUND THEN
EXIT;
END IF;
END LOOP;
PERFORM dblink_close('curs');
PERFORM dblink_disconnect();
END;
$$ LANGUAGE plpgsql;

Tuesday, April 27, 2010

PostgreSQL Arrays and Java JDBC (always quote on insert)

I ran into a problem recently using PostgreSQL arrays with Java. I had a table where each row represented a sentence in a web page. One column contained the entire sentence. Another column contained an array of tokens that make up that sentence (as parsed by GATE).

While parsing a Wikipedia page, it contained the character: '†' (\u2020). This inserted fine as a sentence, but became {"?"} in the array. I used the class PostgreSQLTextArray from Valentine's tech log (thanks Google). The contents would not display in pgAdmin3. How in the world could the same character work to insert into a character varying field but not a character varying[] field?!

What I found out is that this character and many others need to be quoted to properly insert into a PostgreSQL array. I changed the Array class I was using to always quote characters.

Tuesday, December 29, 2009

Fix quiet microphone on Acer Aspire 5100 after install Windows 7

After installing Windows 7 on my system the microphone was extremely quiet with the default Microsoft drivers. I finally was able to fix the problem using the following steps:
  1. Download driver from Acer.com (http://global-download.acer.com/GDFiles/Driver/Audio/Audio_Realtek_10.0.5605_Vistax86.zip?acerid=633640464374493351&Step1=Notebook&Step2=Aspire&Step3=Aspire%205100&OS=V10&LC=en&BC=Acer&SC=PA_6).
  2. Next disable Windows automatic driver download and installation. Type "change device installation settings" into Start and select the option of the same name. Change the settings to either "No..." and "Never..." or "No..." and "Install...if not found...". (This is the critical step.)
  3. I also changed the driver install to work in compatibility mode. This is done by right clicking on the Setup.exe, selecting properties > compatibility and changing to Vista mode.
  4. Install the drivers and restart your computer. If you are as lucky as me then your built in microphone will now work.

Monday, August 10, 2009

Use of Grocery Store Data

I am sure all of you have seen or used a grocery store card to receive discounts on purchases. These cards allow stores to link together purchases made over time to a single customer. I know there are many potential uses to this kind of data. On Friday I finally saw a use to this data that I agree with. Kroger sent my family in the mail personalized coupons. These coupons were for in all but one case items that we have bought in the past. We plan on actually using these coupons. I am not sure what the incentives are for Kroger, but I will be glad to use coupons for things my family was planning on purchasing anyways.

Well done Kroger.

Friday, June 12, 2009

Health Care Spending

Check out this blog entry. It gave me new eyes to see health care spending as not a burden, but potentially a boon to society. With increased health care spending we are spending money on prolonging our lives.

Google Wave

I watched most of the long video previewing Google Wave, and I have to say that I am impressed. For starters I really like the feature that when doing IM you can watch the other person type. I find myself staring at times at the message "so and so is typing...". I look forward to the release of Google Wave. Check it out for yourself (http://wave.google.com/).