Free Open Source Sentiment Analysis

I discovered a cool little sentiment analysis tool thanks to my buddy, Wilhelm. It’s built in Python with Python NLTK Text Classification. Check it out!

Sentiment analysis (also known as “opinion mining”) refers to the application of natural language processing, computational linguistics, and text analytics to identify and extract subjective information in source materials.

Generally speaking, sentiment analysis aims to determine the attitude of a speaker or a writer with respect to some topic or the overall contextual polarity of a document. The attitude may be his/her judgment or evaluation (see appraisal theory), affective state (that is to say, the emotional state of the author when writing), or the intended emotional communication (that is to say, the emotional effect the author wishes to have on the reader).

How to Enable Remote Access to MySQL

MySQL remote access is disabled by default, but with a few simple steps, you should be up and running with remote MySQL in just a few minutes. This is especially useful when working with multiple developers in an Agile project environment, so that you all use the same data set, and can focus on just writing the application.

Make note that I’m not focused on the “most secure” way for that you would probably want to do all of this through an ssh tunnel. However, this should be plenty secure for most developers, especially if you’re working with a dev server and not production which is what I’ve geared this post towards.

Login to SSH to edit remote MySQL config

First, we need to edit the mysql config file to accept and bind remote connections to your server. We do this by editing your my.conf file located on most unix systems at /etc/my.conf or /etc/mysql/my.conf. I’m going to hope and assume you know the basics to ssh into your remote server and vi or nano the conf file.

ssh root@yourserver.com
vi /etc/my.conf

Replace mysqld Defaults

You can either set this up as a new connection or override the default, in this case, I replaced the default connection with my own remote connection settings. Keep in mind if you want to be creative and bind to localhost without interfering with other settings or services you can bind to 0.0.0.0 or another alias.

[mysqld]
bind-address    = 255.112.324.12
port            = 3306
user		= mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/English
# skip-networking
# skip-external-locking

After your done editing, just save and close the file and restart mysql services:

# Ubuntu
service mysql restart
# Other Unix
/sbin/init.d/mysql restart
# Test that your connection is allowed with telnet on your local machine:
telnet 255.112.324.12 3306

Granting Remote Access to MySQL Users

Now we’ve created our remote config for MySQL, we have to grant access to this server to other machines.

mysql -uroot -pMyPass
CREATE DATABASE mydb;
# Grant permission to root from any host:
GRANT ALL ON mydb.* TO root@'%' IDENTIFIED BY 'MyPASSWORD';

Open Up MySQL Remote Ports

Now that our user has been granted access from any host, all thats left is to make sure our OS will allow connections to the default MySQL port

/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT

And now we should be able to login to our server from our local machine:

mysql -h255.112.324.12 -uroot -pMyPASSWORD

Does this work for you? Comments or suggestions?

MongoDB Tools and Techniques in Denver

I’m really excited for our upcoming mongo meetup (July 31, 2013) in Denver! We will be discussing various software to manage mongoDB such as GUI apps for mongo, how to monitor mongoDBmigrate RDBMS databases to Mongo, and run benchmarks on MongoDB with GO!

MongoDB Topics

We have about five formal speakers for this next meetup, with some informal conversations and social time before and after the presenters. If you’re interested in speaking or sharing at any future meetup, don’t wait to contact me, just bring your laptop and show and tell!

MongoDB Monitoring Service (MMS)

Anthony Hildoer will be giving us a quick introduction into 10gen’s MMS. MongoDB Monitoring Service is a free, cloud-based service provided by 10gen for monitoring MongoDB deployments in real time. It collects statistics on all key server and hardware indicators and presents the data in a web console. Designed specifically for mongo, MMS provides users the visibility they need to manage and optimize their deployments.

Tricks and Tools to manage your Data

I will be speaking about various applications for managing your databases such as MongoHubServer Density, and other tools for importing MySQL into Mongo, monitoring the mongod services on your servers, and viewing your data in a clean and simplistic interface.

MongoDB Aggregation Framework and ODM vs Native Driver

