Tuesday, January 17, 2012

Text Your Heart Out - Emotion in Text

It is a seemingly controversial concept, that there can exist emotion in nothing more than text.  However, between those that grow up in the era of texting, blogs, instant messages and email, it is not only possible, but something happening everyday.
Emotional texting is the idea that, word choice, slang dialect, incorrect or excessive capitalization, purposeful misspellings, excessive punctuation and sentence fragmentation timing all come into play when trying to convey and comprehend text.  When using the term “text message”, it does not simply refer to cell phone SMS, but all forms of textual messaging including, but not limited to; SMS, email, instant messaging, online comments and social network status messages.
In a generation that grew up in the internet age and the instant feedback of SMS texting age, I believe people have started to adapt communication needs to portray their emotion via stylistic changes in text.

The theory of LOL.
LOL is loosely an acronym for “Laugh out Loud”.  Which, when it was first used, actually meant “that is really funny”.  However, a lot of people will use LOL as a substitute for acknowledgment. It is widely accepted that if someone says something even slightly humorous, the response might be “lol”.  This isn’t to say the receiving party is laughing, it’s more of an acknowledgment that the message was received.  it’s also becoming something we are unaware of.  Some people tend to use LOL way more often responses, even if they offer a more detailed response right there after.  For some, it is second nature to respond with LOL.  Why?  LOL is a term that is associated with a positive connotation, because in it’s original use, humor is generally positive.  So as a response, the sender feels good about the comment they have made.  LOL has many more meanings, which will be discussed in a minute.

I’m Being Sarcastic.
Sarcasm is something normally easy to pickup when talking in person, or even on the phone.  Voice inflection is used, and certain words are changed.  Say to your self sarcastically “Oh, that’s what you mean”. As if you are rolling your eyes at the same time.  You make the “Oh” sound longer, the word “that’s” is also drawn out, and then the rest of the sentence is said rather quickly as your tone lowers. Then you world normally look at the person a bit longer so they could see your eyes rolling.  So, in text, how would you portray sarcasm?  Identifying how you would say it like we just did gives us insight.  When grammar is not as important we can apply new rules.  So, if I was needing to portray sarcasm without first telling you I’m being sarcastic, I would write something similar to “Ohh, THAT’S what you mean...  Reading this, one should be able to actually say this in their head differently.  There are 3 techniques applied above.  “Ohh” is using excessive “Hs” to depict extending the sound as it’s said. The comma is overused here to show a pause.  “That’s” is fully capitalized in order to bring the most emphasis in the sentence to that word.  The ellipses at the end denotes trailing off, which can be seen as looking at the person after the phrase has been said.  This concept is similar to spelling a word phonetically, in that you are changing the grammar of the phrase to depict what you mean. In phonetics, you change the spelling of a word to tell the reader how it’s meant to be pronounced.

Don’t YELL at me.
Another emotional portrayal often used in text is the idea of yelling, or raising your voice.  Using all capital letters is often the way most choose to show that they are raising their “voice”.  But capitalization alone is not enough.  We can again utilize punctuation, albeit incorrectly, to show levels of yelling.  In normal speech, we have the ability to yell, scream, slowly raise our voice, and even use body language to show an even greater rage. So, with text, how can we achieve the same effect?  The mildest form of yelling is all capital letters with no punctuation.  DONT TOUCH THE STOVE.  Adding an exclamation point ramps up the energy. DONT TOUCH THE STOVE!  One might add multiple exclamation points now to really tell the reader they are infuriated.  DONT TUOCH THE STOVE!!!!!  This doesn’t only apply to negative commands like these.  WHAT!? Is a very disturbed and anxious way of saying “what”.  The mild form of that expressive “what” would be to not use capital letters. what!?  You get a smiler sense of urgency, but not nearly as urgent as all capital letters.  That’s because in speech you might say “What” and have a serious look on your face, or scream out loud “what” as if you really need people to feel that energy.

