Search This Blog

Thursday, July 3, 2014

VirtualBox - OSGEO Live - and MacOSX

I've been trying to get the shared folders to work on a Mac running Mavericks and VirtualBox hosting OSGEO Live VM.

The issues was getting the latest kernel headers... the answer is here... many thanks to Andrew Kirkpatrick for the solution.

http://www.andrew-kirkpatrick.com/2011/12/virtualbox-guest-additions-with-shared-folders-on-mac-os-x/


---- text copied from Andrew Kirkpatrick's Site as a backup -----

1
2
3
sudo mkdir /dev/dvd
sudo mount /dev/dvd1 /mnt/dvd/
cd /mnt/dvd
Then you should see VBoxLinuxAdditions in that directory, which you need to run as per the manual. If the above doesn’t work it might be because your DVD drive in VirtualBox is called something else, like dvd (instead of dvd1) which probably differs depending on which distro you’re using.
Then you need to run the installer.
?
1
sudo sh ./VBoxLinuxAdditions.run
Once that’s done you can restart.
?
1
sudo reboot now
Everything should be finished now installation/configuration-wise, but you might encounter some problems… (otherwise skip to Mount the host folder)

Kernel header problems

I got some missing kernel header problems when trying to install Guest Additions, which if building the main Guest Additions module fails will be logged.
?
1
cat /var/log/vboxadd-install.log
If you see something like this…
?
1
2
3
Error! Your kernel headers for kernel 2.6.35-28-generic cannot be found at
/lib/modules/2.6.35-28-generic/build or 
/lib/modules/2.6.35-28-generic/source.
?
1
2
You can use the --kernelsourcedir option to tell DKMS where it's located,
or you could install the linux-headers-2.6.35-28-generic package.
So you can do just that!
--------

Note: to find out which headers you need type this...
uname -a

--------
?
1
2
sudo apt-get install linux-headers-2.6.35-28-generic
sudo ./VBoxLinuxAdditions.run
Hopefully this should install now (although the XFree86 bit will fail, assuming you’re using the command-line) and you may need to restart the VM, although I’m not sure.

Mount the host folder

You can create the host folder in the VirtualBox Manager in the Shared Folders tab on the Settings for that VM. If you add it on the command-line it’ll appear under the machine folders anyways. If you want to type it though, here’s what you’d type into the Mac OS X terminal (note this is the only thing that you’d type into the host itself)
?
1
2
VBoxManage sharedfolder add "my-ubuntu-vm" \
--name "websites" --hostpath "/Users/andrew/pizza"
To mount the Shared Folder from within the guest, the instructions from Ubuntu (as my guest is Ubuntu, although I think this is a better way to mount it anyways) were very useful.
?
1
2
3
4
5
sharename="whatever.you.want.to.call.it";
sudo mkdir /mnt/$sharename \
sudo chmod 777 /mnt/$sharename \
sudo mount -t vboxsf -o uid=1000,gid=1000 $sharename /mnt/$sharename \
ln -s /mnt/$sharename $HOME/Desktop/$sharename


Saturday, May 17, 2014

Eclipse - ADT needs update

Once again needed to do an update for Android SDK in Eclipse…. then Eclipse wouldnt start saying the ADT needed updating… couldn’t remember how… thankfully Stackoverflow to the rescue….

http://stackoverflow.com/questions/15105730/when-i-load-adt-why-do-i-receive-the-error-the-android-sdk-requires-android-dev

 

For some reason ADT (Eclipse) won't pick up on the fact that it does in fact need to be updated. Since the built in tools for updating are failing you you'll have to work around them. On the Help menu instead of selecting Check for Updates instead pick Install New Software (so Help > Install New Software).

On the Available Software screen in the Work With dropdown provide:
https://dl-ssl.google.com/android/eclipse/ if it's not already available. You should see a list of options including Developer Tools. Check everything that you want to update. In the list of checkboxes below uncheck "Contact all update sites during install to find required software."

 

Monday, May 12, 2014

Computer languages and processing speed

 

Interesting article… link =>   Some Languages are Faster

 

Snippets

“JIT compilation is typically faster than traditional interpreting. However, it generally can't compete with conventional ahead-of-time compilation. AOT compilation can be slow, with compilers spending considerable time to optimize the code to the best of their ability. They can afford to do this because nobody is actually waiting for the compilation to take place. JIT compilation, however, happens at runtime, with a user waiting at the keyboard for the program to actually run. This limits the time that can be spent optimizing. Techniques such as performing additional optimization on a background thread and making use of modern multicore processors can go some way toward closing this gap.

