Things I Hate Less About Linux

I spent a good three hours yesterday fighting flash drives and my motherboard to perform a fresh install of Ubuntu 17.04. It didn’t want to connect to my router at first, and the windows were laggy, but those issues have now been fixed.

So what do I hate less about Linux? I can connect my phone! I can also play mp3s in Rhythmbox! Also, Ubuntu is scrapping Unity, so once they come out with Ubuntu 18 it won’t be installed by default, which is kind of handy because I always install Gnome instead, and it’s just nice to think I won’t have all sorts of extra Unity fragments cluttering my file system.

Anyway, it’s time to get back into Linux. I gave away my primary Windows box to the refugee family I used to volunteer with. They were pretty excited, so I’m happy about that. This leaves the Linux box and my Windows laptop, so simplicity wins the day. Now I’m going to get my Music folder ducks in a row.

Revisiting CSS

I write this for my own sanity.

I’m building the visual side of the website for my Nepali friends. I know how I want it to look, but getting it to look that way is the problem. Layouts in CSS2 were a nightmare, and although CSS3 has done much to remedy these problems, the new styles are only patchwork to fix a broken monster. But I’m making my way through.

I have a left-hand navigation. I want it to layer vertically. I have a right-hand content space. When both are <div>s, they layer vertically, when I want them to be side-by-side, left-by-right. What’s was going on? <div> elements have a default display of block, so they push everything else in their container below. The solution? Make each display: inline and float both left so they are side-by-side.

I use <ul> tags with <li>, <a>, and <span> tags inside. I use the spans for Bootstrap glyphicons. But the hover was not working on my <a> tags. What’s was going on? <a> elements display inline by default, meaning they make room for everything around them. Hence why the a:hover background-color was only affecting the text. The solution? Make the <a> elements display: block. I had to adjust some margins and paddings, but it worked out.

Oh my gosh! It’s brutal. I know flex-box can do some of this, but it is not recommended for the layout portion of web pages. But it’s starting to look pretty good! I’m pretty happy with my layout plans. I’ll get back to learning ADO as soon as I have something decent to show them. It’s been four months now, it’s always a good idea to give the “client” something tangible to demonstrate progress. It also means I’m learning more about CSS, and that’s is always good.

MVC Adventures Part 3

Oh, the horror! C# uses a lot of boilerplate. I reached the section where a connection through Entity Framework gets setup, and everything has fallen apart there.

I kinda feel like an idiot. There is so much to learn here. Not having had to write much OOP on the job, I sometimes find myself reeling from all the unexplained object references, but my brain is finally started to wrap itself around how to really use interfaces. There are so many rote configurations to memorize, it’s a very different beast from “understand what this program is doing” when it is written in the raw. What’s a DbContext? “Oh, don’t pay attention to that! We’re programmers, we just rely on abstraction!” I die a little inside every time I have to forgo the full explanation, but I suspect this is just inexperience. After all, Python hides most of the details, it just doesn’t feel that way.

I am learning! I feel much more at home in Visual Studio and with the files. I generally get what MVC is doing. And I would probably be surprised just how much progress I’ve made. I got a simple list to output in html using Razor, building the values off of a subset of the Product Categories for my inventory system. Sometimes I still feel tempted to switch to Django, but there are things I really enjoy about C# and it’s far more common. Never give up, never surrender!

PL/SQL Varray

For the first time since beginning my career in Software Development nearly 4 years ago, I have used a PL/SQL varray on the job.

You laugh! At my previous job, almost every data structure was abstracted from us, and we all know why. PL/SQL data structures are ugly, obtuse, and non-intuitive. I’ve been writing some database cleanup scripts and needed a way to store the values from a particular list that aren’t referenced by another table, and the varray fit the bill. Too bad I couldn’t write it in Python, which would have saved half the effort.

You know what’s even more insane? I built a PL/SQL table of records and it took me nearly half an hour to figure out that when you “index by” a variable of type ‘table’, you can’t use the extend() method on it, you simply assign values to any given table subscript.

It’s the small things in life.

Update 4/20/2017:

Fail. I actually was not able to use the Varray because you cannot use local collections in SQL statements in a PL/SQL block. Oracle architecture confuses me. I could have looped through the varray and inserted each item individually into a SQL statement, but I ended up using the PL/SQL table datatype instead. Maybe one day I’ll get to use the varray. I have, however, been able to learn a lot about associative arrays. It feels good to know about these things.

MVC Adventures Part 2

First off, one more thing I hate about Linux: when you need to copy some web files and all of your USB drives are somehow being mounted read-only, and you can’t format the USB you used to install the OS in the first place. It’s running dd right now, but even on a “tiny” 16GB drive, it’s taking forever.

Anyway, more MVC adventures. I’m really happy that the book I am reading, “Pro ASP.NET Core MVC”, actually dives into what all of the various extra folders mean in an MVC project. I haven’t covered everything yet, but I can skip NuGet altogether and just edit the project.json file manually. I actually figured out that a weird error I had occasionally seen was due to a mismatch in the versions of some of the dependencies. Sweet!

