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.

Learning Strategies

I was up late last night contemplating what I’ve been learning and what I aim to learn, which I want to blog about. But first, a vignette:

Yesterday a technical lead from Microsoft added me as a connection on Linkedin. I have no idea why, and we don’t have any connections through other people. I suppose my company has a big name, that’s all I can possibly think of. This girl has a seriously bad ass profile. Graduated from a top Ivy League school, has held positions at Apple and IBM, and she doesn’t waste her time listing stupid languages on her skills list. Instead there are items such as “Architecture” and “Leadership” and other categories. I’d long suspected my listing of individual languages was an amateurish approach, and I know I’m right. Basically, this girl could kick my ass. Not that that’s a bad thing, but it really makes me feel like a weenie programmer.

Ok, so, here’s a short rundown of some of the books on my shelf. I’m making progress through Learning Python, Database Design for Mere Mortals, Python Algorithms, Pro Oracle Spatial, C# 6.0 and the .NET 4.6 Framework, Head First Design Patterns, and I haven’t touched it in awhile but The Web Application Hacker’s Handbook. Books on the shelf I hope to read after these include Pro ASP.NET Core MVC, Xamarin Mobile Application Development, Beginning SOLID Principles and Design Patterns for ASP.NET Development, A Smarter Way to Learn jQuery, and a few others.

Now, here’s the problem. I haven’t been writing much code lately. I started the Project Euler problems with Python, and I know I still need to fix my XML Formatter, but in general the only code I have written has been at work. This is great but I didn’t get many chances to write code at my previous job, but I’m not writing enough, and I have got to get better at algorithms. But I love reading books. I love the feeling of progress, and the proof as I watch the book mark snake its way down through the pages. But I also know that reading a book is not the same as learning.

I have always had a complicated relationship with books. It’s a love-hate relationship. I love reading books, but I hate how long they take to read, and I hate the pressure of having them sitting over me, waiting to be read. That pressure was very real last night. They have the distinct disadvantage of being – quite naturally – verbose. They tend not to get down to the main point. I love having the big picture, and that’s why I read them, but especially with Database Design for Mere Mortals, for example, I find myself slogging through cruft just to find the meaningful information.

I have always wanted to master the things I set out to learn, and this has also been a huge hindrance. An old supervisor advised me not learn regular expressions thoroughly because he said I could always look the information up again later, but I resented this advice because I really wanted to master regular expressions. I’m a poor polyglot programmer, I’d really much rather master what I know, but this may get me into serious trouble later in my career. Again, that Microsoft technical lead doesn’t highlight many languages at all because she knows languages aren’t the point.

So what am I doing? I’m so focused on reading these books cover-to-cover that I’m not leaving myself with any room to write code. This could be a deadly mistake.

I’m not sure exactly where this post is going, but I am actively reassessing how I approach learning. I have largely resented the explosion of Javascript frameworks because I fear learning a new one would require too much effort. But a friend has been learning Node.js over the past several weeks and hasn’t bought a single book for it. What am I so worried about? Regardless, Python is my favorite language so my motivation to master it goes beyond my career, though I’m very fortunate to now have a job primarily using Python. I will keep going with all my Python material for sure. But I may want to rethink whether I need a 1000 page book on Core MVC. I’ve already elected to donate away my CSS3 and Visual Basic books. Honestly, I’m not going to read a book on CSS3, I know 80% of everything in there, and I’ve done enough C# that a book on VB is completely unnecessary given my access to Google.

Anyway, thanks to my new connection, I’m reminded that it’s best not to waste my time and to get down to business. I’ve owned the perspective of exclusively relying on books for a long time now, so changing may be difficult.

Clean Code

I’m almost finished reading “Clean Code” by Robert Martin. I was expecting it to revolutionize my understanding of programming, but in the end it really didn’t. As one reviewer on Amazon noted, it’s better off being called “Clean Java”. If you make it past the arrogance, you may decide to skip the parts on JUnit, EJB, and refactoring (which is really just one giant Java program with textual comments).