In principle, JIT compilation can offer performance benefits over conventional compilation. A conventionally compiled program generally has to be quite conservative in some ways. Microsoft can't easily compile Windows to, for example, take advantage of the latest AVX instructions found in newer Intel and AMD processors, because Windows has to run on processors that don't support AVX. A JIT compiler, however, knows exactly the hardware it will be used on, and so can take maximal advantage of it.”

- - - - - - - -

 

“Another common technique is the use of bytecode. Bytecode-based platforms, including Java and .NET, have a traditional compilation process, but instead of generating executable machine code, the compiler generates bytecode, a kind of machine code designed not for real hardware, but for an idealized virtual machine. This bytecode can then be interpreted or JIT compiled when the program is actually run.

Generally, the performance of these bytecode systems is somewhere between interpreted ones and compiled ones. The bytecode is easier to JIT compile and optimize at runtime, giving an advantage over interpreters, but it still doesn't enable the same optimization effort as the compiler.”

- - - - - - - -

“Technically, the use of a compiler or an interpreter is not a property of the language itself. There are various projects that, for example, create interpreters for C, a language that's traditionally compiled. JavaScript has gone from simple interpreters to complex JIT compilers to get better performance.”

- - - - - - - -

“C++ is essentially always going to be compiled ahead of time. So too is Fortran. C# and Java are almost always going to be compiled to bytecode and then JIT compiled at runtime. Python and Ruby are almost always going to be interpreted. This tends to create a performance hierarchy: C++ and Fortran are faster than Java and C#, which in turn are faster than Python and Ruby.”

Wednesday, April 30, 2014

Bayes’ Theorem

Find the probability of A occurring given that B occurs.
image
Use a tree diagram to work out the probabilities.
image
Multiply when going deeper into a tree…
Add when combining separate branches….
So probability of getting a Q would be…
P(Q) = (1/3) . (1/2)    +   (2/3) . (1/4)   = 1/6 + 1 / 6 = 1/3

Example from patrickJMT
https://www.youtube.com/watch?v=j2tNxIaGpR4




Tuesday, February 11, 2014

DARPA open source

http://www.darpa.mil/OpenCatalog/index.html

The DARPA Open Catalog contains two tables:

The Software Table lists performers with one row per piece of software. Each piece of software has a link to an external project page, as well as a link to the code repository for the project. The software categories are listed; in the case of XDATA, they are Analytics, Visualization and Infrastructure. A description of the project is followed by the applicable software license. Finally, each entry has a link to the publications from each team's software entry.

The Publications Table contains author(s), title, and links to peer-reviewed articles related to specific DARPA programs.

Open data tools


http://civic.io/2014/01/15/5-essential-open-data-tools/

has a great list of tools... here is what they say....

5 Essential Open Data Tools

Every data wrangler has their own list of favorites – the go to tools that they use when they need to work with data. If you need to clean, transform, or mashup data or if you are working with a data set that will form the basis for an application, here is a list of tools that can make life easier for you.

OpenRefine – I don’t think there is a better tool for cleaning messy data than OpenRefine. One of my favorite features is the ability to add new columns to a data set based on data in an external web service.

jq – I see a lot of JSON in my job, and its exceptionally easy to use JSON data with a tool like this one. For example, here is a simple jq recipe for extracting a list of licensed pawn shops in Philadelphia to a CSV file.

csvkit – CSV is another format I see almost everyday, and using csvkit makes it simple. My favorite utility – though I don’t use it often – is csvsql. use this handy utility to generate SQL insert statements and easily create a relational database from a CSV file.

Unix shell – jq and csvkit are both command line tools, and the Unix shell is the place where I spend a lot of time working with data. Without getting into a Windows vs. *nix war, there is simply no better collection of utilities for working with text files than those that can accessed via the shell. Tools like curl, grep, sed, awk, cut and a host of others are enormously useful on their own, or in combination with tools like jq and csvkit.

CartoDB – pretty much the easiest way to create a web-based map from an open data set. There’s even an API for building apps on top of the data you have in your CartoDB account. Enough said.

"

Tactile Map for the Blind

A new map for Inverleith Park which is designed to be used by visually impaired and sighted people.