I was recently traveling. I loaded up my phone and tablet with videos. I have the 8 GB model, so I could only fit a few videos on it. Normally it is not a big deal, but in this scenario, it mattered a little more. Due to a family emergency, I had to be dropped off at the airport at 7AM for a 1PM flight. My initial plan (before realizing how much time I was going to spend at the airport) was to use my phone to shuffle the videos around. My Galaxy S 2 has a 16GB Micro-SD card that was loaded with videos. The phone and tablet are Bluetooth linked to each other, but it turns out Bluetooth file transfer is really slow. I was averaging about 120 KB/s. That is about 100 minutes per video. That is not exactly fast enough to shuffle videos around.
I decided to look into Wifi Direct. The S2 comes with Wifi Direct built in. I found a Wifi Direct app for the Nexus 7. The two different apps would not communicate with each other. To be fair, I didn't give it a whole lot of time, but I didn't want to spend my battery life figuring out how to watch the video. I want to spend the battery life actually watching the video. I tried installing the Wifi Direct app onto the phone as well, but it wouldn't start on my phone.
I decided to take out the Micro SD card from my phone put it into my IOGear USB Micro SD Card Reader. I transferred the videos to my laptop. I plugged the USB cable from my tablet to my laptop expecting the Nexus 7 to show up as a USB mass storage device. Ubuntu didn't recognize it. I did a quick Google search on my phone and found this blog post about mounting a Nexus 7 in Debian-based Linux distributions. This worked, but some weird things started happening. I could not browse the Nexus 7 filesystem using Nautilus. I decided to copy using the command line. I tend to use rsync --progress instead of cp so that I get a progress bar. The copy "worked" but the rename failed. I decided to use the cp command and it looked like it worked. I checked the folder, and no files were there. I decided to change the Nexus 7 to use Camera mode instead of MTP mode and it worked instantly. I had write access to the photos that were on the camera. I know its a hack, but I copied some videos to the photos folder.
The Camera mode transfer worked and I was able to watch the videos at the airport and on the airplane. Although awkward, this method did work and it seemed to have minimal drawbacks. That is until I got home. I started my tablet and my laptop later in the night. Then I noticed something weird on my laptop. I was using way more space on my Dropbox than I had earlier in the day! I log into the site and a new video was there. My laptop was downloading the new video. I'm guessing the second video was still uploading while my laptop was downloading the first video. Android's Dropbox sync is based on the Camera Upload feature...which is how the file got transferred. This means deleting a file "photo" doesn't actually remove it from Dropbox. Since the file still wasn't downloaded on my laptop, I couldn't delete it. It took me a while to figure out how to delete the file on Dropbox's website (I'm not used to right-clicking in a website). Now that I'm home and I don't have to worry about battery life, I can look into a better way to transfer files between the phone and tablet for my next adventure.
JS Ext
Thursday, February 28, 2013
Wednesday, February 27, 2013
Weird Digital Distribution Rules
My wife noticed something ironic on Netflix recently. My wife likes horses and she saw a show that had horses with multiple seasons available for streaming: Heartland. She started to watch it and she liked it. As she watched the episodes, she realized the show is from Canada. She remembered watching a video of Wil Wheaton talking about Netflix not being available in Canada. This is because Netflix does not have the distribution rights to stream United States (I can't use the adjective "American" in this context) TV shows to Canada. Why is it that Netflix has the distribution rights to stream a Canadian TV show to the United States? Could it be that Canadian content producers want more people to watch their TV shows, not less? If that is the case, then why would United States content producers want fewer people to watch their TV shows?
Tuesday, February 26, 2013
MK802 III: Youtube Fullscreen Button is Back!
Previously I reported that the Fullscreen button was missing in the Youtube app when running on the MK802 III. The same version of Youtube running on the Generation 2 did not have the issue. On February 22nd, the 4.3.9 version of the Youtube app was released. This version of the app fixes the Fullscreen button issue! Now, if I could only get a button on my remote control to put the video in fullscreen mode.
Monday, February 25, 2013
Upgrading from XM to XL (Attempt 1)
I upgraded from Xen 4.1.2 to 4.2 and it was highly recommended that I upgrade from the XM toolkit to the XL toolkit. I was afraid of doing this because of the highly delacate nature of VGA-Passthrough. I found out that you can switch back and forth between XM and XL pretty easily. After verifying that XM VGA-Passthrough worked, I created an XL configuration. I had another machine that I used to test non-passthrough XL configurations, so I knew how to migrate the network configuration. I updated my VM config file to the (slightly) new format.
When I tried to start the VM, it wouldn't work. It would not pass through my PCI USB controller card. The error reminded me of a previous issue I had. In December of 2011, when I was trying to get the PCI passthrough of my USB controller card to work, I found a posting about an error in one of the XM Python scripts. I used the error message to find the exact script in question. When you pass through a PCI (not PCI Express) card, you need to pass through every sibling device. This means every PCI card on the same PCI bus needs to be assignable. The code that gave you a friendly error message when a sibling PCI device was not assignable had a bug in the logic. It followed the PCI tree up to the top, but it forgot to exclude the top. The top of the tree was 00:00:00. There was no way I could make that device assignable. Since the script was written in Python, I just commended out the "detection code" and my PCI USB controller started working. Flash forward and I'm having a similar error with the XL stack. Since XL was written in C, there is no way for me to edit a py file to fix the problem. I don't feel confident enough to modify and recompile the program. This is where I stopped for now.
When I tried to start the VM, it wouldn't work. It would not pass through my PCI USB controller card. The error reminded me of a previous issue I had. In December of 2011, when I was trying to get the PCI passthrough of my USB controller card to work, I found a posting about an error in one of the XM Python scripts. I used the error message to find the exact script in question. When you pass through a PCI (not PCI Express) card, you need to pass through every sibling device. This means every PCI card on the same PCI bus needs to be assignable. The code that gave you a friendly error message when a sibling PCI device was not assignable had a bug in the logic. It followed the PCI tree up to the top, but it forgot to exclude the top. The top of the tree was 00:00:00. There was no way I could make that device assignable. Since the script was written in Python, I just commended out the "detection code" and my PCI USB controller started working. Flash forward and I'm having a similar error with the XL stack. Since XL was written in C, there is no way for me to edit a py file to fix the problem. I don't feel confident enough to modify and recompile the program. This is where I stopped for now.
Friday, February 22, 2013
Windows Performance Issues
I have been having a performance problem with one of my Windows XP computers. All of a sudden, the computer has been running slower. When diagnosing a problem like this, the first thing you want to do is determine what resource is the bottleneck, then what program is consuming too much of that resource. This particular computer has 2 cores (of an AMD X6) and 3GB (of 16GB) of RAM. When I fired up Task Manager to figure out what resource was the bottleneck, I learned that it was the CPU. The computer was using 100% of each CPU and only 300MB of RAM. After waiting a while, the CPU usage dropped down, but the idle system was using 25% of each CPU! That is just wait too much CPU utilization for an idle system.
I don't run anti-virus on the system, because I am very careful about what I put into the system. The only other Windows PC's on the network are either heavily anti-virused, or I am also very careful about what I install on them. That lead me to believe that it wasn't malware that was causing a problem.
I turned off all the visual items in the Performance tab. That increased the responsiveness of the computer a noticeable amount. I disabled System Restore since I use QCOW2's snapshoting feature. I looked at the process table in Task Manager and started Googling what those processes were. Some of them were not needed, so I started uninstalling software. I looked up Windows XP tweaks and found a few good ideas (other than the normal "upgrade your PC"). I disabled the index service. I disabled some services at startup. I disabled "Last Access Time" on the filesystem. I disabled the disk performance counter. I deleted the Preload, but I don't think that will help me. Deletion of the Preload folder on a monthly basis is based on a sound theory, but it assumes your PC is a general use computer. My PC is for gaming, so there was very little in the Preload folder to begin with. I did a disk cleanup, but that didn't have a lot to clean up. It did offer to compress a bunch of files to save 2GB, so I decided it was worth it. That will help with the snapshotting process.
I finally broke down and installed LavaSoft's Ad-Aware. Normally I hate having anti-virus programs installed for two reasons. First, they often advertise heavily and add pseudo-malware like browser toolbars. Second, live scanning tends to consume a lot of resources. Live scanning tends to make your system slower to the point where it feels like you have a virus installed. I ran a scan and it identified one quarantined item. I thought to myself, this is it. I must have installed something that added malware. I clicked on the link to view the item....and it was tracking cookies. Eleven tracking cookies to be precise. Looks like you can protect a system from viruses with your brain as opposed to pseudo-malware.
I ended doing what some people recommended and "upgraded the hardware". I vi'ed my xen configuration file and added a CPU. After all that, Windows is still running slower than it used to. This is why I use Linux.
Thursday, February 21, 2013
Cloud storage api for apps
I use Dropbox as my cloud storage provider. There are a few free close storage providers. On top of that, individual apps, like Evernote, tend to have their own cloud storage infrastructure. Lately, I have been experimenting with storing the save game data for emulators on my Dropbox. I have it working on Windows and Linux, but not Android. It would be nice if there was one generic cloud storage api that all the apps could use.
My fear is that static software is turning more into "software as a service". If the software is tied to its own cloud storage and the company goes under, the software stops working. If the software uses a cloud storage api, then the software will remain usable. Also, people tend to have multiple devices. If I play a game on one device, I would like the saved progress to be available on all of my devices. Right now, of an app wants to support this feature, they have to roll out their own cloud storage solution.
I would like to have a single cloud storage provider. If I use Evernote too much, then I have to pay both Evernote and Dopbox. I also want more apps to be "cloud enabled". Dropbox just released an api that is specific to them. That is a great first step. Once other cloud storage providers do the same thing, someone can work on a single api that works for all storage providers.
My fear is that static software is turning more into "software as a service". If the software is tied to its own cloud storage and the company goes under, the software stops working. If the software uses a cloud storage api, then the software will remain usable. Also, people tend to have multiple devices. If I play a game on one device, I would like the saved progress to be available on all of my devices. Right now, of an app wants to support this feature, they have to roll out their own cloud storage solution.
I would like to have a single cloud storage provider. If I use Evernote too much, then I have to pay both Evernote and Dopbox. I also want more apps to be "cloud enabled". Dropbox just released an api that is specific to them. That is a great first step. Once other cloud storage providers do the same thing, someone can work on a single api that works for all storage providers.
Wednesday, February 20, 2013
Blocking Google Docs
Oxford is getting some bad press because they decided to block Google Docs for 2 hours. Although this is a bit extreme, I do understand why they did it. I am viewing their actions from the perspective of an IT working who has had to support clients similar clients. What is the best way to support clients that promote malicious behavior on the internet, then expect you to defend them from it?
Oxford blocked Google Docs because the IT department noticed an increase in phishing scams that used Google Docs to steal credentials. Google Docs was designed to make it easier to share documents and collect information. Phishers are taking advantage of Google's reputation and the fact that people are getting used to filling out forms on Google Docs. In Oxford's case, phishers are pretending to be Oxford's IT department and stealing their credentials to the email system so that they can send out spam.
A lot of people are caught up on the specifics instead of understanding the larger education problem. They point out other ways to prevent the spam problem. People are saying Oxford should use rate-limiting to prevent themselves from being a spam relay. I think those people don't understand the bigger picture. Right now, phishers are stealing email passwords to send spam. They are doing that because they are successful at it. Because they are successful at it, tomorrow they may steal more valuable credentials.
The bigger problem is a sufficiently large enough portion of the Oxford user base doesn't know how to identify a phishing attack. They don't realize that Google Docs poses an inherit danger. On top of that, the number of people affected by the firewall partly shows why the phishing problem exists to begin with. How is Oxford IT supposed to defend against this threat? The only effective defense is to educate the user base to the concept of phishing attacks. IT departments are largely ignored by their user base, though.
As bad as it sounds, firewalling off Google Docs forced their entire user base to acknowledge the issue. The user base is not happy, but the point got across. The only real way to measure success is by results. Sometimes, tough love is the only approach that works.
Oxford blocked Google Docs because the IT department noticed an increase in phishing scams that used Google Docs to steal credentials. Google Docs was designed to make it easier to share documents and collect information. Phishers are taking advantage of Google's reputation and the fact that people are getting used to filling out forms on Google Docs. In Oxford's case, phishers are pretending to be Oxford's IT department and stealing their credentials to the email system so that they can send out spam.
A lot of people are caught up on the specifics instead of understanding the larger education problem. They point out other ways to prevent the spam problem. People are saying Oxford should use rate-limiting to prevent themselves from being a spam relay. I think those people don't understand the bigger picture. Right now, phishers are stealing email passwords to send spam. They are doing that because they are successful at it. Because they are successful at it, tomorrow they may steal more valuable credentials.
The bigger problem is a sufficiently large enough portion of the Oxford user base doesn't know how to identify a phishing attack. They don't realize that Google Docs poses an inherit danger. On top of that, the number of people affected by the firewall partly shows why the phishing problem exists to begin with. How is Oxford IT supposed to defend against this threat? The only effective defense is to educate the user base to the concept of phishing attacks. IT departments are largely ignored by their user base, though.
As bad as it sounds, firewalling off Google Docs forced their entire user base to acknowledge the issue. The user base is not happy, but the point got across. The only real way to measure success is by results. Sometimes, tough love is the only approach that works.
Tuesday, February 19, 2013
Task Manager Uses All the CPU
When diagnosing performance problems, you need to figure out what is consuming the system resources. In Windows, the program you use is called Task Manager. When I open Task Manager to figure out what is using the most resources, it tends to be a program called Task Manager! Go figure. That means, whenever I have a performance problem, I look at what is using all my CPU. When I kill it, I still have performance problems. I look at what is still using all my CPU and it is Task Manager again! It keeps coming back!
Obviously I know Task Manager isn't the one consuming all my CPU. This is why I like Unix-like systems. Top is lightweight and tells you exactly what you need to know. Somehow, a tiny c program that predates Windows XP has been able to violate the Uncertainty Principle and tell you what is taking up all of your CPU without actually taking up all of your CPU.
This is why I use Linux.
Monday, February 18, 2013
Why I don't use 'break'
I have been looking at a lot of code lately. Some of it is c++ while most of it is Java. People seem to like using the 'break' keyword in code. I never really liked it because I feel like it is ambiguous. What am I breaking? Is it the nearest switch statement? Is it the nearest for loop? How can I intuitively read code if I'm not sure which control statement is being broken? Imagine the following code. What does it print out?
for ( int i = 0; i < 4; i++ ) { for ( int j = 0; j < 4; j++ ) { System.out.println( i + " " + j ); if ( i == 2 && j == 1 ) { break; } } }
Friday, February 15, 2013
Someone has the need, the need for speed
While waiting in line at Microcenter for an associate to get me an SSD, I heard an interesting conversation. The guy in front of me was talking to an associate. He wanted triple-channel memory. I had never heard of triple-channel memory before, but apparently it is the new "thing" that tech-speed people want. He wanted a lot of it, too. He wanted 16GB. The associate was having trouble finding a 16GB triple-channel kit. Now, I'm pretty ignorant about the subject, but my guess is that the problem is with basic mathematics (16 mod 3 != 0 ). The associate tried to talk the person into a 12GB kit (12 mod 3 = 0), but the person said that 12GB is not enough RAM. He said that he can tell when all his RAM is used up because it starts swapping. He said everything slows to a crawl. The associate suggested that the person overclock the RAM, and the person replied that the CPU and RAM are already overclocked. He said that the motherboard he has makes it really easy to overclock. The associate finally asked what the person was doing that required that kind of performance. He asked if the person had a bunch of virtual machines running. That is when the customer responded, "I do online racing".
My head almost blew up. That is almost up there with "If it weren't for that horse, I wouldn't have made it through that year in college". My mind first went to an online video game. What video game consumes 16GB of RAM? RAM like that makes me think calculations. My mind next thought of betting on races online, and he has some sort of program to calculate who he should bet on. If I was doing that, I would have responded with something about math. I wouldn't want to be thought of an an obsessive gambler. I couldn't figure it out. Maybe he was bad at the game and decided it was the computer's fault. If his computer was faster, his car would be faster. The only logical thing I could think of is he has a virus on his computer.
Chances are, he has a custom built system. Most pre-built PC's don't come with a motherboard that supports overclocking that easily. To overclock, you need expensive heatsinks and fans. You sometimes need special CPU's that allow overclocking. He already had 16GB of RAM. He wanted to replace that with triple-channel memory. All of that adds up to a lot of money spent on this computer. And what was he doing with this expensive computer? Online racing! Meanwhile, I'm thinking to myself, "Why doesn't he spend $10 on anti-virus".
My head almost blew up. That is almost up there with "If it weren't for that horse, I wouldn't have made it through that year in college". My mind first went to an online video game. What video game consumes 16GB of RAM? RAM like that makes me think calculations. My mind next thought of betting on races online, and he has some sort of program to calculate who he should bet on. If I was doing that, I would have responded with something about math. I wouldn't want to be thought of an an obsessive gambler. I couldn't figure it out. Maybe he was bad at the game and decided it was the computer's fault. If his computer was faster, his car would be faster. The only logical thing I could think of is he has a virus on his computer.
Chances are, he has a custom built system. Most pre-built PC's don't come with a motherboard that supports overclocking that easily. To overclock, you need expensive heatsinks and fans. You sometimes need special CPU's that allow overclocking. He already had 16GB of RAM. He wanted to replace that with triple-channel memory. All of that adds up to a lot of money spent on this computer. And what was he doing with this expensive computer? Online racing! Meanwhile, I'm thinking to myself, "Why doesn't he spend $10 on anti-virus".
New Laptop: Asus E1-571-6888
I tend to lean towards Dell's when I buy laptops. My wife has had a few HP's, but all but one of them has had issues. I didn't use my previous laptop heavily since I got my tablet, so I didn't want to spend a lot of money. I am a power user, and I do program, but my wife likes point out that I can push hardware far more than most people can. A big part of that is because I use Linux. Another reason is because I have a good sense of where the bottlenecks are in a system. Since I didn't want to spend a lot of money, I decided to go with a lower power laptop that I could upgrade key parts. I decided to go with the Asus E1-571-6888. I purchased it retail from Microcenter for $380.
I did research to make sure Linux ran on the laptop. I heard there was some UEFI issues, but the latest version of Ubuntu claimed to have resolved those issues. I did not see any references online of someone getting the built in Wireless card to work, but I have some very small USB 802.11N wireless nubs, so I wasn't too concerned. It would be nice for the built in wireless to work, but I don't travel with the laptop often (the built in wireless does work by the way).
The laptop only came with an Intel Core i3. Most people want i5 or i7's, but I am happy with an i3. It still packs 2.5GHz and has 2 cores. Computers with an i3 in them are a lot cheaper now, too. It comes with an Intel HD Graphics 4000 which was confirmed to work in Linux. Many people want a dedicated video card, but those take up battery life and cost money. I am not playing games on my laptop.
The laptop comes with 4GB of DDR3 RAM. I don't need RAM that fast, but if it comes with it, why not. One of the key details was the fact that the laptop has 2 SO-DIMM slots, but only one of them was taken. This means it comes with a single 4GB stick. This is a big deal. I picked up another 4GB SO-DIMM stick for $19. 8GB of RAM is more than enough for what I do.
The laptop comes with a 500GB SATA drive. That is a lot of disk space. That disk space could be a great selling point for some people....just not for me. The key piece of information was the fact that it was a SATA drive. This means it can be replaced with another SATA drive that only has 120GB of disk space and has no moving parts. I don't plan on using my laptop for long term storage, so a 120GB SSD is plenty of space. Microcenter was running a deal. You could get a Samsung E 120GB 840 SSD for $99. They even sweetened the deal by offering an extra 10% off if you purchase a motherboard or computer.
In the end, I payed a little over $500 for a laptop that I could get to perform as fast as a laptop twice its price. Having 8GB of RAM means I rarely have to swap. More of my hard disk can be cached into RAM as well. An SSD makes the operating system boot and run really fast. Many operations that normally trashed now run a lot faster. Cherry picking the features that you really care about leads to a better experience while costing you less.
I did research to make sure Linux ran on the laptop. I heard there was some UEFI issues, but the latest version of Ubuntu claimed to have resolved those issues. I did not see any references online of someone getting the built in Wireless card to work, but I have some very small USB 802.11N wireless nubs, so I wasn't too concerned. It would be nice for the built in wireless to work, but I don't travel with the laptop often (the built in wireless does work by the way).
The laptop only came with an Intel Core i3. Most people want i5 or i7's, but I am happy with an i3. It still packs 2.5GHz and has 2 cores. Computers with an i3 in them are a lot cheaper now, too. It comes with an Intel HD Graphics 4000 which was confirmed to work in Linux. Many people want a dedicated video card, but those take up battery life and cost money. I am not playing games on my laptop.
The laptop comes with 4GB of DDR3 RAM. I don't need RAM that fast, but if it comes with it, why not. One of the key details was the fact that the laptop has 2 SO-DIMM slots, but only one of them was taken. This means it comes with a single 4GB stick. This is a big deal. I picked up another 4GB SO-DIMM stick for $19. 8GB of RAM is more than enough for what I do.
The laptop comes with a 500GB SATA drive. That is a lot of disk space. That disk space could be a great selling point for some people....just not for me. The key piece of information was the fact that it was a SATA drive. This means it can be replaced with another SATA drive that only has 120GB of disk space and has no moving parts. I don't plan on using my laptop for long term storage, so a 120GB SSD is plenty of space. Microcenter was running a deal. You could get a Samsung E 120GB 840 SSD for $99. They even sweetened the deal by offering an extra 10% off if you purchase a motherboard or computer.
In the end, I payed a little over $500 for a laptop that I could get to perform as fast as a laptop twice its price. Having 8GB of RAM means I rarely have to swap. More of my hard disk can be cached into RAM as well. An SSD makes the operating system boot and run really fast. Many operations that normally trashed now run a lot faster. Cherry picking the features that you really care about leads to a better experience while costing you less.
Thursday, February 14, 2013
Ubuntu is always updating
I am a Gentoo user. I prefer a minimal system that only has what I requested on it. I started getting tired of the upgrade process for Gentoo, however. On my servers, I don't mind it so much. On my laptop and desktop, I mind it a lot more. The longer you go without updating the world, the more problems occur when you finally update the world. For my desktop, I don't use it that often so it was always in a bad state. For my laptop, I didn't want to spend the processing power to compile everything. I decided to migrate to Ubuntu for my desktop a few months ago. When I got my new laptop, I decided to install Ubuntu in it.
Although it is nice that software upgrades are so effortless, I find it annoying that there is always something to update. Every time I turn my laptop on or go to my desktop, there is more software that wants to be updated. It feels like Ubuntu wants to update very single day. I realize that it isn't actually Ubuntu that is constantly writing software updates. The software that comes with Ubuntu is maintained by other people. The problem is Ubuntu installs so much software onto my computer, that there is always something to update.
When you install Gentoo, you only get the software that is required to boot up. If you want anything else, you have to decide to install it. This minimalistic approach means there is very little bloat. The only shared libraries installed are the ones that your current software requires. I wish Ubuntu had an option for a minimal install.
Although it is nice that software upgrades are so effortless, I find it annoying that there is always something to update. Every time I turn my laptop on or go to my desktop, there is more software that wants to be updated. It feels like Ubuntu wants to update very single day. I realize that it isn't actually Ubuntu that is constantly writing software updates. The software that comes with Ubuntu is maintained by other people. The problem is Ubuntu installs so much software onto my computer, that there is always something to update.
When you install Gentoo, you only get the software that is required to boot up. If you want anything else, you have to decide to install it. This minimalistic approach means there is very little bloat. The only shared libraries installed are the ones that your current software requires. I wish Ubuntu had an option for a minimal install.
Wednesday, February 13, 2013
Wireless Video Standard
When connecting electronics with a wire, there are a set of standards people use. When you network devices, you use an Ethernet cable. When you connect audio, you have a suite of cable types. If you are connecting storage or peripherals, you use USB. If you are connecting video, you use an HDMI cable.
When you try to connect the devices wirelessly, most connection types have a standard. For networking, you use WiFi. For peripherals and audio, you can use Bluetooth. For video, you have nothing.
Having a wireless standard comes in handy when you want to hook up your phone to a TV. It can help when you have a lot of devices that need to be hooked up to a TV. Imagine not having to hook up a bunch of HDMI and component cables to the TV. There is already a device pair that can transmit an HDMI signal wirelessly to a receiver.
On top of that, it fits in with my vision of how we might use phones as our computers. To convert a phone into a computer, you need a keyboard, a mouse, a speaker and a screen. Instead of hooking up a bunch of cables, you can use Bluetooth for most of the connections. The one missing piece is the video. Imagine being able to sit down at someone's desk and start using the keyboard/mouse/screen combo without having to taken your phone out of your pocket.
Tuesday, February 12, 2013
Websphere's tight coupling
When you have a lot of competition, you have to make yourself stick out. In the software development world, this often means having more features than your competition. In Websphere's case, adding more features has been more of a hindrance in the long term. This is because Websphere tightly couples features that were supposed to be module. When you tightly couple the modular features, you make it harder to incrementally upgrade. This has caused people to start using lighter weight Servlet containers as opposed to using full J2EE-compliant application servers.
Websphere Application Server (WAS) is a J2EE-compliant application server. It bundles a lot of Java libraries with the product though. This can come in handy since you don't have to find 3rd party libraries if you want to use one of the various JSR extensions. The prime example is Java Server Faces (JSF). WAS 6.1 comes with an IBM implementation of JSF 1.1_01. It even comes with a component library that gives you extra components that are not part of JSF. This can be a great selling point. You buy one product and you get other products for free. This selling point yielded early sales. Those companies eventually discovered the problem with IBM JSF implementation: you cannot upgrade JSF independently of WAS. WAS comes with a jar called webcontainer.jar. This jar is an Uber jar of the various JSRs. It has the servlet api and implementation. It has some WAS internals. It also contains the JSF api and implementation. This means you cannot replace or upgrade the JSF implementation without upgrading WAS.
This is why more and more companies are migrating to Tomcat. It does not come with JSF. It only implements the basic J2EE JSRs. If you need one of the features that a full appserver has, you can download an implementation of that JSR. You can download one of the open source JSF implementations. If you need to upgrade your JSF implementation, you don't have to upgrade Tomcat as well. This allows a company to phase in an upgrade.
This separation is part of the reason companies are flocking away from Websphere towards Tomcat. Tomcat's lack of features is its main feature. It does a small set of tasks, and it does it well. Also, due to the open source nature of the software, you can buy support from multiple vendors. There is no vendor lock in. Tomcat is a great example of "less is more."
Websphere Application Server (WAS) is a J2EE-compliant application server. It bundles a lot of Java libraries with the product though. This can come in handy since you don't have to find 3rd party libraries if you want to use one of the various JSR extensions. The prime example is Java Server Faces (JSF). WAS 6.1 comes with an IBM implementation of JSF 1.1_01. It even comes with a component library that gives you extra components that are not part of JSF. This can be a great selling point. You buy one product and you get other products for free. This selling point yielded early sales. Those companies eventually discovered the problem with IBM JSF implementation: you cannot upgrade JSF independently of WAS. WAS comes with a jar called webcontainer.jar. This jar is an Uber jar of the various JSRs. It has the servlet api and implementation. It has some WAS internals. It also contains the JSF api and implementation. This means you cannot replace or upgrade the JSF implementation without upgrading WAS.
This is why more and more companies are migrating to Tomcat. It does not come with JSF. It only implements the basic J2EE JSRs. If you need one of the features that a full appserver has, you can download an implementation of that JSR. You can download one of the open source JSF implementations. If you need to upgrade your JSF implementation, you don't have to upgrade Tomcat as well. This allows a company to phase in an upgrade.
This separation is part of the reason companies are flocking away from Websphere towards Tomcat. Tomcat's lack of features is its main feature. It does a small set of tasks, and it does it well. Also, due to the open source nature of the software, you can buy support from multiple vendors. There is no vendor lock in. Tomcat is a great example of "less is more."
Monday, February 11, 2013
Replacement Launcher for the MK802
I have been waiting for a good launcher replacement to use on the MK802. Although the stock JellyBean launcher is very familiar for people, I am looking for something that is more usable at a distance. I tried a few launchers but was not happy with any of them. I would revisit the Play Store from time to time to see if any new launchers came out. During a recent search I found that TVLauncher got a major update. The updated interface is much better for the TV than the original version. The custom tiles look nice. I could fit 9 tiles on the home screen without scrolling. I didn't like the All Apps interface. While it was nice to search/filter for an app, I found the stock JellyBean pager to work better. Since the stock interface used the entire screen, I thought it was easier to find the app I wanted to run. I also prefer pagination over scrolling.
Friday, February 8, 2013
Feature Request: Serving JSPs from Jar files
JSPs need to be in a war file. This is part of the J2EE spec. For simple web applications, this make sense. Your dynamic web project contains the JSPs that are part of the project. When you get into larger, more module projects, it would be nice if the servlet engine could read a JSP from a jar file. I am going to give a concrete example where this would have been useful.
I wrote a regression test library for REST applications at my company. The idea is that you can write a regression test in JavaScript that fires off a fake REST call that returns JSON. You parse the JSON request and call assert functions to make sure the data came back is sane. These tests execute on JVM startup. What good is a test if you can't see the result? I wanted to write a very simple user interface that allows you to see the results of the regression tests. This user interface does a few things. It lists the results of the tests. It also allows you to download the log for the individual unit test, in the event that one fails. This feature makes it easier to debug a failed regression test. It also allows you to re-run the regression tests (maybe the database was down). You can also use your HTTP monitoring software to ping the user interface to make sure all of your REST services are healthy. Sounds simple enough, right?
The J2EE spec actually encouraged me to write the user interface in raw Java as a Servlet instead of writing it as a JSP. Remember, this was a library for other webapps to use. This was not a webapp in and of itself. This means it is a jar file. Any user interface that I write would have to be contained inside of the jar file. JSPs can't be rendered from jar files, though. I toyed with various ideas. I thought, maybe I can unpack my JSPs into a subfolder inside of the unpacked war on JVM startup. I decided this would be a bad idea. I thought about symlinking in the JSPs from a common location. This meant the user interface wouldn't run on the developers' desktops, however. I thought about putting the JSPs in a separate jar file and having the dynamic web projects use the Maven shade plugin to shade in the user interface JSPs. I didn't want to put the Java and JSP code for the library into different projects, though. I finally settled on writing the user interface in Java. The developers would just add the Servlet to their web.xml.
For a library like this, the user interface didn't need to be elaborate. The target audience was Java developers. There were other scenarios that did require a more elaborate user interface, but describing that scenario requires a lot of background information that I can't get into. This would be a great addition to the J2EE spec that would make it a lot easier to write modular code without having to deal with the Maven shade plugin.
I wrote a regression test library for REST applications at my company. The idea is that you can write a regression test in JavaScript that fires off a fake REST call that returns JSON. You parse the JSON request and call assert functions to make sure the data came back is sane. These tests execute on JVM startup. What good is a test if you can't see the result? I wanted to write a very simple user interface that allows you to see the results of the regression tests. This user interface does a few things. It lists the results of the tests. It also allows you to download the log for the individual unit test, in the event that one fails. This feature makes it easier to debug a failed regression test. It also allows you to re-run the regression tests (maybe the database was down). You can also use your HTTP monitoring software to ping the user interface to make sure all of your REST services are healthy. Sounds simple enough, right?
The J2EE spec actually encouraged me to write the user interface in raw Java as a Servlet instead of writing it as a JSP. Remember, this was a library for other webapps to use. This was not a webapp in and of itself. This means it is a jar file. Any user interface that I write would have to be contained inside of the jar file. JSPs can't be rendered from jar files, though. I toyed with various ideas. I thought, maybe I can unpack my JSPs into a subfolder inside of the unpacked war on JVM startup. I decided this would be a bad idea. I thought about symlinking in the JSPs from a common location. This meant the user interface wouldn't run on the developers' desktops, however. I thought about putting the JSPs in a separate jar file and having the dynamic web projects use the Maven shade plugin to shade in the user interface JSPs. I didn't want to put the Java and JSP code for the library into different projects, though. I finally settled on writing the user interface in Java. The developers would just add the Servlet to their web.xml.
For a library like this, the user interface didn't need to be elaborate. The target audience was Java developers. There were other scenarios that did require a more elaborate user interface, but describing that scenario requires a lot of background information that I can't get into. This would be a great addition to the J2EE spec that would make it a lot easier to write modular code without having to deal with the Maven shade plugin.
Thursday, February 7, 2013
Dropbox saved games
I use a Windows PC that is hooked up to my TV for my SNES gaming. It is faster than my MK802, but my MK802 does have reasonable performance. It got me thinking, though. What if I'm on the road and I want to play an SNES game? My MK802 could handle it, but I wouldn't have my saved games. That is when it came to me. I could point my emulators to save the game data to my Dropbox account!
On Windows, I use Zsnes. That is part of the reason for the performance instead in Windows. Zsnes is a lot faster than Snes9x, but it is partially written in x86 assembly. This means it cannot be ported to Android, who's main architecture is ARM. Just about all the SNES emulators for Android are ports of SNES9x. The saved game data is in the same format, though. They write the raw data that the game writes to EEPROM.
I also came up with the idea that I can share the SavedGames folder in my Dropbox with a friend that also has an emulator running. He currently uses Zsnes in Linux. Then, when I go over to his place to play video games, we can continue with the progress that each of us has made. I brought this idea up to him and he was super excited.
At this point, this is all theoritical. I don't know if this will work. I don't know if the emulators keep the file handle to the EEPROM data open. I don't know when Dropbox will detect the change. Will it upload after every save point in the game, or once I exit the emulator? I will do some testing in the coming weeks to figure these details out.
On Windows, I use Zsnes. That is part of the reason for the performance instead in Windows. Zsnes is a lot faster than Snes9x, but it is partially written in x86 assembly. This means it cannot be ported to Android, who's main architecture is ARM. Just about all the SNES emulators for Android are ports of SNES9x. The saved game data is in the same format, though. They write the raw data that the game writes to EEPROM.
I also came up with the idea that I can share the SavedGames folder in my Dropbox with a friend that also has an emulator running. He currently uses Zsnes in Linux. Then, when I go over to his place to play video games, we can continue with the progress that each of us has made. I brought this idea up to him and he was super excited.
At this point, this is all theoritical. I don't know if this will work. I don't know if the emulators keep the file handle to the EEPROM data open. I don't know when Dropbox will detect the change. Will it upload after every save point in the game, or once I exit the emulator? I will do some testing in the coming weeks to figure these details out.
Wednesday, February 6, 2013
Mapping Buttons in Android
The LIRC library allows you to use a remote control to control software on a Linux computer. Because of the wide variety of supported remote controls, LIRC uses a mapping system to allow the user to decide which buttons perform which actions. Programs that support LIRC have a list of "actions". For example, Mplayer has an action called "pause". On my Streamzap remote, I map the Play and Pause buttons to the "pause" action. This allows me to quickly pause and unpause the video.
Android apps need to implement this feature. Right now, if I want to pause MX Player, I have to click the Mele Fly Mouse button to bring up the player controls, move the mouse cursor to the pause button (before the controls disappear again), then click the pause control. If someone is calling (the main reason why I would pause a video), it could take a few seconds, so I could miss the phone call. My wife just started muting the TV instead of pausing it. If MX Player supported mapping buttons, I could use one of the buttons on the face of the Mele Fly Mouse to pause and unpause the video.
In general, I would like to do this in all of the apps. Netflix, Crackle and Hulu (really any video playing app) should implement this feature as well. This feature is one of those things that prevents the tool from being adopted by the mainstream as a potential Cable replacement.
Android apps need to implement this feature. Right now, if I want to pause MX Player, I have to click the Mele Fly Mouse button to bring up the player controls, move the mouse cursor to the pause button (before the controls disappear again), then click the pause control. If someone is calling (the main reason why I would pause a video), it could take a few seconds, so I could miss the phone call. My wife just started muting the TV instead of pausing it. If MX Player supported mapping buttons, I could use one of the buttons on the face of the Mele Fly Mouse to pause and unpause the video.
In general, I would like to do this in all of the apps. Netflix, Crackle and Hulu (really any video playing app) should implement this feature as well. This feature is one of those things that prevents the tool from being adopted by the mainstream as a potential Cable replacement.
Tuesday, February 5, 2013
Growing Qcow2 virtual disks for Xen
Most file systems support growing the filesystem. To grow a filesystem, you need to next and the end of your block device. Sometimes that is as easy as making your partition larger. If you are using a volume management solution, you can make your volume bigger. What if you are using qcow2 with xen? How do you make your virtual disk bigger?
I have searched around and the most common answer I come across is to covert the qcow2 virtual disk to a raw file, then grow the raw file. Those same people argue that I shouldn't use qcow2 anyways because raw files are much faster. To me, snapshot support is much more valuable than then modest performance gains of using raw files.
My first step was to give a second disk to the VM. For my gaming VM, I copied the games to the second disk without too many issues. I updated my backup script to snapshot this disk every week. For my other Widows VM, I added a disk but didn't add it to backup. That data isn't important to me.
I eventually found that newer versions of Qemu have a resize subcommand in qemu-img. I didn't know about it since Xen uses an older version of Qemu. I tried to use it but it won't work with images that have snapshots. I take weekly snapshots, so that is not going to work. I could use the convert subcommand to convert a snapshot to a standalone qcow2 image. Then, I could resize the image and start using it, but I haven't tried that yet.
For the future, I don't know what to do. One idea is to exploit the fact that qcow2 files do not preallocate disk space. I can create the disk as a 1TB disk, but only create a 40GB partition. If I need to "grow" my disk, then I make the partition bigger. The filesystem can grow to fill the new partition size. It is an ugly solution, but it should work.
I have searched around and the most common answer I come across is to covert the qcow2 virtual disk to a raw file, then grow the raw file. Those same people argue that I shouldn't use qcow2 anyways because raw files are much faster. To me, snapshot support is much more valuable than then modest performance gains of using raw files.
My first step was to give a second disk to the VM. For my gaming VM, I copied the games to the second disk without too many issues. I updated my backup script to snapshot this disk every week. For my other Widows VM, I added a disk but didn't add it to backup. That data isn't important to me.
I eventually found that newer versions of Qemu have a resize subcommand in qemu-img. I didn't know about it since Xen uses an older version of Qemu. I tried to use it but it won't work with images that have snapshots. I take weekly snapshots, so that is not going to work. I could use the convert subcommand to convert a snapshot to a standalone qcow2 image. Then, I could resize the image and start using it, but I haven't tried that yet.
For the future, I don't know what to do. One idea is to exploit the fact that qcow2 files do not preallocate disk space. I can create the disk as a 1TB disk, but only create a 40GB partition. If I need to "grow" my disk, then I make the partition bigger. The filesystem can grow to fill the new partition size. It is an ugly solution, but it should work.
Monday, February 4, 2013
Turning on my fireplace using my stereo
I had my stereo remote out, trying to find the input that streamed the TV audio back to it via the HDMI cable (Audio Return Channel). As I was cycling through the inputs, my electric fireplace turned on! I guess that is one less remote control I need.
Friday, February 1, 2013
Non-cloud Evernote replacement
I love then concept behind Evernote. I have implemented similar technology before. I decided to install the Evernote app but got scared with all the items it wanted to access. Evernote is one those cloud-based services that should be a personal cloud, not a public cloud. By using Evernote, you are giving them way too much information. It would be nice if someone wrote a home server equivalent that acts similar to the service. Then, I can be sure that none of my person information isn't being sold to some marketing company. If I find the time, I may write this, but chances are, I never will.
Subscribe to:
Posts (Atom)