New programming language itch

I have recently been interested in exploring a new programming language…Go and Rust. But now that I again see a future in Julia. I think it will scratch that itch…for a while anyway. I used it enough to be productive with it, but not enough to call myself much more than a beginner.

My log reports that I first started using Julia in August 2018. But as of today when I use the search button…that post doesn’t show up. The first entry, that does show up is in October 2018…2 months later…strange! There were actually another 5+ posts I did, that really showed my excitement at discovering Julia. It’s a WordPress bug because I’ve seen others mention it…even 3 years ago.

It seems to be a language heavily aimed at math and data science, however I like/use it for general programming. It has a very Python like feel about it. And yet…for me anyway (probably not others) Julia works in a way that make more sense. I won’t rehash everything I’ve already said. But at the top of the list is array indexing and the way slices work.

Julia & VS Code

Found some odd behavior. I usually press F5 (because I’m lazy) to run my programs…and if I made no errors they seem to run fine. However the startup seems slow. Anyhoo because I’ve been working with Jupyter Notebooks a lot lately, out of force of habit I pressed <Shift><Enter> and the program ran very fast. This is not documented in the Run menu. However <Ctrl><F5> which says Run Without Debugging…is! So I thought perhaps <Shift><Enter> is an undocumented way to do <Ctrl><F5>…except!

When I press <Ctrl><F5> which says Run Without Debugging I get a message that begins “Warning: Package VSCodeDebugger does not have SQLite in its dependencies:”. Why do I get a message about debugging when I’m trying to Run Without Debugging?

And I don’t get this message when I try and run with debugging.

The best answer is probably that this extension is version 0.17.1.

More on Julia and SQLite

While I’m excited to get back into Julia, I think I should take it slow with any program using the SQLite package. A quote I always liked kept popping up in my head overnight… Those who cannot remember the past are condemned to repeat it – George Santayana. And if history has shown me anything it is I can’t rely on this package not to break down the road.

So yesterday I was finally, once again, to able to do basic SQLite activities…connect to the database, perform a SQL select and retrieve rows, in a very basic program. I will hold back for a while doing anything meaningful using SQLite in Julia and continue using Python3 for that purpose.

Besides my most meaningful Julia/SQLite program to date was my generate fake random customer data program. Which at the time was a rewrite on my Python program and proved much faster. However as I returned to Python 3 and found the mimesis package, I no longer feel the need to persue speed increases using Julia.

So…for a while as each new version of Julia comes out, I will run this basic SQLite program as a test, until I feel a sense of stability.

I should mention, at the time of this post…
Julia is version 1.4.2 and SQLite.VERSION reports the same…version 1.4.2

Julia and SQLite

Spent some well used time looking at Julia docs on SQLite. I wish I could say I just read the docs and knew exactly what to do. The docs did help but a lot of playing (trial and error) was just as important to finally get a working Julia/SQLite program. However my history with this module isn’t very good. Of course in hindsight it doesn’t look too hard. But I never did find a small working program which would have made everything much simpler, just pieces of code that wasn’t obvious how to connect. I mean in a mere 30 lines of code I have the necessary pieces to accomplish a lot using Julia/SQLite. Although I think playing with pandas and dataframes in Python helped me get a better perspective to using it in Julia, because Julia also uses dataframes. My goal was simply to get it to work so I don’t understand everything I did following some examples I saw in the docs, for example…

df=DBInterface.execute(db::SQLite.DB, sql::String) |> DataFrame

“|> DataFrame”…what the heck?

I mean it’s not hard to infer. But the syntax is strange to me.

I took about a 9 month break from Julia, kind of excited to start working with it again.

Udemy course…small complaint

I like the instructor…but! I notice in teaching a subject he will often place multiple commands in one cell. For example at around 2:18 in lecture “82. Filter A DataFrame with the query method” he starts talking about the df.query() method but he continues adding two more df.query() in the same cell. My question was…

In your this video you stack 3 queries in the same cell. I assume Jupyter Notebooks is only executing the last query, because the other 2 don’t display. True? However throughout the course you stack other commands together that clearly get executed together. Would you elaborate?

He responded (I added bolding)

Jupyter Notebook will execute all the content in the cell when it is run.

