How and Where to Take a (PostgreSQL) Dump, or, When Documentation Lacks Detail

How and Where to Take a (PostgreSQL) Dump, or, When Documentation Lacks Detail

I’ve made crazy progress in the last couple of weeks. As a result of that, I’ve managed to get my grubby hands onto SQL and I’ve even wrestled with which database management system to use. I used Digital Oceans’ succinct article to settle on PostgreSQL.

Unfortunately, unlike the SQLite I’m a bit more familiar with, PostgreSQL databases (DB) don’t come in one handy portable file. I spent maybe a couple of hours poking around the PostgreSQL directory wondering where the DB was. Then I googled it and read some articles a bit more closely and figured out it’s more complicated than a single manifestation in a single locus.

So, using the vocabulary I had, I googled “how to export PostgreSQL database” and a couple of other variants related to it. Didn’t work. But at some point, I found out that you have to do a dump. That gets you a file you can move around. But not many were good at explaining it, or even the concept of it. Finally, I read the documentation here and thought, this should be easy. But once I’d done a pg_dump, I couldn’t find the file. I spent another couple of hours trying out various things.

Then, finally, finally, I YouTubed “postgresql dump” or something like that and found this silent video. I watched it carefully and realised that the dump is created in the directory from which I work in the command line. And that has not been mentioned in all the previous places I’d looked in, including the documentation. Maybe it’s obvious to experts. But beginners need something a bit more explicit.

The Aggravating Prong of Epistemology

The Aggravating Prong of Epistemology

You’ve heard of forks. What about prongs? Prongs are like forks, but with more, uh, prongs on them. Did that make you think Gnu? That totally made you think Gnu, didn’t it?

Anyway, there are two types of prongs. I don’t really want to name them like that because now it sounds so official. And I’m making this up on the fly but, well, there you go. Now it’ll be in your exams at the end of the semester. Stop groaning. If you’d done something simpler, like brain surgery or rocket science, you won’t be in this mess, would you? Serves you right.

So, there are two types of prongs, broadly speaking. In the first scenario, a prong happens when you want to learn something new, but unfortunately, that new thing is part of some ecology of knowledge. To understand it, you have to understand this other thing, and that other thing, and that other thing over there and there’s also that one by the window, and another one under the stairs, and there’s its brother-in-law and his dog in the kitchen will be the ones to bludgeon your brain with another right thick epistemological tree branch that you also need to understand to understand that one thing.

This will happen to you a lot as you move from the pure and liberating empty-headedness of not even having made the decision to learn to code to becoming a mess of a person at 3am in the morning deep in a morass of open tabs on every subject under the sun that could be remotely related to the English alphabet as you try your desperate and futile best to understand that one thing.

That’s the first scenario, for which I used to have examples but did not write them down. Oh well. They’ll surely pop up again.

The second scenario is similar. It happens when you want to find out What to Do Next. At this point, you’re a feckin’ noob with a soft skull and half a brain when it comes to programming. You may have been a stupendously magnificent diplomat and you stopped World War III by charming the pants and undies off the husband of a diplomat’s wife with your high-brow intellectual wit and sharp observance of his idiosyncratic cultural mores, but in this world of code, you are shit.

So what happens? You go to Google. But alas, you’re in Poland right now and the internet connection is– seriously, why is it so bad? This is Europe, isn’t it? I thought it’s supposed to be way better than this. What do you mean Eastern Europe is different?

All right, all right. We’re digressing way too much. Let’s move on. Google Chrome takes up too much resources so you open up Microsoft Edge and go with the default Bing to save time. Sigh.

The question of the day for me (I’m switching to me now. It’s not all about you.) was thus: I have made a sketch of a small app I think I can deal with. Now, what do I have to do to turn it into a Tinder or Instagram-like thing with users and such? Where do users go? Into a dictionary? I don’t know. I’m a noob.

So Bing gives you this:

How Can I Build an App Like Tinder

I read it and quickly isolate two things I need to learn next to make my app come alive: a backend, and RESTful API’s. Hang on to these two. They’re crucial to the plot. Like when Snyder’s Comedian died in Gotham and breathed, “Martha…”. That kind of important.

Before we move on, let me just say, none of the definitions of “API” I’ve seen have described it to me in sufficient clarity so that I understand it. I kind of gave up trying to figure out what it is. Maybe I’ll get a sort of instinctive embodied sense of it as I go along. Hopefully.

So, I think, right, I need a “back end”. What on earth is a “back end”? I toyed with Flask once. It worked kind of like WordPress, but it also looked like a Prestashop CMS. Is that a “back end”. I don’t know. I’m a noob. So I Bing “back end” and hit Wikipedia:

Front End and Back End on Wikipedia.

Too many words, so I return to Bing. Along with a tab for Firebase, a “back end” open from the Quora piece,  I open up the following:

Flask, a… framework? What’s a framework?

Flask on Wikipedia

