Saturday, December 22, 2012

Mint 13

I'm installing Mint 13 on my desktop.  This will be my third Mint 13 install.

The default marco window manager does not work for me.   Symptom is windows have no decorations, all appear in the upper left corner and can't be moved.  In other words, the window manager is not running.

The first time this happened, I thought it was just my incredibly old laptop, but this happens every single time.  Does the default marco work for anyone?

Same thing with compiz.  Mutter and metacity work, but I had huge problems with the workspace switcher.  I initally (under marco) set my workspace switcher to 3x6, but when I switched to mutter it appeared as 2X2, and the workspace switcher preferences offered no way to change it.  This behavior is similar under metacity.

I tried using the 'Additional drivers' drivers (ATI/AMD proprietary FGLRX driver), also manually downloading and installing the proprietary driver from ati.com, still couldn't get compiz or marco to work.

Here's what finally worked for me
  1.  Install and run gconf-editor
  2.  Navigate to /apps/metacity/general, set num_workspaces to whatever you want
  3.  Run mateconf-editor
  4.  Navigate to /desktop/mate/session/required-components, set windowmanager to metacity
Here's how to switch to  Focus follows mouse, sloppy, autoraise:

As above, run gconf-editor, go to /apps/metacity/general, check auto_raise, set focus_mode to sloppy.

Heh, cool, Quake 3 Arena works.  What a blast from the past.  There's no master server anymore, though.  I found a couple of places saying to use a different server browser to get multiplayer to work.  Xqf works.

Steam for Linux works.  I had to do this manual step:
sudo apt-get install libcurl3-gntls:i386
to get it working on my 64 bit hardware.  See Steam Available in Linux through a Workaround

Ubuntu Tweak for Mint 13 
Peerguardian
Handbrake 
Google Chrome

(1/1/2013) Hibernate didn't work at first.  I tried pm-hibernate.  Then I installed and tried s2disk.  S2disk works.  Also now when I run pm-hibernate, the output messages indicate it is using s2disk.

I used these instructions to get the 'Hibernate' button back on the 'Shut down the computer' menu.

Intermittent problem with hibernate.  Sometimes I have to try more than once to get it to work.

(1/20/2013) I had no sound for Quake 4, Doom 3 and Wolfenstein: Enemy Territory.

Fixed for Quake 4 and Doom 3 by editing these files:

$HOME/.quake4/q4base/Quake4Config.cfg
$HOME/.doom3/base/DoomConfig.cfg

Look for this line:
seta s_driver "oss"
and change it to this:
seta s_driver "best"
 
See also Doom 3, Quake 4, Enemy Territory: Quake Wars sound delay fix.

I couldn't find a comparable setting in the Enemy Territory config file, etconfig.cfg.

This solution worked for me.

Saturday, October 27, 2012

Oracle 11g XE on Mint 13

I switched from Ubuntu 10.04 to Mint 13 in July.  The new Oracle 11g XE is only available in RPM format, and there are other problems, and I'm not using Oracle DB at work these days, so I didn't get around to reinstalling Oracle.

I had some time today and following this:

Installing Oracle 11gXE on Mint and Ubuntu

was able to get it working.  Cool, thanks Mike!

Monday, October 8, 2012

Installing Java EE 6 tutorials on Linux Mint 13

In the good old days, all the Java tutorials could simply be downloaded as a ZIP file or compressed tar file.  But somewhere along the line Sun/Oracle decided to make us use the Glassfish updatetool instead.

I tried this today and had several problems.

(1) Error:

The software needed for this command (updatetool) is not installed.

If you choose to install Update Tool, your system will be automatically
configured to periodically check for software updates. If you would like
to configure the tool to not check for updates, you can override the
default behavior via the tool's Preferences facility.

When this tool interacts with package repositories, some system information
such as your system's IP address and operating system type and version
is sent to the repository server. For more information please see:

http://wikis.oracle.com/display/updatecenter/UsageMetricsUC2

Once installation is complete you may re-run this command.

Would you like to install Update Tool now (y/n): y

Proxy: Using system proxy settings.
Install image: /home/lmulcahy/java/netbeans/glassfish-3.1.2.2
Installing pkg packages.
Downloading 2 packages.
Downloading pkg (511 files, 6,237,937 bytes).
File 4/511#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fdaaf95e3ef, pid=8767, tid=140576351434496
#
# JRE version: 7.0_07-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
File 7/511[thread 140576350381824 also had an error]
File 44/511*** glibc detected *** /usr/local/java/jdk1.7.0_07-x86_64/bin/java: invalid fastbin entry (free): 0x0000000001502d50 ***
[thread 140576349329152 also had an error]
[thread 140576348276480 also had an error]
# [ timer expired, abort... ]
Aborted (core dumped)

Fixed by: Enable the proxy server:

export http_proxy=http://localhost:3128/

(And of course you need to have an actual proxy server.  This is Squid running on port 3128).

 (2) Error:

WX import error.  Verify the WX widgets are in the PYTHONPATH.
The following can be reported to GlassFish Update Tool 2.3.5 Development Team .

Traceback (innermost last):
  File "/home/lmulcahy/java/netbeans/glassfish-3.1.2.2/updatetool/vendor-packages/updatetool/common/boot.py", line 283, in init_app_locale
    import wx
  File "wx/__init__.py", line 45, in ?
  File "wx/_core.py", line 4, in ?
 ImportError: libjpeg.so.62: cannot open shared object file: No such file or directory

Fixed by: (Credit to Scott Dunbar) Install the 32 bit version of libjpeg62:

sudo apt-get install libjpeg62:i386

Interestingly enough, libjpeg62:i386 didn't appear in Synaptic, but installing it this way from the command line worked.


Hope this saves someone the hour or so it took me to figure this out.

Monday, July 16, 2012

The 6-week cure for the middle-aged middle

I've always had a tendency to overeat and get overweight.  In 1997 I hit 190 lbs.  I went on a diet consisting of only eating 1 meal a day 6 days a week, plus heavy exercise and in about 3 months managed to get down to 175.

In 2008 my weight reached 195 and I developed high blood pressure.  Over the course of the next 9 months I managed to get down to 165 (mainly cutting out carbs, sugar, fast food) and the blood pressure issues cleared up.

I was pretty happy with that for a year or so, but my weight still kept trying to creep up.  If I got over 170 or so then my blood pressure would start to rise.  I was in a pattern where every week my weight was fluctuating between 165 and 170.  I had still had love handles and a slight paunch.  I came to the 6 week cure with the idea of just a quick, one-time fix to lose 5 or 10 lbs and get a buffer zone between my top weight and where it started to elevate my BP.

This diet is not for the faint of heart.  I almost walked away when I saw the words 'no alcohol whatsoever for the first 2 weeks'.  It may as well say 4 weeks.  Given the tiny amount you are allowed to drink in weeks 3 and 4 I didn't bother.

For the first four days I felt like I was fasting.  The muscles in my legs ached.  I felt weak from hunger.  One day I had cold symptoms.  A couple of times I had migraines, which I never get.  It was difficult to concentrate on tasks at work.  I felt cold.  The book didn't prepare me for any of this, though from the reviews at Amazon I learned others had a similar experience.  My usual jogging routine went out the window.  I absolutely didn't want to do anything that would burn calories and make me feel even hungrier.

On day 5, something clicked and I started to feel better.  On day 8 I felt well enough to go jogging.  After that I more or less resumed my regular jogging routine (3X a week), though I did not fully recover my normal strength and didn't attempt the longer distances I usually run on the weekends.

Throughout the first 4 weeks I felt hungry a lot of the time.

