All posts by Robin

I'm a woman in my early thirties living in North Carolina, USA, and I have a lot of varied interests; I love creative writing, music composition, web design, surfing the Internet, thinking out loud, and gaming. And yes, my glasses are crooked. :)

camelCase and 2 Other Tips about JavaScript Variable Names

When it comes to JavaScript variable names, you have to keep in mind that JavaScript is like many other web programming languages–it’s picky about capitalization, spelling, and spaces. (And when I say picky, I mean PICKY.)

This doesn’t mean that you have to be a perfect wordsmith to write JavaScript code; you do, however, have to debug your code carefully, because one simple typo can cause your whole script not to run. Here are 3 common pitfalls:

Capitalization (Like camelCase)

Often, you’ll see examples of JavaScripts floating around on the Web with object and function names like “myObject” and “getPage.” These are both examples of camelCase, or the act of combining two words together and then capitalizing one or both words’ beginning letters. (This is also called Embedded Caps, nerdCaps, and a whole host of other terms, LOL!)

Since JavaScript is case sensitive, you have to be careful when you’re writing object and function names with CamelCase in mind. “MyObject” and “myObject” are treated as two different objects; “GetPage” and “getPage” are also treated as two different functions. Read over your code carefully and make sure all your variable capitalizations match!

Spelling (Yep, It’s Still Important)

Along with the issue of capitalization, the spelling of your JavaScript objects and functions matters, too. If you spell your function as “myAwesomeFunction” in one part of your script, for instance, and then misspell it as “myAwseomeFunction” elsewhere, then JavaScript treats those as two separate functions, and you likely have a non-working script.

You wouldn’t believe how many times a careless spelling mistake has thrown my coding off. (One tip: if you’re having trouble spelling the name of the function or object, consider either changing the name to an easier-to-spell option, or setting aside the hard-to-spell name in a little text file and copy-pasting it every time it comes up in a script you’re writing.)

Spaces in the Variable Name: Just Don’t

One reason so many JavaScript developers use camelCase or other forms of combined-word variable names is because JavaScript does not like for variable names to have spaces in them. Thus, if you have a multi-word function or object name, you combine the words, but keep the capitalized letters to make it easier to read.

Sometimes spaces can crop up if there’s an accidental line return in the middle of your file; resizing your script file’s window to check for these line returns could possibly help you debug a script that just won’t run! (This trick saved me some hair-tearing when I was a webdesign newb trying to get a script to work…I had NO idea what was wrong until I maximized the window and saw the sneaky little space hiding in one of the function names!)

Further Reading

W3Schools: JavaScript Statements
W3Schools: JavaScript Object Intro

Crazy, Funny, and Just Plain Weird: Experimental Music

Music is not just about melodies, rhythms, and harmonies, nor it is only about songs that sound “pretty.” Sometimes, you just have to push the boundaries of what most folks think of as “good music” to develop something wildly original.

That’s what experimental music is all about–using standard musical techniques in the pursuit of comedy, combining music and visuals together for a new experience, remixing songs or melodies together to create new melodies, and even arranging random “non-music” sounds into music. Take heart: if the music you make fits into this category, you’re in great company! Here are a few examples, gathered from around the Internet:

Videos


This whimsical remix of songs from the Disney film Mary Poppins is oddly catchy!


Experimental choral madness, indeed! How can random sounds be music? When they are arranged like this!


John Cage, arguably the 20th century master of experimental music, offers this musical experience, recombining, rearranging, and composing this piece out of many different types of harmonies from other songs.


HILARIOUSLY weird video (and really addictive little dance tune), featuring comedian Ken Shimura’s character “Baka Tono-Sama.” “Ai~n” translates loosely to “Did I Do That?!” (1990s Steve Urkel, anyone?)


2:15 of strange electronic music and even stranger bovine visuals.


SILLY He-Man music video…must be seen to be believed. (If this isn’t experimental music applied in a comedic audiovisual way, I don’t know what is!)


Haunting and ethereal–“weird” in the best way!

Non-Video Sound Clips

Pop Danthology (SoundCloud)
Cool mashup of all sorts of pop songs from 2012–revisioning music in a really cool way!

Mythic Morning: Choral Works II
Collection of Danish composer Per Norgard’s avant-garde, post-modern choral music.

Malaysian Composers: Leong Yoon Pin
As of this writing (October 2013), this online radio showcases Leong Yoon Pin’s experimental instrumental music.

More Weird Music Resources

