The best way to ensure that you have a solid handle on the core concepts is to read the manual (cue grizzled developer in worn out khakis and "RTFM" t-shirt.)
If you are the 2% that will dutifully read the documentation before embarking on your first adventure, the latest release can be found here: Julia Manual.
If however, you are in the 98% of people that throw caution to the wind, then try this excellent site: Learn julia in Y Minutes.
That should get you comfortable with the julia repl in a short time frame.
Once you get going, the manual is great for clarifying behavior or finding ways to accomplish your goals.
I also recommend checking out DataFrames. For those that have experience with R, you are most likely familiar with the concept. However, I'd suspect that this is new to many developers coming from java or c#. Don't want to read the book? Then grab some popcorn and watch the movie.
For those inquisitive souls that really want to know how things work under the hood, the source code should be available in your home directory: ~/.julia/PackageName/src
[substitute the desired package name e.g. DataFrames]
Julia for the Common Developer
Monday, January 13, 2014
Installation and Configuration: VM Player, Ubuntu, and Julia
Below are the steps I used to quickly load and configure:
- an Ubuntu VM on Windows
- emacs and mysql
- julia and ODBC
- an Ubuntu VM on Windows
- emacs and mysql
- julia and ODBC
Good luck!
- Download free vmplayer: https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0
- Download the ubuntu iso: http://www.ubuntu.com/download/desktop/questions?distro=desktop&bits=64&release=lts
- Install the vmplayer following the prompts.
- Start the player and create a new vm using the downloaded ubuntu .iso.
- Adjust hard disk size and memory for VM as desired.
- Say yes to pop up on VMWare linux specific tools. They are handy.
- You be asked to enter some information about your vm. Name, user, password, etc.
- Once the install is complete, log in to your new linux box.
- Click on the Update Manager on the left side navigation buttons. Choose to install all the updates. You will need to enter your password for authentication.
- After the updates are finished, open a terminal window (Press the windows key to bring up the dash, type terminal, and then hit Enter.)
- Install git:
- Note: Use Ctrl-Shift-V to paste into the terminal
- sudo apt-get install git-core
- Install julia:
- sudo add-apt-repository ppa:staticfloat/julianightlies
- sudo add-apt-repository ppa:staticfloat/julia-deps
- sudo apt-get update
- sudo apt-get install julia
- Type julia and you should see the julia greeting :)
- Optional: Install Emacs 24 and ESS with julia mode
- sudo add-apt-repository ppa:cassou/emacs
- sudo apt-get update
- sudo apt-get purge emacs emacs-snapshot-common emacs-snapshot-bin-common emacs-snapshot emacs-snapshot-el emacs-snapshot-gtk emacs23 emacs23-bin-common emacs23-common emacs23-el emacs23-nox emacs23-lucid auctex apel emacs24 emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs-el
- sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
- from https://github.com/emacs-ess/ESS/wiki/Julia:
- Make a directory somewhere for ess then change into that directory. In the next step a directory called ESS will be created for you.
- git clone git://github.com/emacs-ess/ESS.git
- cd ESS
- git pull
- make all
- For me it failed on making the documentation, but when opening a jl file within emacs gave me the desired syntax highlighting. That's good enough for me.
- add the following line to your ~/.emacs file to allow for julia mode:
- (load "~/your_dir_to/ESS/lisp/ess-site")
- (setq inferior-julia-program-name "/usr/bin/julia-basic")
- Optional: Install MySQL and ODBC connectivity
- sudo apt-get install mysql-server
- You will be asked to pick a password for the mysql root user
- Optional: Add Time zones to MySQL
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -p**** mysql
- Configure odbc
- sudo apt-get install unixodbc
- sudo apt-get install libmyodbc
- edit the /etc/odbcinst.ini file: sudo gedit /etc/odbcinst.ini
- add the following, save, and exit:
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1
- from the command line run: odbcinst -q -d
- It should return [MySQL]
- Next edit the /etc/odbc.ini file: sudo gedit /etc/odbc.ini
- replace **** with the password you used when installing MySQL
[mysql-connector]
Description = MySQL connection to hist database
Driver = MySQL
Database = mysql
Server = localhost
UserName = root
Password = ****
Port = 3306
Socket = /var/run/mysqld/mysqld.sock
- save and exit the file editor
- check for connectivity on the command line: isql -v mysql-connector root ****
- If you do not receive a "Connected!" message and an SQL> prompt, then check the previous steps to ensure you didn't miss something.
- Press ctrl-D or type quit to exit.
- start julia by typing: julia
- Add the DataFrames and ODBC packages:
- Pkg.add("DataFrames")
- Pkg.add("ODBC")
- Test for a connection:
- using ODBC
- ODBC.connect("mysql-connector", usr="root", pwd="****")
- query("show databases;")
32 bit installations
- If your computer doesn't support a 64 bit operating system there are a few changes:
- Download the appropriate 32 bit vmplayer
- Download the 32 bit Ubuntu iso
- For ODBC, the odbcinst.ini file should have these lines:
- Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.soSetup = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so
For more information check out http://julialang.org and the great community at:
Why Julia? And what do you mean by "Common Developer"?
Since my first days of programming in Fortran and VB for DOS, I've been on the hunt for an elusive quarry. Some might call it the grail. I simply call it a "language that is fun to work with and doesn't make my life a tedious hell."
I want language that allows me to solve problems quickly and without uncalled for verbosity. I don't want a thousand configuration files. I want to choose to declare variable types, or not, as I see fit. I want the ability to easily group data into records/objects. I want responsive I/O and easy database connectivity. I like the idea of macros and dynamic code generation but still code in my comfortable imperative style. Lastly, I want clean and simple syntax.
Oh, one more thing, I need all of those things above, but my programs have to run quickly.
Some might argue that all of those things are available in language abc that has been around since the 1980's or that the latest generation of language xyz gets you almost all of those features plus more. The point of this post is not to kindle the flames of a language war (I mean really, aren't you all tired of that yet?). If you are reading this, I'm assuming that you have an open mind and haven't already decided that there can't possibly be a language that has better features than your current favorite. If that is not a correct assumption, then please do us all a favor and quietly move on.
After years of switching from language to language, I think that I have stumbled onto a winner: Julia. It has all of those features I mentioned. I'm not going to recap the information available on their site. They say it much better than I would. I will simply say that I've coded a couple thousand lines over the last month or so and it was fun. Truth be told there is a bit of a learning curve, but once over a couple hurdles things are working very well for me.
As for the "common developer" comment, it is not meant to be condescending. I'm a business application developer, so I am talking about me. Julia is designed for the scientific computing community. Looking on the forums you'll see the PhD computer scientists and mathematicians. To be honest, most of the time I have no idea what the hell they are talking about. But that's ok, because what I do know is that julia is going to help me become more efficient with my work and eliminate/reduce much of the boring work that I dread.
My goal with this blog is to capture the things I've learned to handle every day common developer tasks. I hope that you find it useful.
Interested in giving julia a shot in a clean, confined environment? Try following the instructions on my next post to install a vm from start to finish. If it turns out that julia is not your cup of tea you can simply delete the vm.
I want language that allows me to solve problems quickly and without uncalled for verbosity. I don't want a thousand configuration files. I want to choose to declare variable types, or not, as I see fit. I want the ability to easily group data into records/objects. I want responsive I/O and easy database connectivity. I like the idea of macros and dynamic code generation but still code in my comfortable imperative style. Lastly, I want clean and simple syntax.
Oh, one more thing, I need all of those things above, but my programs have to run quickly.
Some might argue that all of those things are available in language abc that has been around since the 1980's or that the latest generation of language xyz gets you almost all of those features plus more. The point of this post is not to kindle the flames of a language war (I mean really, aren't you all tired of that yet?). If you are reading this, I'm assuming that you have an open mind and haven't already decided that there can't possibly be a language that has better features than your current favorite. If that is not a correct assumption, then please do us all a favor and quietly move on.
After years of switching from language to language, I think that I have stumbled onto a winner: Julia. It has all of those features I mentioned. I'm not going to recap the information available on their site. They say it much better than I would. I will simply say that I've coded a couple thousand lines over the last month or so and it was fun. Truth be told there is a bit of a learning curve, but once over a couple hurdles things are working very well for me.
As for the "common developer" comment, it is not meant to be condescending. I'm a business application developer, so I am talking about me. Julia is designed for the scientific computing community. Looking on the forums you'll see the PhD computer scientists and mathematicians. To be honest, most of the time I have no idea what the hell they are talking about. But that's ok, because what I do know is that julia is going to help me become more efficient with my work and eliminate/reduce much of the boring work that I dread.
My goal with this blog is to capture the things I've learned to handle every day common developer tasks. I hope that you find it useful.
Interested in giving julia a shot in a clean, confined environment? Try following the instructions on my next post to install a vm from start to finish. If it turns out that julia is not your cup of tea you can simply delete the vm.
Subscribe to:
Comments (Atom)