Mon, 6 Jul 2009

11:25 PM - Is Linux ready for the desktop?

Last Thursday, I setup a Linux box at work.  The idea was that it would at least be a bit more like a Mac or BSD box that I'm accustomed to.  Doing non windows development on a PC is painful without a UNIX like OS to me.  I just use a terminal too much.

So, I installed Ubuntu (the preferred distro at work) on a desktop system with an Intel Pentium D 3.2Ghz CPU and 2GB of RAM.   Day to day operation has been quite stable.  I haven't had any serious application crashes, lags, and power management has been working perfectly.  I can put the system to sleep better than Windows XP has ever worked for me.  All of the hardware I care about works.  I haven't bothered to test the sound.  

Even though I'm a BSD fan, I feel that I have to complement the linux community for progressing so far.  There is one issue I have with Ubuntu though.  There are some serious problems with their package management setup.  I'm not complaining about the tools, but rather the availability and quality of packages.  Midori crashes every time I try to use it and I think it's a mismatched webkit version.   Midori even works well on MidnightBSD, I'm not asking for a lot here.  Now that's one package, but there could be many others.  With a user interface that simple and the amount of help and money that project has at it's disposal, I expect more.  I know what we do with practically nobody.  The second problem is more general.  I could not install a JDK from their tools.  Due to the requirements, I needed a real JDK and not gcj.  A JRE was available, and that's fine for someone like my mom, but I need a java compiler.  I don't think it's too much to ask to expose the option in the GUI when it's possible from the command line.  Yes, I'm smart enough to go CLI, but what about a new computer science student trying to do a homework project?  This is a 2 click operation in windows and it comes with Xcode on the mac.  It's just easier on the first two platforms.  

I think some Linux distros are at the point that everyday folks could use them for basics at home.  They need some more polish, but that can happen.  

I still like our package management and ports system better, but we don't have those gui tools yet.   Still, considering microsoft doesn't have an installer like that for apps, it's certainly possible for linux to get marketshare.  It's it weird that microsoft has the best uninstaller (add/remove programs), but not a good "selector" for apps to install.  It's possible on windows, as you can see with Steam for games.  What if there was something like steam, but for apps?  

So, that means I need to set the bar higher for the BSD projects; mine in particular needs some real progress on the usability front.

()

11:18 PM - Cayenne and Joins

I've been experimenting with Apache Cayenne for work.  Earlier today, I got stumped by a complex database relationship in terms of Cayenne.  I can easily write a six table join to accomplish the query, but i wanted to find an object mapping approach instead.

I've learned several things about Cayenne.  First, it does not support outer joins from the built in object mapping.  It's possible to create outer and left joins with either SQLTemplate or performing a JDBC query directly.  

A SQLTemplate is a method to write a "real" SQL statement and either execute it as a non returning query or a select mapped to an existing Cayenne object.   You can even have it return raw rows back.  My first thought was that it would suck to do that because you'd lose the auto generating code for multiple database feature.  Actually, you can write alternate manual queries and register them for each major JDBC provider.  You write a generic default one that can work in most cases and then a tuned version (or whatever) for a specific database.   

The other option is to write a direct JDBC query and circumvent most of Cayenne.  You can still use it's database connection pool though.

DataSource ds = context.getParentDataDomain().getNode ("mydatanode").getDataSource(); Connection c = ds.getConnection();

tags: cayenne database sql

()

Sat, 4 Jul 2009

1:31 AM - Netflix problems

I noticed a rather interesting bug today.  I got an out of memory error while streaming television shows in netflix.  I watched a movie that was just under 2 hours long.  It worked perfectly.  Then I started to stream a tv show.  About five minutes into the stream, it stopped with the error and told me to reboot.  I observed over 66% memory usage at that point for the system.  I restarted IE and found memory usage was back down to 27%.  I was then able to stream the show.  At the end of the episode, I observed 48% memory usage.