No, no nope, nah
In text there are many ways to say “no”.  This is very similar to speech when talking informally.  If you are with friends, and someone asks if you want the last piece of pizza, you don’t say outright “No” and leave it there. It’s impolite, and the friend will sense that.  The same is true for text.  Let’s say they asked if you wanted the last slice of pizza over text.  Responding simply with No, would come across as rude.  You could say “no thanks”.  Or if it’s in your slang, you could say “nah I’m good” or something similar to that respect.  You are basically being polite through text.  The same applies to other forms of “no”.  “Do you have any cheese sticks left?”  “Nope.”  That is a gentle, nice way of saying no.  If the conversation went as follows: “Do you have any cheese sticks left?”.  “No.” That will be read with a harsher tone.  Because the word is short, and there are no modifiers, the tone feels short. Being ‘short’ is generally considered rude, thus the dad-like statement “Don’t get short with me”.
The same applies to yes as well. However, in my opinion, The Yes’ are measured in terms of their negativity, not their positivity.  “Did you take out the trash?” Yes.  Again, this is short, and thus a short tone of voice.  Simply taking the capitalization and the period off however, results in a much softer answer.  “Did you take out the trash?” “yes”.  The lack of punctuation in this case results in a less serious tone, therefore less rude.  Alternatively, one might say “yea” which is always a nicer way of saying yes.  Form’s of yes can be interesting.  The term “yep”, is happy and energetic.  The same kind of positive feel good energy “nope” had.  That’s mostly due the “pe” at the end.  It’s hard to say Yep and Nope with an angry or upsetting tone.  Therefore when someone reads those back in their head, its more positive.

Smart phones require more work.
when cell phone texting hit it’s booming phase, cell phones had 9 key 3 letter type pads.  Each of the 9 keys had 3 letters and you had to hit a number 1 to 3 times to get a letter, then move on.  Some users trusted T9, and ‘intelligent’ guessing engine that would try to guess what letter you wanted based on the context of the surrounding letters, but it was not accurate if you had a large vocabulary.  So for a while, teenager’s fingers wired new motor maps to type out words in a binary-like pattern. 1, 33, 555, 22, 11.  If you talk to a teenager or 20 something that texted with a “flip phone” (as they were called) for many years, they could probably type words without even looking.  I can still type on those keyboards without looking, just because of the sheer volume I used to text with those phones, my brain has made a lovely neural connection to make it easier.
The nice thing about flip phones, is that they never gave you any punctuation.  So it was very easy to depict emotion, since you had to put the effort into your punctuation.  I even feel that, because this was the case for so long, that is what allowed this emotional texting to form. Not to mention that in all online forms of typing, you are responsible for punctuation.
Now we have smart phones with full querty keyboards and intelligent, automatic grammar engines.  This actually makes it harder to text with emotion, and slowly is changing how it works.  Any sentence I start on my phone has a capital letter.  As we learned sometimes that capital letters gives the wrong impression, so it needs to be changed.  The phone also fixes misspellings.  Which, again, is not what I want at times.  I want it to fix the words I misspelled, but didn’t mean to misspell. One big problem I have with the iPhone autocorrect is how it changes LOL.  I normally don’t say LOL, because nothing is ever THAT funny.  (notice how I capitalized “that” so that you would read it differently).  LOL means “seriously funny”.  lol, is the space filler that one normally means to type, not LOL that the iPhone often changes it to.
There is still a place for writers style, such as blogs, stories, essays, anything scholastic, research papers, business friendly email messages, email in general, long messages and any other kind of formal media.  NOTE: none of this refers to the tweens constant omitting of vowels in words or no-use misspellings. (Ex. Rly = Really” or wut = what) But in the world of peer to peer text, “kids” have developed this new “dialect” similar to phonetical spelling that allows them to portray emotion in their text.

Wednesday, January 4, 2012

SOPA - How to Deal with Piracy

If you don't know what SOPA is, basically, it's the government trying to pass laws that allow them to block websites that distribute copy written content. That includes sites like youtube, blogger, reddit etc..

SOPA is trying to help the "piracy" problem on the internet.  Content providers might agree that there is a piracy problem, and users might disagree saying the internet is free, and if I can get my hands on your content it should be mine.

This isn't about SOPA though, this is about how to stop piracy.  However, when I say stop piracy, I'm not talking about a technical solution to physically stop a pirate from stealing your content.

I believe the real way to stop piracy is to offer a product that is far beyond better than the raw content itself.  Most of the time with digital content, it is not JUST the raw content that is important.  For example, If I run a video training website, My website allows users to view videos in multiple sizes, create bookmarks, save my last watch position, embedded chapter data, language translations, on screen sub titles and more.  So now, if someone steals my video file, and puts it online for the world to steal, the person who illegally downloads a copy will get none of my features.  All they get is the content.