John Cage on Experimental Music
Experimental Music: Wikipedia Article
FreeMusicArchive: Experimental Music
Weird Music History (because today’s music is yesterday’s experimental sounds!)

Gender-Patterned Friendships, Funny Intelligence Quiz, Unbelievable Nature Pics, and Hacking Your Sleep Cycle

Gender Patterns in Friendships
In-depth article about how same-gender and opposite-gender friendships work, and how each gender relates to disabled people.

Intelligence Test
MUCH trickier (and funnier) than it first appears!

The 15 Craziest Things in Nature You Won’t Believe Actually Exist (Pics)

How to Hack Your Brain
How to get into a polyphasic sleep cycle (i.e., lots of short naps throughout the day instead of one solid block of sleep at night)

Soon, Heroes Shall Fly Again, in the City of Titans

Last fall, City of Heroes players wept and raged as Paragon City darkened on November 30th, in spite of everything we tried to do, in spite of protests and calls. It seemed all had finally been lost when the 30th rolled around and NCSoft’s stance had not changed.

Most of us fans crept away and mourned, trying to find solace in other games or projects. But for one small band of players, their response was to recreate the City they had so cherished in a game of their own making. That game is called City of Titans.

The Facts

This group of players formed The Phoenix Project and MissingWorldsMedia, and are currently developing City of Titans as a self-described “spiritual successor” to City of Heroes. According to the FAQ, the game will be built on the Unreal 3 engine by former CoH players, and the studio is shooting for a release date sometime in 2015. Support for Sentinel+ character files (developed by the Titan Network) is planned (yay!).

Lots more is covered in the WorldsFactory interview with TPP’s project lead, Warcabbit–well worth a read to get a good sense of how CoT is developing!

City of Titans Still Needs Your Help!

And most importantly, keep spreading the word! Soon, we heroes will have a City to protect again! 😀

Who Are Prophets? Those Who Listen to and Follow God

Amos 3:7
Surely the Sovereign Lord does nothing without revealing his plan to his servants the prophets.

In this verse, Amos echoes many other Old Testament prophets (Jeremiah and Zechariah, among others) in naming himself and them as “God’s servants.” They are the ones who relay God’s message to His people; they are the ones who write down what God has placed on their hearts. Israel and Judah, both made up of God’s people, were drifting far from God by this time, so nearly all of the prophets’ messages serve as warnings of divine punishment to come, as well as promises of divine restoration after punishment.

These days, the idea of a “prophet” seems a little outmoded; it’s easy to think that the Old Testament prophets were only saying what they wanted to say and passing it off as God’s words. But in fact, as Amos says here, prophets are literally God’s servants, listening to God and acting as God commands. This is not to say that modern Christians can be fortune-tellers, however! Instead, modern people can apply this verse to their daily devotional time, “listening” to God by reading His Word, and then acting in Godly ways based on what they have studied.

So, if we’re confused about an issue, we can seek out Bible verses and passages to learn what God thinks; if we’re having a problem, we can turn to the Bible to see how to handle it in a Godly manner, and so on. We can literally use the Bible as an instructional manual on how to lead a Godly life…and in so doing, become better servants, not only willing to listen but willing to model Christianity for others.

Hoarder Confessions, part 1: Humanizing the Cluttered Life

Hoarders–usually characterized as “packrats” by modern media–seem to be quite mythical, eccentric characters. We even have TV shows about them now (both fictional and non-fictional), which paint such people as willful clutter-gatherers, antisocial, and even crazy.

hoarding_example I, however, have a different perspective on this description of “hoarder”–because by most modern standards, I am a hoarder, and several other members of my family have been as well. (The pictured area is the hallway outside my bedroom door, just as an example.) I’ve been battling against my natural hoarding tendencies for a couple of years now, most notably seen through my Slaying the Clutter Dragon article series, but as you can see from this picture, I have a LONG way to go. What you see here is the unofficial “laundry station” in the house, a tiny bit of order balanced precariously on decades of junk.

What Exactly IS Hoarding?

According to the Wikipedia article on compulsive hoarding, it amounts to gathering and keeping objects long after their usefulness has passed, and being unable to let items go. In severe cases, it can actually keep a person from using much space in their house, turning the “livable” rooms into literal obstacle courses (I should know, my room is like this!). Hoarding is considered either a mental disorder all its own, or part of another mental disorder (usually it’s paired with OCD). (Additional information can be found on Psychiatry.org’s Hoarding Disorder page.)