Constipation was a constant problem.  Towards the middle of the second week my bowels started moving somewhat normally again.  When I switched from shakes to meat it took about another week to start getting 'regular' again.

At the end of 4 weeks of almost constant hunger, weakness and the other symptoms mentioned... the grim, sober weekends... the sacrifice and self-denial... my weight was down a disappointing 5 lbs.

In week five I went back to a diet of mostly meat and salads, plus the occasional shake.  I ate a few things I hadn't eaten for a while like (home made) chili and actual condiments (mustard contains sugar) and beef jerky (ditto contains sugar), as well as liquor.  Weirdly, eating a salad almost every day, yet another episode of constipation strikes.  My weight still declined a bit in week 5.

Week 6, pretty much the same as week 5.  The constipation pretty much cleared up.

Here's my weekly weigh-in leading up to, during, and after the cure:

2/11   166.4
2/20   168.6
2/25   166.8
3/3    166.0    (0)
3/11   166.6    (1)
3/18   164.2    (2)
3/25   163.0    (3)
3/31   161.6    (4)
4/7    160.8    (5)
4/14   161.2    (6)
4/21   159.0
4/28   160.6
5/5    159.6

Total weight loss was about 7 lbs.  I'm more or less keeping it off although there's no magic and you can see there are episodes of my weight creeping up again.  The thought of possibly going through this torture again motivates me.

In spite of my complaining I don't really regret doing this.  The benefits weren't as great as expected.  The cost was greater than expected.  Still, I never would have lost even this modest amount of weight just continuing on the way I was doing.  I suspect if I had done this when I was 30 lbs overweight I would have lost 20 lbs instead of 7 or so.  I think I'm just at a point where my body is fighting tooth and nail to hang on to those last few extra pounds.

My current thinking about losing weight and keeping it off follows:

(1) Avoid sugar.  This includes high fructose corn syrup.  Also note that some fruits are loaded with sugar.  Check the ingredients label; this is present in a lot of stuff where you might not expect it.

(2) Avoid carbohydrates, which your body metabolizes into more sugar.

(3) Exercise.  The benefit of this is not as great as you might think because exercise gives you an appetite and you wind up eating more.  But I still think there is a net benefit.

(4) Mostly eat meat, eggs, cheese, fruits and vegetables.  Limit fruit intake because of the sugar they contain. 

(5) It's useless to go on a diet if you can't stick to it.  Occasionally going off your diet for a day for a birthday or a holiday like Thanksgiving or Christmas won't kill you.  So think about 3 or 4 special days a year when you are going to relax or celebrate something.  But if you are making little exceptions every week, you might as well not bother dieting.  If you screw up, it's important to limit the damage and get back on the diet right away.  Each decision you make about eating sets a precedent for the next decision.  You're not just making isolated, individual decisions, you're cultivating a habit. 

(6) Think in terms of a permanent lifestyle change where eventually your new lifestyle will feel enjoyable and not sacrificial.

Friday, June 22, 2012

Uberconf 2012 themes, trends, observations

What's hot:

Mobile.  This market is growing explosively.  My dabbling in Android programming is OK for a hobby, but to seriously compete in this space you have to cover at least Android and IOS, IOS being the more important.  Solution is either stick to HTML5+CSS3+Javascript, losing some performance and device-specific capabilities, or go with a framework like PhoneGap or Titanium.

Javascript.  It's standardized and ubiquitous.  Javascript and AJAX will be the key to rich web content in the post-Flash world of HTML5.  No one wants to deal with the flaws (browser compatibility issues, for one) of plain vanilla Javascript, so there's an accelerating profusion of frameworks.  There's growing recognition that Javascript's lack of multithreading is a problem.

Gradle.  Gradle recently made it to release 1.0.  I have it in mind to learn more about this and start using it.  Too bad Spring is so joined at the hip with Maven these days, but I wouldn't be surprised if that changed soon.

NoSQL databases.

Conspicuously absent:

The big emphasis on concurrency and multithreading.

Book sales.

Round table discussion.

'No Fluff'... There was an actual vendor booth.  Gradleware is definitely one of the good guys, but this was still a conspicuous departure from the NFJS tradition.  Will this be the first step down a slippery slope?

Random observations:

The MacBook Pro is still a popular choice.

My impression was the presenters were more slack than in the past about having their slides ready on time.  Does this have to do with the iPads?  I suppose when the slides were being printed they had to be delivered earlier.  I liked not lugging the binder full of printouts around, but just having everything on the USB drive, on time, would have been fine with me.

Uberconf day 4

Scott Bain "Sustainable Test-Driven Development"

"In TDD, we are conducting an analysis to create the functional specification."

Tests aren't tests, they're requirements.  I agree with this line of reasoning, but non-programmers won't accept requirements that are written in code.

"A good test is a unique test."

"Behavior-based Analysis and Design"

I was a little worried this was going to be all review for me, but he touched on some points I never thought of.  Good presentation.

Oleg Zhurakousky "Enterprise Integration Patterns with Spring Integration"

I like this guy... he's got a MacBook Pro and he put a sticker over the glowing Apple logo.

Great presentation.  I feel like I learned the maximum possible in 3 hours.

Plus another endorsement for Springsource STS.

Lunch

I sat down next to Craig Walls at lunch and he gave me a Spring Roo t-shirt.  Cool!

Craig Walls "Client-side MVC: Web and Mobile Development with Spine.js"

"Knockout has an awesome tutorial."

"Mobile extension Spine Mobile"

Once Craig got into the details, this was a bit over my head. Looks cool but I'd need to come up to speed on CoffeeScript first.

"REST API follows Rails convention."

Spine apps can be wrapped in Cordova/PhoneGap.

Links

Approaches to Legacy Code
Lean-Agile Resources

Thursday, June 21, 2012

Uberconf day 3

First stop is Craig Walls "Spring Data Workshop".

We're looking at Spring Data support for JPA, MongoDB, Neo4J, Redis.

Craig zipped up his Maven repository and passed it around the room on a couple of USB drives to address the problems we experienced yesterday.

"Don't use JPA Templates... it's just there for consistency.  Exception translation is not needed for JPA.  Works similar to Hibernate contextual sessions."

"Spring Data = GORM"

This was one of the better presentations so far.  Craig was up all night working on a solution to the previous day's problem which proved effective.

It was refreshing to hear Craig endorsing Springsource STS (Eclipse) and disparaging IntelliJ/IDEA...  quite a change for this formerly IDEA-centric venue.

Venkat Subramaniam "Mastering Javascript"

"Gets are deep, sets are shallow."

I never got past the casual use of Javascript, and that was about 2 years ago, so  good review, plus some off-the-beaten-path stuff I don't think you'd find in the O'Reilly book.

"It's hard to get Javascript right, so don't actually write Javascript."  Venkat recommends CoffeeScript.

Szczepan Faber "Mockito Workshop"

Unit testing is an area of special interest for me.   I would like to learn more about Mockito but this just wasn't an effective presentation.

This guy just started coding like a demon with almost no introduction or discussion.  No one could keep up.  After a while he started pushing to his git repository at regular intervals and the rest of us could keep up doing git pulls.  So this turned into more of a coding demonstration than a workshop.

Even then he was doing a lot of refactoring and seemed to focus on developing his application more than demonstrating the features of Mockito.

I didn't come back for part 2 of this.

Pratik Patel "Mobile Development Options"

Lots more technical detail than yesterday's Nathaniel Schutta presentation, focused on PhoneGap and Titanium.

"Titanium's run-time performance is way better than PhoneGap/Cordova."

Keynote: Matthew McCullough "Adam Smith builds an application"

Links

Infinitest Eclipse or IntelliJ/IDEA runs your unit tests every time you save