Robin's Blog
A remote-sensing PhD student talking about interesting things…
Show MenuHide Menu

Category Archives: Computer Help

How to: Solve the ‘Ctrl-Space (auto-complete) not working’ problem in Eclipse

November 15, 2011

This problem is known by various names such as:

  • Ctrl-Space doesn’t do anything in Eclipse!
  • Why can’t I get auto-complete to work properly in Eclipse?
  • I’ve just set up a new University computer and things don’t work like they do on my laptop (maybe that one’s just me…)

It’s actually very simple to solve, but the problem is actually nothing to do with Eclipse. First of all, let’s see what the problem is:

You’ve just installed Eclipse, are starting to do some programming in it, and want to use the very handy auto-complete feature. So, you type part of a function name and press Ctrl-Space, waiting for the magic to work and the rest of the name to be automatically typed….but it doesn’t happen!

In the image above (which unfortunately doesn’t include the cursor) I had typed ST, and pressed Ctrl-Space to autocomplete it but nothing happened.

When trying to fix this myself, I went in to the Eclipse options (Windows->Preferences, then General->Keys) and tried to find the command for auto-complete. Helpfully, it’s not called autocomplete or anything like that – it’s called Content Assist. This showed me that, as I expected, Content Assist was assigned to Ctrl-Space:

So why wasn’t Eclipse picking this up? I tried setting the key for Content Assist manually, but when I deleted the text in the key binding box and pressed Ctrl-Space, it showed that only Ctrl registered – somehow the spacebar press was being ‘eaten up’ by something else. What could it be?

The simple answer is: the Windows language services utility – obvious really! This seems to be set by default (at least some of the time) to switch between languages by using Ctrl-Space. On my personal computer I only have one language set up (English (UK)), but on the university computers there are loads – French, German, Italian, Chinese (simplified) etc. You can find out what languages you have set up by going to Control Panel -> Region and Language -> Keyboards and Languages (tab) and then Change Keyboards (again, how obvious…). You’ll see a list of languages installed – remove any that you don’t want (click the language and then click the Remove button) until you only have the ones you want left. That fixed it for me, but you can also check the Advanced Key Settings tab to make sure that none of the keyboard shortcuts that are set include Ctrl-Space.

Once you’ve done that, Ctrl-Space should work nicely

How to: Fix a network printer suddenly showing as offline in Windows Vista

July 3, 2011

You may find, as I have done recently, that a network printer installed on a Windows Vista starts suddenly showing as Offline even when other machines on the network can access it fine. I originally thought it would be an IP address issue, but it turned out not to be anything to do with that. In fact, the solution was far simpler – but also slightly strange…

It turns out that Windows Vista automatically enables SNMP support for networked printers, and if it can’t get a response to a SNMP message then it assumes the printer is offline. SNMP stands for Simple Network Management Protocol and is a way of getting information from network devices (such as routers, servers and printers), mainly for the purposes of finding out if there are any problems with the devices. A number of networked printers implement SNMP, and will respond to SNMP queries with information, but some don’t. My printer (a fairly old Lexmark T640) is one of the ones that doesn’t implement it – so of course Vista will never get a response to a SNMP message. The result of which is that the printer will start showing as offline at a seemingly random time because Vista has just sent a SNMP message to it, and it hasn’t responded.

Thankfully there is a simple way to fix this – and it just involves telling Vista not to try and communicate with the printer via SNMP. Simply right-click on the printer in the Printers window, choose the Ports tab, and select Configure Port. At the bottom you will see a checkbox saying something like SNMP Status Enable. Untick that, and the printer should start showing as online again.

(Update: If this doesn’t work, then try the method described in Coxy’s comment, below)

Why I hate my Toshiba laptop

May 23, 2011

List of installed software on a Toshiba laptop

I think that screenshot is enough really, but just to give a few more pieces of information:

  • In the screenshot above you can see twenty-one separate pieces of software whose name starts with TOSHIBA. These are 21 different pieces of software which were supplied, by Toshiba, as part of the original build of the machine. I suspect the majority of them run at startup, although I haven’t fully investigated that.
  • Many of the pieces of software seem not to be very important or useful – for example TOSHIBA ReelTime? What is that? Or TOSHIBA Online Product Information – since when has anyone used anything like that? As for what on earth TOSHIA Value Added Package is, I don’t know, but I suspect it isn’t adding much value to my use of the computer!
  • As well as the software above (nicely screenshotable (yes, that is a word) because they’re all next to each other in the list), the laptop came with a number of other applications including: Bing Toolbar, Ebay, TRORMLauncher (seems to be something else from Toshiba) and a number of others.

