The Altogether

Makefile Tips #1

by on Apr.03, 2012, under Code Monkey

I had my first experience with Makefiles in Unix today. Here are some initial tips and errors that I experienced…

1) When faced with a file such as Makefile.pl – you can’t use the make command straight away. You must first generate the makefile itself from the contents of Makefile.pl, like so…

perl Makefile.pl

This will produce a standard makefile, that you can then use in conjunction with the make command – simply run make from the command line.

2) If you have several makefiles, you can specify which one to execute with the command:
make -f <name of the makefile to run>
For example…

make -f MyFirstMakefile

3) A makefile may contain targets, that allow you to run specific sets of actions.  To execute a specific target, use the command:
make <name of target>
For example…

make install

4) Error - "missing separator. Stop."

This basically means “syntax error”, and appears when make is unable to parse the specified line of your makefile. A common reason for this error is a section of the command script that has been indented with spaces instead of a TAB character. A simple fix to try, is to press TAB at the start of the highlighted line.

Note: Each command line must begin with a TAB character.

5) Error"commands commence before first target. Stop."

I experienced this error when I accidentally placed a TAB character in front of a non-command line. In such a case, make will usually interpret the following text as a command. If the erroneous TAB is recognized as a syntax error, the error above will be displayed.

Leave a Comment :, , ,

Lotus Symphony: How to disable/undo automatic corrections

by on Mar.01, 2012, under Word Processing

Two questions:

1) How do I undo or disable automatic typing corrections?

By default, IBM Lotus Symphony automatically corrects common typing errors while you type. For example, abotu will be changed to about, or the first letter of a sentence will automatically be capitalized.  To quickly undo an automatic correction, press Ctrl+Z.

To turn off these features completely, go to Tools -> Instant Changes in the menu-bar, and deselect the While Typing option.

2) How do I disable date formatting in tables?

By default, a date that you enter into a table is automatically formatted based on the regional settings specified by your operating system.  So, for example, a European user may see a date changed from 2012/03/01 to 01/03/12.

To disable this formatting, right-click a table cell and deselect the Number Recognition option.

Leave a Comment :, , , , , ,

How to find the most frequent text value in a spreadsheet column

by on Mar.01, 2012, under Spreadsheets

Here’s a compact solution to find the single most frequent value:

=INDEX(A2:A6,MODE(MATCH(A2:A6,A2:A6,0)))

If entered into cell A1, this will display the value that appears most frequently in the range A2:A6 (see column A below).

Note: In a situation where more than one value appears equal-highest, the value that was counted last will be provided as the result (see column B above).

Leave a Comment :, , , , , ,

Eclipse: Workspace Unavailable

by on Mar.10, 2011, under Computers

Eclipse isn’t known for it’s helpful error messages at the best of times – and here’s one example… “Workspace in use or cannot be created, choose a different one.”

Unfortunately, Eclipse doesn’t offer any suggestions on how to fix this, so some manual searching was required. Here is what worked for me:

  1. Remove the workspace lock:
    • close Eclipse – and go to the .metadata folder in your workspace, e.g. C:\workspace\.metadata.
    • delete the .lock file in this folder.
    • in some cases you may be prevented from deleting the .lock file (see error message below). If this is the case, move to Step 2.
  2. End the Javaw process:
    • open Task Manager, and end the process javaw.exe.
    • return to the metadata folder, and delete the lock file.
    • restart Eclipse.

Eclipse should now open your workspace correctly.

2 Comments :, ,

Viewing Unread Messages Quickly in Gmail

by on Dec.06, 2010, under Internet

One of the most regular complaints about Gmail is the difficulty in quickly viewing your unread messages. The simplest solution is to do the following:

1) In the Search bar at the top, enter one of the following:

label:unread
or
is:unread

2) Click on “Search Mail”. You will now be presented with all of your unread emails.

However, at times when I really need to access my unread mail quickly, I often forget these commands – and have to search online for them – which defeats the whole purpose of saving time. So here’s a method of creating a permanent link to your unread messages – that you can then access with one mouse-click.

1) Go to Settings -> Labs, and enable the “Quick Links” feature.

2) You will now see a new “Quick Links” menu on the left-hand side of the screen (above “Invite a friend”).

3) Follow the same “Search Mail” steps above… then, with the unread messages on screen, select “Add a Quick Link” in the new menu.

4) Save the Quick Link as “Unread Messages” (or whatever you prefer) and you now have one-click access to all unread mail.

Leave a Comment :,