It’s a bit of slog right now. I’m frustrated I’m not learning MVC faster, but the combination of mild busyness and major laziness has produced a mediocre study ethic. I remember one of my past supervisors advising me to schedule my time not with some rigid pass/fail criteria but with a “here is my goal” criteria. So my goal is to put in 30 minutes every day. I don’t hit every day, but I have learned a lot more lately because of this. Tonight I decided to bite into the design of this new website I’m building because I used to love doing that. I would fight html and css for hours on end, and it’s why they are so second nature to me today. I need to be doing this with C# if I really want to get good at it.

Anyway, I set up bootstrap using Bower. It’s not hard by any means, but you haven’t done it until you’ve done it. Currently battling bootstrap trying to figure out why my easy sample is not working. I always want to read without writing any code, but that never works well. I hauled ass on that Lottery WPF application I built, learned a ton.

For what it’s worth, I bought “C Programming: A Modern Approach”. I’m worried I’m going to spread myself thin, but it’s my personal conviction that I can’t say I’m too serious about my profession until I know some C. I wouldn’t dare apply to that others, but I am curious to learn and am rather hard on myself. At the same time I need to know my current tools, I also need to expand my understanding of computers. It took me far too long to realize that logging into a database is basically interacting with an OS process/daemon, and I’m sad I don’t know exactly how those work.

MVC Adventures Part 1

I had just started to learn Asp Core MVC last fall, but my new job uses Python and PL/SQL so I haven’t touched MVC since. However, the time has come to start building the middle-tier for my friends in Nepal, so I’m diving back in.

I have to keep this short because it is definitely bedtime. I started a blank MVC project in Visual Studio and *gasp* forgot to check that little checkbox that pulls in the default MVC assemblies. So of course all my references in the Controller were off. Sane people would just scrap the project and start over, but I lack this desirable quality and decided to tough it out. That’s really the only way to learn, especially in systems like Visual Studio where you have training wheels Frankenstein’ed all up in your business. Point-n-click for WebForms just killed me, I just died inside, I had to blank-slate my way through every asp tag attribute before I felt I wasn’t a complete idiot with what I was doing. Anyway, after several headaches, I finally figured out that if I browse the offline packages in NuGet (what an idiotic name…), I could get Microsoft.AspNetCore.MVC installed, my references would resolve, and I could start the page with the debugger. Of course, I’m still missing tons of packages, and don’t know how to specifically get the Tools assembly from Microsoft.AspNetCore.Razor (I’m referencing another project that shows which packages are normally created when you check the checkbox), but hey, it doesn’t die.

And you want to know something fun? Currently, my page is not loading. But that doesn’t stop MVC from loading a page with nothing other than “Hello World!” in text on it. Somewhere deep in that system it is defaulting to that. Which is retarded because that defeats the entire purpose of doing “Hello World”. “Gee, you screwed up, so we’re going to tell it Hello World for you!” But if you couldn’t get it to work, that is failure, that is not “Hello, World!”

Ok, despite my frustrations, THAT IS HOW IT IS DONE!!! You can’t ever hope to really understand Visual Studio until you can bootstrap the defaults yourself. Ye-ah! Anyway, there will be a part 2.

Things I Hate About Linux

Now, let’s be clear. I don’t hate Linux. But there are some things that I hate about it.

  1. It refuses to transfer files to and from my Nexus phone.
  2. Rhythmbox does not work after a fresh install, at least not with mp3s, because mp3 is a “proprietary” format. I still haven’t gotten Rhymbox to work with mp3s. Or Banshee. But the default Ubuntu video players plays them just fine. Seriously?
  3. It doesn’t play nicely with your most basic wireless connectors. Or printers.
  4. It doesn’t play nicely with much of anything.

Now, these may seem like petty issues to many, but let me explain. When I built my first computer nearly three years ago, I built it specifically to be a Linux box. I built it to be awesome. I built it to be the center of all my computing. And, perhaps foolishly, I have always done the Ubuntu upgrades. My first install gave me a significant amount of grief installing QGIS, which had failed dependencies that I never did work out. I had to go in and change something with Aptitude and managed to hack it. This has been the case with all too many programs. More recently, the upgrade to Ubuntu 16 caused my Nexus phone to appear with lsusb, but absolutely no amount of google research gave me what I needed to transfer music from my computer to my phone. And remember, this computer was supposed to be my core for all computing.

For the longest time I thought I was really bad ass for using Linux. But as time wore on, my patience grew thin, as I always managed to encounter these incredibly obscure issues. Moreover, after the Ubuntu 16 upgrade, I started seeing checksums on every bootup, and no forums answers proved fruitful. It’s awful when it doesn’t ever feel like it’s working right. And my brain still has not figured out how to remember the file structure. It is in opt? Is it in lib? Is it in usr/lib? Nobody knows. I’m not saying Windows is better, but after so many years, I pretty much know exactly where to look for things in Windows.

Sigh. We can’t all be Unix amins. I’ve never written a legitimate Bash script and I can’t say I care to. At the same time, Linux leads me back into computer history, which I find exciting. It provides a world where I can load System Monitor and see that about 1/12 of my 12gb of ram is being used. It’s elegant in its own way, I suppose. I just feel like a dumb ass trying to get it to do “simple” things. Right now I’m mostly using Windows 10, and I hate where they’ve gone with their data mining and privacy concerns. But at least it works with minimal overhead. I’ll figure something out. Maybe I just need to ditch Ubuntu and try a different distro.