Category: Programming

The Road Ahead

As I look at my coding journey, I realize I’ve stagnated a bit. I mean, I’m super proud of the Dynamic Worksheets program, but, to be honest, I’ve moved away from coding.

Lately, the coding work that I do is realizing that something is broken, and then spending an afternoon mostly realizing that my code really does make no sense. And then, eventually, finding the problem and fixing it. It is not as rewarding as actually building the thing was.

And, it’s not for lack of ideas. Or, really, for lack of time (though discipline is a thing that needs to be trained and maintained). I’ve kinda reached a place where I’ve lost track of my next steps.

So, it might help to write through this.

Logical next steps for the worksheet site

I had really hoped that I’d have users for the site before the end of 2017. And, though I shared it with a few people, only one of them actually went through the steps of making worksheets.

So, if I set “making dynamic-efl.com a community of teachers who actually use it (in Germany, at least) to make their classes better,” what are the logical next steps?

Here are the things it makes sense to work on in 2018:

  • Establish a list of exactly which “behind the scenes” tools I want before I advertise, and make them.
  • Draft the series of “welcome emails” as well as “explainer videos” that users will be sent/invited to view with time.
  • Write out a plan for how I’ll approach the market, planning on times to ‘force’ written reflection on lessons learned.
  • Implement the plan.

I’m not going to lie. Most of those things feel more like work to me, than like the play that creating the site was. I look forward to having people use something that I made, and think it’s fair to say that it’s not fully finished until people use it and value it.

So, what are the things I’m excited about doing?

Logical coding goals for the near future

I have ideas for other projects. They meet the standards of “things I would like to use” and “things I think would make the world better.” The thing is, starting a new project seems so daunting now that I see how hard it is to get a project truly finished.

Nonetheless, there are things that I think I can do to get ready for the next project. More than one Code Newbie podcast has included a guest saying something like “there is tons of Javascript in the world that wouldn’t need to exist if people would only learn CSS.” So, as an ongoing project, it seems to make sense that I find a good course and learn CSS before I get around to learning Javascript.

There’s something I’ve meant to get done that isn’t especially sexy. I’d like to create a bunch of reusable Django boilerplate that I could use for basic user management with projects in the future. This is based on the fact that I think I did users badly in the dynamic-efl project.

Django includes a basic User model, but I found myself wanting a lot of other things (some of which I haven’t implemented, yet) like email verification links, something to automatically delete accounts that haven’t been verified or logged into in the last year. There’s more, and I should write it down.

So, put all that together, and it seems that it seems as though it would make sense for me to set the following coding goals in the near future:

  • Pick a CSS course and learn it. (Possibly, also Javascript)
  • Practice writing a Django app that can be re-used
  • Write out what I want the Eternal Customer Model (working title) to be and do
  • Code the Eternal Customer Model and, finally, use it in a project such as
  • The Latin drill program.

That gives me stuff to work on. Look for updates.

Advertisements

It’s easier to expand than to fix…

I feel like everything I learn about coding is already a well-known software truism. But, I wanted to report in on my progress with the EFL worksheet software by saying that it’s moved back to the top of the priorities list and I’m working on it, but slowly.

There was a bug where the gap fill sentences created for capitalized vocabulary (‘Baltic Sea’ and ‘Vienna’ are examples) didn’t work correctly.

I immediately realized that the code put the entire sentence into lowercase (with Python’s .lower() method) before looking for the word. No problem, I thought, I’ll just find where the word is searched for and have it search for the lowercase text of the word. Problem solved.

I genuinely thought that was something I could do quickly, by way of getting back into the coding game…

More than an hour later, I found the spot where I forgot the extra .lower() call and everything was fixed. But I needed a full hour to figure out where in my code that happened.

A full hour.

I’m discouraged that I had such a hard time finding my way through my own code.

Another project idea

While practicing piano today, I realized I needed to work on more scales. My hands just felt weak (and, yes, it was a weird thing to realize), so I thought “okay, what key is this in, I need to get the scale and fingerings for it.”

And then I realized something else. A real strength behind Simply Piano (at some point, I’ll write a full-fledged review) is the way it breaks complicated songs down into components and drills you on those parts, quickly and briefly.

“What I really need,” I thought, “is music notation software, and I’ll just start making those drills for the sheet music I’m working on.”

Then, because I’m in a sharing mode right now, I thought “that’d be a cool online resource: PDFs of sheet music, but with various drills and exercises attached.” The idea ballooned in my mind. Songs that are in G (like the one I was practicing) could be tagged, and automatically also include scales and chords arpeggios…