Apple & iTunes
Let's take a look at how Apple solved the music piracy problem.  If you can remember back in the days of bearshare, kazaa, morpheus, limewire and other peer-to-peer file sharing programs, mainly used for music, they were the main headache to the music industry.  Sure an individual artist may have lost a little bit of money, but in total this was really hurting the music industry.  Then Apple comes in with iTunes and solves the problem.  We will give users a free application for mac and pc, where they can very easily, and graphically find all of their music, download high quality versions as many times as needed, and even sync all that directly with their iPod.  To top it all off, a song will cost a mere 99 cents.  That solution was huge.  Years later, iTunes is the number 1 online reseller of music, and you don't hear the music industry complaining like they did in the past.

So how did it work?
iTunes identified the pains of peer to peer file sharing.  They were ad supported, virus ridden programs.  The songs were generally crappy quality, and searching was not that easy.  Searching for 1 song could yield 40 results, which one was good? Which has a virus?  iTunes is a very fast, easy to use application, offered by a trusted company, for free with out ads, that is also aesthetically pleasing. Couple that with a little bit of money, most people that would have stolen before, now have their solution. Of course there are those that don't care and will still steal the songs, but those numbers are not significant, and would steal no matter what you do.

How can this solution be applied to other digital content?
The answer is to offer a FAR BETTER experience around your content than the content alone can offer.  This works with blogs, news, video, audio, any type of media.  If you have text based content, offer more site features for that text.  Ability to share, save the text, create a feed from it, more articles like the one your reading on the page, save for later, bring the content to mobile.  All of this your site can offer, that a pirate can't.

This doen't solve all kinds of piracy problems, but it does shed light on how a site can cut down on stolen content. There are 2 types of pirates.  Those that will steal no matter what, and those that steal because you're not better.  If you offer a good product around your content, your users will stay, and will pay.  People want to pay for good work.  You will always have people that steal, and you will never be able to stop them, but they will not hurt you.

Thursday, December 29, 2011

The Cost of Expertise

What is an expert?
They are someone who knows their subject front to back, is very experienced, therefore knows the history behind it, and is quick.  What about just from programming? An expert knows the syntax 99%.  They know the little tricks, they know the base language, they can recall functions from memory, etc.

Base language?
A real jQuery expert is also a Javascript expert.  A lot of people now a days are jumping right to jQuery without ever learning Javascript first. That's a tough choice.  When you choose to learn only a library first, you are basically ignoring the way it works under the hood.  And that is OK for libraries that expose nearly all the features you're going to need, or change the language. Like PHP does from C++. You now write PHP code instead of C++ code. However, jQuery is not like that. It is a utility library to Javascript.  It doesn't have it's own syntax, or it's own operands.  It still uses the dot operator, the square brackets, the curly braces, even the same built in Javascript options.

So why does an expert cost so much more money?  You can go find a freelancer for $15 or $20 an hour, sure.   And they might be an "up and coming" expert, or an "expert to be".  But right now, they aren't an expert.  So what do you get with a "non expert"?  You get your results slower, your code my be convoluted, it may not abide by standards, it may not hold up the test of time.  All of the things normally learned through experience.

So when you pay $100 or $200 an hour for an expert, you are paying for all of these things, BUT you're paying for one other VERY IMPORTANT thing that experts have.  When an expert is compensated well, money is no longer a concern. Obviously right?

The funny thing about experts, is that money is NOT the most important thing - The work is.  So by filling the pot with more than enough water (money) the pasta (expert) can boil freely.  (Sorry my metaphor is terrible).  Basically, when money is no longer on the mind of the person doing the work, they are now free to do amazing work.

With your $20 an hour guy, he's gonna stretch his 1.5 hours to 2 hours, he's gonna work while thinking about the time - "is this project really worth it?", "I can't go back and optimize it, it wasn't in the budget".

Experts can do their jobs without any of those concerns, because they are already being paid enough, so you allow them to do what they do best, and nothing else.  People generally do not work their best when they are concerned about money (or time), or if they don't feel the time spent is worth it.

In the past, before I was an "expert", I would charge $30 an hour.  And I would be doing work that others would pay $100 an hour for.  I always kind of felt that, even if I did good work, I should be charging more.  I felt like my time wasn't well spent and it kept me from really going wild on the code, from being really creative.  Later, now that I'm much better compensated, I don't even think about the money. I charge enough now, that if I want to spend 3 hours re writing some method or some function to make it way better, I can.  I can slow down on some parts because I'm not worried about spending time I shouldn't be spending.  Time is no longer a concern, because money is no longer a concern.

