my2cents

14. September, 2008

Connecting to the Internet with Bluetooth mobile phone on Leopard

Filed under: Apple & Mac — frightanic @ 16:40

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

Here’s another OS X Tiger to Leopard upgrade issue…

From time to time while on the road (in the train rather…) I connect to the Internet through my Nokia mobile phone hooked up to the MacBook via Bluetooth. This stopped working with Leopard. The phone icon in the menu bar showed “Connecting” for a few seconds and switched to “Disconnecting” immediately afterwards. The Console listed as error: MPPE required, but MS-CHAP[v2] auth not performed.

A Google search directed me to a Mac OS X Hints article that explains that you needed to change CCPEnabled from 1 to 0 in /Library/Preferences/SystemConfiguration/preferences.plist – and restart the system, that’s important.

Advertisements

aclocal-1.4… missing/automake-1.4… missing

Filed under: Apple & Mac — frightanic @ 16:28

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

In contrast to the problem described in my previous post this one was directly related to the OS X 10.4 (Tiger) to 10.5 (Leopard) upgrade.

After the upgrade I tried to install a software packet through MacPort’s port command. The pile of error and warning messages left me puzzled at first:

checking for working aclocal-1.4... missing
...
checking for working automake-1.4... missing
...
some more

Then I found out that XCode is not automatically updated during the 10.4 -> 10.5 installation. Hence, I needed to uninstall the old XCode and install XCode 3 from the Leopard DVD.

iPod touch not showing in iTunes on OS X

Filed under: Apple & Mac — frightanic @ 10:11

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

After an upgrade to OS X 10.5 Leopard and iTunes 8 my iPod touch stopped showing in iTunes on my MacBook. I doubt, however, that the missing iPod has anything to do with Leopard or iTunes 8 because it worked flawlessly with Leopard/iTunes 8 on my Mac mini.

I went through a lot of steps trying to reset/restore the iPod, resetting the USB adapters and so on. Although recommended in some articles I didn’t dare to uninstall/install iTunes, tough. I saved this as my last resort, for I had no desire to loose all my settings and I figured that it’d be quite difficult to get rid of all the preferences files on my system that are associated with iTunes. Turns out there’s a great article entitled “Removing ITunes for Mac OS X” at Apples’s support center.

And indeed, reinstalling iTunes 8 solved my problem.

6. September, 2008

Broken families

Filed under: Life — frightanic @ 17:40

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

In a previous post I wrote about a situation I witnessed where kids were being shoved back and forth between mon/dad on weekends. Earlier I also once wrote that I listen to American country music more and more. The below lyrics from the song “Every other weekend” by Reba McEntire and Kenny Chesney combine both subjects in a tragic way:

(Reba)
Every Other Friday
It’s toys and clothes and backpacks
Is everybody in?
Ok lets go see dad
Same time in the same spot
Corner of the same old parking lot
Half the hugs and kisses
There are always sad
We trade a couple words and looks and kids again
Every Other Weekend

(Kenny)
Every Other Weekend
Very few exceptions
I pick up the love we made in both my arms
It’s movies on the sofa
Grilled cheese and cut the crust off
“But that’s not the way mom makes it daddy” breaks my heart
I miss everything I use to have with her again
Every Other Weekend

(Kenny)
But I can’t tell her I love her

(Reba)
I can’t tell him I love him

(Kenny)
Cause there’s too many questions and

(Both)
Ears in the car

(Reba)
So I don’t tell him I miss him

(Kenny)
I don’t tell her I need her

(Both)
She’s(He’s) over me, that’s where we are

(Kenny)
So we’re as close as we might ever be again

(Both)
Every Other Weekend

(Reba)
Every Other Saturday
First thing in the mornin’
I turn the TV on to make the quiet go away
I know why, but I don’t know why
We ever let this happen
Fallin’ for forever was a big mistake
There’s so much not to do, and all day not to do it in
Every Other Weekend

(Kenny)
Every Other Sunday
I empty out my backseat
While my children hug their mother in the parking lot
We don’t touch
We don’t talk much
Maybe goodbye to each other
Then she drives away with every piece of heart I’ve got
I reconvince myself we did the right thing
Every Other Weekend

(Kenny)
So I can’t tell her I love her

(Reba)
I can’t tell him I love him

(Kenny)
Cause there’s too many questions and

(Both)
Ears in the car

(Reba)
So I don’t tell him I miss him

(Kenny)
I don’t tell her I need her

(Both)
She’s(He’s) over me, that’s where we are

(Kenny)
So we’re as close as we might ever be again

(Both)
Every Other Weekend

(Kenny)
Yeah for fifteen minutes we’re a family again

(Reba)
God I wish that he was still with me again

(Both)
Every Other Weekend

Inserting data into an Oracle LONG field with Spring JDBC

Filed under: Java,Software Development — frightanic @ 17:32

This blog now resides at http://www.frightanic.com/. It will be discontinued here…

I struggled to update the content of a LONG column in an Oracle database with Spring JDBC. However, (in retrospective) this is more of a general JDBC problem than a Spring problem.

The problem first occured when I tried to use a regular SQL update statement to save a few thousand characters in that LONG field.

simpleJdbcTemplate.update("update mytable set content = ? where id = ?", new Object[] { o.toString(), o.getId() });

Hence, I tried to execute the same statement in a SQL editor, Oracle’s SQL Developer in my case, and got “ORA-1704: string literal too long” as a feedback from the database. Further analysis revealed that the LONG datatype has been deprecated in Oracle ever since 9i. It can hold 2GB max. but you’re encouraged to use CLOB instead. Some poking around the JDBC pages at oracle.com revealed sample code that describes how to manipulate LONG fields: http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/basic/LongSample/Readme.html.

Now, whether the below code is optimized or not is yet to be seen. It solves my problem, though.

final LobHandler lobHandler = new DefaultLobHandler();
final byte[] contentBytes = o.toString().getBytes();
final InputStreamReader clobReader = new InputStreamReader(new ByteArrayInputStream(contentBytes));
simpleJdbcTemplate.getJdbcOperations().execute("update mytable set content = ? where id = ?", 
    new AbstractLobCreatingPreparedStatementCallback(lobHandler) {
    protected void setValues(PreparedStatement ps, LobCreator lobCreator) throws SQLException {
        lobCreator.setClobAsCharacterStream(ps, 1, clobReader, contentBytes.length);
        ps.setString(2, o.getId());
    }
});

Create a free website or blog at WordPress.com.