Tuesday, May 20, 2014

Properties signleton


It seems I've written this code for a few projects - so I though it's good enough to share.
There is always a need for a Java application to know about its environment. It's easy enough to set properties on the command line, or to encode them in some kind of a constants file, but sometimes you need to change the properties on the fly, without recompiling or re-launching. If it's a production application, you don't have the liberty of bringing it down just to change settings.

So I wrote a convenience implementation of AppProperties object. It reads a properties file, parses it into a Properties object, and makes it available as a singleton to the application. Then all you need to do to change settings is to update the file and wait a minute or two (or whatever you set the interval to be), and presto - properties are updated.

The easiest way to set it up in a web application is to have a separate servlet, which loads on startup, like this:
<servlet>
  <servlet-name>AppStartupServlet</servlet-name>
  <display-name>Startup Servlet</display-name>
  <description>Servlet to perform webapp initialization tasks, such as configuring app properties singleton and initializing logging</description>
  <servlet-class>com.example.AppStartupServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>

Then, in the Init method of the servlet, initialize the AppProperties object, like this:

  public void init() {

    context = getServletContext();
    String confDirName = context.getRealPath("/" "WEB-INF" + File.separator + "classes" + File.separator);
    String confFileName = AppConstants.CONFIG_FILE_NAME; // the name of the config file

    AppProperties.getInstance().init(confDirName, confFileName);
    context.log("Application initialization complete");
    log.info("Init complete");
  }

From within the application, you can load properties like this:

      String value1 = AppProperties.getInstance().getProperty("Key");
      String value = AppProperties.getInstance().getProperty("Key""Default value");

Here is the actual code:


/**
 * Title:        Application Properties object
 * Description:  Application Properties object
 @author Ilya
 @version 1.0
 */

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

import org.apache.log4j.Logger;


/***********************************************************
 * Singleton properties object; properties loaded from props file and
 * available to calling classes. This class will not know about
 * any specific values in the props file, and whether they are mandatory.
 * This is done for two reasons:
 * 1. This is a utility class and should not contain business logic and
 * 2. Business classes should as much as possible have all their rules
 *    and logic contained in them and should not rely on this class to
 *    enforce them.
 * This class exists to improve performance by only accessing the filesystem
 * once per refresh cycle and to isolate system-dependent value (props file location) to one
 * place in the code.
 * The refresh interval is defined by property "property-file-refresh-time" in the same
 * properties file, or will default to 1 minute if one is not defined
 ***********************************************************/

public class AppProperties {

    private static AppProperties _instance;
    // transient object, to force publish update to other threads. Because there is only one thread
    // writing to this property, 'transient' is sufficient to assure thread safety
    private transient static Properties _props;
    public final static long serialVersionUID = 01L;
  private static Thread tPoll;
  private static Logger log = Logger.getLogger(AppProperties.class.getName());
  
  // pass-through to encapsulated class
  public String getProperty(String key) {
    return _props.getProperty(key);
  }

  // pass-through to encapsulated class
  public String getProperty(String key, String defaultValue) {
    return _props.getProperty(key, defaultValue);
  }
  

  /**
   * Primary way to interact with this object
   @return
   */
  public static AppProperties getInstance(){
      
      if (_instance == null){
        throw new AssertionError("init() must be called before calling getInstance() for the first time");
      }
        return _instance;
  }
    