A “Clutter Continuum,” Constantly Changing

Hoarding is not, however, made up of just a couple of easily-recognizable behaviors. Rather, it can appear in mild, moderate, and severe forms, all along a continuum of clutter. My maternal grandmother was a severe hoarder; for example, she had a stack of TV Guide magazines so large that it had formed a side table of sorts in her TV room. The entire second floor of her home was unusable, and several of the first-floor rooms were piled so full of boxes that the doors could not even be opened. And let’s not talk about the refrigerator. By contrast, I would call myself a mild to moderate hoarder; I don’t hoard old newspapers and REALLY obvious trash, but I have a hard time letting go of broken/messed-up items, old toys from childhood, etc.

Hoarding tendencies can also develop and change over one’s lifetime as life events happen; as a child, I hoarded just about everything that was “mine” because it was simply mine and I liked knowing that I could claim these items for myself. As I grew up, I realized that my cluttered room was not only keeping me from using about 80% of my bedroom space, but kept me from inviting friends and family over. Thus, I got a big attack of “Sick-Of-It-Itis” and started a slow purge of items that continues to this day. By contrast, my mom’s previously uncluttered and almost painfully-tidy rooms have become more cluttered as her health has declined; de-cluttering has become an almost insurmountable task.

The Mindsets Behind Hoarding

Having observed the hoarding tendencies both in myself and in my family members, I believe I can describe the thought processes that cause and perpetuate hoarding:

“I’ll Need It Later/Someone Else Will Need It”

This is the constant belief that the item will be useful for someone at some point in time–just not right now, or not for me personally. I fall victim to this all the time, especially if the item was REALLY useful to me in the past, or if it’s messed up and “just needs a little fixing” to be ready for someone else to use. It makes my skin crawl to think I’m throwing out a perfectly good item! (See next point for more on this)

“I Paid Good Money for This”

This, above all, is where my hoarding comes from. I cannot STAND it when something I paid for is broken/no longer useful and everyone else says I should throw it away–I can’t STAND seeing money go in the trash. During the Great Purge of 2009, I actually got physically ill at the thought of having to throw away a really expensive blouse, even though it had some staining and a little rip in it. I was angry at myself for letting the blouse get messed up, and I was angry that the money I had spent on it was virtually wasted. (Thanks to some super-awesome stain remover and a few stitches, however, I was able to save the blouse and wear it again…LOL)

“I’m Keeping the Memories in This Item”

This, I think, is what Gran suffered from the most. By the time her hoarding had gotten severe, my granddad had already died and a lot of her friends had passed away, too. Keeping Granddaddy’s old papers, records, and books, as well as cards from her late friends and old newspaper articles featuring them, may have made her feel more secure, as if she hadn’t lost all these people in her life. Plus, if she had started to deal with all the boxes in Granddaddy’s old study (one of the rooms that you couldn’t even walk into), she would have had to deal with the onslaught of grief at realizing he was really gone. I don’t know for a fact that this is what caused ALL her hoarding, but it’s a really good guess based on what I observed.

“If I Don’t Hang Onto It/Remember How Important It Is, Who Will?”

This question arises from a sense of preserving history as well as memories, as if the hoarder is somehow a caretaker and curator of their own personal museum. Mom and I both do this a lot–she and I have both kept a lot of old stuff from my childhood. In a way, the clutter becomes a memory book, except that you have to walk around it instead of being able to leaf through it…and there’s an underlying fear that if you get rid of the item, whatever it is, you’ll forget why it was important to you, and forget something vital to who you are today.

In short, hoarding (at least from my experience) comes from wanting to be prepared for everything, trying to keep memories (even when it seems no one else will), and preventing waste (either of money or items). These are all pretty valid concerns, but in our brains, it takes top priority. It seems it all boils down to preventing loss; it is our way, perhaps, of fighting Father Time and Death, and staving off grief. (I know I don’t deal with loss very well, at least, though I can’t speak for any other hoarders out there.)

Don’t Judge or Shame, PLEASE

If you don’t live as a hoarder or live in a house with one, chances are you have no idea why or how all this happens; the tendency to judge hoarders as “crazy” or “gross/weird” people is very strong, especially now that hoarding TV shows are such a media hit. But people really do live this way, and a lot of it is based on fear. Either we’re terrified to lose memories or be unprepared, or we’re terrified to let other people know how deeply we are mired in a mess of our own making. Other people’s judgments and shaming, including the TV shows which seem to just make a spectacle out of us, do not help in the LEAST.

