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…’

Advertisements

Jesu, Joy of Man’s Desiring

Something you may not know about me is that I am working to learn how to play piano. My motivations are many: I’ve always envied people who could, I once believed I couldn’t and want to prove myself wrong, and I want my kids to see me working hard at learning and not fall into the lie of “either you’re good at it, or you’re not.”

Recently, my family has started passing around videos of us working at our music, and I thought I would share the video I made. Watching it was good (but painful) for me, and I’m thinking of making more videos. A Christmas concert?

Recognize your power

This is the second in my continuing series of reflections on the chapters in The Obstacle is the Way. Fun follow-up on post one: the day after that, I buckled down and took on the goals I bullet-listed in that post and felt much more productive for it. Let’s hope the reflections continue to help.


Choose not to be harmed–and you won’t feel harmed. Don’t feel harmed–and you haven’t been.

That quote from Marcus Aurelius opens the chapter and basically sums it up: we can choose what things mean to us, and how we react to them.

The chapter includes several ‘inspiring’ stories of adversity, people either unjustly imprisoned or, in the case of Laura Ingalls Wilder, in Kansas… And the point that Ryan Holiday makes is that they all chose what the experience meant to them, and how they were going to react to it.

This is one of the lines I liked a lot, because it made the person in question (Rubin “Hurricane” Carter) seem more… well, more like a person I could emulate:

Was he angry about what happened? Of course. He was furious. But understanding that anger was not constructive, he refused to rage.

I like it for the differentiation between ‘anger’ and ‘rage,’ and because of the acknowledgement that it’s okay to be angry, but not okay to lose control of yourself. Until I read that, I saw Rubin Carter as some titan who was able to be unjustly imprisoned and be unaffected by it. That line suggests that he was affected, but he chose the effect. And that is what it’s about.

That idea is summarized by a few lines towards the end of the (very short) chapter:

…As for us, we face things that are not nearly as intimidating, and then we promptly decide we’re screwed.

This is how obstacles become obstacles.

In other words, through our perception of events, we are complicit in the creation–as well as the destruction–of every one of our obstacles.

The point: you get to choose if you’re getting screwed, or if your education took an unexpected turn.

In my life…

I’m not going to lie, I was eager to return to this exercise because reflecting on the first chapter seemed so helpful to me. It seemed immediately applicable to my life.

This chapter didn’t seem that way, at first.

I’m not facing some insurmountable obstacle in my coding or teaching. There’s work to do, and I need to buckle down and do it, but I feel like I’m on track to getting it done the way I want to. (You know what that means.)

However, I realized that I often choose to feel the victim in my private life. There’s another family event in my in-law’s family, we’re ‘required’ to go. My wife has chosen to repaint various rooms and I’m ‘harangued’ into helping her.

Poor me.

(No joke, I can get pretty self-pitying about these breaches of my own sovereignty.)

But, I don’t refuse to attend the family event, I don’t refuse to help my wife, I just feel sorry for myself, expend a lot of negative psychic energy, and reduce the quality of the day I’m having.

And I can do better.

After all, that’s my power.

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.

The Discipline of Perception

After reading the Obstacle is the Way, by Ryan Holiday, I recently resolved to re-read it more slowly, writing about what I read in order to reflect. This is part of that, and may only be of interest to me.


 

The first story in the Obstacle is the Way is of John D. Rockefeller, and the education he gave himself — basically — by remaining level-headed in times of panic. The lesson seems to be that there cna be a financial panic happening around you, but if you choose to see it as an education, that’s what it is.

My favorite line from the chapter is actually from Warren Buffet, who is credited with summing up Rockefeller’s mentality this way: “be fearful when others are greedy and be greedy when others are fearful.”

The actual lesson of the chapter seems best summed up here:

Outward appearances are deceptive. What’s within them, beneath them is what matters.

We can learn to perceive things differently, to cut through the illusions that others believe or fear. We can stop seeing the “problems” in front of us as problems. We can focus on what things really are.

This comes at a good time. In fact, I’m several weeks late in writing this. I’ve been working as hard as I can on the dynamic-efl worksheet app and consistently feel as though I’m almost there.

I’m so very almost there that I’m getting lazy. There is a (growing) list of minor things that I want to fix, once I get it so far that I can start asking others to take it for a test drive. But, it’s getting harder and harder to reach that point, because I didn’t do something I should have: I hard-coded everything to use the new domain name.

That means that it’s almost impossible to run in development mode on my notebook, and everything has to be tested out on the website. No big deal, really, except that everything is slowed down by committing every minor change to GIT, pushing it to Git Hub, and then pulling it to the Linode server and restarting the uwsgi service. Gah, it’s frustrating. (And that frustration is part of why the list of things I’m going to fix ‘later’ is growing.)

The reason I thought to read this now was that it was just this afternoon that I realized “I could be using this as an opportunity to practice overcoming problems, rather than feeling sorry for myself.” And that’s what this could be. Should be.

There are all kinds of lessons that I should focus on learning:

  • using django’s url tags to avoid hard-coding anything at all
  • setting up a project so that it can be easily changed over to ‘production settings’ with only a few changes in the settings
  • serving static files with django (turns out just copying a template from startbootstrap.com is not enough to make a landing page)

And that is what I’m going to try to do. There isn’t really a rush, as long as I can use it to make my own worksheets.

The trick is not seeing what it looks like, it’s seeing what it is.

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.