Since netflix uses silverlight, i can only assume there's a memory leak in silverlight or in the controls for the page.  However, as it gets worse during the stream it makes sense that it's silverlight.  Other interesting bits are that it does not seem to happen on my mac, although there are streaming problems at times.  This is the first time I've seen this error, but I don't typically stream a lot.  The other possible explanation is the new configuration in my computer is related to the problem.  I had an ATI X1900 and now two 4550s in crossfirex.  It could be something to do with the hardware acceleration or the crossfire configuration wasting extra memory.  I noticed some odd lines in the video for the show but not in the movie.  That could be the encoding too.  It was a british tv show. 

While I'd like to squarely blame microsoft or netflix, I'm not sure what the exact problem is.  Futher research on the web shows that many other people have reported problems.  Most people say that it doesn't occur on the mac, only vista boxes.  Others reported a correlation to amd cpus.  There wasn't enough feedback to verify that.  Macs do have intel cpus.. if there is a different path in the decoder for amd chips, it's certainly possible a leak exists.  For instance, maybe they use some amd specific instructions (incorrectly). 

()

12:04 AM - Swing Vote

 Caryn went to bed a few hours ago.  I decided to stream a movie on netflix.  Oddly enough, I chose to watch Swing Vote.  Like most people, I thought the movie looked stupid from the previews.  I had every intention of stopping the film twenty minutes into it.  I was just curious how bad it was.  A few minutes ago, I finished the movie.  The premise was flawed, but it was still entertaining.  The movie was just as much about the main characters relationship with his daughter as it was about the vote.  I suppose the movie was interesting to me as my father was rather disconnected during parts of my life.   I don't think that movie would appeal to everyone.  

One thing about the film I didn't like was that they never explained who he voted for.  I'm sure it was supposed to be a grand point about the process and that votes matter. I just found it to be a movie... and as such a conclusion is nice.  I think the family story had a conclusion. 

()

Fri, 3 Jul 2009

6:04 PM - ATI Crossfire with 2 4550s

I purchased two ATI Radeon HD 4550s recently.  These cards are designed at the segment between gamers and non-gamers.  The cards feature low energy consumption (20 watts max) and do not require pciE power connectors (from the power supply).    

My system uses an Asus motherboard that supports CrossfireX with a x16 and x4 pci express 2.0 slot configuration.  I have a 380 watt 80 plus certified Antec power supply and a quad core AMD Phenom 2.3Ghz (9600) with 3GB of RAM.  

My hope was that the new crossfire configuration would be at least as fast as my previous X1900 card that no longer gets driver updates.  WIth Windows 7 just around the corner, I needed a card that would be supported. I also wanted to experiment with CrossfireX. 

Crossfire is the technology to take two graphics cards and use them together to display an image on one (or two) monitors.  Each graphics card individual could run two displays.  

Now for the performance characteristics.

Enemy Territory:  1280 x 1024 

x1900:  90fps ~ 
4550 (crossfireX on):  30-60 FPS

World of Warcraft:
x1900: (custom settiings similar to high)   30-60fps

4550(2):  15fps .. at medium settings 27fps

Quakewars:

x1900:  ~30 fps  at 1680 x 1050