Now, I have a whole new project that I want to develop, abandoning the many others I have in the pipes.

I won’t, but I want to.

Updating the Interface

I have been busy, and frustrated, as I work on the worksheet generation app. And, unfortunately, I haven’t been adding new functionality or improving the existing functionality. At least, I haven’t been improving it from the point of view of how the worksheets are made. I’ve been working on how people make the worksheets.

This is what the app interface used to look like:

old-formattingIt really isn’t bad, it’s just very basic. I knew I’d change it at some point — I use this site more than anyone else, and I have an idea how I want it to look — but I wanted to focus on features.

Then, recently, I invited friends and colleagues to try the website out. And nobody seemed to understand what it did. I told them (in emails, in person) and they loved the idea, but the interface that seems obvious to me… well, it obviously isn’t.

I had an idea: I’ll make a sort of tour you take, before you can sign up, that will explain the functionality with screen-grabs. 

But, there are so many things on my plate, I know the chances of me making the same tour twice are not great. At least, not in the same year. So, logically, the interface should be changed.

CSS is hard!

The thing about CSS is this: you can  download templates (like I did for the landing page, from a great resource called Start Bootstrap), and I figured I could easily adapt the rest of my page to match it.

Wrong!

To be fair, I haven’t yet come across a CSS problem that, once I figured out how to articulate it correctly, didn’t have a clear answer somewhere. (Also, I love the resources provided by W3Schools, but hate their search functionality. Are they trying to make money there?) But, every step felt like an uphill battle.

Eventually, I got to a point where I was starting to be satisfied with the result.

Hosting static files on django is poorly explained!

I’m starting a list of things that were hard for me to learn about django, to eventually explain when I feel like I understand them. One thing would be the deployment to linode (remember that?) and another would be hosting static files.

After a lot of googling and basically blindly trying things, I’ve stumbled into a configuration that worked. But, for a while, it only worked on the linode site and not locally and I was too frustrated to change it. So, every change I made had to be pushed to the site to be tested, which was also frustrating.

Then, I got around to working out my development file hosting and was able to test changes more quickly (and without feeling like I’d have ‘broken’ the site just then when a friend would try to use it), but when I pushed my changes to the linode server, I realized that I’d broken hosting there!

Now, things seem to be working both locally and on the server, and I’m going to not play around with it. But, I have other projects cooking, and I’ll need to wrap my head around this.

So, what does it look like now?

Obviously, after all that drama, you’d expect something amazing, right? Well, it turns out that I can fix individual problems, but I don’t really have much of a vision of an overall design. So, while the layout is basically the same, the new formatting is something I’d rather spend my time looking at:

new-formatting

It has a title bar that remains fixed as you scroll, and functions are presented as buttons (because they seem to suggest action) and, rather than telling you “there is enough vocabulary to make a memory activity,” it simply doesn’t show you the option unless there is sufficient memory.

I can live with this for the rest of the academic year, I think. Now, I just have to clean up all the pages and make a tour, as well as finishing up my ‘minimum functionality…’

Preparing for Clowns, or what I learned from a Twitter-fight

The CodeNewbie chat last night was about dealing with bullies, and, since that dovetailed so well with what I’m working on right now, I thought I’d try to be a bit more active in blogging about what I’m doing.

You see, I think my app is 90% finished, but I’m taking a break from features to get ready for the public. Which, really, means, to get ready for the jerks. You see, the worksheet generation app isn’t a social app. The user’s interaction with it is basically all centered on the user and their own groups and classroom resources for their groups.

But, contributions are shared. That is to say, if you need a translation for the word ‘web app’ for one of your groups and there isn’t one in the system, the system just asks you for one. But then, the next guy profits by the translation you added. And you’re profiting from the resources added by others.

The Twitter Fight

But then, I got in a bit of a fight on Twitter. I’ll post sometime on the idea of ‘defending the ancestors,’ and why I don’t like the term ‘the ancestors’ being used as a dog-whistle for racism (racist dogs!) but that was what it was about. And it wasn’t nice.

While I’m a middle-child and can handle Internet strangers being mean to me, I realized that the guy I was fighting with had the advantage: his Twitter handle was only for his trolling. My Twitter handle connected to all my life, and he could see that, use it in a fight. And, because I tend to fear the worst, he could start being a jerk in other parts of my life.

I realized that, when I start posting about the worksheet generation app by name, with links, anybody who felt like they didn’t like me (and there have been a lot of those people in my life) could create a free account, and just throw a wrench in the works by adding terrible resources.

