Watch the latest videos on YouTube.com

Random Ramblings

17
Nov

It’s been awhile

But just came across an app that I think will come in very handy, and didn’t want to forget it. BeLarc

http://www.belarc.com/free_download.html

I was reformatting my drive, and needed some of my licenses, this software lists everything you could possibly need to knwo about your computer. Licenses, what size and types your monitors are, hard drive information, manufacturers, various updates that have been installed etc. I ran in on a Vista machine and it worked flawlessly. Highly recommend it!

20
Jul

Seti@Home

Well, I have finally done something outside of work. Decided to rejoin seti@home, haven’t done it since it first came out in 1999/2000. Now I have 3 machines, and decided to use them when they are just sitting there. Maybe when my power bill shoots up from the machine constantly running, I won’t want to do it anymore :). Guess it’s not doing much, but there’s the what if aspect. I may decide to change to one of the many other grid computing systems that BOINC offers (Berkley’s grid computing project). If anyone has suggestions let me know. I was actually wanting to find on that maybe sequences cancer genes, and help with that, but didn’t stumble upon it during my searches. So went with SETI. It seems it may not be around much longer, funding is only through 2011, unless private donors help out. So maybe I’ll only be helping them for a couple years, and who knows maybe it will help, maybe it won’t.

Initially, I unknowingly had it set to use 100%, that is not conducive to using ruckus, remote server and VS.NET and SQL Server all at once…I think I heard my machine cry in pain. I since have changed the settings to only start when Ive been idle for 3 minutes. Seems to be working better.

01
Jun

GWT-Ext

Awesome app, that adds some very nice gui and adds some great functionality to GWT. I have been developing with GWT-Ext for the last couple of months, and it has improved the look of my app quickly, and improved functionality while saving me time. Unfortunately the author is stopping development because of changes to ExtJS license information. But, this is still a great app to check out. Especially if you enjoy writing client side applications in Java.

Check out the demo here: GWT-Ext Demo It uses some Swing terminology, but the borderlayout with collapsible panes is pretty cool, and really simple.

One thing I have found is that GWT panels containing GWT-EXT work inconsistently. It’s better to convert all your main GWT panels to GWT-Ext panels. Gwt-Ext panels can contain GWT panels a bit better.

Happy Coding

01
Jun

Popcorn Hour

Well I’ve been looking into setting up my home media center. I’ve been playing around with Windows Home Server, and have liked it a lot. But it’s only the RC. I want to build a new machine that can hold my 2TB of IDE drives, plus be able to add SATA drives. I have 1.5 TB of my movies ripped, but I’ll probably start over. I’ve been trying to find something that would stream VOB files directly. The XBox 360 did not, so I returned it. Now I have been introduced to Popcorn Hour. Seems like a pretty cool little device. It will allow me to have a small component to stream movies, web content, and music from my WHS box in the basement, to my 42″ 1080P Vizio upstairs.

I’ve been investigating building my own box similar to Popcorn Hour, buying a Motherboard with HDMI and Digital Sound, and a small hard drive for the OS. There’s no way I could build it for 179, and have new updates, free, for the software that it uses.

I’m waiting for it to get some more reviews, but from what I’ve heard is it works as described. I have already run cat5e cable upstairs and have a Gigabit switch running my internal network, connected to my FIOS router which gives me 15mb download speeds.

Looks like it’s time for me to build my WHS. Since it will be in my storage room in the basement, I don’t need anything pretty. Just a box that can hold maybe 8 drives of either IDE or SATA. Looks like newegg.com has plenty of options there for inexpensive MB that would do this for me. I won’t need video, so the MB won’t need anything fancy there. I’ll probably put 4GBs ram in it, and then a gigabit eithernet card. Really don’t foresee much else that I’ll need in that box. Looks like 500GB SATA drives can be had for about $80 currently. I think total cost for a box designed for good growth can be had for about $300, and the WHS Os is 160 on newegg.

Popcorn Hour should be a good addition to the setup, but I’m curious to see how reviews are once they catch up to demand.

31
May

VB.Net Window Services

I recently had to visit some old code for windows Services using VB.NET. What I needed to be able to do was run multiple services at once. In case anyone else needs some help on this, here’s what you need to do.

Windows will not allow the same windows service to be installed at the same time. The solution is that you have to use your app.config file. Found this thanks to the CodeProject write up By Wil Peck a for this great post: http://www.codeproject.com/KB/dotnet/MultipleInstNetWinService.aspx.

Using that article and sample code I was able to convert the c# code to VB.NET, one key thing is that you need to make sure to include System.Configuration in your project references. (ie. go to the project properties -> references and scroll down the list to system.configuration)

Some additional items you might want to do. We need our installed service to be able to run with a bit more access. I hated typing in the username and password everytime, as well as change the start type to automatic everytime I reinstalled the service. So in the function GetServiceProcessInstaller update the code to the following:


Private Function GetServiceProcessInstaller() As ServiceProcessInstaller
Dim installer As ServiceProcessInstaller = New ServiceProcessInstaller()
installer.Account = ServiceAccount.User
installer.Username = "usname"
installer.Password = "upass"
Return installer
End Function

To change the Starttype to automatic do the following:


Private Function GetServiceInstaller() As ServiceInstaller
Dim installer As ServiceInstaller = New ServiceInstaller()
installer.ServiceName = GetConfigurationValue("ServiceName")
installer.Description = GetConfigurationValue("ServiceDesc")
installer.StartType = ServiceStartMode.Automatic

Return installer
End Function

I had used a different way to implement the webservice, so I had to do some refactoring, but it all seems to be working. I have not noticed any issues as of yet. Post if you want the service code…

Happy Coding

12
Apr

Firefox

Some cool features in firefox.

1) ctrl + t = new tab (IE as well)
2) ctrl + shift + t = reopen last tab (if you accidently close a tab, hit this combo and it will reopen the recently closed tab
3) To have multiple home pages open when you hit home, use pipes | under the main option for default homepage. Each pipe is a new tab with the specified web address
4) Double clicking on the “border” under the tabs opens a new tab
5) Ctrl + mouse wheel forward / backward changes font sizes (this is true in IE as well)
6) Holding ctrl when right clicking on image will open it in its own tab (middle click does this as well)
7) Using mouse wheel Click on tab closes that tab (if you try it might want to use step 2 afterwards :) 8) Wheel click on back and forward buttons, puts the next history in a new tab
9) Wheel click on link, opens it in a new tab
10) ctrl + enter in address bar will surround the words in www and .com. So you can just type google ctrl+enter and you’ll be taken to http://www.google.com
Coolest add on

Firebug, great for developers to view source, find errors in html and javascript, see style sheets, etc.

07
Apr

Great GWT / Javascript color picker

Haven’t added anything for awhile, been too busy. But I did find a very nice color picker, as well as it’s recreation for use in GWT.

Javascript Friendly

GWT friendly (Just in case GWT cleans up old entries, http://auroris.googlecode.com/files/colorpicker.zip )

Very Easy to implement both versions. Make sure to make the image smaller as Aurura posted in GWT, because it causes the popup to take longer to implement. I actually took the ColorPickerSample.java and pulled out the dialog into it’s own class. Added a few setters for the colors, and called it directly from HTML objects to open the picker.

06
Mar

A simple GWT Popup

Here is a simple popup I use for some of my items that I create, so if a user clicks on something in my HTML I use a span that calls a native function, which then creates the popup with the text I would like displayed. I’ll write up the native code example that calls this some other time.

public class DisplayDetailsPopup extends PopupPanel
{
public DisplayDetailsPopup(String text2display)
{
super(true);
createDisplayLabel(text2display);
}

private void createDisplayLabel(String text)
{
HTML lbl = new HTML(text);
lbl.setStyleName(”Popup”);
lbl.setSize(”120″,”25″);
lbl.setWordWrap(true);
this.setWidget(lblDisplay);
}
}

Note: use a label instead of HTML if you don’t want to render HTML when the user clicks. I wanted to pass in HTML to make it all function. Also, the style I used was a blackbackground with slight changes in sides at the right and bottom to make it look slightly 3D. Just to give it a bit of an effect over top of the text.

21
Feb

GWT - A simple toolbar with spacers

Here are three classes I created in GWT to help me create a toolbar. I wanted the toolbar to look somewhat similar to toolbars you see in desktop applications all the time. Below you will find the ToolBarFactory class, the ToolBarItem class, and the ToolBarSeparator class. I also included the styles I used for mine. Hopefully this helps. Grab the code if you want. I didn’t include all the imports, but if you want just click on the underlined class hit ctrl+1 in eclipse and tell it to import (or you can use ctrl+shift+M to import automatically). I had to type these in by hand because my code is on another network, so hopefully it all compiles, if not, let me know and I can help fix it :) I’m sure some of it can be cleaned up, I just haven’t gone back to visit it. Who knows in GWT 1.5 maybe they’ll have one for us to use. There are several 3rd party ones available, but I had created this before I found them, and it works great for my needs.

Anyway, the toolbar takes in an arraylist of the items you want added. Along with the imgHeight and Width of the items you will be adding.