This is a similar point to being paid on salary vs hourly.

Tuesday, November 29, 2011

Great Design makes for Great Programming

I can't really express enough how much I believe in great design.  Part of making a really great web application, or any software in general, is ascetic appeal.  This is really 3 fold.  There is the actual visual design / look and feel of the application.  The user experience design, which is how the application is designed to function, and then the internal structure design.

I'm going to soon rant about internal design, and how imperative that is, but that is not what this post is about.  This post, is about interfaces.

There is something to be said about amazing interfaces.  I am by no means a designer, and I have really no artistic skill.  The only artistic thing I do, or am trying to do, is photography.  But as an engineer, my brain respects, and expects exceptional design.

When you create something great with code, the public won't really be able to understand that unless it's coupled with good design.  If the application feels great, looks beautiful, and is always pleasant to look at, then you've got something.  Then you have a success on your hands.

Whenever I've made some new web app, or software app, the very next thing I think about is the icon.  I don't know what it should look like, but I go right to my favorite icon guys to make me a beautiful icon.

RealTime Logo

A good icon really makes your application legitimate.

I think thats the best thing about good design. It makes your work Real. It makes it professional.  Sure I can tell people, I made a PHP framework.  But if I say, "I made this amazing PHP framework that you can build custom frameworks out of, It's called CornerStone". And couple that with the icon on the left here. Then yea, you want this framework.  It shows a level of legitimacy, that your applications wouldn't normally have.

The same goes for websites.  having a website with a bad, or mediocre design is just not acceptable.  If you want to make it in todays web world, you have to have designs that make people notice the design. Not just pass it by.

You want people to love your company, love your brand, and respect your work. Great functionally is only half the battle, Great design is what brings it all together.

*the icons were designed by iphone-icon.com.

Monday, October 17, 2011

Token Replacement inside DocX

Before I get into this.  YES you can do this same thing with some standard microsoft tools like excel and access.  There is even a PHP class already built for this.


So have you ever needed to work with "less than computer savvy" clients?  And maybe they need to have document templates for whatever reason.  Well normally when you generate a word document or PDF you have to get a PHP class to generate that, and code in the document. That way you can dynamically generate the document on the fly when you need to.

Well that would take you a long time to type up say.. 20 documents.  Wouldn't it be cool if you (or the client) could just create their own templates in word, and your system would understand that? AND be able to generate a document based on that template?

Well I wouldn't be writing this blog if the answer was "sorry we can't do that".

Opening the Docx

So whats the technique?  It turns out that docX files are just zip files.  You literally can rename docx to zip and unzip it.

You get the following files when you unzip

Well inside the word folder is a file called document.xml. That file is the actual content of your word doc. Which means you can replace the text right there.

Re-Creating the DocX
So now that you have edited these files, you need to make them into a docx again. Just zip it back up, and rename it docx. Done and done.

PHP can do this for us
So all of the things we just did, php can do for us. So that means we can build this into our systems.

Step 1) Create a temp folder to store the extracted contents of the docx file

All this code does is create the temp directory if it does not exist. If it already exists, clean it out. Refer to the youtube video for the full code, and to see what recursive_remove_directory does (if you haven't figured it out)

Step 2) make sure the directory path is safe for shell use
So were going to be executing linux commands using shell_exec, and you can't have spaces and other random things in the path. So we just need to escape that first.
Step 3) Unzip to the temp folder
This is just a shell command
Step 4) Replace tokens.
So now we get the contents of the document.xml file, use str_replace to replace our tokens, then save it back.
Step 5) Re-zip ONLY the files we need.
we are going to specify the files here, because mac os x likes to create random folders when it unzips from the command line...
And thats it!
Now we have programmatically token replaced a docx file.

Here is the full tutorial

Thursday, August 18, 2011

When you know you should give up

I needed to know how to play vimeo videos inside and iPhone App.  So I googled for "vimeo videos inside iPhone app"

I found the first stack overflowlink to

Which had the accepted answer of using some "tips and tricks" which was a link to

I read that PDF and the code looked really familiar.  So I went to the blog post that the PDF came from.