    /**
     * call this init() method before using the singleton. Technically given this intended use, it should not be
     * necessary to make it synchronized. Adding the synchronized block out of abundance of caution for possible
     * reuse of this code in a different context. Acquiring a lock is expensive in relative terms but cheap in 
     * absolute terms; this should be called once (or rarely)
     @param confDirName directory where the config file is located
     @param confFileName name of the config file
     */
  public void init(String confDirName, String confFileName) {

    synchronized (AppProperties.class) {
      try {
        if (tPoll != null){ // this must be a subsequent invocation
          tPoll.interrupt()// interrupt old thread
        }
        AppPollThread pollThread = new AppPollThread(confDirName, confFileName);
        tPoll = new Thread(pollThread)// create new thread based on new parameters
        tPoll.start();
        // sleep until init finished. The thread will not stop on its own so no way to wait() for it
        while (pollThread.initComplete == false) { 
          Thread.sleep(1000)// 1 second
        }
      catch (Exception e) {
        log.error("error configuring App: ", e);
      }
    }

  }
    
  /**
   * The way to stop a running thread is to tell it that it is interrupted. A well-behaved thread should then stop itself
   */
  public void stopUpdates() {
    tPoll.interrupt();
  }

  private class AppPollThread implements Runnable {

    Logger log = Logger.getLogger(AppPollThread.class.getName());

    public transient boolean initComplete = false;

    private String confDir;

    private String propFileName;

    public AppPollThread(String configFileDir, String propFileNameParam) {
      super();
      confDir = configFileDir;
      propFileName = propFileNameParam;
    }

    public void run() {

      long lastPropUpdate = -1;
      int propFileRefreshTime = 1// default; minutes

      try {
        // iterate...
        while (!tPoll.isInterrupted()) { // thread must check to see if it should stop itself

          File propFile = new File(confDir + File.separator + propFileName);

          if (propFile.lastModified() > lastPropUpdate) { // need to re-init properties
            if (log.isDebugEnabled() && lastPropUpdate != -1)
              log.debug("Re-reading Properties file");
                
              Properties newProps = new Properties();
              newProps.load(new FileInputStream(propFile));
            AppProperties._props = newProps;

            lastPropUpdate = propFile.lastModified();
            try {
              propFileRefreshTime = Integer.parseInt(AppProperties._instance.getProperty("property-file-refresh-time"));
            catch (Exception e) {
              log.warn("Property property-file-refresh-time not defined in property file");
            }
          }

          initComplete = true;

          Thread.sleep(propFileRefreshTime * 60 1000)// minutes

        }
      catch (Exception ex) { // 
        log.error("EmtProperties Initialisation Failed", ex);
      }
    // end of Thread
  }

}

That's it. When shutting down the servlet, don't forget to call stopUpdates() like this. This is important when shutting down or redeploying the application (including hot-deploying during development

  public void destroy() {
    AppProperties.getInstance().stopUpdates();
  }

Friday, June 7, 2013

Questions to ask in an interview

I've worked with a lot of people in my time.
I've worked with lots of really smart people, and lots of really, really dumb, lazy, unqualified people.

I prefer the former. It's become so very clear to me how important it is to keep bad people out. I'm better off having an un-filled position that have it filled with the wrong person. (It's probably the same with romantic relationships - but I digress).

OK - so there are lots of Java interview questions all over the iternets, but here are some questions I like to ask when interviewing a candidate for a Java developer position (and sometimes beyond)


  1. Have you read Effective Java? This is a good litmus test. This is a fundamental book - and if you haven't bothered to read it I probably don't want you on my team. It's not an absolute rule - but it's a decent starting point. 
  2. What books have you read? Aside from Effective Java I like to hear Java Patterns - then maybe some technology -specific books on whatever technology's listed in your resume, especially from your last job. Maybe it's Springs or Hibernates or XMLs or PHPs or whatever. Point is, there's only so much you can get out of a quick intro read on a website and form your own exposure - if you really want to know it  then learn from an expert.
  3. What did you read most recently or what are you reading now? What I am trying to find out here is, what's the candidate's approach and attitude towards continuous learning? The very last thing I want is someone who learned to write Java code in a class in college a few years back, or read the intro on the Oracle site. It's a continuously evolving field - if ever there was a field which requires a lifelong learning, this is it. My most recent read is Java concurrency in practice - which I highly recommend.
  4. Why do you want to work here? This always seemed to me like a really stupid and annoying question when people ask me that at interviews. It's as legitimate as an interviewee asking 'Why do you want to hire me'. As an applicant I think (to myself) 'I didn't say I wanted to work here - it's an interview. It's a two-way evaluation'. Maybe a better question is, 'What motivates you to come to work'? The truth is there are multiple reasons why somebody would want to come to work, and they are all important. Yes, I want to be paid for my work - if everything else was perfect about a job but it had no pay, I'd definitely have to pass. I want to work with smart, motivated people that I like. I would prefer being the least knowledgeable and dumbest person in the room - but the reality is I typically find myself coaching others. I like to be challenged with new ideas, technologies and tools. 
  5. How do you manage your email inbox? This is also a no-single-right-answer type question, but it gives me a good idea of your organizational skills. That's probably a good topic for another post.
  6. I am always curious about the candidate's outside-of-work work - like open source projects, StackOverflow posts, SIG memberships etc - but that's not at all a requirement. I understand perfectly well that people have a life outside of work - homes, families, hobbies, twins to feed and change and put to bed, dinner to cook and clean up from - so if I get into bed and manage to watch a half hour YouTube on building JIRA workflows, it's sometimes still a good night. 

It occurs to me there are also questions I like to ask of an interviewer when I'm sitting on the other side of the table... 
  1. Describe your development process. This is also a good litmus test question. If I don't hear something about 'code reviews' - well then there's a really good chance people at the helm don't know what they are doing. It's such a fundamental part of a good software development process that if it's not there - well that means I'm probably walking into a mess of someone else's crappy old code. 
  2. Describe your testing methodology. This is also a sort of a litmus test - but it's not a yes or no situation, there is more of a spectrum here. Automated unit tests like jUnit are a great way to start - I don't want to hear that 'developers test their own code'. If there's a UI testing framework set up then so much the better. I ask about what kind of load testing and performance testing you do (if at all). 
  3. More open ended questions - say, what do you do to help your employees succeed? It's a flip side of the 'why do you want to work here' question. 
I'll probably think of others...

Lessons learned: working with an outsourcing partner

A few random thoughts have occurred to me, having worked with several offshore / near-shore outsourcing partner companies.


  1. Don't think of - or treat them - like slave labor. Just because they are cheap (by comparison) doesn't mean the individual coworker's motivations are any different from your own. People want to work and do a good job, and to be recognized for it. Nobody likes to be mistreated. I've seen this attitude from some people - and it just doesn't work.
  2. Don't ever let an outsourcing company 'give you people'. You wouldn't hire a local resource without interviewing them, reading their resume, and making sure they are qualified. Why should it be any different when working with an offsite person? It's doubly important that they be qualified for the job. If you get a resource who isn't - you will waste far more of your time training them then you ever get productivity out of them. So get a resume and conduct an interview (that's subject for another post). Depending on what you want their role to be, their language skills may or may not be at all important. One of the best UI people I have offshore speaks very poor English, but her work is top notch and I don't expect her to interact with the business clients.
  3. Don't assume the company, no matter how big it is, has its act together. I've seen companies as small as 100 people (E5 consulting) and as large as 60,000 people (Cognizant) produce some terrible, terrible work. The responsibility falls on you to set up a quality software development process - whether it be code reviews, testing, documentation - anything.
  4. Recognize and acknowledge good work, initiative and good thinking. People appreciate that - and it makes them want to do more. Just as importantly, recognize bad / slow work and under-performance. Here I don't have any patience - I will give direct feedback, but you don't get many chances.
  5. Don't assume you can just email work request in the evening and expect that work will be completed by morning. It's often a collaborative process - so expect to talk constantly, even daily, about work specifics. Find a way to make your schedules overlap. I can shift my day and come in at 7:30 and I expect my team to shift their day too - to still be there and be able to work with me for at least several hours. 
  6. Pick an outsource partner in a timezone that's conducive to collaboration, if you have the luxury to do that. If your team is in India or China and you're on Eastern time, you have a 12 or 13 hour time difference - that makes it extra hard. 
  7. If you found a company you trust, hold on to them. Don't let senior IT management get rid of them because 'it's easier to deal with just one big company' - or corporate compliance raise a stink because they 'don't have a privacy statement on their website' - or corporate security to block their access un-necessarily - defend your working relationship. Switching providers is really, really disruptive. Learn and expect to deal with incompetence of middle or senior management - if you don't have that in your organization then consider yourself very fortunate and enjoy the experience. That's probably subject for another post.
  8. Expect that senior developers cost more than junior developers. It the same way here - so why would it be any different offshore? Good people are worth the extra money, so resist the temptation to compare providers on the basis of costs.
I'm sure there's more to it that will come to me...

Sunday, February 17, 2013

How-to: Record a video interview

How-to: Record a video interview


Here are some tips for recording a video interview. I am putting these 'to paper' so I won't forget - and maybe they will help someone else later. Many thanks to Whitney Dow (of When the Drum is Beating) and Ramon Fabregas from Talamas in Boston.


  • Set up dedicated microphones - lav mikes for your subject and for yourself. Don't rely on the built-in mike in your video recorder. Dedicated mikes make a world of difference, and they are not expensive to either rent or purchase.
  • Use proper lighting. Something as seemingly insignificant as a backlight makes a dramatic difference. Don't rely on room or outdoor lighting. Even if you are recording during the day when you have some outdoor lighting, it's better to close the curtains if possible and use artificial lighting instead. Here's a really nice overview of a lighting setup, I won't duplicate that here. Not only can you control and compensate for the color temperature, but you won't have to deal with changes in lighting, because:
  • Your interview environment needs to stay consistent. The interview conversation, if it's going well, might take a meandering path with detours, side bars and dead ends. When you are editing it afterwards, cutting and reordering parts of it, you don't want changes in the environment - subtle as they may be in real time, to become jarring and sudden in the edited version. That means keep lighting consistent. Don't have other objects in the shot. You may be tempted to talk over a cup of tea - resist the temptation. What you don't want to see in the final version is a tea cup mysteriously jumping around the table. Give your subject a drink break if you feel that necessary (keep the video rolling). By the same token, don't have a clock visible in the background either.
  • Give yourself plenty of time. Lighting and A/V takes a while to set up and test. I think it took me about an hour to set up lighting the first time around; once I marked all the locations on the floor with blue tape (another tip) and was familiar with the equipment, it still took about 30 min to set up and plug everything in.
  • Unless you can be absolutely sure that you can edit the interview into a narrative later, I suggest you have a camera on yourself in addition to your subject. This way your questions don't seem like they are coming from some disembodied voice. If your seating setup is one where you sit side by side with your subject - maybe less formal but works well - one camera can capture you both. If you sit opposite your subject, make sure the camera that's covering you doesn't have your key light in the shot. It's totally fine if some of your video equipment makes into the shot of you.
  • Prepare for your interview. Have questions ready, but don't allow the conversation totally driven by them. Don't think ahead to your next question while the subject is answering the previous one; be in the question
  • Before you start asking the questions you really want to talk about, talk about other things. Ask some general questions or talk about something non-stressful. It takes people a while to relax when they are on camera.
  • Ask open ended questions. When the subject finished answering, leave a pause - they will sometimes think of something else to say. It's amazing how many times I can identify this 'trick' in other people's interviews now.
  • Lighting and audio can be pretty inexpensive to rent. I rented four lights, two mikes and a mixer for the weekend for about $100 at Talamas in Boston. Video camera rental cost me the same from another vendor in Newton. I later found out that I can purchase the same camera for $200. 
That's it. Now I don't need to keep this in the back of my mind

Tuesday, September 25, 2012

How-to: Record SiriusXM online radio

A lot of people have been wondering whether it is possible to record the music they play from SiriusXM. Well with a little determination and patience it's possible. If you follow the instructions you should be able to do it too.

I should probably point out that recording online radio is no big accomplishment. There are a number of programs that will let you record an audio stream to a file. There's no trick to it. What 'is' a trick is having the stream broken up into individual songs, properly named with the artist name and track name in both the filename and ID3 tags. That's what I'm going to try to explain here.

Why would you want to? I can tell you why I would want to. I like to be able to listen to this music offline. I also like to be able to skip songs I don't like. I particularly enjoy the Coffe House channel, but I hate some songs that sound like someone is dying. I also don't like the station promos they play, I don't like to have to be forced to listen to freaking Jhon Mayer ad nauseum. Some program director at SXM is seriously into freaking Jhon Mayer. I know, it's the hair.

I should first say that it feels marginally 'iffy' to be doing that. The truth is that you are entitled to record anything if you are legally allowed to listen to it in the first place. That is part of the 'Fair Use' doctrine of the US Copyright act, as specified in the Audio Home Recording Act. See section 5 of this page.
Still, just because it's legal doesn't mean SXM will make it easy for you - in fact they will do everything possible to make it very difficult.

I should also say that this works as of the time of this writing, but if you are reading this a month later, things may have changed a bit. Yesterday I heard SiriusXM was loosing money, and there is no guarantee they will stick around forever. It costs a lot to operate a satellite network and pay Howard Stern, and smartphone-based options are giving SXM some real competition.

Now to specifics.
You are going to need some tools. Some are free some are not.
  1. Google Chrome. You probably already have this, but that's not good enough, for reasons that I will describe later. As of today Chrome is on major version 15. What you will need is version 8 or 9 or 10 because it works differently. You can get it from OldApps.com - I'm using version 8.0.552.237. I have tested it with version 9 and 10 and they work too. And yes, you will have to un-install your current version of Chrome first - them's the breaks.
  2. Windows Macro Recorder. It's a free utility program, works well, and there's a nice short video on the site telling you exactly how to use it. Believe me it's well worth the minute of your time to watch the video.
  3. Total Recorder from High Criteria. It's not free, but you can get an evaluation edition so you can make sure your setup works before buying a license. It's well worth the money spent. I use Professional version 8.3
Now the process.

The basic idea is this. We will use Total Recorder to record the music. We will configure it to split the stream into individual files, name and tag them, based on the song information from SXM. To do that we will need to get the song information from the SXM website, then put it into a place where Total Recorder can pick it up - and that place is the Google Chrome browser.


1. Download and install Total Recorder. You will then need to configure it as follows. Firstly, we need to add a few lines to its players.txt configuration file. It goes in the Program Files directory - in my example under XP it's in "C:\Program Files\HighCriteria\TotalRecorder\players.txt"; it's something similar on newer OSes. Add the following lines to the bottom of the file:

; XM in Google Chrome
;
[XM in Google Chrome]
CLASSNAME="Chrome_WindowImpl_0"
FORMAT="about:blank - <artist> - <title>"

This will tell Total Recorder to look for the Google Chrome application, find what's written in its title bar, and extract the Artist and Title information out of it.

You will probably need to reboot after installing Total Recorder.
Further configuration:
Select Options -> Settings and click on "Split" on the left side of the window.
Make sure the first checkbox is checked and the dropdown reads 'Rules using file tag'.
Also check the second checkbox 'Split mode...'.
Click on the 'Conditions' button. Here is where the magic happens. This is how the program knows when to cut your audio stream, write out the audio file, name it and tag it.
Check the 'when the clip info in external player is changed', but uncheck 'Split at the point with the lowest level' check box.
Also check 'use info from external player...' check box, and in the dropdown select the bottom-most setting - 'XM in Google Chrome'. This is why we added the configuration above to the players.txt file.
You will also need to check 'duplicate last X seconds of previous file and next file'. Set it to 30 seconds each. I know, it's not ideal, but this has to be done this way, because the song information does not change at the exact same time the next song starts. We will address what to do with this later.

Optionally save this configuration using 'Save as...' button, give it some meaningful name like XM Chrome Split.

Now we'll go through and tell Total Recorder what to record, what format to use, where to save it, etc.
Slect Tools-> Recording Wizard.
1. Accept default first checkbox (sound produced by sound player), click Next
Feel free to perform a test recording at this point. Start the browser-based player. If you see green bar in the Total Recorder window, showing recording level, you are probably okay.
2. Select MP3 format. Do not use Ogg Vorbis. This is because tools are readily available for trimming MP3s, not so for Ogg. Also, MP3s can be trimmed to the milliseconds instead of blocks the way Ogg is. More on that later. Next.
3. I suggest Near High Quality. It's music afterall, not talk radio. Next.
4. Accept default. Next.
5. No to 'Pause reduction feature'. Again, not talk radio. Next.
6. Leave 'Yes' to automatic file creatin. Next.
7. Leave next setting in place (we set it earlier). Next.
8. Leave this in place also. Next.
Wizard Finish Screen - say 'yes'


So now we have configured the software to record your audio stream, and to split it automatically based on the track information in the title bar of your Google Chrome browser. But how do you get that track information in there? That's the next step.

Open another browser. I recommend Firefox. You can't just do it using a different tab in Chrome, or a different window either. Has to be another browser. Chrome sets its title bar to be the title of whatever page it is currently displaying. We need it to be displaying the song information so we can't be using it for browsing.

So, now that you have another browser (Firefox) opened, navigate to the web page of the channel you would like to record. SXM has individual web pages for its channels. For example, channel #35 Lithium has a web page at http://www.siriusxm.com/lithium. When you load the page, it will display the song information for whatever it is currently playing. This is where we will be getting the song information.

As a sidebar, SXM really doesn't want you to be getting the information from there... Instead of embedding the information directly in the HTML of the page, they make the page load and then have Javascript send an AJAX request to the server to populate the song info... This way you can't just use a program to get the HTML from their server and then parse out the song info. But anything that can be read by a human can also be read by a program - just takes a little more doing, that's all. Even if the song info was displayed as an image, nothing prevents me from having a program do a capture of a screen area then have a Perl script feed it to an OCR library... but I digress.



Now do this: Highlight the song information in the Firefox browser window, copy it (Ctrl-C) to the clipboard, alt-tab to your Chrome window with a blank tab open, and type this in the URL bar:
about:blank <space> to paste song info>
Using the screen grab from above, I get this in the URL bar.
about:blank Beastie Boys - Intergalactic

Now position your cursor over your Start bar over the Chrome program icon. You will see a tooltip that shows something along the lines of
about:blank Beastie Boys - Intergalactic - Google Chrome
Bingo! this is the information that Total Recorder will now pick up, parse out the artist and title, and split your track.

Of course the song information changes as the music changes, and the last thing you want to do is sit in front of the computer copy-pasting all day. This is where the macro recorder /player comes in. The steps you just performed - load the SXM page in the Firefox browser, select song info, copy and paste into Chrome - you will perform again, but this time you will record it using the macro recorder, then simply tell the recorder to replay.

IMPORTANT: before you start running this macro, or any macro, know how to stop it. Otherwise you are stuck in your own private Voodoo dick joke. In this case, Ctrl-Escape does it.

OK, so now we're ready. Here's what you do:
1. Start the browser based player and get it to play your station in tab 1 in Firefox. Do not have Firefox or Chrome maximized; this will let you switch easily between programs by clicking their title bar.
3. In a second tab in Firefox, load page for your station.
2. Start Macro Recorder.
4. Press Record on Total Recorder.
5. Press Record on Macro Recorder.
6. Switch to Firefox by clicking on its title bar. Twice with 1-2 second interval (don't want your clicks to read as a double-click, which would maximize your window - not what you want). Two clicks are necessary here - has to do with the way macros run... I'll tell you later why if you're interested.
7. Click on tab 2 to open it (even if already open). Press F5 to reload page.
Switch to Tab 1 where your player is. Select some text in the page, doesn't matter what. This is to tell the player "I'm still listening, don't time out".
Switch back to Tab 2. After artist and track info appears, wait another few seconds (they might not appear as quickly fifteen minutes from now and you don't want to trip up your macro).

7. Select artist and track info in Firefox and Ctrl-C to copy it to clipboard. While selecting, pretend the song title and artist name are really long - select a wide area of the screen. The song that's currently playing might nave a short name, but some subsequent song might have a really long name.

8. Switch to Chrome by clicking on its start bar icon

9. Type into the URL bar 'about:blank - ' (that's a space dash space in the end there) then Ctrl-V to paste artist and track info.

10. Click the Stop button on the Macro recorder to stop recording. (Do not ctrl-escape to stop recording). Right-click and select Save to save your macro, give it a filename. Exit and re-open macro recorder, then load your recorded macro.

10.5. Macro recorder was placed in the same spot on the screen where it was when you last closed it. Which means when you run your macro, it will recreate every one of your keystrokes and mouse moves - that includes the clicked you used to stop recording the macro. When you run your macro in the repeat mode, you don't want the macro itself to stop running of the macro. For that reason, you need to move your Macro recorder to a different spot on the screen. Also, when you run the macro in repeat mode and the macro executes a click in the space where the Stop button used to be, there is now only the windows desktop. The click registers as an interaction with the desktop. This is why we were clicking on the Firefox window title bar twice earlier.

11. Click on Repeat button in Macro recorder and press Play.

12. Sit back and watch as the macro recorder gets the info from the station's web page into Chrome, then Total Recorder cuts the song and creates a new file whenever song info changes.

Adjust your macro as necessary. It will probably take you a few tries.

For extra credit, interject an intermediate step in your macro which uses a simple graphics program like FastStone Image Viewer to capture a rectangular area on your player where album art is displayed, and save it as a separate JPG file named with artist and track info.
You will need the Regex tool at this address http://www.regular-expressions.info/javascriptexample.html and this as the regex string: [\\]+|[*]|\/|:|\?|>|<\|
in order to sanitize file names. Don't worry about it if you don't care about having images available.





Tuesday, February 23, 2010

ZOTAC MAG Nettop

The system arrived late last week. I had a chance to set it up over the weekend and put together some impressions. First of all, here's the unboxing video - in HD!




My overall impressions of the system are overwhelmingly positive. Aside from a few minor issues, it has exceeded my expectations.

I purchased this little PC with the intention of using it for an HTPC (Home Theatre PC). Specifically I wanted to be able to play Hulu and Boxee, Pandora, and my CD collection from a network server. Most importantly, I wanted to be able to use it as a MythTV DVR frontend (viewer).check back for updates on how that is going I did not expect to be able to use it as the backend (recorder) - I expected that it would not be powerful enough. That's yet to be determined. I also expect that I will be using it for browsing the net when I need to do that jointly with my wife or company (hey, what does IMDB say about actor Blah, or what does Wikipedia think about this or the other.).


The features can't be beat.

Design:The unit is very compact and also very stylish. Shiny black case, nice shape. Rubber feet on the bottom to allow it to sit horizontally, an upright stand for standalone setup, and a monitor mount which has two screw patterns (screws included).

Pros:


  1. Nice design. Very compact, stylish.
  2. Dual-core Atom with hyperthreading. Allows two threads to run simultaneously on each core, for a total of four. The Task Manager shows it as four processors.
  3. NVIDIA ION chip - a HUGE improvement over Intel's own graphics shipset. Adobe Flash 10.1 (currently in beta) is able to take advantage of the GPU, so the load on the processor is low and video runs very smoothly, in full HD, full screen.
  4. HDMI output - carries both video and audio, one simple connector.
  5. Multi-monitor support. It has both HDMI and VGA connectors, and so you can connect and use two monitors at the same time - if you're into that kind of thing and your OS supports it
  6. FAST networking, not just any networking. GIGABIT ethernet and wireless at 802.11 N. So streaming HD video over my LAN from my NAS won't be an issue.
  7. BONUS: HDCP support - I didn't see this in the specs, so this is a bonus. This means I can play HD content like BlueRay movies, if I attach a drive
  8. ANOTHER BONUS: GPU-accelerated encoding/transcoding! I couldn't believe it! I fully expected to have to purchase an encoding card and stick it into a desktop, but this might work very well! - check back for updates on how that is going
  9. No OS supplied. I am listing this as a positive, though this will depend on your point of view. I would rather not be charged for some overpriced OS that I don't need or use. I happened to have an old copy of Windows XP Pro, which I installed and it works very well. I also left room on the HD for an Ubuntu install later. Added bonus - no bloatware!
  10. No keyboard, no mouse. Since I intend to use this as an HTPC, I need a remote keyboard/mouse - better not spend money on whatever the manufacturer might have decided to throw in, if I would not be able to use it anyway. Check back later for a sidebar on wireless keyboard
  11. The case has a neat amber LED ring that glows when the PC is turned on. Not functional, but looks very neat.
  12. It is literally whisper quiet. It isn't completely silent - there is an internal CPU fan, and the HD has moving parts also. However, the fan is super quiet - you literally almost don't realize it's there unless you get your face up against it. The power supply is an external power brick, so that's fanless - very nice.
  13. Very low power draw. I'm going to check with a Kill-a-watt just how much under different tasks. Check back for updates on how that is going
  14. Some nice trial software included on the driver CD. Video encoder, video editor, virus protector. GPU-accelerated! I'll be testing that out separately. check back for updates on how that is going
  15. Little ZOTAC foil sticker. Call me crazy. I am liking this little guy. I might peel off the backing from the sticker and put it on the TV or something.

Now the cons:


  1. Biggest so far is the reception on the wireless card. The antenna must be weak. It shows my N network as having a weak signal (2-3 bars) when my Dell laptop sitting next to it shows it as Excellent - 5 bars. I'll have to take the router out of the closet. Probably a good idea to do that anyway. UPDATE:Took router out of the closet. Reception went to two bars to three. Changed the orientation of the system - set it upright instead of flat. Reception went to four bars. Still pretty weak though. The system is now less than 20 feet from the router, no walls between them. Plugged in a D-LINK DWA-142Wireless USB Adapter Rangebooster N Draft 802.11N
    which immediately showed 100% signal strength, and a fast connection speed.
  2. HDD and Power LEDs are a hwee bit too bright. I might have to tape over them. If I'm using this to watch video, I don't want to see the bright blue blinking HDD led.
  3. Having a little trouble getting sound over HDMI to work. The driver under XP doesn't seem to have that option. That's the driver that came on the CD; I will try downloading updated drivers from the ZOTAC site.
  4. Case is not meant to be opened. There are no screws holding the case together; it's a snap-on plastic, which means it's also pry-apart plastic. There's a sticker that says opening the case will void warranty. What if I want to upgrade the HDD? That's just weird.
  5. The HDD is only 5400 rpm. I think you would get a noticeable performance boost on heavier tasks if it had a 7200 rpm drive.

Other notes:


  1. I would have been willing to pay a little extra to have the case made of aluminium, which could act as a heatsink and in that way make the processor fan unnecessary and the PC almost completely silent (if I plug in an SSD).
  2. Plasma TVs suffer from burn-in very quickly. That's sad. I might have to limit the use of the PC desktop on my TV.


Installation notes:

Installation involved a few hiccups but it succeeded. I went with the venerable Windows XP Pro OS, for which I had a license laying around. I did not feel inclined to purchase Windows 7 full license (although I have a free upgrade coming to me from a Vista system, so I might do this in the future). I also left 10GB unpartitioned on the HDD for an Ubuntu installation later.

The first thing to note is that you can't install an OS without having a proper full USB keyboard. I had only a USB wireless Lenovo keyboard/trackball combo, which I thought would work fine. (separate review, stand by for that). While the keyboard works fine, it lacks Function keys, so the point in the installation where you need to press F8 to accept EULA - that's where I got stuck and had to call neighbors to see if anyone has a USB keyboard I could borrow. Luckily someone did. Else it would have been a ride to MicroCenter for one of their $6 cheapo USB boards.

The next thing to note is that the drivers on the included CD aren't necessarily up to date, so you need to download the latest from the ZOTAC website (except graphics, more on that later). Once I installed all the drivers, the system worked very well (including sound over HDMI).

Graphics: the primary purpose for getting this system was to run it as an HTPC, and playing full screen Flash is a major part of that. Initial results were disappointing. The playback was pixelated and blocky and jarry, not at all smooth. Unwatchable. A quick look at the quality setting revealed 'medium' instead of 'high' while playing some NOVA program. That had to do with a weak wireless network connection, so once I fixed that the quality went to 'High'. The playback still was far from smooth however, and the CPU was running at 70%. Clearly the GPU-accelerated Flash wasn't so accelerated. I installed the latest player from Adobe (10.1 beta 3). The installation requires running an uninstall program on the previously installed Flash version - without that step the software wasn't updating. The new version of Flash didn't fare any better. While playing The Office off Hulu the playback was jarry. As a last step I downloaded and installed graphics drivers directly from NVIDIA. After reboot the display settings reset to 640x480 resolutions at 4 bit, which looked terrible, and would not reset to anything higher. Another reboot somehow fixed that problem, the resolution restored to normal.

With the latest Flash installed and the latest NVIDIA drivers (from January 2010) finally Hulu ran smoothly. Primary purpose of this system is achieved.


Remote controlling the box:

There's a Remote Desktop Connection (RDC) program for Android, and XP Pro has the RDC server. I will try this and post the results. If I can control Pandora remotely - this might be an excellent bonus standalone media player application for this little powerhouse

Bottom line:

this unit is very well suited for the tasks for which I purchased it. It's also unbelievable value. I can see using this for most anything a home computer can be asked to do - web browsing, media streaming and consuming, email, Quicken, Office programs, even video editing, believe it or not. I would even go so far as to say that this little PC would be perfectly appropriate as an office PC. However, keep in mind that it's still a low powered CPU, and the PC has limited expansion options. I would not use it for application development, where I need to run an application server, database server, programming environment and a front end. But then who knows, I may be proven wrong. I will try to load an Android IDE and see how that works.

If you would like to see what other people have said, here are product links to Amazon and NewEgg


Amazon gift card link.



AmazonNewEgg
Zotac MAG MAG HD-ND01-U Mini PC





Zotac Mini / Booksize Barebone System

Labels: , , , , , , , , , ,

Sunday, February 21, 2010

ASUS VH226

First post, just for practice, mostly.
Video unboxing in HD!





Pros: High resolution, low price, good brand. Lots of inputs. Bought two - one for work and one for my wife's computer - no problems with either, no dead pixels, brightness and colors are consistent between the units. My "blacks are black", but I have the higher-contrast version of this screen (VH222H). Many cables included. Excellent for daily business computing, occasional movie watching, and casual FPS gaming.

Cons: I could only afford two ;-)

Complex/annoying menu. The auto-seeking input selector will switch to another input when your display falls asleep, so your display may not fall asleep until all your devices fall asleep.. which won't happen at all with some devices (like DVD players, Satellite/TV set-top boxes, etc). This also means that you can't select another input without first waking the target device from sleep. Worse speakers ever. Must manually configure 4:3 when applicable. No HDMI cable included. Altogether, I take one egg for these problems.

Other Thoughts: Note, I own the nearly identical version of this monitor, the VH222H, which is no longer in stock here on NewEgg. The differences being that this, the VH226, has a lower contrast ratio but a faster refresh rate.

This display is a TN screen which means that colors will shift depending on the viewing angle. How much this bothers you will depend on how much color consistency matters to you and from how far you view the monitor. This is certainly not a good thing, but it isn't really a con for a monitor at this price. If this bothers you, consider a smaller TN monitor on which the problem would exist but would be less significant, or invest in a more expensive VA or IPS based display.

If you would like to see what other people have said, here are product links to Amazon and NewEgg




AmazonNewEgg


Product not currently available, but here's the link to the page

Labels: , , , ,