<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kevin McAlear on Medium]]></title>
        <description><![CDATA[Stories by Kevin McAlear on Medium]]></description>
        <link>https://medium.com/@KevinMcAlear?source=rss-7a2f2d0e7793------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z60l7f7wA6XSzo8u3DcLSg.jpeg</url>
            <title>Stories by Kevin McAlear on Medium</title>
            <link>https://medium.com/@KevinMcAlear?source=rss-7a2f2d0e7793------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:42:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@KevinMcAlear/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Hater News]]></title>
            <link>https://medium.com/@KevinMcAlear/building-hater-news-62062c58325c?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/62062c58325c</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Mon, 27 Oct 2014 03:51:01 GMT</pubDate>
            <atom:updated>2014-10-27T03:51:01.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*A1NTpE_V2YQZsdg2.jpg" /></figure><h3>Hater News</h3><p>Haterz gonna hate. <a href="http://haternews.herokuapp.com/">But now you can know who the haterz are</a>. I wanted to use data science / machine learning to identify and rank trolls by their “hater” level throughout the internet. I started with Hacker News ( check out <a href="http://haternews.herokuapp.com/">Hater News</a> ) and I wanted to explain the how and what I’ve done so far.</p><p>This post is long and detailed but I’ve tried to explain and post my code for how I’ve built out the Machine Learning aspects of this project using Python and <a href="http://scikit-learn.org/stable/">Scikit Learn</a>.</p><h3>My Goal:</h3><p>Look at any user from <a href="https://news.ycombinator.com/">hacker news</a> and be able to tell if they are a “hater” or not based on a score I give them. Then turn the whole thing into a web app so anyone can use it.</p><h3>Feel Free To Look Under The Hood.</h3><p><a href="https://www.kaggle.com/c/detecting-insults-in-social-commentary/data">The Classifier Data I’m Using</a>.</p><p><a href="https://github.com/HackerNews/API">Hacker News API I’m Using</a>.</p><p><a href="https://github.com/kevinmcalear/hater_news">My GitHub Repo</a>.</p><p><em>*Side Note: Eventually I would love to turn this into a </em><a href="https://developer.chrome.com/extensions/getstarted"><em>Chrome App</em></a><em> that will just real-time analyze any user on a page when you visit hacker news and put a score right next to them so the world can see if they hate or love. I’m also going to build versions of this for Twitter, reddit, Instagram, Facebook, and maybe even dating apps. If you want to help, reach out!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/15/0*voqp8uCGaxMIGHFN.gif" /></figure><h3>Lets Get Started!</h3><p>We will begin by importing all of the required items we need from things like <a href="http://scikit-learn.org/stable/">scikit learn</a>, <a href="http://pandas.pydata.org/pandas-docs/stable/10min.html">pandas</a>, <a href="http://www.numpy.org/">numpy</a>, and even play around with things like <a href="http://www.nltk.org/">nlk</a> and <a href="https://docs.python.org/2/library/re.html">re</a>.</p><p>The basic idea will be to split out each comment, create features based on things like if a word shows up in a comment or not, if insulting words appear, and other types of features. Once I have that then I will add in a classifier and if it scores well we are on our way to finding haters!</p><p>In [1]:</p><pre># Importing my standard stuff <br>import pandas as pd <br>import numpy as np </pre><pre># Importing different Vectorizers to see what makes my soul sing the loudest. <br>from sklearn.feature_extraction.text import TfidfVectorizer <br>from sklearn.feature_extraction.text import CountVectorizer </pre><pre># Importing various Classifiers to see what wins out. There can only be one!  <br>from sklearn.linear_model import Perceptron <br>from sklearn.svm import LinearSVC <br>from sklearn.svm import SVC <br>from sklearn.linear_model import LogisticRegression </pre><pre># Snagging the validation stuff to see how well things do. <br>from sklearn.pipeline import Pipeline <br>from sklearn.cross_validation import cross_val_score </pre><pre># Getting Stopwords to potentially improve accuracy. <br>from nltk.corpus import stopwords <br># Messing with tokenization via NLTK <br>from nltk import word_tokenize, pos_tag </pre><pre># Messing with Stemming <br>from nltk.stem import PorterStemmer <br># Messing with Lemmatizing <br>from nltk.stem.wordnet import WordNetLemmatizer <br># Messing with some other string splitting techniques. You can use the following thing like this: # re.split(‘; |, ‘,str) <br>import re</pre><h3>Exploring Different Ways To Achieve My Goal.</h3><p>Here I am importing my data using <strong>pandas</strong>, pulling out the right features and assigning them to my X &amp; y to put into my models. You’ll notice that I’m actually using both my test &amp; training data in a single variable because of how <a href="http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.cross_val_score.html">cross_val_score</a> works later on.</p><p>In [2]:</p><pre># Setting up my english stopwords, yo. <br>stopwords = stopwords.words(‘english’) </pre><pre># Here I combined my training &amp; test data. I will used this as main total “training” data in production &amp; for cross_val stuff. <br>corpus = pd.read_csv(‘data/total_data.csv’) </pre><pre># Setting Up my X &amp; y <br>X_raw = corpus.Comment <br>y_raw = corpus.Insult </pre><pre># Setting Up My Different Pipelines. I tried out several different combos to see where to go next. <br>pipeline = Pipeline([ (‘vect’, TfidfVectorizer(binary=True, use_idf=True, stop_words=’english’)), (‘clf’, LogisticRegression()) ]) <br>other_pipeline = Pipeline([ (‘vect’, CountVectorizer(binary=True)), (‘clf’, LogisticRegression()) ]) <br>LSVC_pipeline = Pipeline([ (‘vect’, TfidfVectorizer(binary=True, use_idf=True, stop_words=’english’)), (‘clf’, LinearSVC()) ]) <br>Perceptron_pipeline = Pipeline([ (‘vect’, TfidfVectorizer(binary=True, use_idf=True, stop_words=’english’)), (‘clf’, Perceptron()) ])</pre><h3>EVALUATION TIME!</h3><p>Here I am looking at <strong>Accuracy</strong>, <strong>Precision</strong>, &amp; <strong>Recall (</strong><a href="http://en.wikipedia.org/wiki/Precision_and_recall">learn more</a>) and using the <strong>cross_val_score </strong>method which splits up my data, takes the <strong>pipelines </strong>I made, and then evaluates it over and over, in different combinations against itself to get a reliable score.</p><p>I want a good overall score but I would also like to improve my Recall as much as possible. Recall gives me a measurement of false negatives, meaning a score based on if I miss-classify something by saying a comment is NOT insulting when in fact it actually is. I am interested in a high score using this measurement to ensure <a href="http://www.quickmeme.com/img/a3/a3e69566093ab74d0625a7c5892cade8c2adeecd86112356875ff2b05fcd020d.jpg">no hater is left behind</a>.</p><p>In [3]:</p><pre># THE INITIAL ‘STATNDARD’ MODEL I STARTED WITH <br>accuracy_scores = cross_val_score(pipeline, X_raw, y_raw, cv=5) precision_scores = cross_val_score(pipeline, X_raw, y_raw, cv=5, scoring=’precision’) <br>recall_scores = cross_val_score(pipeline, X_raw, y_raw, cv=5, scoring=’recall’) </pre><pre>print “***************OUR RESULTS***************” <br>print <br>print <br>print “TfidfVect + Logistic Regression” <br>print “———————————————-” <br>print “Accuracy:”, accuracy_scores, “Mean:”, np.mean(accuracy_scores) <br>print “Precision:”, precision_scores, “Mean:”, np.mean(precision_scores) <br>print “Recall:”, recall_scores, “Mean:”, np.mean(recall_scores) </pre><pre># VS NORMAL COUNT VECTORIZER **NOTE** Out of all of the models without extra features, this performed the best for my goals. <br>other_accuracy_scores = cross_val_score(other_pipeline, X_raw, y_raw, cv=5) <br>other_precision_scores = cross_val_score(other_pipeline, X_raw, y_raw, cv=5, scoring=’precision’) <br>other_recall_scores = cross_val_score(other_pipeline, X_raw, y_raw, cv=5, scoring=’recall’) <br>print <br>print <br>print “CountVect + Logistic Regression” <br>print “———————————————-” <br>print “Accuracy:”, other_accuracy_scores, “Mean:”, np.mean(other_accuracy_scores) <br>print “Precision:”, other_precision_scores, “Mean:”, np.mean(other_precision_scores) <br>print “Recall:”, other_recall_scores, “Mean:”, np.mean(other_recall_scores) </pre><pre># VS NORMAL COUNT VECTORIZER <br>LSVC_accuracy_scores = cross_val_score(LSVC_pipeline, X_raw, y_raw, cv=5) <br>LSVC_precision_scores = cross_val_score(LSVC_pipeline, X_raw, y_raw, cv=5, scoring=’precision’) <br>LSVC_recall_scores = cross_val_score(LSVC_pipeline, X_raw, y_raw, cv=5, scoring=’recall’) <br>print <br>print <br>print “TfidfVect + LinearSVC” <br>print “———————————————-” <br>print “Accuracy:”, LSVC_accuracy_scores, “Mean:”, np.mean(LSVC_accuracy_scores) <br>print “Precision:”, LSVC_precision_scores, “Mean:”, np.mean(LSVC_precision_scores) <br>print “Recall:”, LSVC_recall_scores, “Mean:”, np.mean(LSVC_recall_scores) </pre><pre># VS NORMAL COUNT VECTORIZER <br>Perceptron_accuracy_scores = cross_val_score(Perceptron_pipeline, X_raw, y_raw, cv=5) <br>Perceptron_precision_scores = cross_val_score(Perceptron_pipeline, X_raw, y_raw, cv=5, scoring=’precision’) <br>Perceptron_recall_scores = cross_val_score(Perceptron_pipeline, X_raw, y_raw, cv=5, scoring=’recall’) <br>print <br>print <br>print “TfidfVect + Percptron” <br>print “———————————————-” <br>print “Accuracy:”, Perceptron_accuracy_scores, “Mean:”, np.mean(Perceptron_accuracy_scores) <br>print “Precision:”, Perceptron_precision_scores, “Mean:”, np.mean(Perceptron_precision_scores) <br>print “Recall:”, Perceptron_recall_scores, “Mean:”, np.mean(Perceptron_recall_scores)</pre><p>return:</p><pre>***************OUR RESULTS*************** </pre><pre>TfidfVect + Logistic Regression ———————————————- <br>Accuracy: [ 0.81969697 0.81439394 0.81790592 0.81942337 0.81866464] Mean: 0.818016967858 <br>Precision: [ 0.85806452 0.825 0.84615385 0.8313253 0.84713376] Mean: 0.84153548429 <br>Recall: [ 0.38108883 0.3782235 0.37931034 0.39655172 0.38218391] Mean: 0.383471659586 </pre><pre>CountVect + Logistic Regression ———————————————- <br>Accuracy: [ 0.83939394 0.84848485 0.84218513 0.84825493 0.84066768] Mean: 0.843797305375 <br>Precision: [ 0.75464684 0.76895307 0.74137931 0.75694444 0.73793103] Mean: 0.751970939603 <br>Recall: [ 0.58166189 0.61031519 0.61781609 0.62643678 0.61494253] Mean: 0.610234495933 </pre><pre>TfidfVect + LinearSVC ———————————————- <br>Accuracy: [ 0.83181818 0.82878788 0.8323217 0.84066768 0.82776935] Mean: 0.832272957189 <br>Precision: [ 0.74329502 0.743083 0.73605948 0.75367647 0.7122807 ] Mean: 0.737678935001 <br>Recall: [ 0.55587393 0.53868195 0.56896552 0.58908046 0.58333333] Mean: 0.567187036854 </pre><pre>TfidfVect + Percptron ———————————————- <br>Accuracy: [ 0.8 0.80606061 0.79742033 0.79817906 0.79362671] <br>Mean: 0.799057341242 <br>Precision: [ 0.64214047 0.63716814 0.6231003 0.61452514 0.60795455] Mean: 0.624977719778 <br>Recall: [ 0.55014327 0.61891117 0.58908046 0.63218391 0.61494253] Mean: 0.601052267562</pre><h3>Now That I Have A Baseline, Time to Pick A Model And Build It Out Further.</h3><p>I ended it up picking <strong>CountVectorizer + Logistic Regression </strong>which you will see further down. In order to improve the score I started to play with extra features adding them manually and “hand making” them. These are almost meta data about each document that I was hoping would help give extra information to my classifier. They are things like How many “bad words” are used in a specific comment or the ratio of bad words used vs how many words total were in a comment. I even tried to look at things like if someone spoke in all CAPS or not to see if that could help predict if the comment is insulting or not.</p><p>In [4]:</p><pre># Setting up our actually train and test data sets <br>train_corpus = pd.read_csv(‘data/train.csv’) <br>test_corpus = pd.read_csv(‘data/test_with_solutions.csv’) </pre><pre># Getting our list of “badwords” <br>badwords = set(pd.read_csv(‘data/my_badwords.csv’).words) <br># If you would like to see what some of these words look like, play with this: <br>print “Some Badwords We Will Check:”, list(badwords)[0:9] <br>print </pre><pre># Setting Up my X &amp; y <br># NOTE: If you want to use all the data (including the test data), uncomment out the other X &amp; y trains below. <br>X_train = train_corpus.Comment <br>y_train = train_corpus.Insult <br>X_train = corpus.Comment <br>y_train = corpus.Insult <br>X_test = test_corpus.Comment <br>y_test = test_corpus.Insult </pre><pre># Just giving feedback so we know if we are using all of the data to train the model or not. <br>print “X_train’s number of instances:”,X_train.shape[0] print <br>if X_train.shape[0] &gt; train_corpus.Comment.shape[0]: <br> print“************************************************************ *************************************************” <br> print “***JUST AN FYI, YOU’RE USING BOTH THE TRAINING &amp; TESTING DATA FOR TRAINING. SHOULD BE FOR PRODUCTION ONLY.***” <br> print “*************************************************************************************************************” <br>else: <br> print “———————————————————————————————————” <br> print “You are using just the training data for training. Makes sense, right?” <br> print “———————————————————————————————————”</pre><p>return:</p><pre>Some Badwords We Will Check: [‘bugger’, ‘jizz’, ‘l3i+ch’, ‘f u c k e r’, ‘s hit’, ‘ma5terbate’, ‘bum’, ‘bimbo’, ‘pimpis’] <br>X_train’s number of instances: 6594 ************************************************************************************************************* <br>***JUST AN FYI, YOU’RE USING BOTH THE TRAINING &amp; TESTING DATA FOR TRAINING. SHOULD BE FOR PRODUCTION ONLY.*** *************************************************************************************************************</pre><p>Here I add in various extra features to help my classifier out. These are features that I had to manually create and add into my model so I didn’t use cross_val_score and had to evaluate them manually.</p><h3>Features I added to improve the model are the following:</h3><ul><li><strong>badwords_count – </strong>A count of bad words used in each comment.</li><li><strong>n_words – </strong>A count of words used in each comment.</li><li><strong>allcaps – </strong>A count of capital letters in each comment.</li><li><strong>allcaps_ratio – </strong>A count of capital letters in each comment / the total words used in each comment.</li><li><strong>bad_ratio – </strong>A count of bad words used in each comment / the total words used in each comment.</li><li><strong>exclamation – </strong>A count of “!” used in each comment.</li><li><strong>addressing – </strong>A count of “@” symbols used in each comment.</li><li><strong>spaces – </strong>A count of spaces used in each comment.</li></ul><p>In [5]:</p><pre># Since I was unhappy with aspects of my score, I added addtional features my classifier can use <br># This is just a count of how many bad word <br>train_badwords_count = [] <br>test_badwords_count = [] </pre><pre>for el in X_train: <br>  tokens = el.split(‘ ‘) <br>  train_badwords_count.append(len([i for i in tokens if i.lower() in badwords])) </pre><pre>for el in X_test: <br>  tokens = el.split(‘ ‘) <br>  test_badwords_count.append(len([i for i in tokens if i.lower() in badwords])) </pre><pre># **SHOUT OUT** <br># I was messing with stuff from Andreas Mueller for these next features. Thanks man! ☺  <br># His Blog Post on this: <a href="http://blog.kaggle.com/2012/09/26/impermium-andreas-blog/">http://blog.kaggle.com/2012/09/26/impermium-andreas-blog/</a>  <br># **SHOUT OUT** <br>train_n_words = [len(c.split()) for c in X_train] <br>test_n_words = [len(c.split()) for c in X_test] <br>train_allcaps = [np.sum([w.isupper() for w in comment.split()]) for comment in X_train] <br>test_allcaps = [np.sum([w.isupper() for w in comment.split()]) for comment in X_test] <br>train_allcaps_ratio = np.array(train_allcaps) / np.array(train_n_words, dtype=np.float) <br>test_allcaps_ratio = np.array(test_allcaps) / np.array(test_n_words, dtype=np.float) <br>train_bad_ratio = np.array(train_badwords_count) / np.array(train_n_words, dtype=np.float) <br>test_bad_ratio = np.array(test_badwords_count) / np.array(test_n_words, dtype=np.float) <br>train_exclamation = [c.count(“!”) for c in X_train] test_exclamation = [c.count(“!”) for c in X_test] <br>train_addressing = [c.count(“@”) for c in X_train] <br>test_addressing = [c.count(“@”) for c in X_test] <br>train_spaces = [c.count(“ “) for c in X_train] <br>test_spaces = [c.count(“ “) for c in X_test] </pre><pre>print “train_badwords count:”, len(train_badwords_count), “test_badwords count:”, len(test_badwords_count), <br>print “train_allcaps count:”, len(train_allcaps), “test_allcaps count:”, len(test_allcaps)</pre><p>return:</p><pre>train_badwords count: 6594 test_badwords count: 2647 train_allcaps count: 6594 test_allcaps count: 2647</pre><h3>Time To Pick Our Model &amp; Add In Our New Features.</h3><p>Now that we have our new features we need to pick a vectorizer, smash the new features inside of our vectorized old features, and evaluated everything with our classfier.</p><p>In [6]:</p><pre># SIDE NOTE: TfidfVectorizer sucks for this type of problem. Well, you could use it and not use idf and it does get better but not too much… <br># vect = TfidfVectorizer(binary=True, use_idf=True, stop_words=’english’) <br>vect = CountVectorizer(binary=True) <br>clf = LogisticRegression()</pre><p>I’m basically fiting and transforming our features via our vectorizer and then useing .<a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html">reshape( </a>) &amp; <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.hstack.html">np.hstack( </a>) to manually add in our extra features.</p><p>In [7]:</p><pre>X_train_transform = vect.fit_transform(X_train) <br>X_test_transform = vect.transform(X_test) <br>train_reshaped_badwords = np.array(train_badwords_count).reshape((len(train_badwords_count),1)) <br>test_reshaped_badwords = np.array(test_badwords_count).reshape((len(test_badwords_count),1)) train_reshaped_n_words = np.array(train_n_words).reshape((len(train_badwords_count),1)) test_reshaped_n_words = np.array(test_n_words).reshape((len(test_badwords_count),1)) train_reshaped_allcaps = np.array(train_allcaps).reshape((len(train_badwords_count),1)) test_reshaped_allcaps = np.array(test_allcaps).reshape((len(test_badwords_count),1)) train_reshaped_allcaps_ratio = np.array(train_allcaps_ratio).reshape((len(train_badwords_count),1)) test_reshaped_allcaps_ratio = np.array(test_allcaps_ratio).reshape((len(test_badwords_count),1)) train_reshaped_bad_ratio = np.array(train_bad_ratio).reshape((len(train_badwords_count),1)) test_reshaped_bad_ratio = np.array(test_bad_ratio).reshape((len(test_badwords_count),1)) train_reshaped_exclamation = np.array(train_exclamation).reshape((len(train_badwords_count),1)) test_reshaped_exclamation = np.array(test_exclamation).reshape((len(test_badwords_count),1)) train_reshaped_addressing = np.array(train_addressing).reshape((len(train_badwords_count),1)) test_reshaped_addressing = np.array(test_addressing).reshape((len(test_badwords_count),1)) train_reshaped_spaces = np.array(train_spaces).reshape((len(train_badwords_count),1)) test_reshaped_spaces = np.array(test_spaces).reshape((len(test_badwords_count),1)) </pre><pre>X_train_transform = np.hstack((X_train_transform.todense(), train_reshaped_badwords)) <br>X_test_transform = np.hstack((X_test_transform.todense(), test_reshaped_badwords)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_n_words)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_n_words)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_allcaps)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_allcaps)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_allcaps_ratio)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_allcaps_ratio)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_bad_ratio)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_bad_ratio)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_exclamation)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_exclamation)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_addressing)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_addressing)) <br>X_train_transform = np.hstack((X_train_transform, train_reshaped_spaces)) <br>X_test_transform = np.hstack((X_test_transform, test_reshaped_spaces))</pre><h3>Scoring Our New Model.</h3><p>Finally We get to see our new score. It seems to be doing a bit better but to start to look at recall and other measures we can set our predictions and then see how many items we missed and in what ways we missed them. Execute the final cells to see the scores.</p><p>In [8]:</p><pre>clf.fit(X_train_transform,y_train) <br>predictions = clf.predict(X_test_transform) clf.score(X_test_transform, y_test)</pre><p>In [9]:</p><pre># Run this cell to get a print out of each of our wrong predcitions, and how they were predicted incorrectly. wrong_predictions_number = 0 <br>false_negatives = 0 <br>false_postitives = 0 </pre><pre>for i,p in enumerate(predictions): <br>  if p != y_test[i]: <br>    wrong_predictions_number += 1 <br>    if p &gt; y_test[i]: <br>        false_postitives += 1 <br>        print <br>        print “++FALSE POSITIVE++” <br>    if p &lt; y_test[i]: <br>        false_negatives += 1 <br>        print <br>        print “—FALSE NEGATIVE—” <br>        print “predicted:”, p, “actual”, y_test[i]</pre><p>return:</p><pre>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>++FALSE POSITIVE++ <br>predicted: 1 actual 0 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>++FALSE POSITIVE++ <br>predicted: 1 actual 0 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 <br>—FALSE NEGATIVE— <br>predicted: 0 actual 1 </pre><p>In [10]:</p><pre># Execute this cell to see a final scoring of our new model <br>print “total number of instances:”, len(predictions), <br>print “| total number wrong:”, wrong_predictions_number, <br>print “| total false negatives:”, false_negatives, <br>print “| total false positives:”, false_postitives <br>print <br>print <br>print “ THE FINAL STATS” <br>print “————————————————————” <br>print “Percent Right:”, 100 — (float(wrong_predictions_number) / float(len(predictions))) * 100,”%” <br>print “Percent Wrong:”, (float(wrong_predictions_number) / float(len(predictions))) * 100,”%” <br>print “Percent False Negatives:”, (float(false_negatives) / float(len(predictions))) * 100,”%” <br>print “Percent False Positives:”, (float(false_postitives) / float(len(predictions))) * 100,”%”</pre><pre>total number of instances: 2647 | total number wrong: 67 | total false negatives: 54 | total false positives: 13 </pre><pre>THE FINAL STATS<br>———————————————————— <br>Percent Right: 97.4688326407 % <br>Percent Wrong: 2.53116735927 % <br>Percent False Negatives: 2.04004533434 % <br>Percent False Positives: 0.491122024934 %</pre><p>In [11]:</p><pre># Uncomment this and execute to get a list of insults to look through for more potential patterns <br># corpus.Comment[corpus.Insult == 1].to_csv(“insults.csv”)</pre><h3>Now Time To Pull In Data From Hacker News.</h3><p>Thanks <a href="https://news.ycombinator.com/">Hacker News</a> for your great <a href="https://github.com/HackerNews/API">API</a>! Here I will be using urllib2 and json to pull in and organize the data I get back from HN.</p><p>In [12]:</p><pre># Setting up a connection to the internetz <br>from urllib2 import urlopen <br># Getting things to come back <br>from json to a dict import json <br># Making that json pretty if needed <br>from pprint import pprint <br># Dealing with stupid Unicode issues <br>from django.utils.encoding import smart_str </pre><pre># Let’s make sure things work by getting a magical kitten from the interwebs <br>kittens = urlopen(‘http://placekitten.com/&#39;) <br>response = kittens.read() <br>kitty = response[559:1000] </pre><pre>print “MY PRETTY KITTY. HIS NAME IS FRANK.” <br>print <br>print kitty <br>print </pre><pre># Now time to try with Hacker News <br>username = “testhater” <br>strt_item = “8478757&quot; <br>url_usr_strt = “https://hacker-news.firebaseio.com/v0/user/&quot; <br>url_itm_strt = “https://hacker-news.firebaseio.com/v0/item/&quot; <br>url_end = “.json” <br>kevin = urlopen( url_usr_strt+username+url_end ) <br>post = urlopen( url_itm_strt+strt_item+url_end ) <br>kevin = json.loads(kevin.read()) <br>post = json.loads(post.read()) </pre><pre>print “MY HACKER NEWS ACCOUNT:” <br>print “———————————-” <br>pprint(kevin) <br>print <br>print <br>print “MY HACKER NEWS POST:” <br>print “———————————-” <br>pprint(post)</pre><p>return:</p><pre>MY PRETTY KITTY. HIS NAME IS FRANK.<br><br>                       __     __,<br>                       \,`~&quot;~` /<br>     .-=-.             /    . .\<br>    / .-. \            {   =   Y}=<br>   (_/   \ \            \      / <br>          \ \          _/`&#39;`&#39;`b<br>           \ `.__.-&#39;`          \-._<br>            |              &#39;.__ `&#39;-;_<br>            |              _.&#39; `&#39;-.__)<br>             \     ;_..-`&#39; /     //   \<br>              |   /  /    |     //     |<br>              \  \ \__)    \   //     /<br>               \__) <br><br>MY HACKER NEWS ACCOUNT:<br>-----------------------<br>{u&#39;created&#39;: 1413737356,<br> u&#39;delay&#39;: 0,<br> u&#39;id&#39;: u&#39;testhater&#39;,<br> u&#39;karma&#39;: 1,<br> u&#39;submitted&#39;: [8478765, 8478763, 8478761, 8478759, 8478757]}<br><br><br>MY HACKER NEWS POST:<br>-----------------------<br>{u&#39;by&#39;: u&#39;testhater&#39;,<br> u&#39;id&#39;: 8478757,<br> u&#39;parent&#39;: 8478079,<br> u&#39;text&#39;: u&#39;nope. everything is terrible.&#39;,<br> u&#39;time&#39;: 1413737378,<br> u&#39;type&#39;: u&#39;comment&#39;}</pre><h3>Building Out Some Functions to Ping The Hacker News API and Return Back Some Hate.</h3><p>The three main ones I use are to get the comment ID’s accociated with a username, Get all the text from each of the comments and feed them into my model to get predictions, and finally run them through a function that gives me my “hater score”.</p><p>In [13]:</p><pre># Get all of a user’s comments <br>def get_user_comments(username): <br>  comments = [] <br>  url_usr_strt = “https://hacker-news.firebaseio.com/v0/user/&quot;     <br>  url_itm_strt = “https://hacker-news.firebaseio.com/v0/item/&quot; <br>  url_end = “.json” <br>  user = urlopen( url_usr_strt+username+url_end ) <br>  user = json.loads( user.read() ) <br>  if len(user[‘submitted’]) &gt; 100: <br>    for c in user[‘submitted’][:101]: <br>      item = urlopen( url_itm_strt+str(c)+url_end ) <br>      json_item = json.loads( item.read() ) <br>      if ‘text’ in json_item: <br>        comments.append(smart_str(json_item[‘text’])) <br>   return comments </pre><pre># Get all of an item’s comments <br>def get_item_comments(itemid): <br>  comments = [] <br>  url_itm_strt = “https://hacker-news.firebaseio.com/v0/item/&quot; <br>  url_end = “.json” <br>  item = urlopen( url_itm_strt+itemid+url_end ) <br>  item = json.loads( item.read() ) <br>  if ‘kids’ in item: for c in item[‘kids’]: <br>    comment = urlopen( url_itm_strt+smart_str(c)+url_end ) <br>    json_comment = json.loads( comment.read() ) <br>  if ‘text’ in json_comment: comments.append(json_comment[‘text’]) <br>    if ‘kids’ in json_comment: <br>      for c in json_comment[‘kids’]: <br>        kcomment = urlopen( url_itm_strt+smart_str(c)+url_end )     <br>        kjson_comment = json.loads( kcomment.read() ) <br>    if ‘text’ in kjson_comment: <br>      comments.append(kjson_comment[‘text’]) <br>    if ‘kids’ in kjson_comment: <br>      for c in kjson_comment[‘kids’]: <br>         k2comment = urlopen( url_itm_strt+smart_str(c)+url_end ) <br>         k2json_comment = json.loads( k2comment.read() ) <br>    if ‘text’ in k2json_comment:    <br>       comments.append(k2json_comment[‘text’]) <br>       if ‘kids’ in k2json_comment: <br>         for c in k2json_comment[‘kids’]: <br>           k3comment = urlopen( url_itm_strt+smart_str(c)+url_end )     <br>           k3json_comment = json.loads( k3comment.read() ) <br>    if ‘text’ in k2json_comment:   <br>      comments.append(k3json_comment[‘text’]) <br>  return comments </pre><pre># Get a final Hater Score. 100 is the worst, 0 is the best.  <br>def calculate_score(predictions): <br>  total_score = [] <br>  for s in predictions: <br>    total_score.append(s[1]) <br>  return np.mean(total_score) * 100 </pre><pre># Get all a users comments and run them through my model <br>def user_score(username, my_vect, clf): <br>  comments = filter(None, get_user_comments(username)) <br>  badwords = set(pd.read_csv(‘data/my_badwords.csv’).words) <br>  badwords_count = [] <br>  <br>  for el in comments: <br>    tokens = el.split(‘ ‘) <br>    badwords_count.append(len([i for i in tokens if i.lower() in badwords])) <br>  n_words = [len(c.split()) for c in comments] <br>  allcaps = [np.sum([w.isupper() for w in comment.split()]) <br>for comment in comments] <br>  allcaps_ratio = np.array(allcaps) / np.array(n_words, dtype=np.float) <br>  bad_ratio = np.array(badwords_count) / np.array(n_words, dtype=np.float) <br>  exclamation = [c.count(“!”) for c in comments] <br>  addressing = [c.count(“@”) for c in comments] <br>  spaces = [c.count(“ “) for c in comments] <br>  re_badwords = np.array(badwords_count).reshape((len(badwords_count),1))   <br>  re_n_words = np.array(n_words).reshape((len(badwords_count),1)) <br>  re_allcaps = np.array(allcaps).reshape((len(badwords_count),1)) <br>  re_allcaps_ratio = np.array(allcaps_ratio).reshape((len(badwords_count),1)) <br>  re_bad_ratio = np.array(bad_ratio).reshape((len(badwords_count),1)) <br>  re_exclamation = np.array(exclamation).reshape((len(badwords_count),1)) <br>  re_addressing = np.array(addressing).reshape((len(badwords_count),1)) <br>  re_spaces = np.array(spaces).reshape((len(badwords_count),1)) <br>  vect = my_vect.transform(comments) <br>  features = np.hstack((vect.todense(), re_badwords)) <br>  features = np.hstack((features, re_n_words)) <br>  features = np.hstack((features, re_allcaps)) <br>  features = np.hstack((features, re_allcaps_ratio)) <br>  features = np.hstack((features, re_bad_ratio)) <br>  features = np.hstack((features, re_exclamation)) <br>  features = np.hstack((features, re_addressing)) <br>  features = np.hstack((features, re_spaces)) <br>  predictions = clf.predict_proba(features) <br>  return calculate_score(predictions)</pre><p>In [78]:</p><pre># Testing out my function. Put in a User Name here (example: ‘pg’, ‘vegabook’ or ‘KevinMcAlear’) <br>username = ‘CmonDev’</pre><pre># Here is there hater score! 100% is a pure hater. <br>print “The Hater Score of”,username,”:”,user_score(username, vect, clf),”%” <br>print <br>print <br># Here is there most reacent comments maxed out at 100. user_comments = get_user_comments(username) </pre><pre>for c in user_comments: <br>  print c <br>  print “——————————-”</pre><p>return:</p><pre>The Hater Score of CmonDev : 4.53430404659 %</pre><pre>The damn thing hasn&amp;#x27;t even been released yet.<br> ——————————- <br>&amp;quot;Unity brings the cutting edge graphics&amp;quot; — huh?&lt;p&gt;Great initiative though. <br>——————————- <br>&amp;quot;I&amp;#x27;ve received nothing but positive feedback…&amp;quot;&lt;p&gt;People are generally nice because it is considered polite. <br>——————————- <br>More like: &amp;quot;What the fuck is wrong with this guy. He poses a complex ethical dilemma. It makes me think and thinking hurts my brain. I will better pretend he is some sort of creep.&amp;quot; <br>——————————- <br>And why would an intelligent being with a free will still hang around? <br>——————————- <br>As calculated as the Nexus-muting &amp;quot;leak&amp;quot;. <br>——————————- <br>We are at the high of the HTML5&amp;#x2F;JS hype cycle. <br>——————————- <br>If it&amp;#x27;s just an expression than maybe &amp;quot;forking&amp;quot; is also just an expression with a random meaning? Either that or he never was a BDFL. <br>——————————-</pre><h3>Doing Everything Manually To One Time To Be Safe.</h3><p>Everything seemed to work great with my nice functions! But to be sure let’s manually do what my functions just did to be sure.</p><p>In [51]:</p><pre># Starting the transforming of my comments <br>test = vect.transform(user_comments)</pre><p>In [74]:</p><pre># Running through my feature manipulation manually  <br># *NOTE: This time I printed the features out each transformation I do to them so you can kind of see how they change. <br>p_badwords_count = [] </pre><pre>for el in user_comments: <br>  tokens = el.split(‘ ‘) <br>  p_badwords_count.append(len([i for i in tokens if i.lower() in badwords])) </pre><pre>p_n_words = [len(c.split()) for c in user_comments] <br>p_allcaps = [np.sum([w.isupper() for w in comment.split()]) for comment in user_comments] <br>p_allcaps_ratio = np.array(p_allcaps) / np.array(p_n_words, dtype=np.float) <br>p_bad_ratio = np.array(p_badwords_count) / np.array(p_n_words, dtype=np.float) <br>p_exclamation = [c.count(“!”) for c in user_comments] <br>p_addressing = [c.count(“@”) for c in user_comments] <br>p_spaces = [c.count(“ “) for c in user_comments] <br>p_re_badwords = np.array(p_badwords_count).reshape((len(p_badwords_count),1)) <br>p_re_n_words = np.array(p_n_words).reshape((len(p_badwords_count),1)) <br>p_re_allcaps = np.array(p_allcaps).reshape((len(p_badwords_count),1)) p_re_allcaps_ratio = np.array(p_allcaps_ratio).reshape((len(p_badwords_count),1)) <br>p_re_bad_ratio = np.array(p_bad_ratio).reshape((len(p_badwords_count),1)) <br>p_re_exclamation = np.array(p_exclamation).reshape((len(p_badwords_count),1)) <br>p_re_addressing = np.array(p_addressing).reshape((len(p_badwords_count),1)) <br>p_re_spaces = np.array(p_spaces).reshape((len(p_badwords_count),1)) </pre><pre># Adding In badwords<br>X_p_transform = np.hstack((test.todense(), p_re_badwords)) <br># Adding In n_words<br>X_p_transform = np.hstack((X_p_transform, p_re_n_words)) <br># Adding In allcaps<br>X_p_transform = np.hstack((X_p_transform, p_re_allcaps)) <br># Adding In allcaps_ratio<br>X_p_transform = np.hstack((X_p_transform, p_re_allcaps_ratio)) <br># Adding In bad_ratio<br>X_p_transform = np.hstack((X_p_transform, p_re_bad_ratio)) <br># Adding In exclamation<br>X_p_transform = np.hstack((X_p_transform, p_re_exclamation)) <br># Adding In addressing<br>X_p_transform = np.hstack((X_p_transform, p_re_addressing)) <br># Adding In spaces<br>X_p_transform = np.hstack((X_p_transform, p_re_spaces)) </pre><p>In [75]:</p><pre># Predicting the comments insult probaility <br>test_predictions = clf.predict_proba( np.nan_to_num(X_p_transform) )</pre><p>In [76]:</p><pre># Seeing what some predictions look like <br>test_predictions[:5]</pre><p>Out[76]:</p><pre>array([[ 0.93827726, 0.06172274], [ 0.99678827, 0.00321173], [ 0.93641375, 0.06358625], [ 0.94203673, 0.05796327], [ 0.99731428, 0.00268572]])</pre><p>In [77]:</p><pre># Finally Evaulating the hater score manually. <br>print “The Probability of”,username,”being a hater is:”, calculate_score(test_predictions),”%”</pre><pre>The Probability of pg being a hater is: 2.76497951931 %</pre><h2>Some Final Thoughts.</h2><ul><li>Sarcasm is hard to detect.</li><li>Using Pipelines when building my own meta-features is difficult.</li><li>Most people on Hacker News are pretty nice people.</li><li>I want to build in more training data from comments in Hacker News using the web app.</li></ul><p>Well, that’s it for now. I hope this was informative. Feel free to reach out and ask me anything. And remember, all of my code for this project is in <a href="https://github.com/kevinmcalear/hater_news">My GitHub Repo</a>. I made a detailed README.md file so you can run the app locally and try it out for yourself. You can even mess with pickling, but that is for another day…</p><p><em>Originally published at </em><a href="http://kevinmcalear.com/thoughts/building-hater-news/"><em>kevinmcalear.com</em></a><em> on October 27, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62062c58325c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Friendly With Instagram’s API]]></title>
            <link>https://medium.com/@KevinMcAlear/getting-friendly-with-instagrams-api-abe3b929bc52?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/abe3b929bc52</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Sun, 02 Mar 2014 21:21:40 GMT</pubDate>
            <atom:updated>2014-03-02T21:21:40.153Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using anything from #hashtags to selfies in your rails application.</h4><h3>Instagram and You.</h3><p>The power of social media is fantastic and people are using Instagram to do some pretty amazing things. Companies are making <a href="http://instaprint.me/mosaics/">real-time mosaics</a> for events and parties, printing out Instagram photos using <a href="http://instaprint.me/">instaprint</a>. People are <a href="http://www.casetagram.com/landing_bis?utm_expid=80074162-4.Jp2FVFo8TsOxsez7hnYOvA.1&amp;utm_referrer=http%3A%2F%2Fwww.casetagram.com%2Flanding_bis">creating iPhone cases</a> with their own pictures. Marketers are building platforms to creatively <a href="http://seenmoment.com/">communicate to their customers</a>. Others are finding ways to <a href="https://copygr.am/">take Instagram pictures physical</a>.</p><p>Developers are still exploring what can be done, making things like a real-time <a href="http://now.jit.su/">exploration of places through the eyes of Instagram</a>, <a href="http://instawar.org/">battling pictures against each other</a>, making your <a href="http://screenstagram.s3.amazonaws.com/download.html">background your feed</a>, enjoying the <a href="http://instac.at/">cats of Instagram</a>, or even trying to help people with an <a href="http://hashback.herokuapp.com/">idea I’ve been working on</a>. The point is, now, more than ever, you can do some amazing stuff. Enough talking, lets get into it shall we?</p><h3>The Breakdown</h3><p>I will be covering two aspects of this API, <strong><em>the tools</em></strong> I work with and <strong><em>the process</em></strong> of using the API in a program. I’m going to focus on getting you up and running, and assume that the ultimate goal is to be able to feed yourself and use this as a reference once you really start digging into Instagram’s API.</p><p>Full disclosure, I’m still learning myself. I am actually in the middle of an <a href="https://generalassemb.ly/education/web-development-immersive">intensive web development program</a> and am still solidifying my own skills. With that said, Enjoy!</p><h3>The Tools</h3><p>I work in a <a href="http://ruby-doc.org/">Ruby</a> environment, using the <a href="http://rubyonrails.org/">Rails</a> framework, and hosting everything with <a href="https://www.heroku.com/">Heroku</a> (which uses <a href="http://www.postgresql.org/">PostgreSQL</a>) for web apps. This will be the most useful for someone using something similar but not required to just understand Instagram’s API. Lets break down the tools.</p><p><a href="http://johnnunemaker.com/httparty/"><strong>HTTParty</strong></a><strong> - Makes http fun again! One-line http magic.</strong></p><p>You can query web services, parse the output, and return the response as a Ruby data-structure. <em>(On as side note: if data doesn’t come back in a usable data structure, i.e. one huge string, you can use the </em><a href="https://github.com/flori/json/tree/master"><em>JSON ruby gem</em></a><em> to convert the string into json. Luckily we don’t need to with this API.)</em></p><p>You can run request like so:</p><pre>HTTParty.get(‘http://SOMEAPI.com/WHATEVER_ASPECT_YOURE_USING’)</pre><p>Just so you know, if you don’t want to use HTTParty, there is actually an <a href="https://github.com/Instagram/instagram-ruby-gem">Instagram Gem</a> you could use instead.</p><p><a href="http://instagram.com/developer/endpoints/"><strong>Instagram’s API</strong></a><strong> - Where data comes from. All selfie info is here.</strong></p><p>Instagram has a well document, decently straight-forward API. Endpoints are only accessible via https<strong> </strong>and are located at <em>api.instagram.com</em>.<strong> </strong>The basics of that API call look like the following:</p><p>You can grab the most popular photos at the moment by accessing the following URL with your <a href="http://instagram.com/developer/clients/manage/">client ID</a>.</p><pre>https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID</pre><p><em>*On a side note:</em> Make sure you get a client ID right away. It is pretty straight forward but it can be confusing if you don’t know any better. You can <a href="http://instagram.com/developer/clients/register/">get one here</a> and if you want to use Authentication via Instagram you need to <a href="http://instagram.com/developer/authentication/">get a an Access_Token here</a>.</p><p><a href="http://guides.rubyonrails.org/active_record_basics.html"><strong>Active Record</strong></a><strong> - The </strong><a href="http://en.wikipedia.org/wiki/Object-relational_mapping"><strong>ORM</strong></a><strong> Rails uses. This will be important later.</strong></p><p>Active Record allows us to connect our Database to our Ruby Objects in some pretty powerful ways. I’m telling you this because in further code you will see me call methods on objects that are returning an array of information I’m using in conjunction with the Instagram API. Let’s go through one quick example:</p><p>Let’s say I have two tables in my database, users and searches. One user has many searches so I make a user_id column in searches. Then I set up my Active Record Models in Rails. Next the awesome happens. Let’s watch.</p><p>So let’s say I want to find the user with an id of one. Now in ruby, I just type:</p><pre>bob = User.find(1)</pre><p>(*I’m just saving it to a variable for another part of the example.)</p><p>What Active Record <em>actually</em> did was write this:</p><pre>SELECT &quot;users&quot;.* FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;id&quot; = $1 LIMIT 1 [[&quot;id&quot;, 1]]</pre><p>It then creates an object in Ruby for me to play with containing everything about this user that was in the database. Pretty cool! Let’s also say that I wanted every search this user made. All I have to do now is this:</p><pre>bob.searches</pre><p>Which writes this:</p><pre>SELECT “searches”.* FROM “searches” WHERE “searches”.”user_id” = $1 [[“user_id”, 1]]</pre><p>This gives us every search in an array as nice pretty ruby objects!</p><h3>The Process</h3><p>Ok, it’s time to actually do this. Lets walk through grabbing a hashtag from a user on a website, dynamically writing an API call, parsing the data, and displaying it back to the user on the web.</p><h4>A logged in user types in #yolo to look at pictures via a website.</h4><p>We get the user from the session they are in, using ActiveRecord we then add a new search to our user and our database to use for other stuff, if we desire to later (like seeing our most recent searches or checking out what other users search for, for example). Let’s pretend they fill out a box on a website to put in a hashtag. When they press enter, it will go through this process.</p><p><strong>This is what the rails search controller may look like:</strong></p><pre>def create<br> @user = User.find(session[:user_id])<br> @user.searches.new(params[:hashtag])<br> <br> if @user.save<br>  redirect_to user_path(@user)<br> else<br>  render(:new)<br> end<br>end</pre><h4>We dynamically write an API call request to Instagram.</h4><p>We take that new search request from the user and feed the hashtag into a method I made to pull back the data. Here are two methods you can check out, one to get the full data about a hashtag and one to just return the total times a hashtag has been used. Check em out!</p><p><strong>Here is a method I made to get info on pictures with a hashtag:</strong></p><pre>def instagram_photos(hashtag) </pre><pre> the_data = HTTParty.get(“https://api.instagram.com/v1/tags/#<br>  {hashtag}/media/recent?client_id=#{INSTAGRAM_CLIENT_ID}”<br> )<br> <br> return the_data[“data”]</pre><pre>end</pre><p><strong>Lastly, a method to get the total count of times a hashtag was used:</strong></p><pre>def instagram_tag_stat(hashtag)<br> <br> tag_stats = HTTParty.get(<br>  “https://api.instagram.com/v1/tags/search?q=#<br>  {hashtag}&amp;client_id=#{INSTAGRAM_CLIENT_ID}”<br> )<br> <br> return tag_stats[“data”][0][“media_count”]<br> <br>end</pre><h4>Getting data back in a crazy structure.</h4><p><em>Hashes within arrays within hashes…</em></p><p>Let’s start by making an API call to Instagram for some info about the hashtag #yolo and save what we get back to a variable called our_data.</p><pre>our_data = HTTParty.get(<br> “https://api.instagram.com/v1/tags/yolo/media/recent?  <br> client_id=#{INSTAGRAM_CLIENT_ID}”<br>)</pre><p>The output that we get back is a hash of key, value pairs containing arrays and hashes that contain arrays and hashes. It’s like data inception, very useful data inception actually. Lets break down a bit so we can use it. I’ll quickly go over the skeleton of the data structure you you can explore the juicy information inside.</p><p><strong>Accessing this:</strong></p><pre>our_data[“pagination”]</pre><p><strong>Gives us:</strong></p><pre>{<br> “next_max_tag_id”:”1393732758253&quot;,<br> “deprecation_warning”:”next_max_id and min_id are deprecated<br>  for this endpoint; use min_tag_id and max_tag_id instead”,<br> “next_max_id”:”1393732758253&quot;,<br> “next_min_id”:”1393732780802&quot;,<br> “min_tag_id”:”1393732780802&quot;,<br> “next_url”:”https://api.instagram.com/v1/tags/yolo/media/recent<br>  ?client_id=***INSTAGRAM_CLIENT_ID***&amp;max_tag_id=1393732758253&quot;<br> }</pre><p>Accessing this key in our hash will return a hash that allows to you make another API call to get more #yolo photos. Because of the amount of data available Instagram limits how much data you can get per API call to information on the last twenty photos. (#yolo has been been used on 18,290,259 freaking photos at the time of this writing, for example.) So, you will get the key if your #hashtag has been used on more than 20 photos.</p><p><strong>Accessing this:</strong></p><pre>our_data[“meta”]</pre><p><strong>Gives us:</strong></p><pre>{<br> “code”:200<br> }</pre><p>The “meta” key is usually short and sweet. It returns meta information (via another hash) on the api call itself. If everything works well you will just get a code number (200 specifically) and if you get any errors they will be inside of meta and help you troubleshoot what is happening.</p><p><strong>Accessing this:</strong></p><pre>our_data[“data”]</pre><p><strong>Gives us up to twenty of these big hashes containing other hashes and arrays:</strong></p><pre>[<br> {<br>  “attribution”:null,<br>  “tags”:[“yolo”],<br>  “location”:null,<br>  “comments”:{ “count”:0, “data”:[] },<br>  “filter”:”Hudson”,<br>  “created_time”:”1393703980&quot;,<br>  “link”:”http://instagram.com/p/lAznqkAUz0/”,<br>  “likes”:{ “count”:0, “data”:[] },<br>  “images”:{<br>  “low_resolution”:{<br>    “url”:”http://distilleryimage0.s3.amazonaws.com/<br>    ca4f97e2a17b11e3b8590a1f8b30899c_6.jpg”,<br>    “width”:306,<br>    “height”:306<br>   },<br>   “thumbnail”:{<br>    “url”:”http://distilleryimage0.s3.amazonaws.com/<br>    ca4f97e2a17b11e3b8590a1f8b30899c_5.jpg”,<br>    “width”:150,<br>    “height”:150<br>   },<br>   “standard_resolution”:{<br>    “url”:”http://distilleryimage0.s3.amazonaws.com/<br>    ca4f97e2a17b11e3b8590a1f8b30899c_8.jpg”,<br>    “width”:640,<br>    “height”:640<br>   }<br>  },<br> “users_in_photo”:[],<br> “caption”:{<br>  “created_time”:”1393703980&quot;,<br>  “text”:”hverdagsbilde 1/5. utfordret av @marthefjeld93 ,sender<br>   videre til @tpt88 💕\n#yolo”,<br>  “from”:{<br>   “username”:”iselinkristensen”,<br>   “profile_picture”:”http://images.ak.instagram.com/profiles/<br>    profile_214645082_75sq_1386628652.jpg”,<br>   “id”:”214645082&quot;,<br>   “full_name”:”iselin kristensen”<br>  },<br>  “id”:”666759771872906934&quot;<br> },<br> “type”:”image”,<br> “id”:”666759770983714036_214645082&quot;,<br> “user”:{<br>  “username”:”iselinkristensen”,<br>  “website”:””,<br>  “profile_picture”:”http://images.ak.instagram.com/profiles<br>  /profile_214645082_75sq_1386628652.jpg”,<br>  “full_name”:”iselin kristensen”,<br>  “bio”:””,<br>  “id”:”214645082&quot;<br>  }<br> }<br>]</pre><p>This is where the the actual data we want is. Accessing this key will give us an array of hashes, each hash containing photo information about a specific photo that was tagged with #yolo. From the amount of likes and comments to the filter used, this hash contains nearly anything you could want to know about a specific photo. For example, lets access the first (and only in this case) image’s “standard resolution” photo url so we can use it in our app.</p><p>We would just do something like this:</p><pre>our_data[“data”][0][“images”][“standard_resolution”][“url”]</pre><p>Which returns the following link we want.</p><pre><a href="http://distilleryimage0.s3.amazonaws.com/ca4f97e2a17b11e3b8590a1f8b30899c_8.jpg">http://distilleryimage0.s3.amazonaws.com/ca4f97e2a17b11e3b8590a1f8b30899c_8.jpg</a></pre><p>So, to recap, we accessed the “data” key in the hash which gave us an array of hashes, each hash containing its own photo and all the information we could want about it. We then found the “images” key in the first photo in the array (we got to the first photo with index [0]). Finally, we found the “standard resolution” of the photo and found it’s “url” which gave us a the link we needed.</p><p><strong><em>Note:</em></strong><em> This is a condensed version of something you may get back for the hashtag #yolo. I’m only showing you info for one picture!</em></p><h4><strong>Then it gets restructured and prepared to be viewed.</strong></h4><p>Here is a peek into what the search controller’s show page could look like. This helps us get everything ready to view and show our user.</p><pre>def show<br> @search = Search.find(params[:id])<br> @tag_count = <br>  instagram_tag_stat(@search.hashtag).to_s.<br>  reverse.gsub(/…(?=.)/,’\&amp;,’).reverse<br> @pics_info = instagram_photos(@search.hashtag)<br>end</pre><h4><strong>We feed the data back to the user so he can see as much #yolo as he can handle.</strong></h4><p>Here we are just iterating through any picture, pulling out the parts we want to write in html, and then serving it back up as a webpage.</p><pre>&lt;div&gt;<br> &lt;ul&gt;<br> &lt;% <a href="http://twitter.com/pics_info">@</a>pics_info.each do |pic| %&gt;<br>  &lt;li&gt; <br>   &lt;a href=”&lt;%= pic[“link”]%&gt;” target=”_blank”&gt;<br>   &lt;img src=”&lt;%= pic[“images”][“standard_resolution”][“url”] %&gt;” <br>   width=”300px”/&gt;<br>   &lt;/a&gt;</pre><pre>   &lt;a href=”http://instagram.com/&lt;%= pic[“user”][“username”]%&gt;”<br>   target=”_blank”&gt;&lt;p&gt;@&lt;%= pic[“user”][“username”]%&gt;&lt;/p&gt;&lt;/a&gt;<br>   <br>   &lt;p id=”likes”&gt;&lt;%= pic[“likes”][“count”]%&gt; Likes&lt;/p&gt;<br>   <br>   &lt;p&gt;<br>    &lt;%= truncate(pic[“caption”][“text”], :length =&gt; 80) unless <br>    pic[“caption”].nil? %&gt;<br>   &lt;/p&gt;<br>  <br>  &lt;/li&gt;<br> &lt;% end %&gt;<br> &lt;/ul&gt;<br>&lt;/div&gt;</pre><h3><strong>Code Away, My Friend.</strong></h3><p>Phew, now that you’ve made it this far it’s time for you to start to play around with your own hashtags and ways to interact with Instagram. Good luck and enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abe3b929bc52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WDI Week One.]]></title>
            <link>https://medium.com/@KevinMcAlear/wdi-week-one-3d984442b55a?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d984442b55a</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Mon, 27 Jan 2014 05:50:28 GMT</pubDate>
            <atom:updated>2014-01-27T19:39:44.749Z</atom:updated>
            <content:encoded><![CDATA[<h4>Thrown into the deep end and loving it.</h4><p>In an attempt to collect my thoughts, observations, and emotions while they are still fresh, I will break down my first real week at <a href="https://generalassemb.ly/">General Assembly</a> and their <a href="https://generalassemb.ly/education/web-development-immersive/">Web Development Immersive</a>.</p><h3>My Week In Review</h3><h4><strong>What I Learned:</strong></h4><p>I am now surprisingly comfortable in the basics of the <a href="https://www.ruby-lang.org/en/">Ruby programming language</a>, command-line (I love <a href="http://www.iterm2.com/#/section/home">iTerm2</a> btw), version control using <a href="http://git-scm.com/">git</a>, <a href="https://github.com/">GitHub</a>, a few software development theories, and <a href="http://www.youtube.com/watch?v=lbXsrHGhBAU">Object Oriented Programming</a>.</p><h4><strong>How I Feel:</strong></h4><p>Initially I was overwhelmed and intimidated. I normally learn relatively quickly, but with programing and the pace we are doing things, I can sit down for an hour, try to complete something and not understand what I am doing at all. Then, after a day or so, I get a kind of “ah ha!” moment, something small starts to click, and make a little more sense.</p><p><strong><em>I constantly feel like an idiot and simultaneously am in awe of how much I have learned in five days.</em></strong></p><h4>The Structure:</h4><p>Every day goes something like this; wake up, get into GA, get a coffee, code. Take a ten minute break, learn new material, brain starts to explode, lunch. Learn more mind bending material, ten minute break, more coding, then homework until late at night. Repeat. Also, add more coffee.</p><h3>My Observations</h3><h3>Installfest</h3><p>Before my first real week began, our class did something called installfest. This consisted of a meet and greet with the students and teachers, lots of pizza, and our computers. I briefly met the people I would be spending the next twelve weeks with. I saw the facility we would be doing it in, started to set up my computer, and the expectations for the program.</p><p>They made sure everyone’s development environment looked similar and built a healthy cultural foundation from the start. Teachers and students alike stood up and explained who they were, why they were there, and what they were doing before this program. Businessmen, teachers, artists, engineers, Stanford graduates, designers, philosophy graduates, marketers, dancers, singers, and many more types of people from many different places, all coming together to make digital things. Everyone had their own interesting story to tell and all of them left everything behind to start a new adventure.</p><h3>A Well Crafted Engulfment</h3><p>From day one, I have been living in an area of my computer I was always uncomfortable with. Terminal, bash profiles, git, ruby; “code land” with no pretty visual interface. I am amazed at what I am already capable of in five days. This is because the quality, relevancy of content, effectiveness, and overall culture of the immersive have been excellent. It takes a lot of targeted effort to keep people learning and applying their new found knowledge for twelve or more hours a day. As of right now all of my expectations have been exceeded. Here are a few things I noticed that I feel make this possible.</p><h4>The Relevancy Of Information</h4><p>I have a lot of developer friends and friends in the digital industry. Before I came to this program, I used to manage a group that put out several digital products for its organization and simultaneously I was making digital things with other people from all over. That being said, it has been fantastic to learn the most relevant information and processes currently available that are in use. What I am even more impressed with is the attitude behind the information, the focus on continuous learning, and innovation. Things are always changing and their methods incorporate this.</p><h4>The Quality Of Teachers</h4><p>There is something powerful about a good teacher. Someone who is not only fantastic at their craft, can explain it well to others, has a contagious passion for the content, but who also cares about the people they are teaching. They will go above and beyond to help them succeed. Our program has three such teachers with complementing skill sets and teaching styles.</p><h4><strong>The Culture</strong></h4><p>You can have the best information, teachers, and facilities, but without a healthy mindset it will never be great. The culture at General Assembly, in everything from student expectations and interactions, to teacher and facility attitude, make it one of the most encouraging and healthy places I’ve seen.</p><p>From day one people want to help each other succeed. Everyone has a “we’re in this together” attitude, feeds off of each others’ energy, and takes comfort in each others shared frustration. People really seem to care abut each other. I feel like General Assembly attracts like minded people, with a lot of passion, that are excited to share it with others.</p><p>Things seem to be built on mutual respect, tolerance but still being “real”. In comparison to a normal education experience, conformity and the marginalization that follows it doesn’t exist here and it is refreshing. I think this is possible because everyone has worked very hard to get in and are working even harder to keep up which is what unites us. Everything else isn’t so important. Oh yeah, people here have fun too.</p><h3>Happy Hour</h3><p>General Assembly has a tradition that every Friday there is free beer and wine for students and alumni alike for all of the different classes. This may be one of my favorite things so far. People in the same program I am in that are half way done and have already built web applications were there. People in other disciplines like business, marketing, design, UX, and so much more were there. I remember seeing someone taking the <a href="https://generalassemb.ly/education/user-experience-design">UX Immersive</a> was wearing Google Glass, she let me play around with them. Other people who have started their own companies were there. It was a great way to get to know people who have similar motivations and interests as I do, and a great way to learn about the start up and digital community here.</p><h3>On To Week Two…</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d984442b55a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pre-Gaming. ]]></title>
            <link>https://medium.com/@KevinMcAlear/pre-gaming-b1b7917b692?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1b7917b692</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Sun, 12 Jan 2014 00:04:18 GMT</pubDate>
            <atom:updated>2014-01-12T00:04:18.331Z</atom:updated>
            <content:encoded><![CDATA[<h4>Starting the General Assembly experience.</h4><p>After doing a lot of <a href="https://medium.com/design-startups/f80bb2d5e64f">soul searching</a>, I decided to apply to <a href="https://generalassemb.ly/">General Assembly</a>’s <a href="https://generalassemb.ly/education/web-development-immersive">Web Development Immersive</a>. I got accepted, dropped everything in my life, and moved to NYC. Although the actual program begins in three days, I have had to do a lot of work already.</p><p><strong><em>Here is what to expect if you’re thinking about doing something similar.</em></strong></p><h3>The Interview Process.</h3><p>It started for me by simply <a href="https://generalassemb.ly/applications/new/web-development-immersive">reaching out</a> and asking for more information while I was <a href="http://bootcamper.io/">exploring several different options</a>. Once I was sure that I wanted to come to GA, this was the process I went through.</p><h3>Step One.</h3><h4><strong>Received A Prospective Student Handbook.</strong></h4><p>This was just a small PDF explaining the entire course, everything from the pre-work, the actual course, the next potential steps after the course, and useful information about what it takes to do something like this. If you are considering doing something like this, definitely read it.</p><h4>Filled Out My Actual WDI Online Application.</h4><p>This was pretty straight forward, I just had to answer questions about what I did (the job I had at that time), why I wanted to go through the program, and my commitment level to do something like this.</p><h4>Met With An Admissions Officer.</h4><p>We had a phone interview, he asked me several questions about what I hope to get out of the program, my current core competencies, explained the actual commitment involved (you really can’t have a life or a job for three months), and tried to see if I was a good fit culturally (explaining their process of education and their atmosphere).</p><p>If they still like you, advance to the next step.</p><h3>Step Two.</h3><h3>The Pre-Admit Work.</h3><p>I received four assignments/projects to complete within one week to see where I was skill-wise and if this sort of thing was for me. I have a decent amount of knowledge on the front end of the web so it was fun for me as it focused mainly on basic HTML and CSS skills. If you want to see what this is all about, try out <a href="https://dash.generalassemb.ly/">DASH</a>, an application to get you building fun stuff with HTML, CSS, and a teeny-weeny little bit of Javascript/JQuery. If you get wide eyed and even smirk with enjoyment a few times, you may be on the right path.</p><p>*<em>Note, I already did a lot of </em><a href="http://www.codecademy.com/tracks/ruby"><em>Codecademy’s Ruby Track</em></a><em> so you may get asked about Ruby and actual back-end programming as well, I’m not sure.</em></p><p>After you do everything asked of you, the “formal” interview begins.</p><h3>Step Three.</h3><h3>The “Formal” Interview.</h3><p>I was living in Ohio at the time so I ended up doing a <a href="http://www.google.com/+/learnmore/hangouts/">Google Hangout</a> with one of my potential instructors where they started asking me all sorts of things. Here are a few to expect.</p><h4>The Get-To-Know-You Part.</h4><p>We started like normal interviews, explaining who I am, why I wanted to move my life to NYC and to GA, and if I was a bed-wetter or not (I made that last part up).</p><h4>The Gauge-You-On-Your-Prework Part.</h4><p>We then discussed the pre-work I completed and whether or not I enjoyed it, what was confusing, and what I learned doing it. I am guessing they want to gauge how well you enjoyed the work and see if you could do nothing but that for three months.</p><h4>The Blow-Up-Your-Brain Part.</h4><p>I then got asked some brain-teasers to help me understand how things would feel as I go through the program, not getting it at first, then having an “a-ha” moment, over and over again. This was fun, I have been using one of the questions I was asked on all of my friends.</p><p>There were other parts but I feel like if you just be yourself and answer everything honestly you’ll be fine either way. After this, comes official acceptance.</p><h3>Step Four.</h3><h3>Officially Accepted Into WDI!</h3><p>I was super excited! But wait, there is a catch… The Pre-Program work. In order to actually take the course you have somewhere around fifty hours of pre-work you receive that you <strong>MUST </strong>complete. Honestly, there is enough work involved in this that you can take double that time if you really want to. Want to start on this now? <a href="http://pine.fm/LearnToProgram/">Read this book</a>.</p><p>I’ll break down some of the pre-work for you.</p><h3>Step Five.</h3><h3>The Real Pre-work.</h3><p>The pre-work is really broken down into three main parts, computer and internet basics, web development basics, and programming and version control basics. It moves fast, expects a lot from you, and you come away with <strong>A LOT</strong> of great knowledge. I went from not knowing how to use terminal and knowing <em>nothing</em> about Ruby to being able to write small applications I made and run them on my computer.</p><h4>Computer And Internet Basics.</h4><p>This part was actually surprisingly useful. The focus here is to really learn how to use your computer quickly and efficiently, using things like <a href="http://support.apple.com/kb/ht1343">quick-commands</a> and better over-all workflow using your computer. I am already noticeably faster from going through this part.</p><h4>Web Development Basics.</h4><p>I have a decent understanding of the front-end of the web so this was a good refresher on HTML and CSS. If you don’t know what those are, or feel like they are a bunch of crazy gibberish, this part will be super useful. If you want a great introduction, <a href="https://www.udemy.com/learn-html5/">This Course</a> really helped me out but it costs $50. If you want a free alternative <a href="http://www.codecademy.com/">Codecademy</a> is awesome.</p><h4>Programming And Version Control.</h4><p>The main chunk of this section was Ruby, Ruby, and more <a href="https://www.ruby-lang.org/en/">Ruby</a>. I went through example after example, starting small and gradually getting more and more complex with everything from syntax (how to read and write the code), to programming concepts (like operators, variables, strings, loops, arrays, OOP in general, etc). This made my brain hurt from time to time but I actually loved every moment of it. I built little “apps” that would do stupid but entertaining things just for my amusement. I created a very disgusting choose-your-own-adventure game and made my friend play it. The other part I learned was <a href="http://git-scm.com/video/what-is-version-control">Git</a> and <a href="https://www.youtube.com/watch?v=l_T3XEgXl14">Github</a> basics. Version control is a super important part of programming and Github is an amazing platform that is much more than version control that I would highly recommend you dig into.</p><p>After all of that, I’m guessing the real fun will begin.</p><h3><strong>Congrats! Now You’re <em>Really</em> In!</strong></h3><p>I hope you found my experience helpful! Many people have been super helpful and supportive along my journey thus far and I want to be just as helpful and supportive to anyone looking to explore a similar path! Good luck and happy coding! ☺</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1b7917b692" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show Me A Man, I’ll Show You The Ideas He’s Built On.]]></title>
            <link>https://medium.com/@KevinMcAlear/show-me-a-man-ill-show-you-the-ideas-hes-built-on-7beb54b2bddd?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/7beb54b2bddd</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Fri, 27 Dec 2013 21:29:46 GMT</pubDate>
            <atom:updated>2013-12-28T03:06:10.770Z</atom:updated>
            <content:encoded><![CDATA[<h4>The powerful business of ideas. </h4><h3>I have watched it play out time and time again.</h3><p>Everyone around me, every person I have ever been able to observe or read about, seems to go through this process:</p><ol><li><strong>Encounter an idea.<br></strong><em>“money = happiness”</em></li><li><strong>Allow it to become part of them.<br></strong><em>“That makes sense, it has to be true.”</em></li><li><strong>Allow the idea to shape their views.<br></strong><em>“I should find a job that pays the most, rich people are where it’s at.”</em></li><li><strong>Allow this new disposition on life to play out through actions.<br></strong><em>“I have three job offers and even though I don’t think I’ll have the most fun at the highest paying one, but I should be happier because I’ll make the most money so I’ll work there.”</em></li><li><strong>Finally, see those actions change the course of that person’s life. </strong><em>“How the heck did I end up in a job I hate for the last 20 years? Why aren’t I happy?”</em></li></ol><h4><em>It’s an incredible process.</em></h4><p>It affects my own friends and family in some fantastic and horrifying ways. Family members believing fallacies about who they are and how the world works, taking them down dark paths. Friends changing their views and ultimately, their actions about how relationships and people should be treated. What is crazy to me is that most people don’t think twice about this process. In fact, I don’t think most people think too much about <em>how</em> they think or <em>why</em> they think the way they do at all.</p><p>Lets explore a question for a moment.</p><h3>What makes you, you?</h3><p>It’s a tough question to ask. Let me clarify what I mean when I say this. What makes up the components of what people see about you and what you know about yourself. The way you treat people, the way you treat yourself, the choices you make, your overall disposition on life, your stress level, what you care about, how tolerant you are of others, and any other thing that you relate to yourself, big or small, that makes you, uniquely you.</p><p>Where did these things come from? Why do you act the way you do? Why do you think the way you do? It all stems from the ideas we’ve decided to let into our lives. Let’s go through one small example to see what I’m talking about:</p><h4>The Idea:</h4><blockquote>“I will always have debt.”</blockquote><p>If someone takes this idea, believes it to be true, lets it shape their view on things, allows it to affect their actions, then eventually their <em>whole life</em> will be changed by this single statement.</p><p>I can see someone who has added this idea to themselves think things like:</p><blockquote>I will always be in debt so why save anything anyways? I should just enjoy life and what I have because it would be stupid to try to save. What would be the point? That new TV I always wanted? <strong>Let’s get it!</strong> Take out a loan to get that new sweet car? <strong>Heck yeah!</strong></blockquote><p>And as they make choices, both big and small, they start to play out this idea and solidify it’s grip on their lives. Add more debt, not pay off their current debt; choice by choice, they are letting an idea dictate their own personal reality. Lets replace this idea with something different and see what happens:</p><h4>The Idea:</h4><blockquote>“I can be debt free.”</blockquote><p>I can see someone who adds this idea to themselves say something a bit different, like:</p><blockquote>I know I can get debt free, how the heck do people do it? I’ll go ask people in my life who seem to know, or maybe I’ll find some great books on getting out of debt, maybe I’ll just watch some video or take a class on it. Heck, I’ll just start by Googling it and go from there! I do not need things that are expensive right now, it will pay off later when I’m debt free. I can find plenty of fun things to do that don’t cost money.</blockquote><p>Just as before the idea leads to a different thought about life, the individual, and ultimately a different path through our actions. The ideas that we have about ourselves and the world around us are the powerful building blocks that begin to shape us into who we are, and who we will become.</p><h3>Whatever You’re looking For, You Will Find It.</h3><p>If you think the world is a horrible place, you’re right. You will find example after example of the disgusting, cold, heartless things this planet has to offer. If you think all people are out to get you, you’re right. You will focus on every single time someone stabs you in the back, screws you over, and is dishonest with you, and the way you treat others will only compound and confirm your suspicions.</p><p>Conversely, if you think that the world is an amazing, beautiful place, you’re right too. You will find endless examples of its beauty, goodness, hope, human love and betterment, and every kind act this planet has ever done. And if you think people inherently want to do the right thing, you’ll find that you’re also right. Your focus will be on the good things people have done for you, the sacrifices people have made for you, and the way you treat people will only confirm the goodness of people and yourself.</p><p>Crazy how that works, isn&#39;t it? Life can always “suck” or be an incredible adventure. You can change the world or be completely insignificant all by what ideas you have allowed to shape you. But there is good news! Whether you think so or not, <strong><em>you choose</em></strong> what ideas you let in.</p><h3>Don’t Be Held Captive.</h3><p>Here’s what I mean. Don’t allow something to control you, you have more power than you give yourself credit. But as soon as you give that power away, you become a “victim” in your own life, allowing life to happen to you. The ideas you may already have accepted may have just come from prior, unintentional, life experience and you’ve just kind of got what you’ve always been exposed to.</p><p>Someone once said that life is <strong><em>10% action</em></strong> and <strong><em>90% reaction</em></strong>. What I think is implied in that is that there are things that happen to you that you can’t control but that is only a part of life. If you really think about it, you have a lot of choice in life and it’s up to you to exercise that choice. The same goes for what ideas you accept and allow into your life. You choose them even by not choosing.</p><h4><strong>Think carefully about this.</strong></h4><p>It is exciting, liberating, and terrifying all at once. Force yourself to keep an open mind, actively look for fantastic ideas about yourself, others, and the world and add them into your life. Analyze what ideas you currently have accepted and challenge them. Throw out the shitty ones, the useless ones, and the destructive ones and replace them with ideas you really want.</p><h3>Go Forth And Be Intentional.</h3><p>I want to leave you with a challenge. Set some time aside this week and ask yourself, <em>“What ideas have I allowed into my life?”</em> Write them down. Seriously consider why you let them in your life. Then, start to expose yourself to new ideas every week, write down the ones you like, the ones that challenge your current ideas, and the ones that frustrate you the most. Try to understand them and seriously consider working them into your life. <strong>Repeat over and over and over until you die.</strong> I hope that all of us are intentional idea collectors and appliers.</p><p>It will change our lives; it will change the world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7beb54b2bddd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NYC, Here I Come.]]></title>
            <link>https://medium.com/@KevinMcAlear/nyc-here-i-come-f80bb2d5e64f?source=rss-7a2f2d0e7793------2</link>
            <guid isPermaLink="false">https://medium.com/p/f80bb2d5e64f</guid>
            <dc:creator><![CDATA[Kevin McAlear]]></dc:creator>
            <pubDate>Mon, 25 Nov 2013 03:34:03 GMT</pubDate>
            <atom:updated>2013-11-25T22:51:33.760Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*LXmzS9zdDsYzkoNowUs4gA.png" /><figcaption>diving into to general assembly and nyc.</figcaption></figure><h4>Diving head first into the start up world.</h4><p>So far my life has been a crazy ride. I’ve played in bands, opened a manufacturing plant, married a German, Invented production equipment, played ultimate frisbee in different states (haha), been an “Exec” (CIO at Service Spring Corp.), given talks about nerdy stuff, built all sorts of interesting systems, traveled all over the world, helped lots of people with various projects, been on the Y-PAC board for the Make A Wish foundation, and have lived in California, Ohio, Germany, and soon, New York. Now that I sound like a self-absorbed douche bag, I want to explain myself.<strong> </strong><em>I still don’t know what I’m doing. </em>I just know that I love technology, people, and business and I want to change the world for the better. I also feel like General Assembly and New York City can help me with just that.</p><p>There is only one way to find out…</p><h3>My Problem.</h3><p><strong>Someone once told me that I can do anything, just not everything.</strong></p><p>It really is true, and unfortunately one of my strengths is my ability think about something from a lot of different perspectives; to really listen and understand people around me, and see things from their viewpoint. I get interested and passionate about what they are interested and passionate in and work that into my life. This gives me interest overload.</p><p><strong>At some point I’m going to die.</strong></p><p>With all of these interests floating around in my brain, it makes me sad that I only have a little bit of time on this earth to do something valuable, or even experience things. Because of this my brain is constantly in “dramatic mode” thinking along these lines:</p><p><em>“Is what I am doing right now going to make me, the people around me, and the world a better place? Because, come on man, you’re gonna be an old man soon. What are you doing with your life?!”</em></p><p>This creates two things in me; a bunch of drive to live life and minimize drama because, hey! I’ll be dead at some point anyways right? Why waste my time with that! Unfortunatly, this also can stress me out. It makes me think about the fact that life is ticking away every moment and that I better not just throw the time away.</p><p><strong>I want to change the world.</strong></p><p>I am wired to be sold out on something so big that I will never be able to do it alone. But together, with fantastic people, we can forever change the world and make it a better place for everyone! Corny, I know, but it fills my heart and when I’m filled up with passion I ooze it out all over everyone around me (gross). It’s contagious, people can feel it, they want more, and at the end of my life I want to look back and be able to say I was a part of something amazing. This makes me never really satified with anything I do. It keeps a growing hunger in me to do more, to be more, to make more. And I don’t know where I can really “change the world” yet, so I’m still looking.</p><h3>My Solution?</h3><p><strong>I want to go where the “magic” happens.</strong></p><p>So here is the plan thus far. Go to <a href="http://generalassemb.ly/">General Assembly</a>, learn to build digital products and services in their <a href="https://generalassemb.ly/education/web-development-immersive">Web Development Immersive</a>, and network my little heart out with every startup and like minded person I can get my hands on.</p><p>I have seen great, big, crazy things happen right where I will be and I want to understand it. I want to live it, eat it, breathe it. I want to know how companies can go from nothing to world changing in only a couple of years. I want to understand the brains, the brawn, and the failures and successes involved and I can’t think of a better way than to be there, learning and contributing.</p><p>So with that said, I will be starting my adventure in January! I will be writing about it, mainly for myself, so I can document where I’ve been, and think about where I am going. I can’t imagine where I will be even next year, but I will do my best to be to closer to changing the world in a big way, one nerdy adventure at a time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f80bb2d5e64f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>