July 27, 2004

July 19, 2004

Sebadoh!

I don't know how I missed this, but they're back together; well, Lou and Jason anyway. Salt Lake show is Aug. 16 Interview

Freeks & Geeks

on retroweb

July 16, 2004

A Voice for Working Stiffs

In the St. Petersburg Times and the Salt Lake Tribune: "The leaders of the backlash may talk Christ, but they walk corporate," Frank writes. "Values may 'matter most' to voters, but they always take a back seat to the needs of money once the elections are won."

"Vote to stop abortion; receive a rollback in capital-gains taxes. Vote to make our country strong again; receive deindustrialization. Vote to screw those politically correct college professors; receive electricity deregulation."

June 30, 2004

June 25, 2004

June 16, 2004

Joel has a good article on the demise of the win32 api

Here is proof that Win32 programming sucks the life out of developers.

June 14, 2004

JCA Links

http://jboss.org/index.html?module=bb&op=viewforum&f=136 http://www.onjava.com/pub/a/onjava/2004/03/24/j2eeca.html https://www6.software.ibm.com/developerworks/education/j-jca/j-jca-ltr.pdf OR https://www6.software.ibm.com/developerworks/education/j-jca/index.html?x=71&y=11 http://www.java201.com/resources/redirect/1625.html http://jboss.org/index.html?module=bb&op=viewtopic&t=19732 http://jboss.org/index.html?module=bb&op=viewtopic&t=46930

JBoss Performance Links

http://dev.simblogg.is/archives/cat_jboss.html http://jboss.org/index.html?module=bb&op=viewforum&f=121&topicDays=0&start=0 http://linuxintegrators.com/jbossBlog/bburke/?permalink=Optimizing+JBoss%3A+Experiences+with+SPECj2002.html http://www.javablogs.com/ViewEntry.jspa?id=88770 http://www.myj2ee.com/Members/Firedragon/jbosstuning

June 03, 2004

// Slashdot Your Printer

// Sends an rss feed to the lcd on your printer

package com.mike;

import java.net.*;
import java.io.*;
import java.util.*;

/**
 *
 */
public class PrinterNews {
    static String rss=/*"http://slashdot.org/index.rss";//*/"http://rss.news.yahoo.com/rss/topstories";
    static String printer="";
    static int updateFrequency=30*1000*60;
    static int scrollDelay=300;//ms
    static String msg="";
    static String blank="                ";
    static OutputStream out;
    static ArrayList headlines;
    static boolean nice=true;//otherwise, it locks the printer

    public static void main(String[] args){
        try{
            if(!init(args))
                return;
            readHeadlines();
            connect();
            long startTime=new Date().getTime();
            while(true){
                scroll();
                if(new Date().getTime()-startTime>updateFrequency){
                    readHeadlines();
                    startTime=new Date().getTime();
                }
            }
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    public static boolean init(String[] args){
        if(args.length < 2){
            usage();
                return false;
        }
        for(int i=0; i<args.length; i=i+2){
            System.out.println("param "+i+" ="+args[i]);
            String parm=args[i];
            if(!parm.startsWith("-") || parm.length()!=2){
                usage();
                return false;
            }
            switch(parm.charAt(1)){
                case 'p':
                    printer=args[i+1];
                    System.out.println("set printer to "+printer);
                    break;
                case 'u':
                    rss=args[i+1];
                    System.out.println("set rss to "+rss);
                    break;
                case 'f':
                    try{
                        updateFrequency=Integer.parseInt(args[i+1])*1000*60;
                        System.out.println("set frequency to "+updateFrequency);
                    }catch(Exception e){
                        usage();
                        return false;
                    }
                case 'd':
                    try{
                        scrollDelay=Integer.parseInt(args[i+1]);
                        System.out.println("set delay to "+scrollDelay);
                        break;
                    }catch(Exception e){
                        usage();
                        return false;
                    }
                default:
                    usage();
                    return false;
            }
        }

        return true;
    }

    public static void usage(){
        System.out.println("\nUsage:\n");
        System.out.println("java com.mike.PrinterNews -p printer");
        System.out.println("                         [-u rss_url]             url of rss feed");
        System.out.println("                         [-f rssUpdateFrequency]  minutes between rss refresh");
        System.out.println("                         [-d scrollDelayMS]       ms between lcd update");
        System.out.println("defaults to -u http://rss.news.yahoo.com/rss/topstories -f 30 -d 300");
        System.out.println("NOTE: slashdot will blacklist you for -f<30 !\n");
    }

    public static void connect() throws Exception{
        Socket s = new Socket(printer, 9100);
        out =s.getOutputStream();
    }

    public static void scroll() throws Exception{
        for(Iterator it=headlines.iterator(); it.hasNext();){
            sendMsg((String)(it.next()));
            if(nice){
                out.flush();
                out.close();
                Thread.sleep(1000);
                connect();
            }
        }
    }

    public static void sendMsg(String msg) throws Exception{
        msg=blank+msg+blank;
        //OPMSG, RDYMSG, STMSG
        for(int i=0; i<msg.length(); i++){
            byte[] b;
            if(msg.length()> i +15){
                b=msg.substring(i, i+15).getBytes();
            }else{
                b=msg.substring(i).getBytes();
            }
            out.write("\033%-12345X@PJL RDYMSG DISPLAY = \"".getBytes());
            out.write(b);
            out.write("\"\r\n\033%-12345X\r\n".getBytes());
            Thread.sleep(scrollDelay);
        }
    }

    public static void readHeadlines() throws Exception{
        headlines= new ArrayList();
        BufferedReader i = new BufferedReader(new InputStreamReader(new URL(rss).openStream()));
        while(true){
            String nextLine=i.readLine();
            if(nextLine==null)
                break;
            int start=nextLine.toLowerCase().indexOf("<description>");//<title>
            if(start!=-1)
                headlines.add(scrub(nextLine.substring(start+13, nextLine.indexOf("</")>start+13?nextLine.indexOf("</"):nextLine.length()))); //+7
        }
    }

    private static String scrub(String s) throws Exception{
        int start=s.indexOf("&");
        int end=s.indexOf(";",start>0?start:0);
        if(start!= -1 && end != -1)
            return scrub(s.substring(0, start) +s.substring(end+1));
        else
            return s;
    }
}

May 18, 2004

Some Fedora Issues: NVidia driver issues. dual boot issues.

This is a really good article about a guy studying virtual economies in muds

May 06, 2004

This is the first article in a series of 12 on the theory of classification. An excellent read for anyone interested in object oriented design.

April 15, 2004

I don't know why I couldn't find one out there, but anyway... pipe a find to it to operate over a directory structure: #!/bin/bash fname=start count=0 total=0 echo "getfile" while [ "$fname" != "" ] do read fname if [ -f $fname ] then count=`grep -v --count xyzzy $fname` echo "$fname = $count" let "total=total + count" fi done echo "total= $total"

March 23, 2004

IntelliJ gets hosed on Fedora, and other 2.6 kernels: If you add jar files to a project, they appear to imported correctly, but then aren't visible, and browsing through them in the package explorer shows unnamed classes. Workaround: Close IntelliJ Edit your idea.lax in the bin directory, find the lax.nl.java.option.additional property, and append -Didea.jars.nocopy=true to the end of arguement list. Then delete the contents of $intellij/system/jars and $intellij/system/caches Restart, and you may need to recreate your project.