Thu, 28 Jun 2007

3:24 AM - Grades

I just found the major/minor form on emu's website.  I declared my minor today.  I also got my grades for ENG 328 and ENG 444.  I got an A- in ENG 328 and an A in ENG 444. That gave me a GPA for the semester of 3.85 and raised my cumulative to 2.85. 

()

3:17 AM - Merit ends dial-up services

http://www.merit.edu/news/newsarchive/article.php?article=20070207_dialin

I found this interesting both from the perspective as a student and as someone who used to tech support merit dial-up.  I think USOL has a real problem.

()

12:50 AM - Still got issues

My image code is slower now and i made this worse too. ugh.

ab -n 100 -c 10 "http://www.justjournal.com/users/laffer1"
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.justjournal.com (be patient).....done
Server Software:
Server Hostname: www.justjournal.com
Server Port: 80

Document Path: /users/laffer1
Document Length: 41886 bytes

Concurrency Level: 10
Time taken for tests: 43.138 seconds
Complete requests: 100
Failed requests: 0
Broken pipe errors: 0
Total transferred: 4224400 bytes
HTML transferred: 4188600 bytes
Requests per second: 2.32 [#/sec] (mean)
Time per request: 4313.80 [ms] (mean)
Time per request: 431.38 [ms] (mean, across all concurrent requests)
Transfer rate: 97.93 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1575 4121 1870.9 3585 9645
Waiting: 1575 4120 1870.9 3585 9645
Total: 1575 4121 1870.9 3585 9645

Percentage of the requests served within a certain time (ms)
50% 3585
66% 4344
75% 4913
80% 5700
90% 6763
95% 8819
98% 9234
99% 9645
100% 9645 (last request)

()

Wed, 27 Jun 2007

8:53 PM - The plot thickens

I just ran apache bench on this thing...

70-91-226-205-busname-michigan:/Users/laffer1% ab -n 100 -c 2 -k http://www.justjournal.com/users/laffer1
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.justjournal.com (be patient).....done
Server Software:
Server Hostname: www.justjournal.com
Server Port: 80

Document Path: /users/laffer1
Document Length: 38393 bytes

Concurrency Level: 2
Time taken for tests: 33.879 seconds
Complete requests: 100
Failed requests: 0
Broken pipe errors: 0
Keep-Alive requests: 100
Total transferred: 3880102 bytes
HTML transferred: 3839300 bytes
Requests per second: 2.95 [#/sec] (mean)
Time per request: 677.58 [ms] (mean)
Time per request: 338.79 [ms] (mean, across all concurrent requests)
Transfer rate: 114.53 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 29 293.0 0 2931
Processing: 442 644 73.4 630 828
Waiting: 442 644 73.4 630 828
Total: 442 674 305.3 630 3608

Percentage of the requests served within a certain time (ms)
50% 630
66% 677
75% 686
80% 692
90% 731
95% 808
98% 828
99% 3608
100% 3608 (last request)
70-91-226-205-busname-michigan:/Users/laffer1% ab -n 100 -c 2 http://www.justjournal.com/users/laffer1
This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.justjournal.com (be patient).....done
Server Software:
Server Hostname: www.justjournal.com
Server Port: 80

Document Path: /users/laffer1
Document Length: 38393 bytes

Concurrency Level: 2
Time taken for tests: 36.213 seconds
Complete requests: 100
Failed requests: 0
Broken pipe errors: 0
Total transferred: 3876500 bytes
HTML transferred: 3839300 bytes
Requests per second: 2.76 [#/sec] (mean)
Time per request: 724.26 [ms] (mean)
Time per request: 362.13 [ms] (mean, across all concurrent requests)
Transfer rate: 107.05 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 660 724 34.2 733 796
Waiting: 659 724 34.2 733 795
Total: 660 724 34.1 733 796
ERROR: The median and mean for the initial connection time are more than twice the standard
deviation apart. These results are NOT reliable.

Percentage of the requests served within a certain time (ms)
50% 733
66% 744
75% 752
80% 756
90% 765
95% 777
98% 782
99% 796
100% 796 (last request)

()

4:41 PM - Servlet v2

Here's another version of the servlet. This time it uses prepare statements and avoids the beta CachedRowSet code.

/*
Copyright (c) 2006-2007, Lucas Holt
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

  Redistributions of source code must retain the above copyright notice, this list of
  conditions and the following disclaimer.

  Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or other
  materials provided with the distribution.

  Neither the name of the Just Journal nor the names of its contributors
  may be used to endorse or promote products derived from this software without
  specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
package com.justjournal;

import com.justjournal.utility.ServletUtilities;
import org.apache.log4j.Category;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;


/**
 * Image viewer servlet to display userpics and other images
 * from the database.
 * 

* User: laffer1 * Date: Nov 22, 2005 * Time: 9:31:28 PM * * @version $Id: Image.java,v 1.9 2007/06/27 20:20:24 laffer1 Exp $ */ public final class Image extends HttpServlet { private static final Category log = Category.getInstance(Image.class.getName()); // processes get requests protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Integer id; Context ctx; DataSource ds = null; Connection conn; PreparedStatement stmt; try { id = new Integer(request.getParameter("id")); } catch (Exception e) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } if (id.intValue() < 1) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } try { response.reset(); response.setHeader("Expires", ServletUtilities.createExpiresHeader(180)); try { ctx = new InitialContext(); ds = (DataSource) ctx.lookup("java:comp/env/jdbc/jjDB"); } catch (Exception e) { log.debug(e.getMessage()); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } conn = ds.getConnection(); stmt = conn.prepareStatement("call getimage(?)"); stmt.setInt(1, id); ResultSet rs = stmt.executeQuery(); if (rs.next()) { response.setContentType(rs.getString("mimetype").trim()); BufferedInputStream img = new BufferedInputStream(rs.getBinaryStream("image")); byte[] buf = new byte[4 * 1024]; // 4k buffer int len; while ((len = img.read(buf, 0, buf.length)) != -1) baos.write(buf, 0, len); response.setContentLength(baos.size()); final ServletOutputStream outstream = response.getOutputStream(); baos.writeTo(outstream); outstream.flush(); outstream.close(); } else response.sendError(HttpServletResponse.SC_NOT_FOUND); rs.close(); stmt.close(); conn.close(); } catch (Exception e) { log.debug("Could not load image: " + e.toString()); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }

()

4:25 PM - I need help with JJ

I've been having weird problems with Safari and just journal. Most noticeably, the image servlets seem to be randomly failing to load. What I mean by an image servlet is a servlet that pulls an image (JPG, PNG or GIF) from a MySQL blob field and then spits it out to the client. Here's the source of my servlet. This version is not in production yet, but it is similar to the one in production.

The weird byte array plus buffered stream thing is to allow me to send the size of the file. It seemed to fix some issues with IE and firefox, but it did slow down the servlet. I'm looking for two outcomes: fix safari and speed this up. Safari is more important. The expires header is new code.

/*
Copyright (c) 2006, Lucas Holt
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

  Redistributions of source code must retain the above copyright notice, this list of
  conditions and the following disclaimer.

  Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or other
  materials provided with the distribution.

  Neither the name of the Just Journal nor the names of its contributors
  may be used to endorse or promote products derived from this software without
  specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
package com.justjournal;

import com.justjournal.db.SQLHelper;
import com.justjournal.utility.ServletUtilities;
import org.apache.log4j.Category;
import sun.jdbc.rowset.CachedRowSet;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;

/**
 * Image viewer servlet to display userpics and other images
 * from the database.
 * 

* User: laffer1 * Date: Nov 22, 2005 * Time: 9:31:28 PM * * @version $Id: Image.java,v 1.9 2007/06/27 20:20:24 laffer1 Exp $ */ public final class Image extends HttpServlet { private static final Category log = Category.getInstance(Image.class.getName()); // processes get requests protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Integer id; try { id = new Integer(request.getParameter("id")); } catch (Exception e) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } if (id.intValue() < 1) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } try { response.reset(); response.setHeader("Expires", ServletUtilities.createExpiresHeader(180)); CachedRowSet rs = SQLHelper.executeResultSet("call getimage(" + id + ");"); if (rs.next()) { response.setContentType(rs.getString("mimetype").trim()); BufferedInputStream img = new BufferedInputStream(rs.getBinaryStream("image")); byte[] buf = new byte[4 * 1024]; // 4k buffer int len; while ((len = img.read(buf, 0, buf.length)) != -1) baos.write(buf, 0, len); response.setContentLength(baos.size()); final ServletOutputStream outstream = response.getOutputStream(); baos.writeTo(outstream); outstream.flush(); outstream.close(); } else response.sendError(HttpServletResponse.SC_NOT_FOUND); rs.close(); } catch (Exception e) { log.debug("Could not load image: " + e.toString()); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }

()

1:14 AM - Another Reason EA sucks

EA turned off the xbox live servers for their 2005 and lower games.  I can't play NHL 2005 or NBA Live against other people.  Consider that the only game that works online is forza motorsport, the point of an xbox live membership is limited.  I downloaded all the content for NBA Jam today.  How lame.

(1 comment | )

Tue, 26 Jun 2007

11:51 AM - Kirk

I ran into Kirk today. He got a bunch of new intel iMacs in. He said he'd let me know when 10.5 comes in. That's kewl. (ADC)

()

11:51 AM - ENG 328

I just finished my English 328 portfolio stuff. I think I've got everything up. :)

()

11:10 AM - The 8 colors of Dell

Dell decided to join 1999 with the release of laptops in 8 colors. You may remember Apple, Inc. released the original iBook in two colors in 1999 (or 2000?) and the 5 flavor iMacs a little after that. Dell now wants to be "hip" with there tired OLD marketing plan. How nice for them. Worst of all it appears the inside is still the same ugly gray color. Some of those colors look terrible with that gray. UGLY.

()

Mon, 25 Jun 2007

2:46 AM - Impressions of Safari 3

The new version of Safari (mac) has some pros and cons. Spell check seems to work correctly in input text boxes as well as textarea now. Spell check is much faster. The find dialog was moved to the top of the browser window. I got used to Firefox so that is odd to me. Some elements are a little bigger. The positioning of several items is wrong as a result. Safari 2, Firefox (mac and win), IE 7 all position the same way for the most part. I'm finding that I have to revisit sites and change floats and sizes of things to make it work in safari 3. The pixel size versus the text size is wrong. What is really weird is that i usually use pixels for font sizes now. They should match even if the size is bigger.

()

Sun, 24 Jun 2007

3:11 AM - Jewel website

I just published some changes to my Jewel website.

http://www.foolishgames.com/jewel/index.php

I even wrote a new RSS script in PHP.

feed://www.foolishgames.com/jewel/news/feed.php

At times, I totally see the upside of PHP. I wrote that script very quickly compared to a Java solution. I must be tired; I praised PHP.

()

12:19 AM - Vista speedboost bug

If you dual boot two operating systems and have a modern bios, you may experience problems with vista speedboost.  The number of partitions is changed causing issues booting into some operating systems.  In my case, the partition was changed for my MidnightBSD OS causing GAG to freak out.  It detected an OS/2 partition for some reason.  The boot failed.  Pulling out the USB stick fixed the issue.

()

Sat, 23 Jun 2007

11:40 PM - Reflections on Wii use: Day 1

Caryn used the Wii more than I've seen her play any game console in years.  I was shocked.  She's really good at Wii bowling and boxing. 

I played Excite Truck, Boxing, Tennis,  Bowling, Punch-Out and Ice Hockey.  I did a little surfing on the Wii too.  I suspect widescreen would help a bit. 

All Wii activities took up over 5 hours of our day.  The Wii tells you how much you play.  I should exchange codes with Geo or something. 

()

7:43 PM - Wii time

While it wasn't necessarily the best fiscal move, I lucked into a Wii at Best Buy today.  They got 4 in at 3PM.  We were there at 3:15 and there were only 3 left.  By the time we left, they had 2 left and an old guy was going to buy one.  I've already downloaded the Internet channel and two original NES games.  Punch-Out and Nintendo Ice Hockey are great classic games.  Caryn can't stop playing Wii Sports.  We also got Excite Truck for it.  One problem is the lack of a second remote.  Its going to be awhile before we can buy accessories.  Still, I'm really excited about it. 

Another problem seems to be with the Wii wireless.  It works with WEP and WPA TKIP and WPA2 AES, but it does not work with a hash key.. only password based systems.  My PC's wireless will not work with a password, only the hash value.  My Macs can do either.  I'm not sure how to fix this yet as the Wii does not include a standard ethernet port.  I know you can buy them, but I'm not sure what my final answer will be. 

The Wii channels time out sometimes.  I think that is due to my hack job.  Right now, I'm using Caryn's iBook as a NAT box sharing the wired connection over the wireless unencrypted.  It is not secure, but it did get us up.  The distance could be causing signal issues too. 

Bowling is OK on the Wii.  Tennis and Boxing are amazing.  Boxing is the best workout I've had in months.  I can't believe how many calories one can burn playing a video game. 

It also supports game cube games with ports on the top for memory and controllers.  It has an SD slot on the front for digital camera pictures to be added to the picture channel. 

location: Home

()

1:48 PM - Journalists give money (silently) to campaigns

http://www.msnbc.msn.com/id/19113485/

What I find interesting is that the reporter is very harsh against these other journalists for giving donations.  I don't care if journalists give donations to political parties if they can keep their reporting unbiased or disclose their bias in their reports.

I do find it amusing that Fox News employees are giving money to democrats. 

()

Fri, 22 Jun 2007

3:49 PM - Adventure of the day

I went to Meijers today. As I was entering, a police officer was remvoing a suspect in hand cuffs. The guy was kind of fighting him a bit. I don't know what happened but it looked like it might be shop lifting related. A few people turned around, got back in their cars and left. LOL

(1 comment | )

3:50 AM - WWDC 2007 Keynote

I watched most of Apple's keynote. I couldn't stand to watch the iPhone stuff at the end. Developing AJAX stuff isn't the same as Cocoa apps. That was very insulting to developers.

OS X has a few nice features coming up. I'm still not sure about the Vista style Finder with iTunes flipping crap. It looks like they tried to make the whole thing iTunes like. I guess if you already know how to use iTunes its not terrible, but its not a good application in terms of usability. It is not NeXT like by any means.

I wish they would have talked about server a little bit. That effects me quite a bit.

()

3:47 AM - (no subject)

I finished installing Windows ME on that old computer. I attempted to load Windows XP, but it crashed during the setup process. I was suspect of Microsoft's minimum system requirements. 64MB of ram for XP seems way to low. It got pretty far in the process. I think the shared memory for the video card was the clincher. I did get Firefox 2 working in WinME and Lotus Smartsuite. I've got a disk that came with my laptop I'm not using. I used to love SmartSuite. i wish IBM would have kept up with it. A Mac version would have been nice too. Anyway, that old computer is still humming loudly. It ran Windows ME rather quickly. Until I installed the IE6 service pack it was very quick. I think Microsoft started using more DirectX crap in that release or something.

()

3:42 AM - Theme work

I've been trying to make right aligned menus work. Theme 14 is the black theme with right menus. There are a number of problems including a really bad reaction to clicking the subscribe to blog link. I may need to switch to a drop down or use a third party library. I'm very unhappy with the positioning problems.

()