l learned a lot from the sections on functions, classes, and comments. The best thing you can get from the book, however, is a better understanding that there are competing standards, and your are better off knowing what they are and why they are there.

Just writing code is not enough. There is so much to it. Not considering the customer side of things, you should probably know design patterns, data structures and algorithms, application architecture, general coding best-practices, multi-threading and concurrency, application security, test-driven development and automated unit tests, and IDE features and frameworks. This is on top of knowing several languages thoroughly, writing code in your free time, contributing to open-source projects, and have good social and customer service skills.

It’s no wonder that nobody really knows how to codify programmers. And Computer Science programs still make you spend a lot of time learning Calculus III. As a developer who loves to learn, I’m not sure how long it will take me to learn all of these. It’s mind blowing that I came across so many companies recently who wanted to hire somebody who had skills in all or most of these areas with less than five years of experience! Ok, so two people said the concurrency could slide, but still.

This is also perhaps the only industry that expects you to have “passion” and wants to see you coding outside of work. I understand how that can be a valuable indicator of your performance on the job-we don’t want Jimmy typing on a screen all day if he hates doing it at home-but the fact that it has become an expectation is disturbing.

As much as I love learning, I can’t fit all of that in right now. Learning takes time, even when you can pick things up quickly. That’s something I get to prove on the job here soon. I do like the idea of tradecraft, that there is a good way to write code and some best practices that can help you really stand out as a professional. But I can’t say I trust that from any one developer, no matter how famous of a company he’s worked for, and a lot of those companies are churning out bloated pigs branded as software.

Speaking of, I had a Windows process max out a brand new Intel i7 processor the other day, and I cannot imagine what sort of trash caused that to happen under the coverts.

Push on, keep fighting! I have way too many books, but it is worth it!

The Year of Ambition

The past three months have really done a number on me. I didn’t mention it in my last post, but I had planned to make it half-way through a book on Oracle Spatial before I started my new job this week, and only covered a fraction of my goal. Last week I felt the exhaustion of all this study weigh-in, and crashed into a “theory-only” book routine. Everyone needs rest. Cheers.

Finding the time to read in the evenings has been difficult. I have more programming books than I’ve ever had before, and probably more projects than I can handle. Tonight I enjoyed a pizza and some Best Damn and have been picking at Clean Code as I try to recover from a very busy week. There is no rest in reading when you get slapped in the face by concurrent programming, a realm I had to confess to knowing nothing about during several interviews. The list of things I don’t know continues to grow, and it’s depressing after having knocked out so many other subjects. But I’m not giving up.

The message is clear: there’s no getting comfortable this time around. Last time, what I was doing was so uninteresting that I let it affect my enthusiasm for all things code. This work is a lot more interesting, so there are no excuses! At work I’m learning how our product interacts with CAD, and I’m hoping very soon to start writing Python code for it. I got a chance to look at some existing programs today. What is so awesome is that this feels like a challenge that is above me just enough that I know I can hit it if I work hard, but I will have work. They’re counting on me to learn this system quickly and start producing, and I don’t want to let them down.

I also bought five books during the Apress sale two weeks ago, so uh, there’s plenty more to read. And I decided I wanted to cover Design Patterns this month. I’m probably out of my mind.

Most sobering is that I’m going to be building an intranet inventory system for an ethical manufacturing company in Nepal over the next six months. I’ve never built a full-stack application before, so while it gives me a chance to do just that, it also means that looking at screenshots of their existing system caused me to nearly crap myself. To be fair, there’s far more shiny-looking WYSIWYG functionality for desktop applications than there is for web applications, but I hadn’t even thought about print options and icons. But I have to stay frosty. I’m putting some serious thought into the database, which is the most important piece, and if I know what’s good for me, I’ll focus on that first before worrying about what’s next. Let’s just say I get the chance to learn. Or grow. Like my last post. Whatever.

You could call it the fire. Or the funk. There’s that piece of me that won’t be satisfied until I’ve got this down. I can do this. No slacking, no giving up. Do well at work, earn my place in the industry. Do well on this inventory system, help companies hire and empower the marginalized. These are good motivations.