If you know a hoarder who wants to get out of their cluttered mess, and you want to help them, then be supportive, be available to help, and be patient. Tangled in the clutter is a lot of emotions, possibly grief as well as fear and humiliation; be sensitive to that, even as you plod on, gaining ground inch by inch. Understand that not every hoarder wants to give up their lifestyle, but some of us feel more trapped than soothed by the clutter and would LOVE a helping hand. And finally, respect that we are human beings and don’t deserve to be treated like naughty children; after all, if a hoarder willingly shows you his or her house, you have just been deemed trustworthy enough to bear a secret, one that may be much more painful than you know.

Next Time: Help for Hoarders

In Part 2, I’ll discuss how we hoarders can start to overcome our fear and humiliation with a few simple-sounding tactics. You’d be surprised how much these little changes can really make a difference!

4 PHP Security Pitfalls to Avoid

For PHP developers of both newbie and veteran status, there are always new ways in which hackers exploit our carefully-crafted scripts. We have to keep tabs on newly discovered security holes in our scripts, as well as minding how we construct our pages so that people can’t just inject a bunch of code into our websites, all so that our sites will run the way we want them to, and so our users’ data will be protected.

Thus, I bring to your attention the following 4 PHP pitfalls, which are vitally important for us to be aware of as we build our sites. (Incidentally, this post started out as a “PHP tricks” post, but when I saw just how many blog posts are out there already with that premise (and how many of them advocate unsafe code), I thought it best to research PHP security problems instead. And boy, did I ever discover some doozies!)

#4: Exposing Your Filepaths to Users

Most users won’t care much if the paths to various files on your site are easy to guess (or easily viewable in their address bars). A few users, however, may choose to take advantage of that–not just for hotlinking your images, scripts, etc., but for stealing data that is supposed to be secure! Yikes! If you’re running any kind of site with
logins and passwords, especially an e-commerce site, easily-visible filepaths are BAD!

So, how to fix this? Thankfully, there are fairly easy PHP scripts that can disguise a file’s real path on your server with variables, making it much more difficult for hackers to guess where a file is. For instance, motov.net has an example script that is only 13 short lines of PHP code!

#3: Not Securing Your Databases

As mentioned in #4, MySQL databases with logins, passwords, credit card info, etc. are very juicy targets for hackers. If you don’t build in protections for all this sensitive data, your site could end up being victimized, leaving you with very angry users!

PHP.net has a series of articles on how to design your database for better security, how to securely connect to such a database, and more. Layering database security, just like layering clothes before you go out in the cold, can really help protect your users’ data! (Also, WebmasterWorld’s forums has a post about securing database connections which may be of further use.)

#2: Leaving Your PHP Sessions Open to Hijacking