I don’t get it. But, I have to move on. So I Bing something like “python back end for android app” because I’m most familiar with Python. Although I’m familiar with it in the same way Jem and Scout are familiar with Boo Radley. Wha-? What do you mean who? Do you guys not read books? Geez. Boo Radley!

Anyway, Binging that gives me these:

Creating a Web App From Scratch Using Python Flask and MySQL

Can I use some Python in the backend for an Android app?

Which is better for my back end needs: PHP or Python?

I want to develop a backend for an Android app. Which technology should I use?

Adding a database/backend to android applications [closed]

In one of these many links, “Node.js” is mentioned, and I’m currently learning JavaScript. Maybe that’s framework? I’ve always thought it’s a framework. But Node.js on Wikipedia says:

Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of tools and applications. Although Node.js is not a JavaScript framework…

What the hell is a runtime environment?! Wikipedia:

A runtime system, also called run-time system, primarily implements portions of an execution model. This is in contrast to the runtime lifecycle phase of a program, during which the runtime system is in operation. Most languages have some form of runtime system, which…

What the– What?!

Ok. All right. Take a deep breath. Don’t lose it. You’re doing fine. Just breathe. I’ve heard of ReactJS. Is that a framework or a runtime environment or a back end? Wikipedia:

React (sometimes styled React.js or ReactJS) is an open-source JavaScript library providing a view for data rendered as HTML.

It’s a LIBRARY?

*Defenestrates computer in frustration.*

I’ve also heard of AngularJS and I’d Bing it but I’d just thrown my computer out the window and someone’s probably dead four storeys down because that’s what happens when you hit people on the head with the weight of all that knowledge.

FUCK.

So, I go all the way back to the original Quora entry on how to build a Tinder-like app. Yes. That’s all I have. After twenty minutes of aggravating pronging, I learn nothing more than the fact that I still need to find out what back end to use and how to work with RESTful API’s. Notice, I am tired out enough not to bother looking for their definitions anymore. And that is what a prong does to you.

First Flounderings in the Real World

First Flounderings in the Real World

After driving through HTML, CSS, JavaScript, PHP, Responsive Design, and Information Design courses on Coursera, Udacity, and Code Academy, I knew I was ready to get super confused and flounder like a drowning rat in the real world. So yesterday, I came up with the brilliant idea of making a quote randomiser.

I calculated: index.html, CSS, and JS files. Just three files. The HTML file contains just the usual links to the CSS and JS files, and an element for the randomiser. That’s it. The JS file contains what I imagined to be a simple function to pick from an array of quotes. So simple. What could go wrong? Well, remember that time you wanted to have the computer open a program automatically at a specified time and you thought it would take 5 minutes but it took like 4 hours?

Three frustrating hours later, after tweaking a handful of functions I’d taken from elsewhere any which way I could, and on the verge of murdery activities, I discovered why they weren’t working. They were working! The problem was, I’d put the link to the JavaScript code in the head of index.html, just like many examples showed. Of course it’s not supposed to be there. Why would it be? Just as life, destiny, and the universe will it, it should be at the bottom, below </body>, and all the examples before were created by the Elders of the Internet solely to fuck with you.

Finally, I could turn my mind to other problems. Two aggravating hours later, I figured out that some of the code was JQuery, and I couldn’t use them without installing something? I’m not sure at this point, but I googled up strictly JavaScript alternatives and they finally worked.

Then I could work on the CSS, which wasn’t bad, just tedious. Changed sizes and colours and floated things left and right and, vitally, realised that I did not know what the standards for these things were. I was just making things up on the fly. I’m sure there are standards. Right? I have to return to Colleen Van Lent’s lectures and read up on conventions and other things.

In particular, I spent a lot of time trying to figure out how to make the background cycle through all the colours of the colour wheel. Apparently, that’s a tough one. Most tutorials tell you about how to cycle through just a few colours. At least I learn that. It was at this point that I found -webkit- codes. My first brush with it and it’s confusing. I kind of get what it is, but not really.

And then, because someone’s onclick function worked for him but didn’t work for me even though I’m very sure it should, I had to look into addEventListener, at which point I discovered that the fight between Netscape and Microsoft over event handling left us with and inconvenient piece of heritage: confusing events order. Naturally, I had to wonder why they couldn’t get their shit together. Anyway, I read the linked article, and I will likely forget it until it comes back to bite me on the behind.

I also learnt that document.getElementById() is different from document.getElementById().innerHTML. But I don’t know how and I don’t know when to use either, and tutorials and lectures don’t seem to explain the difference between them. I got by on trial and error on this one, and several other things. Not ideal.

Finally, the randomiser worked. And now, I wanted to go on to the next phase. I want users to input quotes. But, I need some sort of CMS. Something like Flask? So each user has his/her own account. The gap betwixt seems the length and breadth of Thanatos’ scythe. But, what with the Law of Diminishing Marginal Returns (that is, I got tired) setting in, I became more and more unwilling to research things properly and experiment. Next weekend then!

