Jekyll2019-05-21T18:28:13+00:00http://chevonie.com/feed.xmlChevonie DanielA repository of any various ideas, tips and projects I can think up.Chevonie DanielFound some deleted factory pictures on my Oneplus One2018-05-10T23:40:00+00:002018-05-10T23:40:00+00:00http://chevonie.com/Found-Deleted-Pics-on-OPO<p>While going through my OnePlus One a few months ago, I came across the folder containing thumbnails for the stock photos at <code class="highlighter-rouge">/0/DCIM/.thumbnails</code>. Along with the stock photo thumbnails, however, were four pictures that were taken within a factory. The thumbnails are all fairly good quality, with resolutions of 243 x 324, 195 x 260, 195 x 260 and 288 x 512. All the pictures were taken on December 31, 2013, approximately four months before the OnePlus One was unveiled. The pictures depict what appear to be camera calibration sheets with various colors and geometric lines and other unknown machinery. The original pictures themselves appear to have been deleted and were not included in the stock photos folder.</p>
<p>I went through a friend’s OnePlus One to check if he also had the factory thumbnails included, but they weren’t. I also contacted OnePlus via email and was strongly advised by a representative to avoid posting the photos here.</p>
<p>Judging from the date the pictures were taken and what is depicted, the response from the representative and the fact that I purchased the phone brand new, I think I can safely assume that they’re authentic. It’s kinda cool to have small a piece of phone history of one of my favorite brands.</p>chevoniedanielWhile going through my OnePlus One a few months ago, I came across the folder containing thumbnails for the stock photos at /0/DCIM/.thumbnails. Along with the stock photo thumbnails, however, were four pictures that were taken within a factory. The thumbnails are all fairly good quality, with resolutions of 243 x 324, 195 x 260, 195 x 260 and 288 x 512. All the pictures were taken on December 31, 2013, approximately four months before the OnePlus One was unveiled. The pictures depict what appear to be camera calibration sheets with various colors and geometric lines and other unknown machinery. The original pictures themselves appear to have been deleted and were not included in the stock photos folder.Using Microcontrollers to save water on farms2018-05-10T23:40:00+00:002018-05-10T23:40:00+00:00http://chevonie.com/Using-microcontrollers-to-save-water-on-farms<p>Since taking agricultural science in high school, I’ve become interested in sustainable farming and more specifically, the utilization of technology to optimize farming efficiency.</p>
<p>One of the green solutions that I have invested time researching, stem from problems that I observed farmers were experiencing in my area. Due to the high mountains that surround the villages where I live, farmers are faced with a two pronged problem, getting water to their farms in the mountainous areas and the utilization of far more water than is necessary when they manage to do so. This is because the weather forecasting services are unable to accurately predict weather in mountainous areas, since the mountains themselves create localized disturbances (rain, thunderstorms, etc) which are very spontaneous.</p>
<p>A potential solution to help reduce the amount of water utilized on the farms, involve the use of portable weather stations that are able to measure the air humidity, soil humidity, rain drops, and temperature. These devices would help the farmers save water by providing accurate readings for the specific area around their farms. The readings would help to lessen both the amount of water required to be transported to the farms and the amount of petrol used to transport it there due to the weight reductions. The cost of normal portable weather stations can run into the thousands of dollars; however, due to advances in Microcontroller technology, it is now possible to construct a portable weather station from a microcontroller and sensors costing tens of dollars. One of the most popular microcontrollers used to create these portable weather stations is called an Arduino Uno, which I have previously purchased and experimented with. I am also interested in the possibility of adding evapotranspiration sensors to the Arduino Uno’s that could inform the farmers of the rate by which moisture is returned to the air through evaporation from the soil and transpiration by plants.</p>
<p>The microcontrollers also provide a means for storing the data collected, which could result in long term benefits for farmers, both in mountainous and flat regions, by uploading the data to a potential open, shared data storage service. There, the information could be analyzed by volunteer data scientists and researchers, thus resulting in further optimizations as Artificial Intelligence technology and Data Wrangling techniques improve.</p>
<p>I believe water conservation is a very important issue, and as its scarcity increases around the world, this, and other similar solutions may become an absolute necessity.</p>chevoniedanielSince taking agricultural science in high school, I’ve become interested in sustainable farming and more specifically, the utilization of technology to optimize farming efficiency.Using Twitter data to create Wordclouds in R2018-03-10T21:00:00+00:002018-03-10T21:00:00+00:00http://chevonie.com/build-worldcloud-in%20r<p>Wordclouds can be very useful to determine what customers are saying about your product or service. They can be created using the R Programming Language in a relatively short amount of time and customized in a variety of ways. I’ll walk you through the process of creating your own Wordclouds and customizing it based on Twitter data.</p>
<p>The first thing you’d want to do is install the R Programming Language. The most recent version can be found on <a href="https://cran.r-project.org/">this website</a>. When that’s completed, I strongly recommend installing <a href="https://www.rstudio.com/products/rstudio/download/">RSudio</a>. It can make your programming in R a lot easier, unless of course if you really enjoy programming in the terminal.</p>
<p>Now that you’ve installed the required software, the next step is setting up an account with Twitter and creating the Wordcloud app. This will allow you to interface with their API in order to download the tweet data.</p>
<p>Go to https://apps.twitter.com and click on the “Create New App” button. Fill out the relevant information and click on the “Create your Twitter application” button. Now that you have the app set up, head over to the “Keys and Access Tokens” section and click on the “Generate my Access Token” button. Take extreme care to avoid posting your access tokens or private keys online or sharing them with anyone in general. Any malicious use of your keys will be associated with your account, which could get you in trouble with Twitter.</p>
<p>Now that setup in complete, lets start programming!</p>
<p>Open up RStudio and type the following:</p>
<pre><code class="language-rconsole">install.packages("twitteR")
install.packages("tm")
install.packages("wordcloud")
require(twitteR)
require(tm)
require(wordcloud)
</code></pre>
<p>All this does is import the necessary packages required to create the Wordcloud. The <code class="highlighter-rouge">twitteR</code> package will be used to interface with the Twitter API, The <code class="highlighter-rouge">tm</code> package is used for mining the Twitter data. The <code class="highlighter-rouge">Wordcloud</code> is used to create the Wordcloud.</p>
<p>Next we’re going to authenticate our app information with Twitter. Enter the following code:</p>
<pre><code class="language-rconsole">consumer_key <- 'Your Key Here'
consumer_secret <- 'Your Key Here'
access_token <- 'Your Key Here'
access_secret <- 'Your Key Here'
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
</code></pre>
<p>The next step is the most important. We will now craft how much (that’s what the <code class="highlighter-rouge">n</code> is for), and what kind of tweets (we’re searching for Tweets where <code class="highlighter-rouge">cheese</code> is mentioned) we want to collect from Twitter. Type the following:</p>
<pre><code class="language-rconsole">coll_tweets = searchTwitter("cheese",n=500,lang="en")
coll_text = sapply(coll_tweets, function(x) x$getText())
</code></pre>
<p>The above code can be modified in a wide variety of ways using different <a href="https://www.rdocumentation.org/packages/twitteR/versions/1.1.9">functions</a> of the <code class="highlighter-rouge">twitteR</code> package; feel free to experiment with it.</p>
<p>Next we will create a <code class="highlighter-rouge">Corpus</code>, which is just a fancy way of saying a collection of data.</p>
<pre><code class="language-rconsole">coll_corpus = Corpus(VectorSource(coll_text))
</code></pre>
<p>Now that we’ve created the corpus, lets clean it up. We’ll make all the words lowercase and remove punctuations, numbers and whitespace from the tweets. Sometimes it may be useful to remove the main word from the Wordcloud. This is due to the fact that the words will be displayed larger based on their frequency, and since we’re searching for a particular word, we know that it will appear all the time. By excluding it, you get to see what people are saying about it without the word itself occupying a large amount of space in the word cloud.</p>
<pre><code class="language-rconsole">coll_clean <- tm_map(coll_clean, tolower)
coll_clean <- tm_map(coll_corpus, removePunctuation)
coll_clean <- tm_map(coll_clean, removeNumbers)
coll_clean <- tm_map(coll_clean, stripWhitespace)
</code></pre>
<p>If you’re on a Mac and got some errors, the piece of code might help</p>
<pre><code class="language-rconsole">coll_clean <- iconv(coll_clean,to="utf-8-mac")
</code></pre>
<p>Okay! Lets can finally run the code the creates the Wordcloud from the tweets we’ve collected.</p>
<pre><code class="language-rconsole">wordcloud(coll_clean)
</code></pre>
<p>If everything worked out, you should be seeing something like this:
<img src="/assets/images/wordcloud_tut/unfinished_wc.png" alt="Unfinished Wordcloud" title="Unfinished Wordcloud" /></p>
<p>Not very impressive I know, but we can spruce it up a bit with this:</p>
<pre><code class="language-rconsole">wordcloud(coll_clean, random.order = F, random.color = T, max.words = 100, scale = c(3, 0.5), colors = rainbow(51))
</code></pre>
<p>This code limits the number of words to 100, determines the range of the size of words and adds color to the Wordcloud. After running it, your Wordcloud should look something like this:
<img src="/assets/images/wordcloud_tut/finished_wc.png" alt="Unfinished Wordcloud" title="Finished Wordcloud" /></p>
<p>Now you have a swanky new Wordcloud, don’t stop here, tinker with it, try new functions and have some fun!</p>chevoniedanielWordclouds can be very useful to determine what customers are saying about your product or service. They can be created using the R Programming Language in a relatively short amount of time and customized in a variety of ways. I’ll walk you through the process of creating your own Wordclouds and customizing it based on Twitter data.The most useful Sublime Text packages2018-03-09T15:00:00+00:002018-03-09T15:00:00+00:00http://chevonie.com/most-useful-st-packages<p>It’s no secret that I enjoy using Sublime Text, both for its aesthetics, and the productivity boost I noticed when using it. So, I figured why not spread the joy around, and hopefully help make another programmer become just a bit more efficient.</p>
<p>To start off, you’ll obviously need to have Sublime Text installed. It’s cross-platform, and the latest version can be downloaded directly from <a href="https://www.sublimetext.com/3">their website</a>. After it’s installed, you’ll need to get Package Control, which only involves pasting some code into the Sublime Text console, the instructions for which can be found <a href="https://packagecontrol.io/installation">here</a>. If everything is all set up, you can now install packages by pressing <code class="highlighter-rouge">Ctrl + Shift + P</code> on Windows or <code class="highlighter-rouge">Command + Shift + P</code> on Mac, choose “Package Control: Install Package”, input the package name, and select the one you want.</p>
<p>Finally, here’s the list of Sublime Text packages I consider to be the most useful:</p>
<h2 id="sidebarenhancements">SideBarEnhancements</h2>
<p>Despite it’s apparent simplicity, this is one of the most useful Sublime Text packages. It adds a number of very handy functions to the ST sidebar, since the number of default options are a bit sparse. You can find its official documentation <a href="https://packagecontrol.io/packages/SideBarEnhancements">here</a>.</p>
<h2 id="dayle-rees-color-schemes">Dayle Rees Color Schemes</h2>
<p>Remember all that talk about the aesthetics of Sublime Text that I like so much? Well, this package really helps to bring it out. It brings a large number of different color schemes that make working with ST a real treat. You can find the official documentation <a href="https://packagecontrol.io/packages/Dayle%20Rees%20Color%20Schemes">here</a>.</p>
<h2 id="sublimelinter">SublimeLinter</h2>
<p>SublimeLinter, is a <strong>very</strong> useful package that helps make ST seem a lot more like an IDE than a text editor. It provides an interface for other language specific packages to provide insight on potential errors in your code. You can find these language specific packages by typing a <code class="highlighter-rouge">-</code> after SublimeLinter and reading the installation instructions. The documentation can be found <a href="https://packagecontrol.io/packages/SublimeLinter">here</a>.</p>
<h2 id="sublimecodeintel">SublimeCodeIntel</h2>
<p>SublimeCodeIntel adds another IDE like function to ST, code completion. Depending on the language you’re using (I’m looking at you Java), this package can save you a good deal of time. You can read the official documentation <a href="https://packagecontrol.io/packages/SublimeCodeIntel">here</a>.</p>
<h2 id="emmet">Emmet</h2>
<p>Emmet is a great little tool that aims to reduce the amount of time you spend writing repetitive code, and by repetitive code I mean stuff like HTML tags (it won’t save you from yourself). You can find the Readme <a href="https://packagecontrol.io/packages/Emmet">here</a>.</p>
<h2 id="brackethighlighter">BracketHighlighter</h2>
<p>This useful little package helps by showing you the scope of a function or class while programming, and has a number of customizations. You can read the official documentation <a href="https://packagecontrol.io/packages/BracketHighlighter">here</a>.</p>
<h2 id="auto-save">Auto-save</h2>
<p>This package, coupled with a browser extension with the same same, saves you from having to press refresh all the time, when working on files open in the browser. The official documentation can be found <a href="https://packagecontrol.io/packages/auto-save">here</a></p>
<p>I hope some of these packages were useful to you, and I’ll try to keep updating this list as I find more great packages. Feel free to contact me with suggestions.</p>chevoniedanielIt’s no secret that I enjoy using Sublime Text, both for its aesthetics, and the productivity boost I noticed when using it. So, I figured why not spread the joy around, and hopefully help make another programmer become just a bit more efficient.#DominicaStrong Retweet Bot2018-01-29T16:23:00+00:002018-01-29T16:23:00+00:00http://chevonie.com/dominicastrong-retweet-bot<p>In the aftermath of the catastrophic category 5 hurricane (Maria) that ravaged Dominica in September last year, the #DominicaStrong hashtag attained widespread popularity. It united and encouraged a distraught populace that had just witnessed the worst natural disaster in living memory.</p>
<p>To date it has inspired numerous songs, pictures and poems, none of which I want to miss out on. This is why I decided to build a simple twitter bot that retweets posts that include this hashtag that perfectly describes my people.</p>
<p>#DominicaStrong</p>chevoniedanielIn the aftermath of the catastrophic category 5 hurricane (Maria) that ravaged Dominica in September last year, the #DominicaStrong hashtag attained widespread popularity. It united and encouraged a distraught populace that had just witnessed the worst natural disaster in living memory.The difference between \n and endl in C++2017-12-23T17:00:00+00:002017-12-23T17:00:00+00:00http://chevonie.com/Difference-Between-n-and-endl<p>About two years ago when I took my first C++ class, I remember my professor used both <code class="highlighter-rouge">\n</code> and <code class="highlighter-rouge">endl</code> to create new lines. Having been previously acquainted with <code class="highlighter-rouge">\n</code> from Python, I wondered what difference the two had on the running of a program. One day after class, I asked him what the difference was and he told me that <code class="highlighter-rouge">endl</code> also flushes the buffer.</p>
<p>I wanted to find out more about this, so when I got home I checked with the all-knowing StackOverflow for more information on the two and found out that <code class="highlighter-rouge">endl</code> is a <a href="http://www.cplusplus.com/reference/library/manipulators/" title="cplusplus.com Stream Manipulator Reference">stream manipulator</a> that forces a flush the buffer which can have a negative impact on the performance of a program. This is in contrast to <code class="highlighter-rouge">\n</code> which is a typical <a href="http://en.cppreference.com/w/cpp/language/escape" title="cppreference.com Escape Sequences Reference">escape sequence</a> and only 1 byte (for <code class="highlighter-rouge">'\n'</code>) or 2 bytes (for <code class="highlighter-rouge">"\n"</code>) large. One interesting little nitpick is that using <code class="highlighter-rouge">"\n"</code> will cause the program to run just <em>slightly</em> slower than <code class="highlighter-rouge">'\n'</code> since <code class="highlighter-rouge">"\n"</code> is a string literal representing two characters, the <code class="highlighter-rouge">'\n'</code> newline character and the null terminator <code class="highlighter-rouge">'\0'</code>.</p>
<p>Therefore the wanton use of <code class="highlighter-rouge">endl</code> should be avoided in instances where performance is major issue.</p>chevoniedanielAbout two years ago when I took my first C++ class, I remember my professor used both \n and endl to create new lines. Having been previously acquainted with \n from Python, I wondered what difference the two had on the running of a program. One day after class, I asked him what the difference was and he told me that endl also flushes the buffer.Clock Gene Analysis2017-11-21T17:00:00+00:002017-11-21T17:00:00+00:00http://chevonie.com/Clock-Gene-Analysis<p>For this project, my partner and I did an analysis of the clock gene (Dmel/Clk) found on the third chromosome of Drosophilla Melanogaster (the fruit fly).</p>
<p>Our research involved determining the function of the clock gene and how it is affected by different stimuli such as light and comparing the gene and amino acid sequences of the fruit fly with those of other organisms (The Red Junglefowl, The typical House Mouse, The Brown Rat, The Giant River Prawn and the Firebrat).</p>
<p>We utilized the Multiple sequence alignment tool by Florence Corpet to align the clock genes and amino acid of the different organisms. This provided a clear view of the areas of high and low sequence matches. However, we were interested in the exact percentages of not just the high an low consensus areas but the areas of the gene with medium and no consensus at all. For this we used the Multiple Sequence Comparison by Log-Expectation (MUSCULE) system. The report it generated marked the areas we were interested in with different symbols that allowed us to determine consensus frequency variations in the gene versus the protein using good Google Chrome features and a calculator. We then created a rotating 3-D model of the different motifs using PyMOL.</p>
<p>Our analysis led us to conclude that there is more variation in the protein versus the gene and the clock gene affects organisms differently, with and mutations in the gene resulting in unique changes in the rhythmic activities of the organisms.</p>
<p>Some pictures detailing portions of our analysis can be found below:</p>
<table>
<thead>
<tr>
<th style="text-align: center"><img src="/assets/images/clock_gene_analysis/gene_alignment.PNG" alt="Area with Highest Concentration of Gene Alignments" class="center-image" /></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"><strong>Area with Highest Concentration of Gene Alignments</strong></td>
</tr>
</tbody>
</table>
<p><br /></p>
<table>
<thead>
<tr>
<th style="text-align: center"><img src="/assets/images/clock_gene_analysis/protein_alignment.PNG" alt="Area with Highest Concentration of Amino Acid Alignments" class="center-image" /></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"><strong>Area with Highest Concentration of Amino Acid Alignments</strong></td>
</tr>
</tbody>
</table>
<hr />
<table>
<thead>
<tr>
<th style="text-align: center"><img src="/assets/images/clock_gene_analysis/Concensus_Frequency_Gene.PNG" alt="Consensus Frequency in the Gene" class="center-image" /></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"><strong>Consensus Frequency in the Gene</strong></td>
</tr>
</tbody>
</table>
<p><br /></p>
<table>
<thead>
<tr>
<th style="text-align: center"><img src="/assets/images/clock_gene_analysis/Concensus_Frequency_Protein.PNG" alt="Consensus Frequency in the Amino Acid" class="center-image" /></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"><strong>Consensus Frequency in the Amino Acid</strong></td>
</tr>
</tbody>
</table>
<hr />
<table>
<thead>
<tr>
<th style="text-align: center"><img src="/assets/images/clock_gene_analysis/protein_model.PNG" alt="3-D Model of Amino Acid Interaction with DNA" class="center-image" /></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"><strong>3-D Model of Amino Acid Interaction with DNA</strong></td>
</tr>
</tbody>
</table>chevoniedanielFor this project, my partner and I did an analysis of the clock gene (Dmel/Clk) found on the third chromosome of Drosophilla Melanogaster (the fruit fly).