Imagine if a legitimate user — maybe even one paying for the service — wanted that aforementioned translation of ‘web app’ and got something like ‘where we see the naked photos of your mom.’ Even worse, what if that person — like I often do — didn’t proofread that worksheet before handing it out to students. (At some point, worksheets will be emailed with a mouse-click.) What a nightmare.

Worse than paranoia

I talked myself back down from “Twitter people will be mean.” After all, the solution could easily be ‘just charge everyone.’ Who’d pay me money for the privilege of trolling me?

Then I realized I shouldn’t worry about Twitter trolls making accounts and being jerks. I should worry about people just like me thinking that they’re being funny. Or, even worse, thinking that the resource they’re making is appropriate for their students. After all, we teach adults, whose to say that we can’t include “your mom” jokes?

My real  nightmare is someone either testing out the system, playing around, and putting random crap in… Just to see if it really appears in a worksheet.

Of course there’s a solution

I can deal with it. Of course I can. There’s not a problem without a solution.

My interim solution is, for now, giving users the opportunity to explicitly say “this is part of an inside joke with this group.” You can easily add resources that will only be used for a single group. Easy.

The other thing is pretty simple: all resources are immediately available to the person who creates it. Everything else has to be approved, first. As users are added, it will be possible to say “the resources added by user_x will be automatically available,” but, until then, it means that I’ve invested a lot of time already (all morning today was spent creating the interface and the backend that will enable this level of moderation) into the project of investing a lot of extra time in this project.

And that kinda stinks. It makes me like people, as a group, just a little bit less.

Hats of to Django Europe

Something I feel like I should add, as I seem to be live-blogging my situation right now, is that, when I was at my most frustrated last night I signed up for an account with djangoeurope.com, rationalizing that they promised a 30 money-back guarantee.

Today, I asked for the money back and without a whimper it was returned before the end of the day. Good on them.

Can’t say I’m not learning

I continue to be frustrated by whatever it is that is interfering with my rented Ubuntu server serving up my worksheet-generating django site. I’ve even come so far that I’ve written up my troubles in a Stackoverflow question.

While I’m decompressing, I thought I’d summarize some of what I’ve been learning. A lot of what I did felt like trying things wildly (Is this the right path? Maybe up a level?) and restarting services. Then, I took an answer to this question on Stackoverflow to heart:

You should try to invest a bit of time in understanding all the components involved. For example you have merged the .ini uWSGI file with nginx.conf that is completely wrong. I can suggest you to start from here: http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html

Try to understand every step (expecially the part about using official sources instead of distro packages). Start deploying without nginx (only uWSGI), and only after you are sure the thing is clear, you can proxy it behind nginx.

I went through the steps in the quickstart tutorial one at a time, writing a short Python program to do ‘hello world,’ and moving forward from there. It was helpful, and I have learned.

For example, I guess I never really thought about it before, but I think that uwsgi is the part of the whole thing that actually runs my code. I’ve certainly seen something like this often enough:

web browser <=> web server <=> wsgi <=> django code

And, to be honest, I never really thought about what ran my code. When you run the development server, it feels clear.

It looks like, whatever I’m doing wrong, I have the uwsgi service incorrectly configured, such that it can’t load my code. That’s obviously a problem. I just don’t know how to fix it (and I’m not even sure that I know it, this is all a question of me reading error logs, googling, reading answers to questions that are only similar to mine, and trying to extrapolate).

Still, in addition to beginning to wrap my head around wsgi, here are some things I’ve learned:

  • A few new console commands in linux, including ‘env,’ ‘useradd,’ and ‘nano’
  • Where some error files are stored ( /var/log/nginx/error.log — I can type that from memory)
  • How to use ‘sudo’ and ‘su’
  • Starting, stopping, and restarting services

There are some things I’d like to know more about, but my brain feels too melted to really absorb new information. They include:

  • How to uwsgi and nginx communicate via sockets? What does that mean? What is a socket file?
  • I only did the bare minimum of ‘hardening’ my server. How vulnerable is it? What are the chances that it will be attacked deliberately, or by someone just attacking every website in the hopes that one is vulnerable?
  • I’ve realized that all of the http://localhost:8000/…/ in my Django templates will need to be updated to use the domain name I bought. How do grown-up developers deal with this? How will I test things here ‘in development’ before sending it to ‘production.’ (I feel like a poser using those words).

So, yeah, I’m frustrated, but not so much that I’ve opened the red wine. (See my last post.) If I had a bottle open, however, I’d raise a glass to learning.