Category: Blog

Your blog category

  • Got my Java to look better

    I had a bit of an epiphany this morning — and I have a project that is a bit better.

    My java project now has four files, only two that the students have to touch.  Originally, to do the 1980’s console type program, I had two files that the students touched.  The driver and the class.

    So here is the output:

    I have a main program with the lab name (students don’t have to touch):

    A really ugly program that does the output (students don’t have to touch)

     

    And then the two lab programs:

     

    The driver with the test cases:

     

    And the actual class:

    We’ll have to discuss HTML etc as we go along, but learning HTML never killed anyone.

    Here’s the actual files (note that the lab itself is from Stacy Armstrong’s APlus Materials.  lab02a

  • C# is prettier

    image

    Same code to do the stuff the ugly Java did:

     

            public Form1()
    {
    InitializeComponent();
    

    Rectangle test = new Rectangle();

    test.setLengthWidth(2, 6);
    test.calculatePerimeter();
    label1.Text = test.print();

    test.setLengthWidth(12, 5);
    test.calculatePerimeter();
    label1.Text = label1.Text + "\n" + test.print();

    }

     

    Much prettier, and I did try “\n” in Java, but it didn’t put a carriage return /line feed in my label, while C# does.

  • Making Java more interesting

    One of the things that drives me absolutely nuts about the Java materials I am using is that the majority of the programs are console programs.

    Sorry that really sucks when my regular children get to do real live Windows programs.

    So I have decided I am going to rewrite the labs so that they at least display the answer with Swing Frames and Panels.  It’s either that or rewrite them in C#, which I am also close to doing.  Unfortunately we have a district final.

    We’ve been purchasing Stacy Armstrong’s materials so I am going to give some of the labs a try.  He does some graphic programs where he has a runner that does the heavy work, so I think I’m going to try the same thing with SWING.

    Frankly, this is more exciting can a console window.

    image

    However, I am scared of this:

    /**
     * @(#)Lab02aFrame.java
     *
     * JFC Lab02a application
     *
     * @author 
     * @version 1.00 2010/4/21
     */
    

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.BoxLayout;


    public class Lab02aFrame extends JFrame {

    /**
    * The constructor
    */
    public Lab02aFrame() {



    JMenuBar menuBar = new JMenuBar();
    JMenu menuFile = new JMenu();
    JMenuItem menuFileExit = new JMenuItem();

    menuFile.setText("File");
    menuFileExit.setText("Exit");

    // Add action listener.for the menu button
    menuFileExit.addActionListener
    (
    new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Lab02aFrame.this.windowClosed();
    }
    }
    );
    menuFile.add(menuFileExit);
    menuBar.add(menuFile);

    setTitle("Lab02a");
    setJMenuBar(menuBar);
    setSize(new Dimension(400, 400));

    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));

    // test cases
    Rectangle test = new Rectangle();

    JLabel label1 = new JLabel();
    test.setLengthWidth(2,6);
    test.calculatePerimeter( );
    label1.setText(test.print());
    panel.add(label1);

    JLabel label2 = new JLabel();
    test.setLengthWidth(12,5);
    test.calculatePerimeter( );
    label2.setText(test.print());
    panel.add(label2);

    //add more test cases


    this.add(panel);
    // Add window listener.
    this.addWindowListener
    (
    new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    Lab02aFrame.this.windowClosed();
    }
    }
    );
    }


    /**
    * Shutdown procedure when run as an application.
    */
    protected void windowClosed() {

    // TODO: Check if it is safe to close the application

    // Exit application.
    System.exit(0);
    }
    }

    The students need to add their test cases between the comments, and I’ll have to teach them to make a new label each time they need a new test case.

  • Leaving GoDaddy — Feel SO MUCH more clean

    Nice to take a stand.

    I just finished my last domain transfer request.  They are a bit of a PITA. 

    Glad that’s done.  sure it is a drop in the bucket to GoDaddy, but it makes me feel better.

  • How I am fixing my broke CS Class(es)

    Two years ago, I saw that my CS courses — both my regular and my PreAP were broke.  I wasn’t enjoying teaching them, and I had a horrible passing rate.

    The first thing I looked at, was who was successful in the course and who wasn’t.  I was lucky, it was 9th graders.  I also looked at who I was having to deal with the most, discipline wise, and again it was 9th graders.

    I was also lucky to have a support associate principal of instruction who saw the same demographic problems as I was.  We took a big leap of faith, and took CS off the 9th grade choice sheets.  That meant I had NO enrollment this year.  Everyone who wanted to take CS, was in the building for the most part. 

    I then had three class periods free and at the time she was wiling to let me have them off to work on teacher tech stuff, but between getting a new principal and the economy, I did not want to be seen not contributing to student learning.  I gave her three choices and she picked Math Remediation. 

    Man, that’s been tough.  Kids who don’t like math, don’t like computers and don’t like following instructions.  The good news is that I’ve been able to help those kids who haven’t been able to graduate because of the Math TAKS.  I have also identified one child as needing hearing assistance.  There have been some kids that I have helped, but I would like to help all.  One of my beagles did teach me that there are some things you just can’t teach — like swimming to beagles. 

    On the other hand, I have two classes filled with kids I really love to be with.  My first period is so cool.  I had a meeting this morning on the opposite side of campus, and I wasn’t worried a bit.  Left it 5 minutes before the bell, and they were all in the room working when I got here 10 minutes later. 

    I have also changed up my PreAP curriculum and I am working on changing that even more.  I’ve incorporated C# and XNA.  Next year I am going to have to find a way to blend it better as the opportunity didn’t come up until before Christmas.  Unfortunately we have a district final that is heavily Java.

    I’m REALLY looking forward to next year.

  • Enrollment increasing!

    I got good news.

    My CS enrollment has increased by 50% — partly because I banned 9th graders from the course last year, and we are finally getting students who haven't already tried CS.  Both the Visual Basic course and the Java course (PreAP) are up.

    My AP course has tripled (from 1 to 3).  This is weird, because I have two students who are not enrolled in AP taking the test this year (maybe).  Next year I will have another student who has taken AP this year, try the test next year — we have a plan for that.

    I also have around 70 webmastering students.

    And I'm doing the happy dance because I will not be teaching math next year.

    By the way, don't take this as any great enrollment indicator — we had a problem, the wrong population was taking the class and took a year to fix it by not allowing 9th graders in the class.  The indicator will be NEXT year.

  • More on Moving Domains

    I thought that I should probably go through the domain moving process.  It’s time consuming but easy since the Domain Registrant is the same place that I host my domains.  This domain (kweaver.org) is a bit different as I do my exchange mail and have Typepad account on it. 

    I did kweaver.us first, as it has no email associated with it.  Just a site where I put "stuff" I might want to share.  It’s also my way to keep puppy mill people from posting stuff on it (unlike kweaver.org which I don’t own).

    I sent an email to my hosting service (myhosting.com).  I do have an affliate account with them — here’s a nice promotion:

    Save $19.35 on Basic Hosting for Annual Signup

    This one evens gives you free domain name:
    Register now and get your FREE Domain Name

    Once I sent an email to them requesting the change, they did ask for some domain information (made the other’s easier since it was the same, and I did them about one at a time.

    I had to go to the GoDaddy site and unlock the domain and had to request that they send me an authorization code.  I got an email that sent me to a site that asked for the authorization code.

    Then I had to wait for the process.  GoDaddy did send a few messages trying to tempt me back.  I even sent an email to support@godaddy.com telling them why I was leaving.

    It takes about 2 weeks to accomplish and I didn’t notice any interruption in service.  I did have a few days without email when I did the first exchange and I’ll let you know what happens with kweaver.net

  • Combatting Sexism — Moving All my Domains Off of GoDaddy.com

    Literally years ago, long before they sponsored Danika and long before any of the sexist ads, I set up some domains on GoDaddy.Com. Why?  Because the service I was using to host those domains recommended them.

    I will give that GoDaddy.com is one of the cheapest domain hosting services around, but I do not like their ads.  I moved one of my original domains (kweaver.org), from them when I was setting up my Exchange mail.  I couldn’t wrap my head around the directions for setting up the exchange mail that way, and starting using Softcom for the hosting (same people who do my Exchange mail).

    I started the move for the last three domains today, after a painless move of kweaver.us (the domain that would be least disturbed by problems.

    My newest domain (dfwpets.net) are already hosted with Softcom. 

  • Rapid Repair

    I had a device with a broken screen laying around and it was really bugging me.  The manufacture wouldn’t / couldn’t, wouldn’t repair it, and had actually referred me to this company.

    Website is at http://www.rapidrepair.com/ 

    While they are not very communications friendly

    • no way to track orders on line
    • take forever to communicate via email
    • didn’t get emails telling me that I needed to pay for the order

    they did get the item repaired and back to me quickly.

    I shipped a week ago Monday, they got it on Friday morning, got it repaired sometime on Wednesday, and they got paid on Thursday and it arrived yesterday, early evening.

    The item (an 32 gig HD Zune) does not look like it was repaired, and works nicely.  Very happy!

  • Final Thing in Place For Summer

    I believe I have to do an AP Workshop this summer.  There are two in Dallas, one coincides with Early Start, and there is no way I am giving up that program.

    So, I am signing up for the SMU one — it will actually be at the instructor’s school.

    Will also need to find a convenient place for Doggy Day Care since I’ll have my puppy then.  Would like to find a place close enough to visit at lunch, and I think I have.