And on it was:
Thanks to YouTube user “optikalefxx” for posting his solution for everyone.

So turns out... I wrote the solution a year ago. Haha.  Too bad it doesn't work anymore.

Thursday, August 4, 2011

Which E-Commerce Solution Works for Me?

One of the higher paying jobs that I come across is E-Commerce jobs.  That's because clients know that they need to spend more money to ensure they can collect theirs.

There are quite a few popular choices when it comes to online payments, here are the most common in my eyes.

1) Donate button
2) Selling 1 or 2 things
3) Selling a bunch of products
4) You're serious about selling a lot of products
5) Payments integrated into your website
6) Recurring payments

1) Donate Button
This payment option should cost you next to nothing. You just create a paypal account, go create a button, say its for donate, and bam paste some HTML code onto your page.  If someone charges you for this, tell them they should be ashamed.  Just take them out to dinner or something, this payment option is really simple to do.

2) Selling 1 or 2 things
When you just have less than 5 things to sell, you have basically 2 ways of going about this.  You can go the easy way and just create buttons like we did for the donate button.  Thats really easy, and you can just paste those into your site.  But lets say you want a shopping cart now that you have multiple items.  Well paypal gives you this really easy to use FREE api called "3rd party shopping cart" that lets the developer have a bit more customization.  To sell a product you just put this HTML on the page

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="seller@designerfotos.com">
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item Name 2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">

So you can sell any number of products in a shopping cart type way using this HTML.  You can even incorporate discounts by using discount_amount_cart and discount_rate_cart.  You can even discount individual items with discount_amount_x and discount_rate_x.  Where rate is a percentage and amount is a dollar amount off.

3) Selling a bunch of products
If your selling lots of products, more than 10 I would say, then you need a store.  An online store is a solution that allows you add products, edit them, save user information, view order details etc.  Its quite a full featured solution for managing an online store.  This option should not cost that much either, because as the developer you can install something FREE like OpenCart and then let your client add all the products.  Then you just charge for design work making it look better.  OpenCart is really a great store and it allows you have users checkout with paypal (free) or by taking credit cards ($30 a month)

4) Serious Online Store
While OpenCart is great, its not advanced. It doesn't do fraud store checkout, it doesn't integrate with UPS world ship, or USPS Dazzle (these are both shipping programs).  It also has a very primitive inventory control.  A paid / hosted online store like Volusion or Magento is a better solution.  They will give you support agents, and have a very fully functional store, that even integrates right with quickbooks.  Customers can pay by credit card, paypal, check, money order or smoke signal.  If you are buying one of these stores, it can cost 6 to 800 a month, and  you will need someone full time to manage CRM (customer reports), Products and orders.  This is the real deal.

5) Integrated Payments
Lets say you already have a bunch of products on your site, and you already love the way it looks.  Or say you need some super custom shopping cart, or even a affiliate payment program.  All of these tasks can be accomplished with an integrated solution.  This is where you start paying a lot.  These solutions require a programmer that really knows the paypal APIs well, and knows how to integrate Paypal payments pro and payments standard as well as express checkout.  This is the most fun type for me because its by far the most challenging.

6) Recurring Payments
This is also a fun one.  Sometimes you need to handle monthly payments or any kind of recurring payment really.  There are again 2 ways to go about this. You can do the "free" way and use the "3rd party shopping cart" to integrate this. Or use Paypal payments Pro ($30 a month) if you wanna take credit cards and have recurring fees. Here are the needed variables for the free way.

$_POST['business'] = "seller@yoursite.com";
$_POST['cmd'] = "_xclick-subscriptions";
$_POST['a3'] = 30.00;
$_POST['p3'] = "1";
$_POST['t3'] = "Y";
$_POST['src'] = "1";
$_POST['item_name'] = "Single User Yearly Subscription";
$_POST['item_number'] = 2;
$_POST['sra'] = "1";
$_POST['no_shipping'] = "1";
$_POST['no_note'] = "1";
$_POST['return'] = "http://come/back/after/complete;
$_POST['currency_code'] = "USD";
$_POST['lc'] = "US";
$_POST['bn'] = "PP-SubscriptionsBF";

This sets up a 1 year recurring payment of $30 a year.

So you can see there are many ways to accept payments on your site, and this is only a few of them.  There are many more ways included Mass pay, parallel payments, working directly with your bank and more!  If you want to make good money as a web developer, learn the paypal apis.