Born Geek
Posts Tagged "web"

Infinite WordPress Redirects at DreamHost

September 29, 2018

Do you run a WordPress site hosted at DreamHost? Are you seeing infinite redirect errors after adjusting the Do you want www in your URL? setting in the DreamHost control panel? Well friend, I had that same issue. Let me tell you how I fixed it. In this example, I will be migrating from the Add www to the Remove www value for the aforementioned setting.

Step 1: Change WordPress internal settings

  1. In WordPress, browse to the Settings » General menu item.
  2. Change both the WordPress Address and the Site Address to the new URL (in this case https://borngeek.com). Make sure there’s no trailing slash.

WordPress URL settings

Step 2: Change DreamHost control panel settings

  1. In the DreamHost control panel, navigate to the Domains » Manage Domains menu item.
  2. Click the Edit link next to the domain you want to change.
  3. Set the Do you want www in your URL? setting to the desired value.
  4. Click the Save button to save the change.

DreamHost URL settings

Step 3: Change https settings (if applicable)

This is the step that I got tripped up on (but finally stumbled upon). My site has HTTPS turned on, and there’s a setting we need to change.

  1. On the Domains » Manage Domains page, click the https On link next to the domain you’re changing.
  2. Change the Choose exact URL setting to the variant of your choice.

SSH settings

Now sit back and wait the 5 to 10 minutes for everything to take effect.

A New User’s Guide to Stack Overflow

September 26, 2016

Last week, while on vacation in the northwestern corner of the United States, I was notified by a few people that my article Stack Overflow Hates New Users had made it onto a news site I was previously unfamiliar with, hackernoon (actually, the article was a part of a longer piece entitled The decline of Stack Overflow). It’s rather amusing that an article I wrote over four years ago is still being cited by people, and I think that says a lot about the community surrounding the venerable question and answer site. I’ve been a user at said site for over four and a half years, and I have a few additional things I’d like to discuss.

Seeing as I have already written about things I learned using Stack Overflow, a list of my gripes with Stack Overflow, and a few suggested improvements for Stack Overflow, I won’t rehash those here. What I would like to talk about, however, is how I think new users should approach the Stack Overflow experience:

Search, Search, and Search Again

I cannot stress this point enough. Before you ask a question on the site, search it to see if a similar question has already been asked. Over 95% of the time, at least one person will have already asked a question that should point you in the right direction. Don’t use the built-in search, by the way; like many site search boxes, it’s pretty lousy. Search with Google using the site:stackoverflow.com operator, and include any relevant keywords that could narrow your search (searching is an art form and non-trivial!).

Ask Detailed Questions

This is probably the biggest mistake new users make: they don’t provide enough detail. Asking detailed questions takes some practice to master (I still haven’t mastered this). Before you click that “Ask Question” button, ask yourself these questions:

  1. Is my question clear, concise, and easy to read?
  2. Have I mentioned what I’ve tried in the question I’m about to post?
  3. Have I provided all relevant details about my question (any specific library versions, or specific database flavors, or the operating system in use, etc.)?
  4. Do I have an idea of the direction to head, or am I flying blind? Have I made it known in my question that I know (or don’t know) where to go?
  5. Where else have I looked for solutions? Did I mention these in my question?

Being short and to the point, yet detailed, is a difficult balance to achieve, but find that balance and you’ll reap the rewards.

Be Patient

It’s very difficult to get a lot of rep points in the beginning, so be patient; building trust takes time. Set mini-goals for yourself. I personally set a goal to get to 2000 rep points so I could edit other posts without having to have my edits approved. Once I reached that goal, I stopped worrying about points altogether (it’s not worth worrying about)! Also, be courteous to everyone, even the jerks on the site (of which there are a number). Know-it-alls tend to like to flaunt their intelligence, and Stack Overflow is an outlet through which they can scratch that itch.

Join a Sister Site

I’m a big fan of Arqade, a sister site to Stack Overflow focused on video games. The community there is much more friendly and welcoming, and if you earn enough reputation at a site like that (only 200 points), you’ll automatically get 100 bonus points on every other Stack Exchange site!

Stack Overflow is a great resource to use, but it’s one that I keep at arm’s length. These days, I tend to ask more questions than I answer, and I often find answers to questions I have through other people’s postings. It’s easy to get swept up in the competitiveness of the site at the beginning, but if you avoid doing that, you’ll have a much more pleasant experience.

Comments Off on A New User’s Guide to Stack Overflow Tags:

Migrating to HTML 5

January 20, 2015

After sitting on an XHTML Strict template for years and years, I’ve finally migrated this site’s theme to HTML 5. A number of new elements have been put to use, styles have been trimmed a little, and I’m using one less web-font. Hopefully I haven’t broken too much; if you spot something, let me know in the comments below. As always, expect sporadic updates as I add polish.

Controlling Mobile Browser Layout

March 26, 2013

I’m currently working on converting this site’s layout to a fluid, responsive-design variant, which will make the site much more usable on mobile devices (as of this writing, the mobile experience is pretty bad). In my efforts to improve the design, I noted that the browser on my Android phone didn’t respond to my changes at all. The Responsive Design View in Firefox yielded acceptable results, as did the developer tools available in Chrome (which, by the way, are pretty terrible). So why did my phone look so different?

The answer has to do with the concept of the viewport. I found a terrific pair of articles detailing the ideas behind viewports on both the desktop and mobile devices (be sure to read the desktop article first; it sets the stage for the second). It turns out that my page’s header was missing a key meta element, whose very existence we can thank Apple (of all people) for. The tag looks like this:

<meta name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=8" />

Using this meta entry allows devices to scale their layout viewport appropriately. Adding this one element fixed my phone, causing the site to render as expected. There are other articles that discuss this element better than I could, so give them a look. And don’t forget this one line if you’re designing responsively; it’ll save you a lot of potential headache!

Comments Off on Controlling Mobile Browser Layout Tags: ,

On the Importance of Documentation Updates

September 20, 2012

Even though the site aggravated me at first, I still occasionally troll Stack Overflow. One of the leading problems I see in questions pertaining to PHP & MySQL, is people’s use of the MySQL extension in PHP. This extension, it turns out, is being deprecated. But does the documentation reflect this fact? Yes and no.

Certain function pages, such as mysql_real_escape_string, have big red boxes at the top indicating that the extension is being deprecated. “Don’t use this”, they seem to shout. Other function pages, however, such as the mysql_result page, don’t have these warnings. Likewise, the top-level MySQL Drivers and Plugins page lists the MySQL extension first, with no indication whatsoever that the extension is being deprecated.

At the very least, every single documentation page that deals with the MySQL extension in any form or fashion, needs to include information about its intended deprecation. Otherwise, thousands upon thousands of programmers will write code using a plugin that is quickly nearing it’s end-of-life. Which, based on what I see at Stack Overflow, already seems to be the case.

Suggested Improvements for Stack Overflow

February 14, 2012

My last post dealt with a few issues I encountered during my first 30 days of using Stack Overflow. I would now like to propose a few ways I think some of these can be smoothed over. This will be my final post on the Stack Overflow topic; I think I’ve pretty well worn it out.

Hide user scores by default
New users shouldn’t see other people’s reputation scores by default. If the primary goal of scores is to identify the most “helpful” users in the community, use a color-coded or sliding scale graphic instead. Perhaps low-scoring users are on the “cool” end of the spectrum, while high-scoring users are on the “hot” side. Hiding scores by default seems to me to be an easy way to take away some of the competitiveness, while leaving some sort of means for determining a contributor’s “worth” to the community.
Implement a back-off for power-users
The more “powerful” a user (i.e. the higher their score), the longer they should be locked out from answering new questions. A delay of this sort doesn’t need to be giant; a few minutes would suffice. For example, perhaps new users can answer questions immediately, an “average” user can’t answer new questions for three minutes, and power users are locked out for five minutes. This would encourage newer users to answer the newest questions, and would make it harder for power users to snatch up points for simply being the fastest on the block.
Implement a delay for accepting answers
If a back-off delay is implemented, clearly an answer acceptance delay is needed. Let’s say that answers for new questions cannot be accepted for 10 or 15 minutes after they are asked. This would give everyone a chance to form well thought out answers to the questions asked, and would help keep new users from gaming the back-off delay.
Create a better user manual
Hire a competent writer and create a better user manual. This should be self explanatory.

If you have thoughts on these suggestions, I’d enjoy hearing them.

Comments Off on Suggested Improvements for Stack Overflow Tags:

My Gripes With Stack Overflow

February 6, 2012

Having used Stack Overflow for over 30 days now, I’d like to share a few of my personal gripes with the site. Those of you who are frequent Stack Overflow contributors may disagree with the views I express below; if so, feel free to leave a comment. I’m going to try my hardest to point out issues that seem particularly problematic to new users. My next post on this subject will cover a few ways I think some of these problems could be smoothed over.

Stack Overflow is a game
This is a controversial viewpoint, but one that has some merit, especially for the dedicated user base. Every Stack Exchange website has both points and achievements. Given those two incentives, many dedicated users seem to play solely to “win.” If you look at the activity reports for some of the top-scoring users, you’ll find that they spend many hours a day, every day, answering questions and leaving comments. I recently viewed one person’s profile, and saw that he had answered several questions an hour for over 8 hours in a row (he must not have a very demanding job or life)! How can new users “compete” with folks like this?
The game is, by design, not winnable
The ultimate irony is that the “game” cannot be won. There’s no end-point, no game-over screen; just a never-ending leader board. Other than seeing your name among the top contributors, and apart from gaining a small set of user privileges as your score increases, what’s the point? Why have points and achievements at all? I can understand wanting to foster constructive discussion, but won’t that naturally occur given the question and answer voting mechanisms? It seems to me that if points were left out altogether, good answers and good questions would still be easy to find, taking precedence over less useful material.
Being fast is often a requirement
This is my pet peeve with the site. Because Stack Overflow itself has so many “players,” and because they are all playing for the same points, it’s inevitable that faster players end up scoring more than slower ones. I pity the person who yearns to contribute, but whose motor impairment makes it difficult to respond in a timely manner. So too the person who may really know what they’re talking about but, because they post in haste, their answer contains a mistake, resulting in its being down-voted by trigger happy power users.
The instruction manual stinks
Like most documentation developed by engineers, the training manual is way too thin. I cannot stress this highly enough. For the first few days on the site, I was overwhelmed by all the various rules and regulations. Most of my “education” came through mistakes I made early on, some of which resulted in a punishment to my score. It doesn’t help that one must dig down into another site to find a fuller set of instructions, many of which should have been in the training manual to begin with. A set of tutorials describing how the site works is sorely needed. I’m a reasonably intelligent person, and if I’m having trouble, think about how many others are out there having the same problem.
Established users are generally rude to newbies
This is a problem that cannot be solved. People are jerks. But the points system really exacerbates the issue. I’ve seen so many negative comments towards new users trying to answer questions; especially towards those who make mistakes in their answers. I had hoped that people would be friendlier, seeing as everyone’s goal is (hopefully) to learn and grow as programmers. Sadly, that wasn’t the case. I guess I should have known better.

Now that my 30 days are over, I will be dialing back my use of the site considerably. My original intention of helping others may have been noble, but it turns out that there are already too many operators standing by. I question whether that game is really worth playing.

Things I Learned Using Stack Overflow

February 2, 2012

In my last post, I complained about my initial experience with Stack Overflow. I decided to give myself 30 days with the service, to see whether or not I warmed up to it. Now that those 30 days are over, I will be posting several of my thoughts and observations. This first post won’t be about the site itself; instead, it will cover some of the things I learned during my 30 days. A second upcoming post will cover some problems I think exist with the Stack Overflow model, and my final post will provide a few suggestions for how I think things can be improved.

Let me first say that I learned a lot simply by browsing the site. Reading existing questions and their answers was fascinating, at least for the programming topics I care about. Some of what I learned came through mistakes I made attempting to answer open questions. Other bits of information just came through searching the web for the solution to someone’s problem (something that a lot of people at Stack Overflow are apparently too lazy to do). Without further ado, here’s a list of stuff I learned, in no particular order (each item lists the corresponding language):

C (with GNU Extension), PHP (5.3+)
The true clause in a ternary compare operation can be omitted. In this case, the first operand (the test) will be returned if true. This is a bizarre shortcut, and one I would never personally use. Here’s a PHP example (note that there’s no space between the question mark and the colon; in C, a space is necessary):

$a = $b ?: $c; // No true clause (too lazy to type it, I guess)
$a = $b ? $b : $c; // The above is equivalent to this
Regular Expressions (Perl, PHP, possibly others)
The $ in a regular expression doesn’t literally match the absolute end of the string; it can also match a new-line character that is the last character in the string. Pattern modifiers are usually available to modify this behavior. This fact was a surprise to me; I’ve had it wrong all these years!
Bash
I found a terrific article that details the differences between test, [, and [[.
Firefox Extensions (XUL, JS)
You can use the addTab method in the global browser object to inject POST data to a newly opened tab.
Perl
The way I learned to open files for output in Perl (over a decade ago) is now not advised. It’s going to take a lot of effort on my part to change to the new style; old habits, and all that.

# Old way of doing it (how I learned)
open OUT, "> myfile.txt" or die "Failed to open: $!";

# The newer, recommended way (as of Perl 5.6)
open my $out, '>', "myfile.txt" or die "Failed to open: $!";
Comments Off on Things I Learned Using Stack Overflow Tags: ,

Stack Overflow Hates New Users

January 4, 2012

Update (Sep. 26, 2016): See my updated post on how I think new user’s should approach Stack Overflow.

Stack Overflow has always been a better-than-average resource for finding answers to programming questions. In particular, I have found a number of helpful answers to really obscure questions on the site, many of which helped me get past a road block either at work or in my hobby programming. As such, I decided I’d join the site to see if I could help out. Never before has a website given me a worse first impression.

In an effort to keep the community as clean and orderly as possible, new users have very little rights from the get-go. On paper, this is a pretty nice idea. In practice, it makes it difficult for new users to gain any traction. I read through a number of questions today and had several comments for the original poster. Unfortunately, I couldn’t make my comments, since new users cannot post comments on articles they themselves didn’t write (you have to gain “reputation” in order to gain that privilege). Posting my comment as an “answer” to the original question seemed like bad form, so I didn’t do that.

Looking elsewhere around the site, I found a few questions I felt I could answer. As soon as I went to answer said questions, someone else (in some cases, a number of other people) had jumped in and beaten me to the punch. I never had a chance to provide a helpful answer. Not only do you have to be very knowledgeable about a subject, you’ve also got to be very fast in providing said answer. I eventually did provide an answer for a question, then realized that my approach wouldn’t work. Before I could take action and modify the answer, my submission had already been modded down by several people, several of whom left snarky remarks. What a warm welcome for a new user! I subsequently deleted my answer.

I later searched the Meta Stack Overflow site, looking for advice for new users. It turns out I’m not the only one who thinks that it’s very easy for new users to get dumped on. Take a look at the questions revolving around new users on the site, and note how a number of them revolve around how hard it is for new users to improve. Documentation for how best to contribute as a new user is sorely needed.

The folks who manage these websites need to examine the barrier of entry for new users. I fully understand the need for keeping spammers and trolls out, but someone needs to develop a tutorial (or better yet, a set of tutorials) for how to properly use the website. New users do occasionally need hand holding, especially with websites as complicated as Stack Overflow. I think the community as a whole would benefit, and it would certainly help people like me who have been quickly overwhelmed by what the site offers.

Reading Order on the Web

May 13, 2011

One minor annoyance I have always had while surfing the web, is the non-standardized order in which you consume a website’s content. Two pertinent examples spring to mind. First, are the “post navigation” links that you find on many websites. Out of the box, WordPress uses a link pointing to the left to indicate older posts (example: « Older posts), while a link to the right indicates newer posts (example: Newer posts »). This design decision no doubt stems from the humble beginning of the blog: the journal (as in the pen and paper variant). In English, we read left-to-right, top-to-bottom; and in a pen and paper journal, newer entries are always “to the right of” older ones. I’m sure this is one reason why WordPress themes come as they do. I have always taken the opposite stance, however. Digital entries on a site are not (in my mind) the same as handwritten entries in a journal. So I have always used a link pointing to the right to indicate older posts, while a link pointing the left indicates newer ones. In short, the newest content appears “first”.

My opinion changes with my second example, however. The Twitter timeline presents the newest tweets at the top of your home page. This seems like a major design flaw, since I am seemingly shoe-horned into reading tweets in reverse order. My typical modus operandi for reading Tweets is to scroll down to my last known position, and work my way back up to the top of the page. This is really bothersome to have to do. I’d love to have an option to have the newest stuff appear last, so I could consume the content as it was presented to me.

I take a similar stance in Google Reader. I used to browse items in “newest first” mode, but I stopped doing that since I would see stories in reverse order. After switching to reading items in the “oldest first” mode, I’ve been much happier; it feels much more natural to me. I’m not sure why I feel so differently about two remarkably similar items, but I do.

Which order do you prefer? Is there a “right” way to do it?

Comments Off on Reading Order on the Web Tags: ,