public class ToolBarFactory
{
   public static HorizontalPanel createHorizontalToolBar(ArrayList toolbarItems, int imgWidth, int imgHeight)
   {
      HorizontalPanel hpToolbar = new HorizontalPanel();
      hpToolbar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
      hpToolbar.setStyleName("Toolbar");
      hpToolbar.setSpacing(0);
      Label fillerL=new Label(); //add a filler to off set the start
      fillerL.setWidth("2px");
      hpToolbar.add(fillerL);
      hpToolbar.setCellWidth(fillerL, "2px");
      for (int i=0; i< toolbarItems.size(); i++)
      {
         if (toolbarItems.get(i) instanceof ToolBarItem)
         {
            ToolBar Item tbi = (ToolBarItem) toolbarItems.get(i);
            Button btn = new Button();
            btn.setStyleName(ToolBar-button");
            if (tbi.getListener() != null)
            {
                btn.addClickListener(tbi.getListener());
            }
            if (tbi.getName() != null)
            {
               btn.setTitle(tbi.getName());
            }
            if (tbi.getImagePath() != null)
            {
               btn.setHTML("img style='width:" + imgWidth + ";height:" + imgHeight + "' src='" + tbl.getImagePath() + "'>“);
            }
            hpToolbar.add(btn);
            hpToolbar.setCellWidth(btn, String.valueof(imgWidth));
         }
         else if (toolbarItems.get(i) instanceof ToolBarSeparator)
         {
            //add a gap
            ToolBarSeparator tbs = (ToolBarSeparator) toolbarItems.get(i);
            Label spacer = new Label();
            spacer.setStyleName(”Toolbar-separator”);
            spacer.setWidth(tbs.getWidth + “px”);
            hpToolbar.add(spacer);
            hpToolbar.setCellWidth(spacer, String.valueOf(tbs.getWidth()) + “px”);
         }
      }//end for loop
      //gap filler right
      Label fillerR=new Label();
      hpToolbar.add(fillerR);
      hpToolbar.setCellWidth(fillerR,”100%”);
      //make it take the whole area
      hpToolbar.setSize(”100%”, String.valueOf(imgHeight));

      return hpToolbar
   }//end public static
} //end class

That was the main class, here is the items that it uses to add (and the arraylist that is sent in is made of these). So next up is the ToolBarItem:


public class ToolBarItem
{
   private String m_strName;
   private String m_strImagePath;
   private String m_cmdToUse;

   public ToolBarItem(String name, Stirng imagePath, ClickListener listen)
   {
      m_strName=name;
      m_strImagePath=imagePath;
      m_cmdToUse=listen;
   }

   public ClickListener getListener()
   {
      return m_cmdToUse;
   }

   public String getName()
   {
      return m_strName();
   }

   public String getImagePath()
   {
      return m_strImagePath;
   }
}

Now the Separator class.

public class ToolBarSeparator(int widthInPX)
{
   private int m_WidthPX;

   public ToolBarSeparator(int widthInPX)
   {
      m_WidthPX = widthInPX;
   }

   public int getWidth()
   {
      return m_WidthPX;
   }
}

Hopefully someone can use this, or can use the sample code with to figure something else out. And I leave you with some css styles:


.Toolbar {
   padding: 0px 0px 0px 0px;
   background-color: #C8C9CC;
   border: 0px solid #87B3FF;
   border-top: 1px solid #9D9DA1;
   border-right: 1px solid #000000;
   border-bottom: 0px solid #000000;
   color: #000000;
   cursor: default;
}

Toolbar-btn {
   padding: 0px 0px 0px 0px;
   background-color: #E5E3E3;
   color: #000000;
}

Toolbar-separator {
   padding 3px 2px 4px 2px;
   background-color: #C8C9CC;
   color: #000000;

12
Feb

My thoughts about GWT - Google Web Toolkit

I have started working with Google Web Toolkit (GWT) on a large scale product. I’m really enjoying the ease of use of the application. I also like the fact that it’s in active development, so I can look forward to new functionality, bug fixes, etc. It makes life simple for adding many of the DHTML tricks simple. Instead of me have to write all the javascript event handlers to do scroll boxes, split panels, menu bars, etc, it does it all for me. I just have to know Java and it will compile it down to client side javascript that works in all the browsers my users might be using. Cross-browser functionality can be a pain. It is nice not having to deal with it. Also, I love the ease to which I can create server side communication. AJAX is a breeze. Obviously, if you have enough coding libraries written, you might have simple ways to do it already, but GWT certainly makes life easy to have client -> server communication.

I have actually started using GWT to develop my new www.sideview1.com (which currently points to my family blog). Some day maybe I’ll get a release out there. I was able to get a basic layout down with function splitters, status bars, tree menu, etc done in about an hour or so.

In the future I’ll be adding some tips and tricks that I learn in GWT to help develop items. I have developed a toolbar in GWT that I think works quite well, and I’ll share the code in case others are interested.

If you want to learn more I have the GWT link under my links list or use the Google Search to find the various other sites that discuss GWT. I’m looking forward to GWT 1.5, which will hopefully handle right click menus and all the Java 1.5 library.

© 2008 Random Ramblings | Entries (RSS) and Comments (RSS)

Design by Web4 Sudoku - Powered By Wordpress