I wanted a computer to use – not a computer filled with junk like this. I think the best thing to do is probably to wipe the machine and reinstall a clean system, but I should not have to do that with a new computer. If any computer manufacturers are reading this (unlikely, but possible) then please stop doing this.

(For the record, I was given this computer under a university scheme, I did not purchase it myself – if I had I wouldn’t have gone for a Toshiba!)

An ode to PDFs (and PDFs as a first class filetype)

May 20, 2011

Ahhh PDFs…., or more formally, Portable Document Format files. I remember the days when I thought that PDFs were only for instruction manuals downloaded from the internet, or electronic copies of things that you don’t want people to be able to alter. Not so – I have recently discovered the joys of PDFs, particularly through my use of Mac OS X. I will explain more below:

1. PDFs are a vector filetype. That means that when there is text in a PDF document it is stored as text, with details of the font, size and location. When there is a line in a PDF document it is stored as a line from one location to another, with details of colour, width etc. This has a number of benefits – principally that PDFs maintain their quality no matter how much you zoom into them. You never get the horrible pixelated look that you can get with raster graphics files (such as JPEG and PNG). For scientific documents this is great – it means I can generate a graph, and then with one file I can produce an A3 sized copy for use in a poster and a 6″ x 4″ copy for inclusion in the paper. Not only that, but the 6″ x 4″ copy actually looks good – it looks professional, clean and high quality. Recently I had to include a PNG graph in a LaTeX document that I was writing – I hated it, all of the lines were blurry, I couldn’t resize it and it generally looked un-professional. Of course, I’m not suggesting you should store your holiday snaps as PDFs – that’s not what they’re designed for – but for diagrams, graphs and other technical drawings they are perfect.

2. PDFs are cross platform. Nearly every system can read PDFs these days. The standard is now open (ISO 32000-1). There are readers for Windows, Linux, OS X, Android, iOS, Palm, BSD, BeOS – you name it, it’ll probably have a PDF reader. Google Chrome even has a built-in reader these days – and many websites have stopped saying “This is a PDF file. If you don’t have a program to view them please download Adobe Reader”.

3. PDFs can be included in LaTeX documents extremely easily. Yes, I know you can include PNG files just as easily, and possibly it’s even easier to use PostScript files (although who doesn’t use PdfTex these days?). As mentioned above, raster files for graphs just look horrible, particularly when included in a LaTeX document in which (as is nearly always the case with LaTeX) all of the rest of the design and typography is near-perfect.

4. PDFs do not have to be A4 sized (or Letter, for those in the US). I know – I didn’t realise this until very recently, but you can crop PDFs to any size. In fact, there is a great perl script called pdfcrop which will crop a PDF file to the minimum bounding rectangle of the contents – taking your A4-sized PDF with a 6″ x 4″ graph in it down to a 6″ x 4″ PDF – perfect for inclusion in a LaTeX document, for example.

5. PDFs can be annotated easily. For example, as the text in a PDF document is stored as text, it can be selected just like text in a word processor, and then highlighted just as easily. Of course you can also add extra text or vector illustrations (such as circles around important features in a diagram). This is great for making notes on, and highlighting papers, articles and e-books.

6. PDFs are a first class filetype in OS X. I never knew how much I’d value this until I started using OS X. By default so many things are PDF. For example, PDF export is built into the standard OS X print dialog box. On Windows you’d have to install something like CutePDF to do that – but OS X does it by default. In fact, if you use the Print Preview function in the print dialog box, OS X simply prints to a PDF and shows you the PDF in the aptly-named Preview application. In fact, this application – which can display almost any graphical filetype – is also a powerful PDF editor. Using Preview you can re-order PDF pages, merge PDFs, annotate PDFs and crop PDFs. PDFs are a first class filetype in other ways too – all Spotlight searching by default searches within text in PDF files, and there is a separate section in the Spotlight dropdown for PDF files. Overall, Apple just seem to ‘get’ PDF.

How to: Consolidate your internet presence

April 29, 2011

Recently I took a while to try and simplify and consolidate my online presence. I thought it was an appropriate time to do this, as I had just bought a domain name (rtwilson.com), where I was hosting my academic website (www.rtwilson.com/academic) and my blog (which is what you’re reading now!). I thought it’d be useful to document the steps I took:

Stage 1: Create a new, clean identity

I will assume here that you have a good, sensible email address that you are likely to keep for a long time. If you don’t, then I’d recommend buying a domain name and getting a sensible email. This will the email that you use for all web-based communications and accounts.

The tasks below basically involve setting up accounts on major cross-site platforms, and ensuring they have sensible details, images etc. You may want to find an appropriate photo of yourself, or some other photo that you don’t mind representing you on the internet.

1. Create a Gravatar account with that email, and give it a sensible photo. In case you don’t know, Gravatar is a system used by a number of websites, blogs etc. to provide an image to go with your account. It’s all linked through your email, and is very simple to set up – simply go to the Gravatar signup page and follow the instructions.

2. Create an OpenID account. You may already have one of these – check here to see what account you may already have that has an OpenID associated with it. If you don’t have one, either set one up through a dedicated provider like MyOpenID, or link one to your domain.

3. Clean up and configure your Google account. You probably want to update your Google Profile with a sensible image and some sensible information.

Stage 2: Remove old accounts/identities and link them to new ones

This is a little more difficult – but just because you have to remember where you have accounts. Some of these accounts you may wish to close (Bebo, MySpace etc), but some you’ll want to keep and associate with your new email address.

This may involve simply changing the email address of your account and updating details (photo, profile etc) or removing an account and creating a new one. You will find that a number of sites will now let you link your account through OpenID or to your Google Profile, and loads of sites will pick up your avatar from Gravatar. A list of sites you might want to check is below:

  • Bebo
  • MySpace
  • Yahoo
  • Delicious
  • StackExchange sites (StackOverflow, SuperUser etc)
  • Blogging accounts
  • Flickr
  • YouTube
  • Wikipedia
  • Forums
  • Reddit
  • Hacker News
  • LinkedIn

Stage 3: Update as necessary

Last but not least – keep an eye on your profiles on these sites. Update them when they need updating – I found a site which still said I was at school – and make sure photos (if you are using them) are at least vaguely up-to-date.

(If you liked this, you might enjoy my other how-to’s and my book reviews)

How to: Fix ArcGIS 9.3 Licensing Error 96,7 – Valid name, but no record

February 14, 2011

I spent part of today struggling with an undergraduate student to get our university-provided ArcGIS dongle licenses to work. In the spirit of sharing our hard work with the rest of the world, the solution below may be of use to people. The error that we got which were fixed by this solution are listed below, but it may be worth checking this solution anyway, as the licensing errors given by ArcGIS don’t always seem to have much relation to the actual problem.

FLEXnet Licensing error:-96,7.  System Error: 11004 "WinSock: Valid name, but no record (NO_ADDRESS)"

We also found that the ArcGIS License Manager service would not start correctly – it would attempt to start and then stop immediately. When getting this error I originally thought that it meant that the name of the license server (that is, the name of the local machine) was not properly set in the ArcGIS Desktop Administrator application, but it turned out that it was set correctly there. After much Googling and trial and error I found that the license file looked a bit like this:

--------------
START_LICENSE
SERVER xxx ESRI_SENTINEL_KEY=37135503 27004
VENDOR ARCGIS
FEATURE ARC/INFO       ARCGIS 9.0 30-aug-2011
......

In the extract above you can see the SERVER xxx bit. I turns out that the xxx needs to be replaced with the name of the server. This is normally done by systems administrators for networked license servers, but if you are using a dongle you may need to do it yourself. Simple change SERVER xxx to SERVER TheNameOfYourComputer, and the license manager service should start properly and you should be able to run ArcGIS.

Please let me know (by the comments below) if this works for you. Beware that it is unlikely to work for ArcGIS 10.0, as I believe the licensing model has changed.

Git + DTerm = Great Source Control in OS X

January 22, 2011

Git is my favourite version control system (see Why is Git better than X for some good comparisons with other tools, and my GitHub repositories to see what I’ve been doing with it lately). I now use it for all of my programming projects, and many of my writing projects (as I’m now using LaTeX for nearly all of these).

DTerm is a simple utility for OS X which provides a drop-down Terminal in the Finder. The best way to explain it is with a screenshot (see below). When in any Finder window, press Cmd-Shift-Enter, and the DTerm dialog will pop up. You can type any terminal command in the box, and it will run it in that folder, or you can press Apple-Enter to open a full terminal at this folder and run the command.