4550(2): 15-30  (4x AA works though.. frame rate doesnt' change with it on or off)

The amazing part is that the system uses less power by a few watts with the new crossfirex configuration.  It's using about 120.7 watts while playing world of warcraft with the new setup in Vista Ultimate 32bit with power management software (from asus) enabled.  

()

Thu, 2 Jul 2009

12:40 AM - (no subject)

 This year, we have a few anniversaries; think Unix.  At the same time, Asus is dropping Linux on their netbooks.  The original was born 40 years ago, and the inferior copy is losing it's chance on the desktop. I know you're thinking FUD, but consider that the eee pc was the biggest introduction people had to Linux outside geek circles.  I suspect it would have done better with a standard looking desktop (KDE or Gnome?).  Ubuntu would have even been an improvement.  

Then there's the GPL v3 license.  Quite a few projects are selecting it and there's growth of code in other licenses such as the BSD or MIT licenses.  It does place BSD fans in a position.

I just read that Apple is already working on iPhone OS 3.1.  

()

Tue, 30 Jun 2009

10:50 AM - (no subject)

I'm finding that I'm getting a lot more tech support requests for just journal lately.  It's on the magnitude of several a week.  If this keeps up, I may just have to fix some things.

()

Mon, 29 Jun 2009

1:22 AM - (no subject)

I'm trying (again) to port Firefox 3 to MidnightBSD.  it's a real pain in the butt.  I wish they had a porting guide.  That would involve them caring about the operating systems beyond the big three though.  I'd like to have native firefox and thunderbird (latest versions) working.  At the moment, we've got unbranded firefox 2 (www/browser) and seamonkey working (although not all features) There's also the linux versions of those.  Firefox 3 for linux won't run due to dependancies on newer linux libraries.  Even with the newer linuxolator in current, it just isn't happening.  

This type of stuff is a real time waster.  

()

Wed, 24 Jun 2009

3:58 PM - (no subject)

All of the sudden, I'm getting a lot of emails from users asking for various changes to the site.  Normally I'd be happy about getting feedback, but I just don't have the time to work on the site.  There's a certain tone to some of the emails I don't like.  I work on the site for free after all.  

()

3:49 PM - (no subject)

 I just watched a very different movie.  It's called Cashback.  

The movie starts with a guy who dumped his girlfriend because she's relying on him to make her happy.  After they break up, he becomes depressed.  After several weeks of sleepless nights, he takes a job at a supermarket.  He's able to freeze time and move about.  The characters he works with make the movie.  One guy thinks he's a martial arts master and dresses accordingly.  Another character used to be a soccer player, but got injured and now manages the store.  His best friend was a pervert.

()

Sun, 21 Jun 2009

12:04 AM - (no subject)

What is wrong with CNN?  Lately, they've been reporting on twitter and youtube.  I don't care what some guy said on youtube.  I can watch the video myself.  At first, I thought it was just Iran that they were twiting about.  Now, I find an article about a tweet regarding an emergency landing with Gov. Swartzeneger's plan today.  That's just silly.  I also think they should attribute the damn articles to the authors at least.  In this case, they did mention the source of the user on twitter, but usually they don't. 

()

Thu, 18 Jun 2009

12:49 AM - More iTunes fun

i was finally able to connect to the ITMS to download some content.  Part of the problem people had was apple added a new terms of service.  If you hadn't agreed to it, it would take you to that page first.  That often times out and causes problems on the backend.  I missed a TV show last night that I enjoy.

()

12:36 AM - Starbucks changes the way they brew coffee?

According to an MSN article, starbucks is grinding coffee throughout the day.  What I find amazing is that they weren't doing this already.  If they want their core customers back, they have to stop making wimpy coffee.  Most of the posts on that article are about watering down the coffee as either decalf or some mild blend.  They need to offer a bold or extra bold blend for real coffee drinkers too.  People who want wimpy coffee can go to MacDo or get coffee at a donut shop.

tags: starbucks

()

Wed, 17 Jun 2009

7:01 PM - iTunes not usable, iPhone update to blame

Yet again, Apple releases a highly anticipated update and cannot handle the server load.  Users of iTunes may remember the problems during Christmas with ITMS timing out.  This time iPhone updaters are killing the connection to ITMS.  I was able to get the os update for my phone earlier and it's ok, but not as amazing as I expected.  Now I'm unable to purchase any content from iTunes.  The apple forums are full of crazed users wondering why their computers aren't working and it's all a server farm at apple that's the problem.  One person suggested apple updated to a new server farm and yet still can't handle the load.   

()

Wed, 10 Jun 2009

8:34 PM - (no subject)

 Doh.  I just found out I didn't backup my firefox bookmarks when i formatted my computer.  Apparently copying the ENTIRE profile directory was not enough.  Firefox 3's approach is very annoying and I'm not going through it again.  I'll just switch to IE or safari which can sync to .mac/mobileme

()

Sat, 30 May 2009

10:20 PM - Annoying MySQL issue with jdbc

Ever get this?   Cannot convert value '0000-00-00 00:00:00' from column  to TIMESTAMP. 

The problem is that the MySQL jdbc driver doesn't map it to null.  There are flags to the connection that are supposed to do this for you, but I've had no luck getting them to work.  I have two timestamp fields on the User table for this site.  I wrote a MySQL to java data mapper years ago, but now that I'm converting to Cayenne, I can't use that anymore.  Time to fix the database :)