Any time you have users logging in to a site, you are most likely incorporating a PHP session ID, a unique number that tracks them around the site so they don’t have to keep logging in every time they go to a new page. Unfortunately, hackers can get hold of those numbers if they’re easily guessed or stored in an insecure location (see #3). You might not think somebody could wreak much havoc with just a PHP session ID number, but a hacker could end up stealing somebody else’s whole account with just such a number!

To keep your users’ session ID numbers safe(r), consider some of the tactics suggested on this StackOverflow topic, including SSL connections, randomly-generated ID numbers (instead of incrementally increasing numbers), and sessions that expire within shorter time frames.

#1: Leaving Your Site Vulnerable to SQL Injections

When we PHP developers, especially newbie developers like myself, write MySQL queries pointing to our databases, sometimes we forget that malicious users exist for a minute. We forget to keep our very PHP script files safe from “SQL injections”–that is, targeted code attacks that fiddle with our SQL queries just enough to dig up data from the database, rewrite it, or even delete it all!

To keep your SQL/MySQL code from being fiddled with or just plain overridden, PHP.net has an excellent reference article which explains several code tactics you can use, such as connecting to your database with a user specifically limited to the task you’re trying to complete, checking that the inputted data is the right type, etc. This StackOverflow topic about preventing SQL injections may also be helpful as you tackle this tricky issue.

Summary

All of these precautions may seem unnecessary, especially to newbie PHP developers, but these are all giant security holes that can cause us a lot more headaches and frustration (not to mention user anger). Nip these problems in the bud, and you’ll be saving yourself a lot of time and trouble later!

Naming Your Fictional Characters

As a writer, my largest hang-up has always been finding the perfect names for my characters. I’m very picky–I don’t like to name my characters after real people if I can help it, nor do I want to copy another author’s name choices. But I usually don’t get good ideas for characters’ names as I’m developing the concept; names are always the last thing to come to me when I’m crafting a fictional person.

If you’re a fellow writer with this same problem (or if you’ve ever tried your hand at making a unique fictional character for a role-playing scenario, video game etc.), you know how frustrating this can be. I stayed frustrated a long time, until I figured out something pretty simple to help:

Baby Name Websites: A Writer’s Best Friend

It might seem silly, but baby name websites have given me more ideas for character names than I can count over the last several years.

Some websites give you more history and meanings for the name so that you can decide if it’s a good fit or not; others allow users to submit original names (which sometimes ends up in utter strangeness getting added to the database, but is mostly okay). I don’t necessarily gravitate toward popular names when I search–I instead browse through the database one alphabet letter at a time, seeing which names catch my eye and noting those as I go. (This works fastest if you’ve already got an idea for what your character’s name starts with, but even if you have NO clue what you want their name to be, this helps.)

BabyCenter.com
BabyNameWizard.com’s Advanced Name Finder
Parents.com’s Baby Names
Nymbler.com Online Name Tool

Get Help with Surnames, Too!

If I’m bad about selecting characters’ first names, I’m even worse about their surnames. Thankfully, there are a few websites, mostly based in genealogy and ancestry, which have helped me select characters’ last names. (Like when I search for first names, I usually search by alphabet letter, writing down the ones that strike my fancy.) Investigating the surnames’ meaning is also a great tool for matching up surnames to types of characters; you may not wish to make it match perfectly, but a loosely linked name can be fun.

SurnameDB.com
SurnameFinder.com
FamilyEducation.com’s Surname Meaning Search

Also Try: Altering Interesting Words

If none of the names seem to fit, try taking a descriptive word you like the sound of, and changing or deleting some of the letters to make it sound more like a name. (Examples off the top of my head: “Whitha” from the words “white” or “with”; “Sentyn” from the word “sentimental”; “Tunar” from the words “tune” or “thunder”.) This trick can help especially if you’re trying to create more high-fantasy or mythical-sounding names, or if you’re really, REALLY stuck on a character name.

Summary

Coming up with character names can feel daunting, but some Internet research plus a little old-fashioned creativity can help you name your heroes (and villains) at last! Try one or more of these tips for your next novel, short story, or game!

30-40 Minute Workout Plan, Pinstrosity, Browser-Based RPG, and Homemade Hair Care

30-40 Minute Full Body Workout
This is part of the “Lifehacker Workout” program for a reason–cardio and strength exercises behind the clikc!

Pinstrosity
When Pinterest crafting goes horribly wrong… xD

Arcuz
Neat little browser-based action RPG (similar to Zelda or Diablo), with lots of medieval-fantasy flavor and the ability to save! 🙂

8 Hair Care Treatments You Can Make Yourself

The Question: 37 Points of Unquestionable Good

If you’re looking for Outwit and Perplex at a cheap point cost, and you’ve not already running this figure, you, my friend, need to know about The Question.

thequestion_fig thequestion_dial

Hard to believe this figure is 37 points, isn’t it? With all her standard powers, she’s a fine second-string ranged attacker as is; 6 range and 10 attack with Stealth and Willpower on first click is awesome for her point cost, and even as she goes down the dial, she maintains her usefulness, adding Close Combat Expert, Energy Explosion, and Combat Reflexes (for a defense boost!). But it’s her special power on damage that really makes her shine.

thequestion_card2 “Ask the Question” is, in a word, powerful. Not only can she Outwit when needed, but if she’s needed to reduce the effectiveness of an opposing character, she can do that too. That doesn’t sound like much, perhaps, but in the middle of battle where 1 less defense or damage can make a big difference, you will soon see how much that ability matters!

This is the reason I have two Questions in my Clix collection, and the reason why she gets played with some regularity–she’s not only a good tactical figure, she can play a little offense as well. Always nice to have a pinch-hitter if one of your other figures unexpectedly bites the dust!

thequestion_card1 As for keywords, she’s a definite boon to Detective keyword teams, as well as to Gotham City (though one can argue that there’s already plenty of Outwit available on Gotham City’s keyword). I also like that she’s Martial Artist; it gives the keyword one more tactical piece, which they can definitely make use of!

So if you’ve found yourself with 37 points open and a need for cheap offense and tactics, grab yourself a Question and start a game. You’ll definitely be glad you did!