This is going to be quite a short post, but I will elaborate on some of these topics when I post documentation for my MongoDB geospatial query. In the meantime, for your viewing and learning pleasure, here are a few excellent resources I found helpful for working with PHP and MongoDB:
MongoDB for the PHP Mind:
The last few weeks have presented a series of extremely trying RL (real-life) challenges to deal with outside of my coding life. There were a few rounds of very upsetting news, on a personal level. I had to make a move on short notice, to a remote area where (believe it or not) internet and cell reception are hard to come by. It took a week and a half to get internet, due to various hold-ups… and since I had no cell reception either, it was very hard to get much done as there was no easy way to look up syntax or examples when I got stuck. Other obligations are suddenly making increased demands on my time and energy, while a number of things have simultaneously gone awry which have been or will be very time-consuming to sort out. Staying focused through the trials and upsets has taken a monumental effort at times.
In short, it’s been pretty horrendous.
I’m a determined soul, though, when I have a goal in mind, so I refuse to quit. It’s just going to take some serious tenacity (and sleep deprivation) to see things through. I love what I’m doing, I’m enthusiastic about this project, and I want this experience, so I’m going to give it all I’ve got.
An in-depth understanding of Git has been slow in coming, I’m afraid. I used Subversion, once upon a time in a class far far away, so the concepts of branching and checking out code and merging aren’t new. Much of the time, technology just kind of innately makes sense to me, and new concepts fall into place with relative ease (considering the complexity of the topic at hand, anyway). I’ve found it inexplicably difficult, however, to wrap my head around Git. I know what I want to do in a given situation, but figuring out how to make Git actually do it has taken an inordinately long time. Recently, some relatively minor fixes were made, but stored on a different repository, and I couldn’t figure out how to pull the changes to my local machine. I ultimately ended up waiting until the changes were merged into the origin. By then, unfortunately, I was half-configured for the other repository… so it took time and some fancy dancing to get everything back to normal. Ick. Well, mistakes lead to more learning, even if the resulting predicaments can be frustrating at times. This evening’s learning, however out of place it may be in the middle of this post, was how to pull the latest changes from the remote of a branch you’ve been working on. I want to post it here, now, because I may not remember to do it later:
git fetch upstream yourworkingbranch
It’s 2:00 a.m., and I’m feeling like a rockstar again.🙂 Just pushed a bunch of bugfixes (plus a whole lot of code standardization, and some occasional refactoring) to the GitHub repository and submitted a pull request. Progress is significantly faster now, as I learn (or get re-familiarized with):
- Proper configuration and integration of Apache, MongoDB, and PHP on a server
- PHP methods and usage
- MongoDB – general functionality, forming queries
- coding styles and standards – the need for establishing them, and how to adhere to them
- standards for best practice
- how to check various error log files for problems
- what different error messages mean, and how to troubleshoot and resolve them
- version control, and usage of Git and GitHub
- how a software project is organized and coordinated, even when contributors are in disparate locations
- online project management tools – tracking tasks, bugs, issues, ideas, resources, documentation, schedules, and people
- how the various pieces of a project come together
- how differing languages and applications work together
- the different types of developer tools that are available (e.g., IDE’s, frameworks… even
vim), and how they can make life easier
- where to find help online if I get stuck (StackOverflow, for one, is the bomb)
- how to think like a programmer
Yeah, we’re just 4 weeks in, but holy crow. It blows me away how much I’ve already learned in this short amount of time. Sure, it’s a crash course in all of the things I knew I needed to learn… but perhaps more importantly, in a ton of other things I wouldn’t have thought to ask. I think the things you don’t know you don’t know are often the ones that can hold you back the most. After all, you can’t fill in the gaps if you don’t even know they’re there. All of this has been so much more than I envisioned. I’ve grown so much more confident in my abilities, and also in my decision to change careers from sysadmin to programmer. I’ve also been able to draw many parallels between the two, on multiple levels. The tools are very different, of course, but the basic concepts of troubleshooting remain the same. It’s all just problem-solving. I’ve realized that, starting with my first programming experiences on a C64 as a child, and through many years in the field working in IT, I’ve already been using and building upon the core skills one needs to be a successful programmer. That’s immensely encouraging to know!
The Ubuntu virtual machine (VM) I was developing on decided to have a thermonuclear meltdown yesterday. I reappropriated a 16GB thumbdrive and have installed Ubuntu natively on that. Since I have to redo the nice little setup I’d done for myself, I might as well document it while I’m remembering. I can’t take credit for it, as it came from other developers who were nice enough to share their wisdom with me, either directly or indirectly. In the spirit of paying it forward, here ya go. 🙂
First, a bit of background info:
When you clone from a GitHub repository with Git, it automatically creates the main project directory for you.
Rather than cloning to the Apache document root
/var/www and fiddling with sudo every time one creates, moves, or edits a file, it’s nice to be able to work from a folder in one’s home directory… but then it’s a pain to keep copying the modified files to
/var/www for testing.
Here’s how I made my life a little easier:
This week, we are working on getting familiarized with Git and GitHub, and writing up some more detailed documentation to facilitate future deployments of TidePools. I am a complete n00b to Git and GitHub, so here are a few of my notes about them to help me keep things straight. I’m posting them here in the hopes that they may be useful to others, as well.
The TidePools code was recently moved here:
I was added to the organization as a team member and given permissions to push and pull. I was told that the preferred way to contribute for this project is to add branches, which will then be reviewed before being merged. I didn’t know where to start, and while GitHub’s tutorials are pretty good, I had to read between the lines to figure out how to set up proper branching. Below are the steps I used. I tested functionality by making small modifications to the README file and then checking whether the changes were reflected on GitHub.
The first step was to log in to the GitHub site, go to the TidePools repository on OTI (linked above), click the Fork button at the top, and tell it to fork to g33kgrrl. That creates a copy of the code in my GitHub repositories. Then I make a copy of the forked repository on my local machine:
g33kgrrl@saturn:~/TidePools$ mkdir fork
g33kgrrl@saturn:~/TidePools$ cd fork
g33kgrrl@saturn:~/TidePools/fork$ git clone https://github.com/g33kgrrl/TidePools.git
Cloning into TidePools...
remote: Counting objects: 1788, done.
remote: Compressing objects: 100% (1734/1734), done.
remote: Total 1788 (delta 63), reused 1778 (delta 53)
Receiving objects: 100% (1788/1788), 50.49 MiB | 280 KiB/s, done.
Resolving deltas: 100% (63/63), done.
g33kgrrl@saturn:~/TidePools/fork$ cd TidePools
This is the first of my documentation for the application project I submitted to the GNOME Outreach Program for Women. First, a little background…
In order to apply for the internship, one must make a small contribution to a FOSS project first. If you are selected, you get a paid 3-month internship where you can continue to hone your skills. In case you missed the last post, I was one of the fortunate ones! I’m thrilled beyond measure to have this opportunity. This internship goes from January 2 to April 2. I am asked to blog at least once every 2 weeks about my projects and experiences… but knowing me, it’ll probably be more often than that. This post outlines the contribution I submitted with my application, which was part of the basis for my selection for internship.
I am working on a cool and philanthropic project called TidePools, through the Open Technology Institute (OTI). In order to understand the following explanation, it’s worth checking out the TidePools website to get an idea what is going on. Should you wish to see the full code listings for my application project, here is the GitHub repository where my code will be stored. GitHub has a fancy interface that displays the code with syntax highlighting, which greatly enhances readability, so I won’t clog the blog by reposting my code here. (You can view the code by clicking on the name of the file you wish to view.) I will post key sections in future posts along with explanations.
As promised in my last post, here is a list of some websites with free classes and/or tutorials. These types of classes are often called Massive Open Online Courses, or MOOCs for short. They’re mainly from big-name ivy league universities like MIT, Harvard, Stanford, etc. and cover all kinds of subjects, not just computer science.
- edX – online classes – I’m taking CS50x (Intro to CS), an excellent class so far, and great for beginners. There’s still time to enroll in this class if you want to take it. It’s pass/fail and you get a certificate of completion if you pass. Scroll down the main page or click “Find Courses” to see what they have.
- Stanford Engineering Everywhere – online classes – click on Courses
- Coursera – online classes – click on Courses
- cplusplus.com – tutorials, discussion forums, and other stuff – in the upper-right box is a link to “C++ Language Tutorial.” I downloaded the pdf version to my phone and I study C++ while I’m standing in line or what-have-you.
- Cprogramming.com – tutorials, lots of them
- MIT OpenCourseWare – online classes – these are online versions of a couple thousand of the classes they teach on campus. There’s an Intro to C++ class and you can find the rest of their computer science stuff by going to Courses > Find courses by: Department > School of Engineering > Electrical Engineering and Computer Science
- OpenCourseWare Consortium – keeps an ongoing list of OpenCourseWare websites offered by universities around the world
Please let me know if there are others that ought to be added here. Best of luck to you in your endeavors!