Screenshot of DTerm running GIt commands

The combination of the two gives what is, for me, the best way to do source control in OSX. I simply use DTerm for all (or most of) my git needs. When I realise I need to get some code into source control, a simple git init in DTerm starts a repository, ready for me to do whatever I want with, and then I just commit using git commit -am "Blah" in DTerm. Simple, fast and all the power of the command-line.

(I must state that I do use GitX (a Git GUI for OS X) sometimes, particularly for viewing commit logs and branch diagrams)

How to: Fix problem where EndNote only shows the EndNote Web toolbar in Word

December 2, 2010

I should probably first state that I’m writing this a few days after I fixed this problem, so I may have some of the details wrong. Apologies if that is the case. Now, on to the problem:

Problem

You have EndNote and Microsoft Word 2010 installed. When loading Microsoft Word the EndNote tab that normally appears has been replaced with a tab labelled EndNote Web. When clicking on this tab you get asked to login to EndNote Web, and cannot access any references you have stored in your local EndNote library.

Solution

The solution to your problem depends exactly how badly things have gone wrong. Try the following steps in order:

1. Change EndNote Cite-While-You-Write (Cwyw) Settings: Go to the EndNote Web tab in Word and click the Preferences button. Go to the Application tab and look for the Application dropdown. Use this to select EndNote rather than EndNote Web. Once you’ve changed this, restart Word and it should work. However, you may have found that the Application dropdown is greyed out and can’t be changed. If so, go to step 2.

2. Remove EndNote Cwyw add-in and reinstall: Go to the File menu on the left of the tab bar and select Options and then the Add-Ins option on the left. You should see a list of Active Application Add-ins, in which there will be a number of EndNote related items. To remove these, select COM Add-ins in the dropdown box at the bottom, and then click Go. Select each of the EndNote-related items in the list and click Remove. Repeat this for all other items in the dropdown box so everything related to EndNote has been removed. Now the Cwyw functionality should have been completely removed from Word, so you can now re-enable it. The EndNote X4 Configuration Wizard (accessed through Configure EndNote in the Start Menu) has an option to enable EndNote in Word 2007, but not for Word 2010. Therefore, the only way I have found to re-enable EndNote in Word is to reinstall EndNote. Do that now (but make sure Word is closed first!), and then restart Word and it should work. If not, go to Step 3.

3. Remove every trace of EndNote from all of Word’s folders and then reinstall: I have found that EndNote seems to hide things away everywhere it possibly can, which makes it very difficult to be sure you’ve removed everything. To make this easier, I would download a copy of the Everything utility and search for “cwyw”. You will get a number of results, including folders, .dll files and .dot and .dotm files. Delete all of the .dot and .dotm files. Then reinstall EndNote and, hopefully, everything will work!

How to: Fix sudden VPN problem in Vista

August 23, 2010

Well, I’ve finally solved a problem that I’ve been struggling with for days. On Friday my VPN connection to the University of Southampton was working fine, and then on Saturday it wouldn’t work. At that point, I assumed it was a problem at the university and waited until this morning to contact their IT support department. After a number of telephone calls we established that it was a problem with my computer, as other computers in my house could connect to the VPN fine. At this point they marked the issue as resolved and told me that I’d have to investigate it myself – which, although frustrating, I could understand.

While trying to solve this I did a lot of Google searches, and found a huge number of forum posts from people who were having VPN problems in Vista. Eventually, however, I found the result that helped me – and I’ve described the solution below.

Problem

Suddenly VPN connections in Vista stop working. When you try to connect to a VPN it sits for ages at the “Connecting to VPN” dialog, and then gives you Error 800 – VPN unreachable. However, even thought it says the VPN is unreachable, the VPN server can be pinged fine.

Solution

I eventually found a good solution on a forum (http://www.vistax64.com/vista-networking-sharing/112970-pptp-stopped-working.html). It involves running some commands on the command-line to uninstall and then reinstall the VPN drivers. So, firstly, open the command window (by clicking Start, typing cmd, and then pressing Enter) and type in the following lines, pressing enter after each one:

netcfg -u ms_l2tp
netcfg -u ms_pptp
netcfg -l %windir%\inf\netrast.inf -c p -i ms_pptp
netcfg -l %windir%\inf\netrast.inf -c p -i ms_l2tp

(that’s a lower-case letter L in the bottom two lines)

After running those commands, VPNs should be working again – hopefully! Let me know in the comments whether this works for you or not.