If this post is a bit confusing with too many irregular bits thrown in, that’s because it reflects what beginning programming feels like. You think the learning curve is linear, but more often than not, it turns into a bewildering mess in the blink of an eye.

Safe Spaces: Women, LGBTQIA+ & Noobs

Safe Spaces: Women, LGBTQIA+ & Noobs

I’ve been visiting hackerspaces and their kin in various cities for a while, and much as I love them, most of them have a few Very Big Problems:

  1. Sexism. This has been detailed elsewhere so I won’t delineate it.
  2. Privileging of software and hardware expertise. This is a strange one to me. In one space I visited, biologists were made to feel unwelcome and second-rate because they were wetware experts, not software and hardware specialists.
  3. General unfriendliness to noobs. A lot of the time, this isn’t intentional. But sometimes, it is. Techxperts tend to forget that noobs can’t hold more than maybe two or three new things in their head at any one time, and ramble on and on with a litany of gobbledegook that turns a noob’s face green with sick.

The sum of these boils down to one thing: bullying. That’s all it is. We don’t need to go through why bullying is bad. We know it is. Some of us, including myself, have friends who committed suicide because of bullying. It’s super, super, incredibly bad. You never get over a suicide.

What do you do if you’re like me and want to find a safe community in which to geek out and learn stuff with people who won’t bully you? You look for it online. Unfortunately, the global hackerspace list doesn’t tell you which spaces are safe for marginalised peoples.

I know Mz Baltazar’s Laboratory in Vienna is an awesome feminist and transgender space. Geek Girls Carrots in Poland is great for women. I’d bet GutHub in Singapore is safe too.

I guess we need a safe spaces list. Let me know if there already is one, or email me your favourite safe space and I’ll put a list together.

PHP: Where’s the Love?

PHP: Where’s the Love?

I want to learn how to make WordPress themes. One of the funny things about WordPress is, it uses PHP. I’m not sure what for exactly at the moment. But here’s the funnier thing.

There’s no PHP tutorial on EDX, Udacity, and Coursera. Codeacademy has a small one at 4 hours. YouTube has comparable results. I can’t check Khan Academy right now because my internet is broken, but I’d wager the results are similar.

As a noob, this puzzles you, and nothing online tells you what’s up. Actually, there are a ton of things online that tell you what’s up, but as a noob, you don’t have the requisite knowledge and vocabulary to search those things up. But, I’m lucky, I have a few helpful programmer friends. They are often far too busy or much too exhausted by the end of the day to help, but sometimes they answer a few questions.

One of them sent me a post detailing why PHP is so unloved. Excerpt:

Virtually every feature in PHP is broken somehow. The language, the framework, the ecosystem, are all just bad. And I can’t even point out any single damning thing, because the damage is so systemic.

I don’t want to get into why PHP is bad because I don’t know and it’s not the point I’m trying to make anyway. Read the post for the details.

My point is, ideally, noobs shouldn’t go it alone. Noobs have to try and make friends with experts, and daunting as it is, especially for those who are scared of sunlight, it can be very, very helpful. Of course, experts don’t make it easy. Too many of them scoff and make inappropriate remarks. But there are nice ones. Unfortunately, it takes some work to find them.

What Does a Noob See?

What Does a Noob See?

One of the biggest myths in learning is that people read and understand documentation. Here’s an example.

After a futzing around in HTML, CSS, and JavaScript for a while, you’ll run into code with “-webkit-” in it. What’s webkit? You google and click the second link, which is Wikipedia, which means it is more efficient to read than the WebKit site itself even though that’s the result on top. Wikipedia says:

WebKit is a layout engine software component for rendering web pages in web browsers. It powers Apple’s Safari web browser, and a fork of the project is used by Chromium-based browsers, such as Google Chrome or Opera.

That’s the first paragraph. Chances are, you’ll barely finish the second, and your attention trickles away on the first sentence of the third.

Finally, your brain makes a decision and rearranges all the words into this:

WebKit is a thing inside browsers that deals with layout. Just learn code and don’t worry about it right now.

Is this ideal? Does it matter? No, it’s not ideal, but it’s the way our brains work. Yes, it matters because many times experts forget that noobs can’t deal with this cognitive load and insist that they read up and understand all of it at once, right now, and remember it forever. If noobs can’t do it, experts mock them, belittle them, tell them to fuck the right off. Way to go, experts, especially those of you who’ve forgotten your own beginnings. And you don’t even know what other personal factors might be affecting learning. Family problems, financial stress, clinical depression, etc. All these things come into play.

This isn’t even a particularly difficult thing to read and already we can feel the cognitive load weighing us down. Just imagine the harder stuff. Stress, anxiety, panic, all your fear-mongering hormones shoot up and strangle your brain immediately. So, don’t simply tell people to RTFM. That’s one of the quickest ways to kill learning dead until death.

This is what beginners have to deal with. Noobs deserve a pat on the back for slogging through.