Ant Errors: “Error starting modern compiler”

by on Sep.14, 2010, under Code Monkey

In my case, this error appeared when I attempted to run an Ant script through Eclipse, that was designed to compile Java classes and package them into a ZIP file.

BUILD FAILED
%my XML file%: Error starting modern compiler

This problem can arise in different development environments, and for different reasons – though generally these reasons are all related – the version of Java being used by the compiler does not match that already loaded by the VM, or being referred to in JAVA_HOME.

To solve this in Eclipse, I first went to Run > External Tools > External Tools Configurations … and accessed the JRE tab.

The next step, change from “Run in the same JRE as the workspace” to specifying a “Separate JRE”:

However, this change still resulted in the “modern compiler” error being displayed. The final step? Despite the prompt asking for a separate JRE – it is in fact the JDK that needs to be selected:

And voila – you should now see these happy words…

BUILD SUCCESSFUL

11 Comments :, , , ,

Java Errors: “UnsupportedClassVersionError…bad major version at offset=x”

by on Sep.09, 2010, under Code Monkey

In my case, this error appeared when I attempted to load a class from a batch file in the Windows command prompt.

“Caused by: java.lang.UnsupportedClassVersionError: (*myclassname*) bad major version at offset=6”

This error indicates that your projects were compiled with a higher level Java compiler than the runtime can support.

Firstly, confirm what version of Java is installed on your machine. In Windows, open a command prompt window and enter the following command:

java -version

The output will look something like:

java version "1.5.0_22"
Java(TM) SE Runtime Environment (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)

This message confirmed that my runtime environment was Java 5 – but error above was stating the classes had been compiled in Java 6. The next step is to check what version of Java is being used to compile your project. In my case, I was using Eclipse.

Go to Window > Preferences > Java > Installed JREs and make sure your 5.0 runtime shows up in the list and is checked. If nothing suitable appears in the list of options, then you need to download the correct Java version from the Sun website.

Finally, go to Window->Preferences->Java->Compiler and ensure that your Compiler compliance level is set to 1.5.

2 Comments :, , ,

How To Rename a Series of Files (MS Windows XP)

by on Jan.28, 2010, under Computers

I’m amazed that I never knew about Windows XP’s built-in function to rename a series of files.  It’s limited (with other available applications giving you more control over the renaming style), but it’s fast and easy.

  1. Open My Computer/Windows Explorer to the folder containing the files you want to rename.
  2. Select the group of files that you wish to rename.
  3. Right-click on the first file in the list and choose Rename from the menu options.
  4. Type a new name for the file…
    • Note that the first file will change to the name you type, while all other selected files will append a number enclosed in brackets to this name.
    • For example, if you typed ‘file.jpg’, the rest of the files will change to ‘file (1).jpg’, ‘file (2).jpg’, etc.
    • When sorting by name, the unnumbered file will sort to the bottom of the list.   To avoid this, include the starting number in the name you type, e.g. ‘mynewfile (1).jpg’.  The numbers for the other files will continue from this number.  Remember to include the space and brackets.
Leave a Comment :,

Keyboard layout shenanigans (MS Windows)

by on Jul.01, 2009, under Computers

Every now and then, I used to suffer the problem of having my keyboard layout change seemingly for no reason. For example, my @ key would change to Shift+2 instead of Shift+’ – and vice versa with the ” key.

I’ve now figured out that the problem has been my keyboard layout changing language (in my case, from “Irish” to “US”). Turns out the keyboard shortcut to change your input language is LeftAlt+Shift, which I must have been pressing by mistake. So all I had to do was press this combination again to restore my keyboard to the way I knew and loved. It’s easy when you know how!

If you need to check a) what input languages are installed for your computer, and b) what your shortcut is for switching between these languages – then go here:

Control Panel -> Regional & Language Options -> Languages -> Details -> Settings -> Key Settings

(csd2ikmze9)

Leave a Comment :, , ,

Killing ActiveX warnings when developing…

by on May.20, 2009, under Code Monkey, Internet

If, like me, you’re sick to the back teeth of IE blocking your attempts to debug your own apps with it’s ActiveX filter – here’s how to stop it.

Note: This is for running locally off your machine – it should still block the ‘evil’ websites perfectly fine.

- In IE 7, go to Tools->Internet Options->Advanced

- Scroll down to ‘Security’ in the Settings pane

- Tick the box next to “Allow active content to run in files on My Computer”

Now run/debug your project once more (e.g. from Eclipse), and it should work fine!

Leave a Comment :, ,

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!