John Cox will be talking about his experiences using MongoDB with Ruby on Rails and Sinatra. He has overcome many obstacles and challenges dealing with performance, and has found that in many cases and contexts the Aggregation framework and Native Driver are better to use than the simplicity provided by ODM layers like Mongoid.

Benchmarks with Go

Levi Cook and Cory LaNou will be talking about how they use Golang with MongoDB. Since Go is equipped with some of the best benchmarking tools of any language, it has major gains in analyzing write throughput from app to db. They will also be talking about the pros and cons of sharding in MongoDB when it comes to high volume of writes.

I look forward to this meetup, and will be posting slides, photos and videos on the meetup page afterwards! Spread the word!

Faster Rails Deployment on Heroku

Heroku can be painfully slow when compiling assets, even if you do all your compiling locally. Luckily, with a couple small tweaks you can cut this time down significantly (given your deploys are indeed slowed down by assets and not something else). Since heroku treats each deployment as an isolated environment – which is actually pretty awesome, especially with heroku fork – Sprockets and other gems can’t really leverage those previous asset compilations. The solution is creating a shared cache between your deploys, assuming you don’t mind your assets being shared.. this solution is actually a bit counter-intuitive to heroku forks and some other features in some ways.

First you need to enable a Memcache Add-on for your application in the Heroku dashboard (or via command line). Like many heroku add-ons you can opt for a free plan with Iron Cache or MemCachier for simple and small applications. Once you’ve enabled your cache service you just need to enable environment variable for your app during pre-compile. It’s a labs feature for now, but I suspect it’ll stay around:

heroku labs:enable user-env-compile

If you’re going to use memcachier, you simply need to add the dalli and memcachier gems to your Gemfile and then configure Sprockets inside of your Rails app:

# config/environments/production.rb config.assets.cache_store = :dalli_store

And with that, you should see the benefits kick in right away! Post your results or other tricks in the comments!

CMS Rivalry: WordPress vs Drupal vs ExpressionEngine

WordPress vs Drupal vs ExpressionEngine

We’re constantly asked to rate WordPress vs Drupal vs ExpressionEngine, but the truth is: No two clients or projects are the same. I think this is a simple fact that you should really consider before reading on. Far too often, I see freelancers and firms adopting a single system or technology and hacking it to meet the demands of the client, and this post serves as a warning and thought about how technology should and shouldn’t be used in solving problems; specifically when it comes to content management.

Note that this is a shortened comparison of some of the most popular PHP-based Content Management Systems (CMS). The views and opinions expressed are simply that; derived from years of working with different technologies, with various clients and challenges. I’m intentionally picking only three platforms to compare at this time, as they are the most commonly used platforms in our industry and used by our competitors. I should state now that I absolutely love wordpress and expressionengine and loath drupal, but that my emotions towards these platforms are not unprecedented.

Drupal CMS

At the time of this post, I’m talking about Drupal 7 and older. If by some miracle, Drupal has evolved to be an OOP system with any kind of programming pattern at it’s core, you may ignore this rant.

Why companies suggest Drupal

Drupal is a very robust and extensible platform due mainly to the fact that it’s been around since the first internet boom. The platform has been pushed and prodded to evolve from a blogging system to a CMS, forum, and intranet over the years. Drupal is also extremely easy to learn, as most of the code is very linear and managed from within the system. This makes drupal ideal to low level developers as it’s extremely accessible with many docs, and gives a developer the feeling that they can build anything. Drupal is also one of the few systems that can run within a windows environment without ripping your hair out fully.

Should you use Drupal? (Hint: the answer is “no”)

If you’re a junior or mid-level developer, you’ll be enticed to use drupal because it’s a step above wordpress in terms of hands-on-code, but it’s not so technical that you’ll ever get in over your head. Drupal is a very tempting choice to developers for it’s mid-level range, but I encourage you to avoid it if you don’t want to be constant support for the client or if you want to grow as a PHP developer, and here’s why:

Drupal drops the ball when it comes to Backward Compatibility: Drupal is in constant development, and each launch lacks backwards compatibility with the previous version. This makes it extremely frustrating as each year you have to upgrade old sites manually and modify the code to have it working correctly with the new version. The reason why drupal really bites with backwards compatibility is because the code is SO LINEAR. This system is nowhere near modular when it comes to architecture, and as such, maintenance for the core team of developers means small changes in one area impact the entire chain of modules, functions, etc.

Your clients will hate Drupal from a Usability Standpoint: Most aspects of Drupal’s administration interface are confusing and intimidating, particularly for new administrators. This makes it difficult to train clients and you usually have to provide documentation and instructions for clients to be able to use it correctly. Most casual users are willing to sacrifice features for ease of use, making Drupal less popular than systems such as WordPress which offers point and click extensibility and a great user interface.

WordPress CMS

It’s actually really amusing to me to call WordPress a CMS finally. Years ago, when I originally wrote this article, I didn’t even bother discussing WordPress because it was really only a blogging platform. Well over time, all platforms are pushed to become more than they were originally intended for, and WordPress is no exception to that rule. I really only have good things to say about wordpress overall, with some slight caveats.

WordPress is STILL mostly a blog-based solution

And the best damn blog you’ll ever use. With community support and effort, WP has implemented great plugin and theming frameworks that really take the platform to another level of blogging. In terms of really simple content management, WordPress dominates with it’s slick interfaces and ease of use. However, this is also the downfall to WordPress, especially if you break the barrier of blogging and want to grow into a larger website. WordPress is not easily scaled to perform advanced Content Management or even mass amounts of blogging content. In fact, we’ve found that many sites really start suffering on Worpress once the break a threshold of roughly 750-1000 posts or 100k in monthly traffic. If you don’t believe us, run the benchmarks yourself. Further, wordpress simply doesn’t want to become a bloated and robust content management system. Requests and need for further expansion has been separated into projects like BuddyPress and paid plugins. The WP team has traded strength for agility, and in their case it was definitely the right choice.

ExpressionEngine: One platform to rule them all

I’m bias, and it’s obvious, but my opinions are not blind or malformed. I’ve worked extensively with both WordPress and Drupal, and have launched at least 50 sites on each of them. After working with ExpressionEngine on both small and large projects I’ve come to a few conclusions: expressionengine is faster, more powerful, and as easy to use as both drupal and wordpress. EE has so many features that I could go on and on about but let’s just assume it can do everything that WP and Drupal can, and move on to address usability, scale, and programming which the other frameworks lacked in.

Corporate and plain or simple and easy?

WordPress wins the battle in terms of beauty, but EE is no slouch when it comes to design and usability. ExpressionEngine is easily 10 times larger than WordPress and generally with scale and features come disorganization and clutter in most systems (ahem, Drupal). Thankfully EllisLabs, the inventor of ExpressionEngine, played it smart when it came to building a CMS that is both expansive and well managed. By going the enterprise route and charging a nominal fee, EllisLabs was able to build EE with well thought out navigation, plugin management, and built on the framework, CodeIgnitor, which means as a programmer I have the power of a custom application framework at the core, which makes EE infinitely more powerful than WP or Drupal.

Don’t take my word for it

You’re likely either a developer or curious client reading this, and you’ve probably formed your own opinion (or been impressed with the opinions of others) without fully understanding these three platforms in detail. For the non-believer, I encourage you to check out the following links and read what they have to say. You’ll find many articles with opinions, but keep in mind opinion is a matter of experience. In my case, I’ve worked with all three for over 3 years (each) and launched at least 50 websites, intranets, or custom applications on all of them. With that, I leave you to explore, or argue at will:

Articles on WordPress

  1. Ranks well on this guy’s list for the same reasons I outlined.
  2. WordPress needs an entire knowledge base on overcoming it’s performance hits in high volume
  3. There are clear memory leaks with WordPress

Articles on Drupal

  1. These benchmarks show that Drupal is better than WordPress in terms of load
  2. Paul Kortman sides with Drupal in terms of developer support and scale

Articles on ExpressionEngine

  1. This spreadsheet cites more examples and features than I have time for
  2. Once again, Paul only has good things to say about the quality and enterprise level of developers for EE