One "solution".  

tags: errors mysql jdbc

()

10:14 PM - JSON in Java

I've been using JSON with Dojo Data Grids lately in PHP.  Now, I want to use something similar on this site.  I decided on the json-simple library.  It's actually quite easy to use.

Encoding examples:

http://code.google.com/p/json-simple/wiki/EncodingExamples 

<%@ page contentType="text/json;charset=UTF-8" language="java"%>

<%@ page import="com.justjournal.model.User" %>

<%@ page import="org.apache.cayenne.DataObjectUtils" %>

<%@ page import="org.apache.cayenne.access.DataContext" %>

<%@ page import="org.apache.cayenne.query.SelectQuery" %>

<%@ page import="org.json.simple.JSONObject" %>

<%@ page import="java.util.*" %>

<%@ page import="org.json.simple.JSONArray" %>

<%

    out.clearBuffer();

    SelectQuery query = new SelectQuery(User.class);

    query.addOrdering(User.USERNAME_PROPERTY, true);


    DataContext context = DataContext.getThreadDataContext();

    List users = context.performQuery(query);

    JSONObject obj = new JSONObject();

    JSONArray list1 = new JSONArray();


    Iterator it = users.iterator();

    while (it.hasNext()) {

        Map map = new HashMap();

        User u = (User) it.next();

        if (u.getUsername().length() > 2 && !new com.justjournal.User(u.getUsername()).isPrivateJournal())

        {

            map.put("id", DataObjectUtils.intPKForObject(u));

            map.put("username", u.getUsername());

            map.put("name", u.getName());

            map.put("since", u.getSince());

            list1.add(map);

        }

    }

    obj.put("items", list1);

    obj.put("label","id");

    obj.put("identifier", "id");

    obj.writeJSONString(out);

 

tags: java dojo cayenne json

()

10:02 PM - Apache Cayenne

 I've been working on converting just journal over to Apache Cayenne today.  I figured it would give me an opportunity to get better with it.  Cayenne has a nice modeling program, but their documentation is often lacking.

For example, suppose you're getting an error from your servlet container (Tomcat in my case) about a filter not loading.  With Cayenne, the "correct" way to use it is to load a filter mapped to /* that catches all the sessions and maps a DataContext to them.  You might find after pulling your hair out that there is a syntax error in your DomainNode.driver.xml file.  Even with logging cranked up in log4j, it will not tell you what's wrong with the filter.  However, if you initialize like a traditional app in a jsp page, you can see the error.  Invalid passwords are an example of what can cause this.

 

tags: java cayenne apache

()

Fri, 29 May 2009

8:13 PM - Hmm

Wondering why visual stuidio keeps crashing on me. Every time i drag a control in vs2008 after a few saves, it seems to crash. Wonder if it's a vista sp2 bug.

location: Home

tags: studio microsoft visual bugs

()

12:12 AM - Windows VIsta SP2

I installed Windows Vista SP2 Today. It's not too bad so far. It went much smoother than the service pack 1 installation. I have issues with vista, but part of me likes it. It's a love hate thing I guess. I often find myself more relaxed using MidnightBSD or Mac OS. Since I got git and some of the cygwin tools installed, vista is much more tolerable. I just love having a unix like shell with unix style commands. Sometimes I wonder if I could just deal with windows if they'd add them as part of the OS.... nah.

I also installed the direct x sdk today. THe C# support is not as nice as I expected. I'm starting to understand why some people write C++ code still for games. If you want to do any clever transformations, it sucks. (directx 9 at least)

You might wonder why i installed the directx sdk. I want to write a very simple game. Caryn's going to work on the logic/backend and I'm going to write the graphical "engine" to render it.

location: Home

()