But it will only visually output the final expression in a cell.

So if we execute a cell like this:

1 + 1
2 + 2
3 + 3

6 will be output. The other calculations will still take place (they just won’t be visually output).

I wanted to say (but I didn’t)…

OKā€¦thanks. So for teaching on small datasets it’s fine. But it’s probably better to run some commands in different cells especially when working with large data sets. You mentioned pandas working with tens of millions of records early in the course. If you do 3 df.query() in the same cell then the 1st 2 are needlessly using computer resources. For example I tried something you taught earlier in the course, on a large dataset and it was noticeably much slower than other operations I tried on the same dataset, it may have been pd.to_datetime()?


Like I said for teaching on small datasets it’s fine. My problem, and it’s a small one, is he will frequently stack commands like this, in one cell. However I don’t ever remember him saying it’s bad practice. Either put a command in a new cell or delete or comment out the previous commands. Now if an assignment was made to a variable for those queries, and in this case it wasn’t, then perhaps the intent was to use those queries later for further analysis!

Manjaro…time to switch?

I started this latest Manjaro journey last December, so it’s been 6 months. Linux Mint has been my primary distro for many years and I still like it. But I’ve been looking for a reliable backup distro for years. According to my log I first tried Manjaro back in 2014. Then I’d have a major problem and try a few other distros without satisfaction, then I’d return to try Manjaro again. I’ve said before…Manjaro was a distro I wanted to like. So now I find myself using Manjaro, more than Mint. So perhaps it’s time to switch my primary/backup distro!

Later that day…Rust fixed?

I bit the bullet and uninstalled Rust by pacman then reinstalled using the rust suggested curl method. After reinstall kate seemed to be working, I didn’t try after pacman uninstall. After I saw the message “Rust is installed now. Great!” I didn’t really read the end of install instructions. Just started VS Code again and it didn’t work. So went back to read the end of install instructions, and found I had to add the following to the .bashrc file…
export PATH=”$PATH:~/Mystuff/Go:$HOME/.cargo/env
source $HOME/.cargo/env

Still didn’t quite work until I uninstalled/re-installed the VS Code rust extension. Seems to be working now!

However when I rebooted, VS Code was crawling. So naturally I assumed it was rust related. But apparently it was a coincidence because there was a CPU hog (baloo-file) causing the problem. Which is apparently some type of file indexer. I believe I ran across this before. It showed up at the next boot also. CPU went back to normal after a few minutes.

Rust

Wanted to play with Rust so installed via the pamac GUI. Successfully wrote simple Hello World program. Then autocomplete stopped working. I would type pr and it would only suggest print and not println! Tried a few more project type things and it reported rustup wasn’t available, so back to pamac to install that. Anyway after doing that VS Code reported other failures. So I thought I’d just uninstall all things rust and reinstall the way the rust web page suggests using curl which actually installs rust by installing rustup. However when returning to pamac, it only shows rustup installed and not rust however rustc is still on my system. The rust package which much larger (300+MB) than rustup (7MB), and is implied by pamac to not be installed because where it once offered the option to remove it now the button says Install. Anyway further attempts to remove rust is met with a warning to the effect that kate relies on rust. Really? I just installed this package yesterday and kate has been working. At this point my head is spinning from all the confusing messages and a proper rust installation with my Manjaro/rust skills, seems impossible.

Kate is only a simple text editor, but one that I use often, still if it’s the only causality of war, I could survive so maybe I’ll go ahead and uninstall. And hope when I install rust the rust suggested way, kate will work!?!?

But it’s late Sunday and I hesitate because I’m working on a few things, and I don’t want to deal with odd system behavior right now. I assume my Python virtual environments will continue to work if I have to do a reinstall. Because everything is local…right?

Then again I have a Clonezilla Manjaro root partition backup from June 20th. Looks like anaconda and jupyter-notebook are installed locally so hopefully I’ll be OK there. That would help.

Perhaps will need to reinstall go and gnome-keyring?

So after evaluating the situation. My plan is…

Remove rust
Install rust using the curl method
See if kate works
See if rust works in VS Code

If anything looks funky…
Restore Clonezilla backup from ~3 weeks ago.
Reinstall anything missing