tag:blogger.com,1999:blog-51609970680943257652024-03-19T14:38:30.822-03:00A Dicotomia do TrabalhoUnknownnoreply@blogger.comBlogger16125tag:blogger.com,1999:blog-5160997068094325765.post-49575808225228605682014-09-13T11:53:00.004-03:002014-10-01T22:21:33.329-03:00Sensorial android app<h2 style="text-align: center;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitT0-otVGKzu1ae7JMtf5UtmNcsqKxCRlQJ6LkA4SkHL6hh6Z-4Qr-oH83X9ylgF_I2Cg7P245A9SQC5_xQrAF_7nUld7x10FknqDixzkSDOUoB8zUzmCbpHOKmsqWXBYHM4nxJ1J0yWM/s1600/gplus.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitT0-otVGKzu1ae7JMtf5UtmNcsqKxCRlQJ6LkA4SkHL6hh6Z-4Qr-oH83X9ylgF_I2Cg7P245A9SQC5_xQrAF_7nUld7x10FknqDixzkSDOUoB8zUzmCbpHOKmsqWXBYHM4nxJ1J0yWM/s1600/gplus.png" title="Sensorial on Google Play" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="https://play.google.com/store/apps/details?id=br.com.rdenadai.oficial.sensorial">Sensorial on Google Play</a></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
</h2>
<div style="text-align: justify;">
Ow, it's been like forever since i write my last post (too bad for me right).</div>
<div style="text-align: justify;">
Since it has been too long, don't think that i was doing nothing (actually play PS4 too some time of my life... :P).</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUoS9PrNJVZg5weYDtQHDLzjNLFsYRqxbVgoOT4cwH6GOfd6kHzs2WNCbvBv0nrPHvyjxd-J6XAH2vZrhyphenhyphenN-ZN4vG5VI0PNmbxc5ZIO6sVb8WLXKRdMhIijEK9dFbAa5o6rvUd_gLebes/s1600/android-icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUoS9PrNJVZg5weYDtQHDLzjNLFsYRqxbVgoOT4cwH6GOfd6kHzs2WNCbvBv0nrPHvyjxd-J6XAH2vZrhyphenhyphenN-ZN4vG5VI0PNmbxc5ZIO6sVb8WLXKRdMhIijEK9dFbAa5o6rvUd_gLebes/s1600/android-icon.png" height="200" width="200" /></a></div>
<div style="text-align: justify;">
Those last months were a blast! I learn java/android programming and thought: "Why not release some app on the Play Store?". So that what i did! This is my first blog post explain some of the core functions i use in my app, so it can help others.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So, let's start with an idea, you must have an idea to build an app, even if that idea has already been implemented for someone else right? The idea behind Sensorial is very simple: Give you data about sensors that we can find in our daily life.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgjKUueE0sqDvhvGCV22eu34t-_aaKGhACqgW-yGLutg67SfmHVMoPrM5DFhDWuDSTm-Gju5B6a52iLVUqqGzEAvkZ5cAaXzmeieSps1-zmTVeaV35WfX_15dOwM-0YaFlzFGSHjCVjCk/s1600/IoT.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgjKUueE0sqDvhvGCV22eu34t-_aaKGhACqgW-yGLutg67SfmHVMoPrM5DFhDWuDSTm-Gju5B6a52iLVUqqGzEAvkZ5cAaXzmeieSps1-zmTVeaV35WfX_15dOwM-0YaFlzFGSHjCVjCk/s1600/IoT.png" height="184" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
You must thought, "IoT"[1] right? That's one path... why not. But since we are on the IT space, i learn that baby steps is a great thing, so im starting small. For now the app will give you some sensors information available using the hardware you have on your device and some collected over the internet using your geolocation to get the better value for you in that point of time and space.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So that's what is implemented right now, but the original idea was way more simple, my father just wanted to replace he's old app that give him values of speed, distance and altitude. Very simple right? So i implement some other features that in the end he found very usefull.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But enough of history, lets talk "techie".</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1d3VoFZFwoYv0RF_364hYdeXT1UR2TZtWEhOiPeBS-p3I9IkUcWGlpCzLMaunud-_6_trEqCO6mDY41KPMwZHcunieOnbviI57rQrPSaQgMXYYnXAoPSlwJ0etFKPdYNe6PZQI6pP0P4/s1600/logo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1d3VoFZFwoYv0RF_364hYdeXT1UR2TZtWEhOiPeBS-p3I9IkUcWGlpCzLMaunud-_6_trEqCO6mDY41KPMwZHcunieOnbviI57rQrPSaQgMXYYnXAoPSlwJ0etFKPdYNe6PZQI6pP0P4/s1600/logo.png" height="200" title="BuffterKnife" width="200" /></a></div>
<div style="text-align: justify;">
In this first post im just listing the libraries used to build Sensorial.</div>
<div style="text-align: justify;">
The first one was <i><b>ButterKnife</b></i>[2], and what a great lib uhm? It takes out all the trouble of writing over and over the famous Android <b>findViewById</b>[3] method of the <b>Activity</b>.</div>
<div style="text-align: justify;">
<i><b>ButterKnife</b></i> was my choice because it looks very simple to use (but in the end Eclipse Bundle impose some difficult) and have some good documentation. If you don't know the library or know but never used give that a change, it's good.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Ok, said one lib right, just to be clear im using 7 libraries! You are think, "That's too much! It must be a performance killer!". Well... it's not that much actually, the performance of the app is good, and usage is not bad, some of those libraries have more performance that the original android code! You could try for yourself if want to, anyway, all those libraries add some high level interface on the programming make it easy to do some tasks.</div>
<div style="text-align: justify;">
The others libraries im using are the following:</div>
<div style="text-align: justify;">
<br /></div>
<ul style="text-align: justify;">
<li> <b>GSON[4]</b>: Great lib to work with json format, since some of the internet services that im using to get sensor info return in json, it was a must have. If you look in the internet the performance is much better that the default android parser. Also you could check jackson, it claims to have better performance that GSON!</li>
<li><b>Http-Request[5]</b>: The android code to make a http request is disgusting, this lib is great, it reminds me python request (which i find awesome!).</li>
<li><b>Joda Time[6]</b>: if you work with date on Java you suffer whole life until Joda was created... :D it is excellent when it comes to parser and transform string into date objects and vice versa.</li>
<li><b>SugarOrm[7]</b>: Awesome, i was checking for orm in android and found this precious lib... what it makes speciall? The simplicity... if you are looking for "Simple is better than Complex", use this and be happy. A plus is that the lib is active on github!!!!</li>
<li><b>ListViewAnimations[8]</b>: This was a life saver for me... android has its ListView component, and im using to make the list of sensors in the main activity. But how one can implement some list special operations? Like Drag and Drop, Swipe to dismiss and stuff like that? Well, enter ListViewAnimations... this lib has all!! And some more! If you are using ListView, check this out and be a little more happy when coding for your users and improve their experiences!</li>
</ul>
<div style="text-align: justify;">
All those libraries will help you a little more to build a great and easy to use app, you should check Sensorial to get a little idea what you could build.</div>
<div style="text-align: justify;">
Sensorial is a paid app, but im thinking in release a free version also, the problem in release a free version is that one of the service im using is a paid one, and if the app has too much requests to that service, the app could be down for a few hours...</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Anyway, in the next posts i will explain some problems and solutions found to build Sensorial, and perhaps my next android app. </div>
<div style="text-align: justify;">
Sensorial is far from finish its development life cycle, im have much more ideas to implement on it to leave there on the Play Store without updates!</div>
<br />
<br />
Cheers!!!<br />
<br />
[1]: <a href="http://en.wikipedia.org/wiki/Internet_of_Things">Internet of Thins (IoT)</a><br />
[2]: <a href="http://jakewharton.github.io/butterknife/">ButterKnife</a><br />
[3]: <a href="http://developer.android.com/reference/android/view/View.html#findViewById%28int%29" target="_blank">findViewById</a><br />
[4]: <a href="https://code.google.com/p/google-gson/">GSON</a><br />
[5]: <a href="https://github.com/kevinsawicki/http-request">Http-Request</a><br />
[6]: <a href="http://www.joda.org/joda-time/">Joda Time</a><br />
[7]: <a href="http://satyan.github.io/sugar/">SugarORM</a><br />
[8]: <a href="https://github.com/nhaarman/ListViewAnimations">ListViewAnimations</a><br />
[9]: <a href="https://play.google.com/store/apps/details?id=br.com.rdenadai.oficial.sensorial">Sensorial on Google Play</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-30657463483253847622013-12-16T13:48:00.000-02:002014-10-01T22:25:00.039-03:00Video Reviewː "The Death of the universe - Renée Hlozek"<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="https://ytimg.googleusercontent.com/vi/mSzCS_5qtVY/0.jpg" height="266" width="320"><param name="movie" value="https://youtube.googleapis.com/v/mSzCS_5qtVY&source=uds" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="https://youtube.googleapis.com/v/mSzCS_5qtVY&source=uds" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
Interesting animated video about the possible way that our universe could and... nice to see and to learn a little more.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
I like very much about the theory about dark matter, but something tells (call it gut felling) that in the end, the universe full with dark matter will colapse in itself, giving origin to a new big bang... </div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3oar9B8EkOwH_BU5-6mfOk6Ed961GYGGhgfLndWSLlcn53l7zZTmR_QZ7dyTn3veJjrO0P8TTHVpMDOhm12N4DV-0Mi9_OvFVvZezswmJiat-VdW1SmE57SjqGPOy1TveW5TG6rEHboQ/s1600/Michio_Kaku_in_2012.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3oar9B8EkOwH_BU5-6mfOk6Ed961GYGGhgfLndWSLlcn53l7zZTmR_QZ7dyTn3veJjrO0P8TTHVpMDOhm12N4DV-0Mi9_OvFVvZezswmJiat-VdW1SmE57SjqGPOy1TveW5TG6rEHboQ/s1600/Michio_Kaku_in_2012.jpg" height="211" width="320" /></a></div>
<div style="text-align: left;">
<br />
Others videos worth watching are from Michio Kaku[1] and from the series "How the Universe Works"[2], documentaries from the Discovery Channel.</div>
<div style="text-align: left;">
There are a lot of others videos and papers about it, and you could find even more scientific papers...</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Explore!!</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
[1] Michio Kaku: <a href="http://pt.wikipedia.org/wiki/Michio_Kaku">http://pt.wikipedia.org/wiki/Michio_Kaku</a></div>
<div style="text-align: left;">
[2] How The Universe Works: <a href="http://dsc.discovery.com/tv-shows/other-shows/videos/other-shows-how-the-universe-works-videos.htm">http://dsc.discovery.com/tv-shows/other-shows/videos/other-shows-how-the-universe-works-videos.htm</a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-18211876969472625572013-11-11T11:17:00.001-02:002014-10-01T22:22:07.386-03:00Web Scraping with Scrapy<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: 'Trebuchet MS'; font-size: 28px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Web Scraping with Scrapy</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">How to extract data from websites</span></div>
<b id="docs-internal-guid-1e5d7449-4747-9292-4bfb-bff67e91932d" style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Months without posting nothing, and than... BAM!!! Posting a lot of stuff, this is for you guys to see that im still doing stuff but the time to put all that in a blog post is limit, so let me take the opportunity given in the present time, and write... </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The following months i’ve been using a lot the Scrapy Framework (those who follow me on twitter should realize that), and this article is about that... use the scrapy framework to extract relevant data.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Extract data means that we want to take unordered info from one (or more than one) website, parser that and use it for our wishs.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Wikipedia[1] has a good explanation about what i just said above:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTtdaSIDe57ysWLlN-ZT0bbM5toiuNGfnGK_qE8OvQ-MDxJRGdAmnf1UTdUwnSOp0IexWh852r1dJT1nrxrBgvN-MRahjvpoGZ4cVBKQg3x_rl84sEUwZKQScpbHq-IvcCzW6s20u6ewk/s1600/Scrapy_logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTtdaSIDe57ysWLlN-ZT0bbM5toiuNGfnGK_qE8OvQ-MDxJRGdAmnf1UTdUwnSOp0IexWh852r1dJT1nrxrBgvN-MRahjvpoGZ4cVBKQg3x_rl84sEUwZKQScpbHq-IvcCzW6s20u6ewk/s320/Scrapy_logo.jpg" height="94" width="320" /></a></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">“Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Web scraping is closely related to web indexing, which indexes information on the web using a bot or web crawler and is a universal technique adopted by most search engines. In contrast, web scraping focuses more on the transformation of unstructured data on the web, typically in HTML format, into structured data that can be stored and analyzed in a central local database or spreadsheet. Web scraping is also related to web automation, which simulates human browsing using computer software. Uses of web scraping include online price comparison, contact scraping, weather data monitoring, website change detection, research, web mashup and web data integration.” - from Wikipedia</span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Well, there’s a lot of tools we can use to extract data from websites, but i find scrapy very good and easy one.</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">What’s Scrapy[2]?</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It’s a framework. A framework that’ll help you extract data and others end. It’s written in python[3], which means it’s far from great!! hahahahaaha :D</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Scrapy there a lot of clients[4] already using it, which makes the framework even more tested, check the list on their website. One client use scrapy for Data Mining[5], this is the stuff you could do, or perhaps just scrap the photos of one site you want to!</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">How to use...</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To use scrapy there’s some basics stuff to do, for the simplicity of this article, im using GNU/Linux, in particular Linux Mint 15[6].</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Since linux is great! Python is pre-install on the Mint distro, so, no need to run anykind of installation procedure.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Scrapy is a third party framework, so we need to install, i recommend the use of pip[7] to install python packages. If you don’t know pip, take a few minutes to understand how it works, and the wonderfull it can do for you.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To install pip on the system (if already haven’t install) use synaptic to search for it’s package, after the installation type on the shell to install Scrapy:</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~ $ pip install scrapy</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4eNa34e1m-wPnBvwDlISif2eEgxsfMwfvNw_Zejky_5Zu6_dkP1OhCMF3yNdbNNqKM6BVwwsODQjiW7kpKV4RMs8pkG0k4ZB93zMA8eMtCc5Qxrh1vyzpgnqq-Lv0tt6muwLNN6NiGV0/s1600/6.1.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4eNa34e1m-wPnBvwDlISif2eEgxsfMwfvNw_Zejky_5Zu6_dkP1OhCMF3yNdbNNqKM6BVwwsODQjiW7kpKV4RMs8pkG0k4ZB93zMA8eMtCc5Qxrh1vyzpgnqq-Lv0tt6muwLNN6NiGV0/s1600/6.1.jpg" /></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This way, the framework will install and be ready to use. BeautifulSoup4 is another great tool to handle HTML, it can parse documents and access items in easy way, good tool to make some pos-processing on items that Scrapy collect and record on a database.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To install it type:</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~ $ pip install beautifulsoup4</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">For fast example, i’ll do the scrapping of the news from the website of PMC[9] (Prefeitura Municipal de Campinas).</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A default scrapy project will be created to do the job, you can find info about this in the documentation of the Scrapy[10].</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To start a new Scrapy project do:</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~$ scrapy startproject noticias_pmc</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A estructure will be created on the folder that you execute the command (in this case a folder is created in the root directory of the default logged user).</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">scrapy.cfg</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: circle; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: square; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">__init__.py</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: square; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">items.py</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: square; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pipelines.py</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: square; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">settings.py</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: square; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">spiders/</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __init__.py</span></div>
</li>
</ul>
</ul>
</ul>
</ul>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">“</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">scrapy.cfg:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the project configuration file</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the project’s python module, you’ll later import your code from here.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/items.py:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the project’s items file.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/pipelines.py:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the project’s pipelines file.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/settings.py:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the project’s settings file.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/spiders/:</span><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> a directory where you’ll later put your spiders.”</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">First step is define a estructure item (the information the we want to extract and put on use). Open the file </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/items.py</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span></div>
<div style="text-align: justify;">
<br />
<code></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.item import Item, Field</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class <span style="text-indent: 48px;">NewsPmcItem</span>(Item):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">title = Field()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">data = Field()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">text = Field()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">image_urls = Field()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">images = Field()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"></code></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Done! Now let’s build out spider! To do data, inside the folder </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">noticias_pmc/spiders/</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> created a file named</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> NewsPMCSpider.py</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. Noticed that Scrapy use the xpath[11] syntax to locate elements inside the parser HTML, another library’s, as the installed BeautifulSoup4 can use others means to access those elements.</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"><code></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># -*- coding: utf-8 -*-</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.contrib.spiders import CrawlSpider, Rule</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.selector import HtmlXPathSelector</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from noticias_pmc.items import NoticiasPmcItem</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import urlparse</span></div>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Class, CrawlSpider is the super class (in python we do this way) </span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class NewsPMCSpider(CrawlSpider):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># name our spider</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">name = 'noticias_pmc'</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># allowed domains, we don’t want the spider to read the entire web, do we??</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">allowed_domains = ['campinas.sp.gov.br']</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># wich url we should start the read</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">start_urls = ['</span><a href="http://campinas.sp.gov.br/noticias.php" style="text-decoration: none;"><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://campinas.sp.gov.br/noticias.php</span></a><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">']</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Rules, which urls format we sould read, the callback that will parse the response and follow to tell our spider to keep going to another urls!</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rules = (</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Extract links and parse them with the spiders method parse_item</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Rule(SgmlLinkExtractor(allow=['http://campinas.sp.gov.br/noticias.php', 'http://campinas.sp.gov.br/noticias-integra.php']), callback='parse_item', follow=True),</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># This do all the work</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def parse_item(self, response):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Create a news items!</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">item = NewsPmcItem()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Parse the response of the server, so we can access the elements</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">hxs = HtmlXPathSelector(response)</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># xpath to find and get the elments, ah! we want only the string of the text here (no html tags!)</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">titulo = hxs.select('//div[@class="itens"]/h3').select('string()').extract()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># If there’s a title, it may be a valide news!</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if titulo:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span># Get the news date</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>data = hxs.select('//div[@class="itens"]/p[@class="data"]').select('string()').extract()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span># The body text</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>texto = hxs.select('//div[@class="itens"]/p[@align="justify"]').select('string()').extract()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span># Clean up</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>item['titulo'] = titulo[0].strip()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>item['data'] = data[0].strip()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>item['texto'] = "".join(texto).strip()</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span># Make the parser of images that scrapy will save automatic on the folder defined on settings.py</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>item['image_urls'] = self.parse_imagens(response.url, hxs.select('//div[@id="sideRight"]/p/a/img'))</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>return item</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def parse_imagens(self, url, imagens):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">image_urls = []</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for imagem in imagens:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">try:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Image path</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">src = imagem.select('@src').extract()[0]</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># If it is a relative path we must put the prefix http://www.campinas.sp.gov.br before the link</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if 'http' not in src:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">src = urlparse.urljoin(url, src.strip())</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">image_urls.append(src)</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">except:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pass</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return image_urls</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"></code></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Before running our spider, we must change two other files, the settings.py and pipelines.py.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Add the following line on settings.py (no matter where):</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"><code></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Nome da classe no arquivo de pipilines que irá fazer o parser das imagens</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ITEM_PIPELINES = ['noticias_pmc.pipelines.MyImagesPipeline', ]</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># O diretório no qual as imagens serão armazenadas</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IMAGES_STORE = '<caminho interno>/noticias_pmc/images'</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"></code></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">And on pipelines.py paste the MyImagesPipeline class:</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"><code></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.contrib.pipeline.images import ImagesPipeline</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from scrapy.http import Request</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class MyImagesPipeline(ImagesPipeline):</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def get_media_requests(self, item, info):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">try:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if item['image_urls']:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for image_url in item['image_urls']:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 144pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">yield Request(image_url)</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">except:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pass</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">def item_completed(self, results, item, info):</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">item['image_urls'] = [{'url': x['url'], 'path': x['path']} for ok, x in results if ok]</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="background-color: transparent; color: #666666; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return item</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="line-height: normal;"></code></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Done again! Let’s now run our spider an see the results. When you run scrapy will show you the url read and the values catch and put on the items class the pages found!</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Inside the Scrapy project folder, type:</span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">~$ scrapy crawl noticias_pmc</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Look!!! a spider on the web.... hahahahahahahhahahaha</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div style="text-align: justify;">
<b style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you have some problem using Scrapy, leave a message, if i could help, i will!!! There’s much more on Scrapy documentation take a minute (more than one) and read it!!!</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5QVomLOnRPw3mVEv9A_WSv4_tfPgNTxMnY5ciK6voMA4ehllvggw_YG_iTrMTQn2D1nYxzX82LThJXmILa_IhOTZ9DfSSoH-Kvc7vGYGO-lto3NzpIOu7OGnZ5UDp7bZ7fRLHGYcR45c/s1600/Dilbert-750x237.png" imageanchor="1" style="font-family: 'Times New Roman'; font-size: medium; line-height: normal; margin-left: 1em; margin-right: 1em; text-align: center; white-space: normal;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5QVomLOnRPw3mVEv9A_WSv4_tfPgNTxMnY5ciK6voMA4ehllvggw_YG_iTrMTQn2D1nYxzX82LThJXmILa_IhOTZ9DfSSoH-Kvc7vGYGO-lto3NzpIOu7OGnZ5UDp7bZ7fRLHGYcR45c/s400/Dilbert-750x237.png" height="126" style="cursor: move;" width="400" /></a></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[1] Web Scraping: </span><a href="http://en.wikipedia.org/wiki/Web_scraping" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://en.wikipedia.org/wiki/Web_scraping</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[2] Scrapy: </span><a href="http://scrapy.org/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://scrapy.org/</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[3] Python: </span><a href="http://www.python.org/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://www.python.org/</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[4] Companies using Scrapy: </span><a href="http://scrapy.org/companies/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://scrapy.org/companies/</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[5] Data Mining: </span><a href="http://en.wikipedia.org/wiki/Data_mining" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://en.wikipedia.org/wiki/Data_mining</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[6] Linux Mint: </span><a href="http://www.linuxmint.com/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://www.linuxmint.com/</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[7] pip: </span><a href="https://pypi.python.org/pypi/pip" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://pypi.python.org/pypi/pip</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[8] BeautifulSoup4: </span><a href="http://www.crummy.com/software/BeautifulSoup/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://www.crummy.com/software/BeautifulSoup/</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[9] Notícias PMC: </span><a href="http://campinas.sp.gov.br/noticias.php" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://campinas.sp.gov.br/noticias.php</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[10] Documentação Scrapy: </span><a href="http://doc.scrapy.org/en/latest/intro/overview.html" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://doc.scrapy.org/en/latest/intro/overview.html</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">[11] XPath: </span><a href="http://en.wikipedia.org/wiki/XPath" style="text-decoration: none;"><span style="color: #1155cc; font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">http://en.wikipedia.org/wiki/XPath</span></a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-13074888812569041502013-11-06T16:48:00.002-02:002013-11-11T10:34:41.763-02:00"The Future of Programming"<h2 style="text-align: center;">
"The Future of Programming"</h2>
<div style="text-align: justify;">
<div style="text-align: center;">
<i><span style="color: #e06666; font-size: x-small;">This is more like a warning than a trully blog post.</span></i></div>
<br />
Hello guys,</div>
<div style="text-align: justify;">
its been sometime without post anything... Since i was moving out my home to a new one and i got stuck in my day work i find it hard to write some big post.</div>
<div style="text-align: justify;">
Anyway, this is no scuse, i now...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggqhR5vB5Vcgkl89-8XQA3CwH-9S0umuWy5HsMvDVtSF9w9DaH2jQOQmBvXUsyb21IKDOApPrYkXJk-6kK2MUjTOWUMfXWWQEisH88iPa04u8FScmo9tm3QkD4sAo9RxePZfegkb1wUkQ/s1600/coding_alamy_2365972b.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggqhR5vB5Vcgkl89-8XQA3CwH-9S0umuWy5HsMvDVtSF9w9DaH2jQOQmBvXUsyb21IKDOApPrYkXJk-6kK2MUjTOWUMfXWWQEisH88iPa04u8FScmo9tm3QkD4sAo9RxePZfegkb1wUkQ/s320/coding_alamy_2365972b.jpg" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I, as most of my days ways checking out the news and see older weekly email lists that i assign and saw this video between the links, i find this peace of audio and image very instructive, everbody who is a programmer or want to be should watch and begging to rethink the way we do our things.</div>
<br />
<div style="text-align: justify;">
The video speaks for itself... watch and get you own perspective.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Bret Victor - The Future of Programming <i>[1]</i>.</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Some key points that Bret says on his talks are very interesting to implement in now days, those that impress me are the following:</div>
<div style="text-align: justify;">
</div>
<ul>
<li><b>Grail System <i>[2]</i>;</b></li>
<li><b>Actor Model <i>[3]</i>;</b></li>
<li><b>SmallTalk Browser <i>[4]</i>:</b></li>
<ul>
<li><b>Almost the same screen on his presentation<i> [5]</i>;</b></li>
</ul>
</ul>
<div style="text-align: justify;">
Another article that is very enlightenment is this, it talks about why arrays start with 0 index or 1 index... i read it on the Guido van Rossum (father of python) blog, check both!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Citation Needed <i>[6]</i>.</b></div>
<div style="text-align: justify;">
<b>Guido van Rossum blog <i>[7]</i>.</b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhD1vLLW2FO8Oa3zQ5eLNCjiEKP-r25Fp3kkwkLRsi49AWjC60ZSRjKKgqLU3GeCWllXeDY9f3Z4daQEB-vZCV51qwCx9JMDvAsLY4P7-5kVDBhXqPEK4yFYDjMEzEhhyphenhyphenJd6DIZBpI2fY/s1600/prog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhD1vLLW2FO8Oa3zQ5eLNCjiEKP-r25Fp3kkwkLRsi49AWjC60ZSRjKKgqLU3GeCWllXeDY9f3Z4daQEB-vZCV51qwCx9JMDvAsLY4P7-5kVDBhXqPEK4yFYDjMEzEhhyphenhyphenJd6DIZBpI2fY/s320/prog.png" width="320" /></a></div>
<br />
Thanks<br />
<br />
[1]: <a href="http://www.youtube.com/v/8pTEmbeENF4?autohide=1&version=3&attribution_tag=EVRJF1Slx80pSNhBlW8y5g&autoplay=1&feature=share&showinfo=1&autohide=1" target="_blank">http://www.youtube.com/v/8pTEmbeENF4?autohide=1&version=3&attribution_tag=EVRJF1Slx80pSNhBlW8y5g&autoplay=1&feature=share&showinfo=1&autohide=1</a><br />
[2]: <a href="http://c2.com/cgi/wiki?GrailSystem">http://c2.com/cgi/wiki?GrailSystem</a><br />
[3]: <a href="http://en.wikipedia.org/wiki/Actor_model">http://en.wikipedia.org/wiki/Actor_model</a><br />
[4]: <a href="http://en.wikipedia.org/wiki/Class_browser">http://en.wikipedia.org/wiki/Class_browser</a><br />
[5]: <a href="http://seaside.st/about/screenshots?_k=x4bar8gA">http://seaside.st/about/screenshots?_k=x4bar8gA</a><br />
[6]: <a href="http://exple.tive.org/blarg/2013/10/22/citation-needed/" style="text-align: justify;">http://exple.tive.org/blarg/2013/10/22/citation-needed/</a><br />
[7]: <a href="http://python-history.blogspot.ca/2013/10/why-python-uses-0-based-indexing.html" style="text-align: justify;">http://python-history.blogspot.ca/2013/10/why-python-uses-0-based-indexing.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-53728877454259363582013-08-19T13:13:00.001-03:002013-08-19T13:13:47.574-03:00Writing a django json propery serializer<h2 style="text-align: center;">
Writing a django json PROPERTY serializer.</h2>
<div>
So, what's up? This will be my first blog post in english, and for the rest of my writing here in this blog that the language i'll use. The main reason is because most of the traffic that is coming here is from people outside my home land (which is Brazil).</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5s6un0kCBbG_SsrBfEAmPwK_UYnPuNKYYd6vAUjRYRRG87kW2vjd0xouwN46ShXWH0t0Gmc-ekCEQd6QES2HlYeeZdwvKgWcg8A6CB629kXdWJgmsuzYWLeZZgcSKOkmMZUpQtE2FJE0/s1600/django-logo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5s6un0kCBbG_SsrBfEAmPwK_UYnPuNKYYd6vAUjRYRRG87kW2vjd0xouwN46ShXWH0t0Gmc-ekCEQd6QES2HlYeeZdwvKgWcg8A6CB629kXdWJgmsuzYWLeZZgcSKOkmMZUpQtE2FJE0/s1600/django-logo.png" /></a></div>
Anyway, this blog post is about the django framework, well not exactly the framework itself but a little part that i use daily.</div>
<div>
But before the code! A little background showing the why i did this...</div>
<div>
<br /></div>
<div>
Most of my time i use PHP as my main programming language to write web software (not that i like that, but anyway... i have to). Right at the beginning we (means me and my coworkers) start using Zend Framework to write our web apps, and we return JSON strings as part of the response. Simply because we used ExtJs togheter! Pretty slick at that time, but also pretty heavy (ok, not that much).<br />
Since then i've been learn more and more about python e django to the point that they bacame my main programming language (and framework, off course) used to make my hobbiest projects! :D<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcOMsC0fibfLZ6JagZC4lkQmczzek7sIydYQshNNERw9yGZ3dKF53WOogn90FgZHFRvSbImK6NJb5u6FjwoBqile6gGIHSoleadqUUiOfSSczBWxNtZwvm5Sorrq4jEGj6wS8W5ZL5w1M/s1600/json160.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcOMsC0fibfLZ6JagZC4lkQmczzek7sIydYQshNNERw9yGZ3dKF53WOogn90FgZHFRvSbImK6NJb5u6FjwoBqile6gGIHSoleadqUUiOfSSczBWxNtZwvm5Sorrq4jEGj6wS8W5ZL5w1M/s1600/json160.gif" /></a>So, there came the need of write my own JsonSerializer, because django default serializer don't serialize propertys... for me, propertys are a way to enhance the data viewed by a user inside a grid.<br />
Nowdays i dont use anymore ExtJs (perhaps ill use in future projects), but i build my own jquery grid! (ill put this code on github, since i make some cleanup!) But this little grid jquery plugin still eat up JSON as the main format.<br />
<br />
And that's why i change the default JsonSerializer and made this PropertyJsonSerializer!<br />
Anyway... here's the fucking code! And if you dear reader find any bugs on this... write that up on the comments or use the gist tool...<br />
<br />
<strong style="background-color: white; color: #666666; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 20px; letter-spacing: -1px; line-height: 28px;"><a class="js-current-repository" href="https://gist.github.com/rdenadai/6095815" style="color: #4183c4; text-decoration: none; white-space: nowrap;">JsonPropertySerializer.py</a></strong><br />
<a href="https://gist.github.com/rdenadai/6095815">https://gist.github.com/rdenadai/6095815</a><br />
<br />
thanks a lot!</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-80519351790850824172013-03-18T11:45:00.000-03:002013-03-18T11:45:27.326-03:00Raspberry Pi: build a home web server (BETTER WAY)!<h2 style="text-align: center;">
<b><span style="font-size: x-large;">Raspberry Pi: build a home web server (BETTER WAY)!</span></b></h2>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTyWu4r1Y6y5P7fTKulDcDGIBlMAJ4Wrjqoa5Azw_JNqXqEyvJ9fnp0_P7UbmTNXPQqVRkuMFaSMAk7HWsnaJSELKS5RgwqDPrmXoo_nZq5vDeB76Xy8ZLRBl4hRsAoc92BTqBU1IBQ8/s1600/Raspberry_Pi_Logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHTyWu4r1Y6y5P7fTKulDcDGIBlMAJ4Wrjqoa5Azw_JNqXqEyvJ9fnp0_P7UbmTNXPQqVRkuMFaSMAk7HWsnaJSELKS5RgwqDPrmXoo_nZq5vDeB76Xy8ZLRBl4hRsAoc92BTqBU1IBQ8/s200/Raspberry_Pi_Logo.png" width="158" /></a><span style="text-align: justify;">Long time no see people!!! Depois de praticamente 2 meses sem postar nada estou eu aqui novamente!</span></div>
<div>
<span style="text-align: justify;">Como podem perceber o nome da postagem (BETTER WAY) quer dizer que eu aprendi muito nestes últimos 2 meses! Foram bem corridos, com o fim do ano e viagens. Enfim, vamos la!!</span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">Bom, como vocês devem se lembrar do meu último post estava criando um servidor web local (intranet) usando o raspberry pi. Não vou repassar toda a parte introdutória do post passado nesse, aqui vou direto ao ponto!</span></div>
<div>
<span style="text-align: justify;"><br /></span></div>
<div>
<span style="text-align: justify;">Minha stack final até o momento:</span></div>
<div>
<ol>
<li style="text-align: justify;">Raspberry Pi (claro!!);</li>
<li style="text-align: justify;">Arch Linux Arm (2013-01-22);</li>
<li style="text-align: justify;">dnsmasq (i trully love this one!!!);</li>
<li style="text-align: justify;">nginx;</li>
<li style="text-align: justify;">supervisor;</li>
<li style="text-align: justify;">gunicorn;</li>
<li style="text-align: justify;">python2;</li>
<ol>
<li style="text-align: justify;">flask;</li>
</ol>
</ol>
<div style="text-align: justify;">
Beleza, tudo só isso... vou mostrar os passos para instalar esses caras e deixa-los funcionando. Lembrando que, eu não me responsabilizo por quaisquer dados causados pela instalação e posterior uso de seus equipamentos.</div>
</div>
<div>
<div style="text-align: justify;">
Não estou levando em consideração precauções de segurança, no meu caso o acesso a esses dispositivos passa por um router, o qual fornece o DNS e outras implementações como firewall.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<h3 style="text-align: justify;">
<b>Instalação</b></h3>
<div>
<div style="text-align: justify;">
Bom, o primeiro passo é instalar a versão do Arch Linux Arm no cartão de memória que será inserido no pi. Este passo já fora explicado no tutorial anterior (la eu usei o Arch Linux Arm), então não irei me alongar aqui.</div>
</div>
<div>
<div style="text-align: justify;">
Depois de instalar a imagem conecte o SD no pi e ligue-o na energia elétrica, se a tela do monitor ficar pequena (cortando o shell), bom nesse caso você precisa alterar o arquivo de configuração do pi. A melhor opção é desligar o pi, tirar o SD dele e conectar no pc novamente.</div>
</div>
<div>
<div style="text-align: justify;">
Altere o arquivo config.txt que estará em <b><i>/boot/config.txt</i></b>. Eu apenas habilitei e fui mudando os valores de framebuffer e overscan até ficarem legal no meu monitor. O problema de se alterar essas informações desta maneira é que cada outro terminal pode precisar de novas configs.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Feito isso o próximo passo é atualizar todo o sistema. Para logar no Arch Linux pela primeira vez o usuário e senha são <b>root</b> e <b>root</b>.</div>
</div>
<div>
<div style="text-align: justify;">
Após o login execute:</div>
</div>
<div>
<div style="text-align: justify;">
<b><i>pacman -Syyu</i></b></div>
</div>
<div>
<div style="text-align: justify;">
<b><i><br /></i></b></div>
</div>
<div>
<div style="text-align: justify;">
Isso irá atualizar todo o sistema e os repositórios cadastrados.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Agora vamos instalar todos os packages que iremos utilizar! Todos mesmo!!! One line to rule them all!!! HAHAHAHAAHA</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
<b><i>pacman -S sudo base-devel openssl pcre zlib libxml2 udev-automount dnsmasq nginx supervisor mongodb python2 python-pip2</i></b></div>
</div>
<div>
<div style="text-align: justify;">
<b><i><br /></i></b></div>
</div>
<div>
<div style="text-align: justify;">
Legal neh?? Mas o que fizemos/instalamos???</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
O principais são o base-devel que irá instalar mais um tonelada de packages e libs incluindo o compilador gcc.</div>
</div>
<div>
<div style="text-align: justify;">
O udev-automount que irá automagicamente montar as unidades que forem conectadas a porta usb do pi, facilitando nossa vida ao inserir um stick usb como unidade de armazenamento.</div>
</div>
<div>
<div style="text-align: justify;">
E claro todo o resto da stack. Se você não quiser instalar algum dos packages é só não coloca-lo na linha listada acima.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Ainda é necessário instalar o flask!! Para isso execute:</div>
</div>
<div>
<div style="text-align: justify;">
<b><i>pip2 install flask Flask-Assets gunicorn pymongo mongoengine</i></b></div>
</div>
<div>
<div style="text-align: justify;">
<b><i><br /></i></b></div>
</div>
<div>
<div style="text-align: justify;">
Acabamos de instalar o flask, Flask-Assets (que junta todos os arquivos .js em um único javascript e css tb), gunicorn (nosso servidor WSGI local que executa código python) e os binds python para o servidor mongodb.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
O próximo passo é definir para nosso raspberry pi um endereço de ip fixo, o motivo disso é que queremos que o dnsmasq consiga redirecionar algo do tipo mypi.lan.internal.server para o ip do nosso pi e chamar consequentemente nosso site web!</div>
<div style="text-align: justify;">
Como eu estou usando um route, entrei na configuração do mesmo e adicionei um endereço fixo para meu raspberry pi (192.168.1.48).</div>
<div style="text-align: justify;">
Agora é preciso alterar 2 arquivos de sistemas, ambos estão em <b><i>/etc/</i></b> e são:</div>
<div style="text-align: justify;">
<br /></div>
<ul>
<li style="text-align: justify;">hosts</li>
<li style="text-align: justify;">resolv.conf.head</li>
</ul>
<div>
<div style="text-align: justify;">
No hosts (não hosts.conf hein!) basta acrescentar:</div>
</div>
<div>
<div style="text-align: justify;">
<b><i>192.168.1.48 mypi localhost</i></b></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Note que o endereço é mypi, o restante do nome o dnsmasq irá colocar para nós (iremos configurar isso la).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
No resolv.conf.head (crie ele se não existir!) devemos acrescentar:</div>
<div style="text-align: justify;">
<b><i>nameserver 192.168.1.48</i></b></div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
E finalmente vamos alterar o arquivo do dnsmasq para que ele funcione:</div>
<div style="text-align: justify;">
<i>Linha 62:</i></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_j3WxfJKsTCtBUqEYlowfBmNSgebkjTw8H24Jcb2A9CyY7aQIDN8Wfikq-fuabOIFrwvWeRFGso4Ub4Op0DJBcD9dMn6crItJDx4bCd0iu_orW4n1UGunbOHDRWmr811nFkL1kJhJd68/s1600/200px-Dnsmasq_icon.svg.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_j3WxfJKsTCtBUqEYlowfBmNSgebkjTw8H24Jcb2A9CyY7aQIDN8Wfikq-fuabOIFrwvWeRFGso4Ub4Op0DJBcD9dMn6crItJDx4bCd0iu_orW4n1UGunbOHDRWmr811nFkL1kJhJd68/s1600/200px-Dnsmasq_icon.svg.png" /></a><b></b><br />
<div style="text-align: justify;">
<b><b><i>local=/lan.internal.server/</i></b></b></div>
<br />
<div style="text-align: justify;">
<i>Linha 99:</i></div>
<div style="text-align: justify;">
<b><i>no-dhcp-interface=eth0</i></b></div>
<div style="text-align: justify;">
<i>Linha 119:</i></div>
<div style="text-align: justify;">
<b><i>expand-hosts</i></b></div>
<div>
<div style="text-align: justify;">
<i>Linha 128:</i></div>
</div>
<div>
<div style="text-align: justify;">
<b><i>domain=lan.internal.server</i></b></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Feito essas alterações nos arquivos de configuração de rede e do dnsmasq devemos alterar as configurações do nginx. Para configurar um novo vhost procure pelo arquivo do nginx, ele vai estar em <b>/etc/nginx/nginx.conf</b>.</div>
<div style="text-align: justify;">
Embaixo esta a configuração que tenho utilizado juntamente com o gunicorn. Atenção apenas as pastas (você deve colocar o caminho para seus arquivos estáticos [<i>/media/www/static</i>], onde estão os arquivos do seu programa [<i>/media/www/home</i>] e claro o ip:port na qual o gunicorn será executado [no meu caso <i>192.168.0.25:8080</i>]). O resto pode ser deixado como padrão... lembrando que aqui, não ainda não ativei compactação via gzip no nginx (e vai ficar para uma próxima).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><i>server {</i></b></div>
<div style="text-align: justify;">
<b><i> listen 80;</i></b></div>
<div style="text-align: justify;">
<b><i> server_name mypi.lan.internal.server;</i></b></div>
<br />
<div style="text-align: justify;">
<span style="font-style: italic; font-weight: bold;"><br /></span></div>
<div style="text-align: justify;">
<b><i> location ~ ^/(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|images|flash|media|static)/</i></b></div>
<br />
<div style="text-align: justify;">
<b><i> {</i></b></div>
<div style="text-align: justify;">
<b><i> root /media/www/static/;</i></b></div>
<div style="text-align: justify;">
<b><i> expires 1d;</i></b></div>
<div style="text-align: justify;">
<b><i> }</i></b></div>
<br />
<div style="text-align: justify;">
<span style="font-style: italic; font-weight: bold;"><br /></span></div>
<div style="text-align: justify;">
<b><i> location / {</i></b></div>
<br />
<div style="text-align: justify;">
<b><i> #root /media/www/home/;</i></b></div>
<div style="text-align: justify;">
<b><i> #index index.html index.htm;</i></b></div>
<div style="text-align: justify;">
<b><i> try_files $uri @proxy_to_app;</i></b></div>
<div style="text-align: justify;">
<b><i> }</i></b></div>
<br />
<div style="text-align: justify;">
<span style="font-style: italic; font-weight: bold;"><br /></span></div>
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>location @proxy_to_app {</i></b></div>
<br />
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</i></b></div>
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>proxy_set_header Host $http_host;</i></b></div>
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>proxy_redirect off;</i></b></div>
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>proxy_pass http://192.168.0.25:8080;</i></b></div>
<div style="text-align: justify;">
<b><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></b></div>
<div style="text-align: justify;">
<b><i>}</i></b></div>
<br />
<div style="text-align: justify;">
<span style="font-style: italic; font-weight: bold;"><br /></span></div>
<div style="text-align: justify;">
Depois disso é hora de configurar o supervisor para executar nosso processo do gunicorn que irá carregar nossa app em flask!!!</div>
<br />
<div style="text-align: justify;">
O bacana do supervisor é que com o comando <b><i>echo_supervisord_conf > /etc/supervisord.conf</i></b> você gera um arquivo de conf padrão! ;) bem simple não?</div>
<div style="text-align: justify;">
Entretanto apenas isso não garante que o gunicorn seja executado, por conseguinte devemos alterar o arquivo de conf criado acrescentando as seguintes linhas acima da explicação de como subir um programa usando o supervisor. Procure por <i style="font-weight: bold;">[program:theprogramname] </i>no arquivo e acrescente acima ou abaixo:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXS_1EVgW9RlJz65UDHexpruqKyg11kIR4Pm8LQJa2a3dkvdEXgOrfS8l0F2hu8XhxcYa8XgRzUyY80Iq71RRxIWnSi8Kvh8my5ZI9JuSELKYdLvcKufJaJB5OQ0AWx0wVX0KimraJCHM/s1600/gunicorn.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXS_1EVgW9RlJz65UDHexpruqKyg11kIR4Pm8LQJa2a3dkvdEXgOrfS8l0F2hu8XhxcYa8XgRzUyY80Iq71RRxIWnSi8Kvh8my5ZI9JuSELKYdLvcKufJaJB5OQ0AWx0wVX0KimraJCHM/s1600/gunicorn.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><i>[program:gunicorn]</i></b></div>
<div style="text-align: justify;">
<b><i>command=gunicorn app:app -b 192.168.0.25:8080</i></b></div>
<div style="text-align: justify;">
<b><i>directory=/media/www/home</i></b></div>
<div style="text-align: justify;">
<b><i>autostart=true</i></b></div>
<div style="text-align: justify;">
<b><i>autorestart=true</i></b></div>
<div style="text-align: justify;">
<b><i>redirect_stderr=True</i></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Atenção para colocar o mesmo ip:port que especificado la no nginx hein!! Outro detalhe importante é o de colocar o nome do arquivo python que representa o app do flask. No meu caso, eu deixei o mesmo padrão que é descrito nos docs do flask, ou seja arquivo app.py, class name app, por isso do <i style="font-weight: bold;">gunicorn app:app</i>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pronto! Agora só subir todos os serviços e torcer pra tudo estar configurado corretamente!</div>
<div style="text-align: justify;">
<b><i>systemctl enable dnsmasq</i></b></div>
<div style="text-align: justify;">
<b><i>systemctl start dnsmasq</i></b></div>
<div style="text-align: justify;">
<b><i>systemctl enable nginx</i></b></div>
<div style="text-align: justify;">
<b><i>systemctl start nginx</i></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><i>systemctl enable supervisord</i></b></div>
<div style="text-align: justify;">
<b><i>systemctl start supervisord</i></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Bom, acesse a sua url padrão no navegador e você perceberá que não é carrega, não se esqueça de configurar o dns primário e secundário em sua conexão com a internet. Essa parte é importante caso seu roteador (assim como o meu) não permita configurar um dns interno.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Referências:</div>
</div>
<div>
<div style="text-align: justify;">
dnsmasq - <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">http://www.thekelleys.org.uk/dnsmasq/doc.html</a></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-47125268188450624582013-03-15T15:36:00.003-03:002013-03-15T15:37:38.292-03:00OpenBadges by Mozilla<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKI2hSqTY0JStmJuuoI5ZkBPJwxb_lXIndVR3CANYEnkRQlV2Y3k_79U89TguHiu2A7QJyZa52BEwztJt_Mw6rZzbPm-rcnoiBH_0JCnk8x7vBmTYqQPav6suv_KXEnltBKjSRy1EEW8/s1600/openbadges-600px.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKI2hSqTY0JStmJuuoI5ZkBPJwxb_lXIndVR3CANYEnkRQlV2Y3k_79U89TguHiu2A7QJyZa52BEwztJt_Mw6rZzbPm-rcnoiBH_0JCnk8x7vBmTYqQPav6suv_KXEnltBKjSRy1EEW8/s400/openbadges-600px.jpg" width="400" /></a></div>
<div style="text-align: justify;">
Esse post será um tanto quanto curto, o tempo me escapa esse ano, 2013 realmente começou com tudo e nem mesmo quando terei férias terei o tempo necessário para atualizar sempre o blog, mas não o abandonei e nem mesmo esqueci.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Hoje vou falar de uma iniciativa da mozilla, o OpenBadges. Pra quem é ligado a fundação mozilla ja ouviu falar e até mesmo ja ganhou alguns badges. O objetivo é bem interessante, você realiza alguns exercícios e em troca ganha um bagde (adesivo) dizendo que você sabe daquele assunto ou tarefa.</div>
<div style="text-align: justify;">
Parece simples não??? E é... o que é necessário para começar??</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Bom, para começar que tal fazer uma visita a página principal do OpenBadges ( <a href="http://openbadges.org/">http://openbadges.org/</a> ). La tem tudo explicado do funcionamento, mas darei um geral aqui.</div>
<div style="text-align: justify;">
Você precisa criar um backpack (é o local onde estarão armazenados seus badges), para criar um backpack é só acessar o site e criar uma conta ( <a href="http://backpack.openbadges.org/">http://backpack.openbadges.org/</a> ). Pronto!!!</div>
<div style="text-align: justify;">
Agora é só sair por ae coletando badges!!!</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRXlMWTuNI9tSnyVzW3-_0Ibm4SxSl9_9xfQQbv4lHo66Lv6y9U7JCa6VTsRbNQomARirnN5oQwbTT7m8pX0mtZ_v9mR3oyCB-FhcQkfONCAubQAzvLxnR59Z5tbSgJrrq54DNrpUx7U/s1600/mozilla-webmaker_logo-wordmark_RGB.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="118" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKRXlMWTuNI9tSnyVzW3-_0Ibm4SxSl9_9xfQQbv4lHo66Lv6y9U7JCa6VTsRbNQomARirnN5oQwbTT7m8pX0mtZ_v9mR3oyCB-FhcQkfONCAubQAzvLxnR59Z5tbSgJrrq54DNrpUx7U/s320/mozilla-webmaker_logo-wordmark_RGB.png" width="320" /></a></div>
<br />
<div style="text-align: justify;">
A própria mozilla disponibiliza alguns como é o caso dos badges para quem gosta do Mozilla WebMaker ( <a href="https://badges.webmaker.org/">https://badges.webmaker.org/</a> ) ... ;D</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs5rnkYnCJeqB3BuAcsqvxgSj4CLRj8qqyzJ0iTsbx4702YsJ2rsmnGTpN9zyLP27FHUIhODoGDtcw6dxPBICeS79hbElUmfXc-UVxnRONF-7MGtWdHoJoVMdfqnZyHsV11adaBbc9N4Q/s1600/P2PU-logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="60" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs5rnkYnCJeqB3BuAcsqvxgSj4CLRj8qqyzJ0iTsbx4702YsJ2rsmnGTpN9zyLP27FHUIhODoGDtcw6dxPBICeS79hbElUmfXc-UVxnRONF-7MGtWdHoJoVMdfqnZyHsV11adaBbc9N4Q/s200/P2PU-logo.jpg" width="200" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9AelYLnj44RJywEcCX239063nQkErrGzFArZHKoCs-OagF6duiEkVYVOY-1yoZpWSX9_xc9kIwYOgF8eKz8vgK0i1o5-OCSmSyxPTJ1KoEDt_eaw83chN_E_e9qazni66TYiB7C0SJnI/s1600/sow.logo_.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9AelYLnj44RJywEcCX239063nQkErrGzFArZHKoCs-OagF6duiEkVYVOY-1yoZpWSX9_xc9kIwYOgF8eKz8vgK0i1o5-OCSmSyxPTJ1KoEDt_eaw83chN_E_e9qazni66TYiB7C0SJnI/s200/sow.logo_.png" width="200" /></a>É válido citar também o site do P2PU ( <a href="https://p2pu.org/">https://p2pu.org/</a> ), la você poderá conseguir dezenas de badges... </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Olha que legal, além de postar sobre o OpenBadges, um dos desafios que estou fazendo pede para assim que terminar você crie um blog post falando sobre o que foi realizado... e consequentemente aqui estou eu!! hahahahahahahaha</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
O desafio é bem simples: </div>
<div style="text-align: justify;">
<i>"This task is going to introduce you to writing a basic html document. But you'll do it on paper, using a pen, for fifteen minutes."</i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt4rPakR_0LrjxBBPs7EJMnFQkmkillBCtGKOFR4yc5myHSaElzuDkyNPqYAfUJPGDXf3SWrLKmSlvshg-6qicH2V5fLY3qO6P_b7hwMSA7Ur9E7yi85sWLKUGyBk42V2vgdBnMyLDU_Y/s1600/IMG_20130315_150423_805.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt4rPakR_0LrjxBBPs7EJMnFQkmkillBCtGKOFR4yc5myHSaElzuDkyNPqYAfUJPGDXf3SWrLKmSlvshg-6qicH2V5fLY3qO6P_b7hwMSA7Ur9E7yi85sWLKUGyBk42V2vgdBnMyLDU_Y/s640/IMG_20130315_150423_805.jpg" width="640" /></a></div>
<div style="text-align: justify;">
<i><br /></i></div>
<div>
<div style="text-align: justify;">
Ok, esse desafio é bem simples, mas não deixa de ser trabalhoso, afinal você tem que escrever um blog post inteiro sobre sua façanha... e colocar uma foto! :O</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Enfim, bom divertimento a vocês todos...</div>
</div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5160997068094325765.post-70244171466708600042012-12-10T16:56:00.001-02:002013-03-25T15:08:01.222-03:00Raspberry Pi: UI + web server!<h2 style="text-align: center;">
<b><span style="font-size: x-large;">Raspberry Pi: UI + web server!</span></b></h2>
<div>
<b><span style="font-size: x-large;"><br /></span></b></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg25Zwti8QnQ0i7P45erezWVMwp1NTR_rhjbgttxzOQsA947O15tSVB4UPWJV5S9FQStwZ5Cpovf1QUPL1EqLLXVNpEtFiKrQhBXiQKJ6LYtd2lBOY0i1vavPrOpSzkzFFHNXpNaJrrZ8I/s1600/300px-RaspberryPi.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg25Zwti8QnQ0i7P45erezWVMwp1NTR_rhjbgttxzOQsA947O15tSVB4UPWJV5S9FQStwZ5Cpovf1QUPL1EqLLXVNpEtFiKrQhBXiQKJ6LYtd2lBOY0i1vavPrOpSzkzFFHNXpNaJrrZ8I/s1600/300px-RaspberryPi.jpg" /></a>Boas pessoal, desculpem a demora em postar conteúdo, fiquei afastado esse mês todo... não só devido ao trabalho e vida pessoal, mas também a projetos que estive fazendo! :D</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Bom em um destes meus projetos, resolvi que iria gastar um tempo comprando um <a href="http://www.raspberrypi.org/" target="_blank">raspberry pi</a> (é eu sei, ja deveria ter feito isso antes), mas eu estava relutando em comprar um, visto que ja possuo uma Pandaboard ES ( <a href="http://pandaboard.org/" target="_blank">http://pandaboard.org/</a> ).</div>
<div style="text-align: justify;">
Mas enfim, comprei um, e vou colocar a minha primeira experiência com ele... do momento que comprei até onde parei, ou seja, um servidor web em casa.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Após ouvir muita coisa sobre o raspberry pi, desde uma galera usando pra educação até pra produção resolvi testar!</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVeCaCy-2GwdsDvB9W4zj9SbJ4eSciAsZlsTaIlOroM6J1gzmW7my-3YrxM6L4dRQCmmwmAGuMRyMiVwufCQR3okL7BiHpnF-n-QkQYAe_SK-AoK8tPuqu4jmBBK1zzgWUApN_e1Zauhg/s1600/Raspi_Iso_Blue.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVeCaCy-2GwdsDvB9W4zj9SbJ4eSciAsZlsTaIlOroM6J1gzmW7my-3YrxM6L4dRQCmmwmAGuMRyMiVwufCQR3okL7BiHpnF-n-QkQYAe_SK-AoK8tPuqu4jmBBK1zzgWUApN_e1Zauhg/s320/Raspi_Iso_Blue.png" width="320" /></a></div>
<div style="text-align: justify;">
Vi muita gente falando onde comprar, que é difícil, e realmente é, muita gente esta atrás dessa plaquinha, assim como do arduino. Mas pra facilitar minha vida, decidi que não iria comprar apenas a placa, afinal é preciso muito mais do que apenas ela para rodar.</div>
<div style="text-align: justify;">
Entrei no site da Adafruit e comprei o starter kit deles ( <a href="http://www.adafruit.com/products/1014" target="_blank">starter kit</a> ). Realmente o preço não é dos mais baratos, mas nada que um cartão internacional e uma conta do paypal não possam lhe auxiliar no pagamento.</div>
<div style="text-align: justify;">
Comprei e fiquei esperando (detalhe que no momento que escrevo o post 10/12/12 eles não possuem em estoque, mas fique de olho), 2 semanas depois chegou em casa o pacote. Tudo certo, vieram todos os items, em suma o que vem:</div>
<div style="text-align: justify;">
<br /></div>
<div>
<ul>
<li style="text-align: justify;">Raspberry Pi model B (pra ver a diferença entre o modelo A e B - <a href="http://elinux.org/RPi_Hardware">http://elinux.org/RPi_Hardware</a>);</li>
<li style="text-align: justify;">Cartão Micro SD + Adapter de 4GB;</li>
<li style="text-align: justify;">Caixa de acrílico da Adafruit! :)</li>
<li style="text-align: justify;">Raspberry Pi Badge... :) (eu colei o mesmo em cima da caixa de acrílico! ficou show olha a foto!)</li>
<li style="text-align: justify;">E outras coisas + ...</li>
</ul>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJmaR5tuuK_NoclYXiyt64nfv_1WsjACKOMvJnGDDAWhkuQUIxqJqKMv77P9SHkcopwTV5WUm538IvJ0UC2z68BQZtdYEHUez_JgrY-pT2nFi9G01mLxrnZ-jm7TqYt5hGJEEJhcVjkNc/s1600/272491_451888384872904_442672137_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJmaR5tuuK_NoclYXiyt64nfv_1WsjACKOMvJnGDDAWhkuQUIxqJqKMv77P9SHkcopwTV5WUm538IvJ0UC2z68BQZtdYEHUez_JgrY-pT2nFi9G01mLxrnZ-jm7TqYt5hGJEEJhcVjkNc/s320/272491_451888384872904_442672137_o.jpg" width="320" /></a>Legal neh, chegou abri e blz! Agora você se pergunta o que fazer? Bom, eu não tenho um monitor / televisor com entrada HDMI e não estava afim de usar a saída RCA também, então eu adiquiri um conversor hdmi to vga no <a href="http://dx.com/" target="_blank">dealextreme</a>. Ok, eu não esperei o pi chegar pra fazer isso, na verdade ambas mercadorias chegaram praticamente juntas.</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
PS: além de usar no pi, eu tenho uma pandaboard, como falei no começo do post, então esse conversor é pra usar nos dois!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4c5CeG9uEZTQ5GIJH1Ex72VFvmwA7Zl01KkZmz0Mgi8qu1RyaQxpoTfUUZBjiln9WzF0c_iAQt6kaFG9QCznirGq7CNQP6NyFSeT_-_Sy6Yi8yxPUgUKbAYyV3ZGZXmF9fBc8KDSK5ds/s1600/occidentalis.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4c5CeG9uEZTQ5GIJH1Ex72VFvmwA7Zl01KkZmz0Mgi8qu1RyaQxpoTfUUZBjiln9WzF0c_iAQt6kaFG9QCznirGq7CNQP6NyFSeT_-_Sy6Yi8yxPUgUKbAYyV3ZGZXmF9fBc8KDSK5ds/s200/occidentalis.png" width="156" /></a>O próximo passo é ligar tudo... conectei todos os componentes, mas ainda falta uma coisa pra sair rodado o pi... instalar o SO que você deseja usar.</div>
<div style="text-align: justify;">
Como início, fui testar o <a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2" target="_blank">Occidentalis v0.2</a> que é uma distro modificada pela Adafruit da Raspbian “wheezy”.</div>
<div style="text-align: justify;">
Fiz o download e instalei no cartão SD seguindo os passos do tutorial que esta no link acima da distro. Iniciei o pi e bing! Estava la a UI do Occidentalis, bem simples e rápido... mas eu não gostei.</div>
<div style="text-align: justify;">
Comecei a olhar na net as opções e vi que era possível instalar o <a href="http://archlinuxarm.org/" target="_blank">Arch Linux ARM</a>, uma distro derivada da Arch Linux que funciona em processadores ARM e pra minha surpresa a pandaboard também é suportada! FTW \o/</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Para instalar no pi, bem simples! Simples até demais, faça o download da imagem e grave a mesma no SD card, eu usei o image writer que ja vem pré-instalado no Linux Mint para fazer isso e foi de boa... Reiniciei novamente o pi, agora com o cartão sd e a instalação do arch e depois de uns 10 segundos eu tinha um shell linux pronto para usar!!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Agora o primeiro passo é atualizar seu Arch Linux... faça o login usando root : root.</div>
<div style="text-align: justify;">
O shell será será liberado, para atualizar o Arch Linux utiliza-se do pacman, então realize um:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ pacman -Syyu</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Isso fará com que todos os repos sejam atualizados e fará em seguida um update no sistema... aguarde vários minutos! Não se esqueça de estar conectado em uma rede de dados para isso, claro...</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Depois de atualizar o sistema, minha sugestão é alterar a senha do root e criar um novo usuário!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Use o comando abaixo para alterar a senha do root!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ passwd</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
E em seguida faça:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ adduser</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
E siga as instruções... quase tudo pode ser o padrão mesmo... só não esqueça da senha!</div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3BW_VNLyn6OBdM4QamyjdBkqosg1pAfMKmZOnapKvhq6HYjQpm1rqCX-UG38GSzI-BGuEgoHbrk5XdK51EmqUQPzM8Dr6Ex_umXNz7kxzig5trcdJNWYq_ZIDZdwxqiX6EDDLp3rVO7s/s1600/xfce_logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3BW_VNLyn6OBdM4QamyjdBkqosg1pAfMKmZOnapKvhq6HYjQpm1rqCX-UG38GSzI-BGuEgoHbrk5XdK51EmqUQPzM8Dr6Ex_umXNz7kxzig5trcdJNWYq_ZIDZdwxqiX6EDDLp3rVO7s/s200/xfce_logo.png" width="200" /></a></div>
<div style="text-align: justify;">
Feito isso, você, assim como eu pode desejar ter uma UI para interagir mais facilmente (ou instalar por diversão mesmo!).</div>
<div style="text-align: justify;">
Eu segui os tutoriais na wiki do Arch Linux para instalar o <a href="http://wiki.lxde.org/en/LXDM" target="_blank">LXDM</a> + <a href="http://www.xfce.org/" target="_blank">XFCE4</a> e deixar o pi +/- com a cara do meu desktop (não que isso fosse necessário, ja que ele será um servidor, mas mesmo assim...).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Antes de mais nada para executar qualquer UI em linux deve-se instalar o <a href="http://en.wikipedia.org/wiki/X_Window_System" target="_blank">X Windows System</a>. Para isso basta você executar:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ pacman -S xorg-server xorg-apps xorg-xinit xorg-twm xorg-xclock xterm xorg-drivers</b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
Isso vai garantir que o x server todo será instalado, assim como qualquer outros drivers e widgets necessários.</div>
<div style="text-align: justify;">
<br /></div>
<div>
<div style="text-align: justify;">
Depois vamos instalar o lxdm e xfce4:</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ pacman -S lxdm xfce4 xfce4-goodies sudo gedit</b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
No meu caso eu ja instalei o sudo e gedit também, apesar do gedit ser um pouco pesado para carregar... ainda não testei pra ver se o emacs funciona de boa.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pronto!!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Para executar o lxdm e xfce4 ao iniciar o pi, ainda precisamos alterar o arquivo <b>/etc/lxdm/lxdm.conf</b> e mudar a linha <span style="background-color: #ebf1f5; color: #222222; line-height: 1.1em;"><i>session=/usr/bin/startlxde</i> para </span><span style="color: #222222;"><span style="line-height: 17px;"><i>session=/usr/bin/startxfce4</i> .</span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">Para editar o arquivo: </span></span></div>
<div style="text-align: justify;">
<b><span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></b></div>
<div style="text-align: justify;">
<b><span style="color: #222222;"><span style="line-height: 17px;">$ sudo nano </span></span>/etc/lxdm/lxdm.conf</b></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">E em seguida executar o systemd para ativar o serviço do lxdm:</span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><b>$ systemctl enable lxdm.service</b></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><b><br /></b></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">Reinicie o pi, agora você deve ter uma interface gráfica aparecendo, faça o login com o usuário que você criou e pronto!</span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">Eu enfrentei um problema bem chato, meu monitor não esta suportando 100% o hdmi do pi, para isso bastar alterar a propriedade disable_overscan do arquivo de configuração do Arch Linux.</span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">Execute:</span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><b>$ sudo nano /boot/config.txt</b></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: #222222;"><span style="line-height: 17px;">Desabilite a linha (tire o <i>#</i> da frente), </span></span><span style="color: #222222; line-height: 17px;"><i>disable_overscan=1 </i>. Além disso altere as propriedades do overscan logo abaixo, é tentativa e erro mesmo, coloque um valor e reinicie o pi pra ver se deu certo.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;"><br /></span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;">Seu startup inicial esta pronto... entretanto...</span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;"><br /></span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;">Quando comprei meu raspberry pi que vem no starter kit da Adafruit, notei que ele não possui conexão wireless (uma pena não??), mas isso pode ser remediado comprar um wireless module, olhei no site e achei esse: <a href="http://www.adafruit.com/products/814" target="_blank">Miniature WiFi (802.11b/g/n) Module: For Raspberry Pi and more</a>, comprei junto.</span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;"><br /></span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;">Mas para você ter uma interface bacana para interagir com o modulo é preciso instalar umas coisas a mais:</span></div>
<div style="text-align: justify;">
<span style="color: #222222; line-height: 17px;"><br /></span></div>
<div style="text-align: justify;">
<b><span style="color: #222222; line-height: 17px;">$ </span><span style="color: #222222;"><span style="line-height: 17px;">pacman -S networkmanager network-manager-applet xfce4-notifyd</span></span></b><span style="color: #222222; line-height: 17px;"> </span></div>
<div style="text-align: justify;">
<b>$ systemctl enable NetworkManager.service</b></div>
<div style="text-align: justify;">
<b>$ systemctl start NetworkManager.service</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Isso vai instalar e inicializar uns widgets bacanas para você controlar seu usb wireless e conetar na sua rede wifi sem precisar digitar comandos no shell!! :D</div>
<div style="text-align: justify;">
Por padrão o driver desse dispositivos usb que comprei vem por default ativado, bastando apenas a reinicialização do pi pra tudo funcionar.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pra finalizar vamos instalar o <a href="http://wiki.nginx.org/Main" target="_blank">nginx</a>, que é um web server muito bom e rápido.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>$ pacman -S nginx</b></div>
<div style="text-align: justify;">
<b>$ <span style="background-color: #ebf1f5; color: #222222; line-height: 1.1em;">systemctl enable nginx</span></b></div>
<div style="text-align: justify;">
<b><span style="background-color: #ebf1f5; color: #222222; line-height: 1.1em;">$ </span><span style="background-color: #ebf1f5; color: #222222; line-height: 1.1em;">systemctl start nginx</span></b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDjuswMV4ezIxUp91f1t_AAosXfo366kt7YOCUHmxuxMM7U6V-b2_Re5f1j2A-ns8m_O9pMGoDTKqQ4dOPxj06hPyqg6fgvlSMee1IAlajJUTbhHuresbiKq52wOtLnS1WDGZ0AyoGDN4/s1600/python+(1).png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDjuswMV4ezIxUp91f1t_AAosXfo366kt7YOCUHmxuxMM7U6V-b2_Re5f1j2A-ns8m_O9pMGoDTKqQ4dOPxj06hPyqg6fgvlSMee1IAlajJUTbhHuresbiKq52wOtLnS1WDGZ0AyoGDN4/s200/python+(1).png" width="200" /></a>Se você quiser um web browser para rodar no seu pi, instale o midori, pois o firefox e chrome não são suportados na arquitetura x86 (bom pelo menos eles não estão listados no repo do arch linux como disponíveis para arm).</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div style="text-align: justify;">
<b>$ pacman -S midori</b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
E é isso ae, por enquanto é isso... no próximo post vou mostrar como instalar o <a href="http://www.python.org/" target="_blank">python</a> e <a href="http://projects.unbit.it/uwsgi/" target="_blank">uWSGI</a> para fazer seu web site rodar no pi!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
falowaer</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBLv9pHckQ8rfB4PCZEhyN221ea5tbT_hUZEyqaDaORQS_OCCsl6YZlB7QDPOOAsrMg2GECsfA4oPBlDHJLCLiiHv14QT7Kxq6rf2RNwutiomDpKFxaBTgYhgnQ35Q1xPr9UDdFQgDY0/s1600/703725_451888348206241_996725550_o.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBLv9pHckQ8rfB4PCZEhyN221ea5tbT_hUZEyqaDaORQS_OCCsl6YZlB7QDPOOAsrMg2GECsfA4oPBlDHJLCLiiHv14QT7Kxq6rf2RNwutiomDpKFxaBTgYhgnQ35Q1xPr9UDdFQgDY0/s400/703725_451888348206241_996725550_o.jpg" width="266" /></a></div>
<div>
<ul>
<li><a href="http://www.adafruit.com/">http://www.adafruit.com/</a></li>
<li><a href="http://www.raspberrypi.org/">http://www.raspberrypi.org/</a></li>
<li><a href="http://dx.com/">http://dx.com/</a></li>
<li><a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2">http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2</a></li>
<li><a href="http://archlinuxarm.org/platforms/armv6/raspberry-pi">http://archlinuxarm.org/platforms/armv6/raspberry-pi</a></li>
<li><a href="https://wiki.archlinux.org/index.php/Xorg">https://wiki.archlinux.org/index.php/Xorg</a></li>
<li><a href="https://wiki.archlinux.org/index.php/LXDM">https://wiki.archlinux.org/index.php/LXDM</a></li>
<li><a href="https://wiki.archlinux.org/index.php/Xfce">https://wiki.archlinux.org/index.php/Xfce</a></li>
<li><a href="https://wiki.archlinux.org/index.php/Nginx">https://wiki.archlinux.org/index.php/Nginx</a></li>
</ul>
</div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-83902525520746877722012-10-21T11:26:00.000-02:002012-10-21T11:26:02.002-02:00Procurando objetivos no Trabalho<span id="internal-source-marker_0.2492270227521658"></span><br />
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span id="internal-source-marker_0.2492270227521658"><span style="font-family: Arial; font-size: 32px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">Procurando objetivos no Trabalho</span></span></div>
<span id="internal-source-marker_0.2492270227521658">
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Nos últimos meses tenho me deparado com uma dúvida, qual o objetivo do meu traabalho? Sim, afinal, porque trabalho na área de TI? E porque sou programador?</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Pode parecer uma pergunta muito simples para alguns, ou muito difícil de responder para outros, mas a questão fica, você sabe o motivo do seu trabalho?</span></div>
<br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Durante minha defesa de TCC da pós-graduação, eu li muitos livros sobre motivação e times de alto desempenho, mas uma coisa que me chamou muita atenção nessas obras foi a falta de direcionamento em como encontrar os objetivos dos integrantes (ou pessoas) dos times. Talvez seja polêmico demais o assunto, foi como discuti com um amigo do trabalho: “Como saber os objetivos das pessoas, se muitas vezes nem elas mesmas sabem o que desejam?” Ou ainda pior, devemos ajuda-las a encontrar seus objetivos... Parece simples, mas como ajudar alguém encontrar um objetivo para trabalhar?</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span style="vertical-align: baseline;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtYygNMzDD8cKjqhJdN0nyKgOkVV_FCIz-H8fvRpiCNJwZaLjRLbeIeKKp-gK0iz6DEfnrqPam5FnTvluYs_K9mEPFUSVZraIWHCjjd6LJJkUo_UMP_oYUXO44wTipXWUEn8-duWROag8/s1600/questions_to_answers2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtYygNMzDD8cKjqhJdN0nyKgOkVV_FCIz-H8fvRpiCNJwZaLjRLbeIeKKp-gK0iz6DEfnrqPam5FnTvluYs_K9mEPFUSVZraIWHCjjd6LJJkUo_UMP_oYUXO44wTipXWUEn8-duWROag8/s320/questions_to_answers2.jpg" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Tenho pensando muito e por conseguinte tentarei criar uma luz no fim do túnel para isso. Acredito que o primeiro ponto a se questionar é se a pessoa gosta do seu trabalho, você como líder tem a obrigação de verificar se o integrante do seu time gosta daquilo que faz ou apenas quer ganhar o pagamento no fim do mês. Acredito que chegar para a pessoa e perguntar é algo totalmente inútil, nem todos irão categoricamente afirmar para o chefe que não gostam, ou mesmo odeiam o trabalho que fazem, mas como podemos tirar isso das pessoas? Mas porque devemos descobrir se as pessoas gostam de seu trabalho? Esse ponto é importante caso a empresa espera que seus funcionários melhorem os métodos e processos utilizados ou mesmo criem novas situações de ganhos para a organização. Gostar do que se faz abre um leque de possibilidades e buscas para melhoria. Isso não significa que quem não gosta do trabalho, não perseguirá isto com afinco, entretanto o indivíduo que possui prazer no que esta fazendo tenderá a se esforçar mais para essa melhoria.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Para descobrirmos quais são nossos objetivos, acredito que primeiro devemos ter uma noção de quem somos e quais nossas características, para isso existem dezenas (e talvez centenas) de técnicas para se descobrir isso. Por existirem tantas técnicas muitas acabarão por darem resultados parecidos, algumas que utilizei em mim mesmo (gratuitas ou não) são demonstradas abaixo:</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>Descobrindo seus Pontos Fortes (Strength Finder).</b></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Tem um livro que achei bem interessante (o qual um amigo me apresentou) chamado </span><a href="http://www.amazon.com/gp/product/B001CDZZI6/ref=kinw_myk_ro_title"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">StrenghtFinder 2.0</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">. Este livro vai lhe ajudar a descobrir quais são os pontos fortes das pessoas que o cercam e seus próprios. A partir daí podemos começar a analisar se o que fazemos é realmente direcionado a nossos pontos fortes ou “apenas estamos dando soco em ponta de prego”.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Isso não significa que descobrindo quais são os pontos fortes eles irão nos direcionar a nossos objetivos, muito pelo contrário, isso vai apenas nos dizer se o que fazemos no trabalho é algo que nossa personalidade pode absorver como simples e prazeroso. É lógico afirmar que ao realizarmos tais tarefas estamos seguros, temos a facilidade de assimilar o assunto e executar a ação necessária para a resolução do problema.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ16pGb-CzwP4Oa1IWRyyQP8VWCyIhoRfEmpSVoYlwXLZ1ryXd9ZDcMfh2QiZXh0v3za89H2MX6dBIR7cmlEwnGXddOot09ZGlo7mq3lz5ftky8Gw-YTyPOt6htT-ANW7aFw_lepyaO3w/s1600/strengths-finder.jpeg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ16pGb-CzwP4Oa1IWRyyQP8VWCyIhoRfEmpSVoYlwXLZ1ryXd9ZDcMfh2QiZXh0v3za89H2MX6dBIR7cmlEwnGXddOot09ZGlo7mq3lz5ftky8Gw-YTyPOt6htT-ANW7aFw_lepyaO3w/s200/strengths-finder.jpeg" width="200" /></a></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">O livro não coloca quais tarefas são mais simples para cada perfil, entretanto ele apresenta um panorama geral em como cada ponto define algumas das atividades que procuramos exercer. Somos puxados a atividades onde nossos pontos fortes brilham.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Isso pode nortear sua decisão sobre o que perseguir em sua vida e como direcionar estudos e esforços.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Conforme eu disse, realizei o teste, e realmente os pontos fortes colocados pelo programa são muito (se não 100%) correlacionados com minha personalidade. Para se ter uma idéia, eu sou um cara competitivo, isso pode ser um ponto forte, como fraco, tudo dependerá de como utilizo essa informação na execução das minhas tarefas e no dia dia. Um detalhamento maior sobre meus pontos fortes e como eles são apresentados a você pode ser conferido </span><a href="http://rdenadai.herokuapp.com/perfil/#strengthsfinder"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">aqui</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="background-color: #f8f8f8; color: #333333; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>Keirsey Temperament Sorter - II (Personality Instrument).</b></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Outro teste interessante e viável de se realizar é o </span><a href="http://www.keirsey.com/sorter/register.aspx"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Keirsey Temperament Sorter</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">. Aqui a idéia é receber uma visão geral de como você age e do seu possível temperamento diretamente relacionado ao seu trabalho e sua vida.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6-8ngnZcQwLPrr8nJNCdSpURUvBbn_3xVhJgqr9anBTIZtYcODqPR08UQLfJ7TvFasFrBQqZJr2rf_f-BCzovFtD11Z5aGuMd-HNwkF25SCdbOcYX9jh2GicAvf5F0ymyu3TLg7y3Gzc/s1600/kts2s_seal_120x140.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6-8ngnZcQwLPrr8nJNCdSpURUvBbn_3xVhJgqr9anBTIZtYcODqPR08UQLfJ7TvFasFrBQqZJr2rf_f-BCzovFtD11Z5aGuMd-HNwkF25SCdbOcYX9jh2GicAvf5F0ymyu3TLg7y3Gzc/s1600/kts2s_seal_120x140.jpg" /></a></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>“</span><span style="font-family: Arial; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">According to Keirsey Temperament Theory, there are four basic temperament groups which describe human behavior. Keirsey’s four temperaments are referred to as Artisans™, Guardians™, Rationals™ and Idealists™. These four temperaments can be further subdivided, often referred to as “Character Types”. There are four types of Artisans, four types of Guardians, four types of Rationals, and four types of Idealists.</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">”</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Todos estes testes dão a você uma visão de si mesmo e como observar aspectos de nossa vida que muitas vezes não nos damos conta pela falta de percepção que temos de nós mesmos.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">A possibilidade de ambos os teste revelarem aspectos intrínsecos da sua psique e que são parecidos é muito grande. Realmente em meu caso ambos os testes deram resultados parecidos, na verdade um é complementar ao outro, mas se você olhar em detalhes, mostra um perfil da minha pessoal.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>Eu completo meus objetivos?</b></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Ambos os testes podem nos mostrar nosso perfil mas não mostrará quais objetivos podemos possuir ou obter, mas eles nos darão um guia para descobrir objetivos que poderiam estar ocultos.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Apesar de tudo, existe algo muito importante nestes objetivos ou em como alcança-los. Uma pesquisadora americana (Angela Lee Duckworth) “descobriu uma característica” que pode nos dizer se possuímos ou não a atitude mental suficiente para finalizar objetivos a longo prazo. Isso poderá influenciar diretamente o cumprimento ou não daqueles objetivos que traçarmos ou dicidirmos como corretos para nossa vida e trabalho.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Bem, ela nomeou esta nova característica como GRIT (Perseverança e paixão por objetivos a longo prazo), e seu significado transcrevo abaixo:</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>“</span><span style="font-family: Arial; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">Definimos grit como perseverança e paixão por objetivos a longo prazo. Grit implica em trabalhar arduamente em desafios, manutenção do esforço e interesse ao longo dos anos, apesar do fracasso, adversidade e plateaus de progresso. O indivíduo com essa característica aborda as realizações como uma maratona; A vantagem dele ou dela é a stamina. Considerando que a desilusão ou tédio são sinais para outros que é hora de mudar a trajetória e cortar as perdas, o indivíduo com grit permanece no curso.</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">”</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Descobrindo se nossa característica GRIT é alta ou não pode nos indicar o motivo da não conclusão de determinados projetos e objetivos. Mas isso não indica que possuímos uma desculpa, mas sim um ponto de atenção todas as vezes que não terminamos um objetivo, e isso pode nos forçar a não desistir. Afinal devemos utilizar nossos pontos fortes, aceitar nossas fraquezas (mas lutar contra elas mesmo assim).</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>No site da própria pesquisadora existe um </span><a href="https://sasupenn.qualtrics.com/SE/?SID=SV_06f6QSOS2pZW9qR"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">teste online</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> para que você possa verificar se seu nível de GRIT é alto ou não (é uma escala de 1 - 5). Eu recebi um valor de 2.88 no teste de grit, e se observarmos em meu perfil, verifico que possuo um ponto forte chamado Ideation, que tem como característica “... Driven by your talents, you may dream up new tasks to do ...”. Ou seja, todos meus objetivos mesmo os a longo prazo, devem ter tarefas curtas que não demandem muito tempo, pois caso contrário poderei abandonar a tarefa ou objetivo para buscar outras mais interessantes.</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>E agora?</b></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Toda essa análise de um perfil é importante para nós conseguirmos idealizar possíveis objetivos a serem seguidos. Devemos lembrar ainda, que essa tarefa apesar de poder contar com a ajuda externa (no caso, testes, documentários, biografias e muito mais) é um trabalho totalmente interno e intensivo, que cada indivíduo deve realizar. A organização pode facilitar essa descoberta dando oportunidades de crescimento e inovação para cada um de seus colaboradores. </span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span style="vertical-align: baseline;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbmiYAc177j2U6cROYuJsW8K_uBm5FBKBj9LXgTHkv3bMNE4cRSmdAjYw-y8OOWCUjg2sGTiXexKWdSFWAJBQcWmF-4Bfncg26FHVDLAberD72O2Sfhp1SEdCSqfSIlc747Jg5-RV2xM/s1600/main-the-curious-case-of-creativity.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbmiYAc177j2U6cROYuJsW8K_uBm5FBKBj9LXgTHkv3bMNE4cRSmdAjYw-y8OOWCUjg2sGTiXexKWdSFWAJBQcWmF-4Bfncg26FHVDLAberD72O2Sfhp1SEdCSqfSIlc747Jg5-RV2xM/s400/main-the-curious-case-of-creativity.jpg" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="color: #191919; font-family: Georgia; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">“We have a strong sense of why we exist and why we do what we do. We believe that our legacy – as a company and as individuals – should be to make a difference in the world around us.”</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> - </span><a href="http://goo.gl/qTHjt"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Think with Google</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 36pt;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Uma filosofia na qual se basear é um fato importante para se criar objetivos, assim como o google tem sua </span><a href="http://www.google.com.br/about/company/philosophy/"><span style="color: #1155cc; font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">filosofia</span></a><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> (conforme ja falado em outro post), minha sugestão é que você tente criar a sua filosofia (mesmo que para isso você utilize pedaços das filosofias de outras pessoas ou organizações).</span></div>
<span style="vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRkjOovMfSeqTBVUay78-Q-CCIkhrbSNhEwzWl9a05mXrMN9Ef2d7EpKSlDrE7ZVsKHZFuxGt7enGkBIVt0201rli2OPcqu57AAOAW9Nz9VULqYlofwYGKfOCNfZjqWTJtZecWZa5sWs/s1600/objective.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRkjOovMfSeqTBVUay78-Q-CCIkhrbSNhEwzWl9a05mXrMN9Ef2d7EpKSlDrE7ZVsKHZFuxGt7enGkBIVt0201rli2OPcqu57AAOAW9Nz9VULqYlofwYGKfOCNfZjqWTJtZecWZa5sWs/s1600/objective.gif" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><div style="text-align: justify;">
falowaer</div>
</span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-2553513590852798372012-09-17T10:58:00.001-03:002012-09-17T10:59:16.045-03:00Melhorando a performance de sistemas web.<span id="internal-source-marker_0.2568958639167249"></span><br />
<h2 style="text-align: center;">
<span style="vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: Arial; font-size: x-large;"><b>Melhorando a performance de sistemas web.</b></span></span></h2>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
</div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<b id="internal-source-marker_0.2568958639167249"><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Com a grande migração de muitos sistemas para a internet após o ano 2000, muitas técnicas foram propostas para a melhoria no processo de carregamento de sistemas web. Essas melhorias visam, claro, uma melhor performance de acesso para os usuários dos sistemas.</span></b></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieBAGVq0yWpdErz_NM95k_rgyANsWKXY6yw-6bATeyDwo4cABFGXRYC-ViINkLlB6Bajav0mOz8bURZ-5y_izNeWt8s7G9Ad9e6S-gTz3chgBm5Y0L8bGXvRHt8UGc-3XI-Q1khPEP5vw/s1600/2x-speed-up-your-apache-website-with-mod_pagespeed-300x300.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieBAGVq0yWpdErz_NM95k_rgyANsWKXY6yw-6bATeyDwo4cABFGXRYC-ViINkLlB6Bajav0mOz8bURZ-5y_izNeWt8s7G9Ad9e6S-gTz3chgBm5Y0L8bGXvRHt8UGc-3XI-Q1khPEP5vw/s200/2x-speed-up-your-apache-website-with-mod_pagespeed-300x300.jpg" width="200" /></a><b id="internal-source-marker_0.2568958639167249"><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Nesse post irei tratar de algumas técnicas que são principais, de fácil identificação e que podem ser implantadas rapidamente. Um detalhe importante é que todas as informações colocadas aqui são as mais simples possíveis, por conseguinte se forem implantadas em ambientes de produção pode vir a ser necessário algum tipo de análise de segurança (não que todas irão precisar claro!). </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">Por onde começar?</span></b></div>
<div style="text-align: -webkit-auto;">
<b id="internal-source-marker_0.2568958639167249"><span style="vertical-align: baseline;"></span></b></div>
<div>
<b id="internal-source-marker_0.2568958639167249"><br /></b></div>
<span id="internal-source-marker_0.2568958639167249" style="text-align: -webkit-auto;"><span style="font-weight: bold; vertical-align: baseline;"></span></span><br />
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span id="internal-source-marker_0.2568958639167249" style="text-align: -webkit-auto;"><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Um start interessante é instalar estas duas ferramentas, as quais irão proporcionar uma visão de como nossa página é carregada e sugerir melhorias a serem feitas:</span></span></div>
<span id="internal-source-marker_0.2568958639167249" style="text-align: -webkit-auto;">
<span style="font-weight: bold; vertical-align: baseline;"></span></span>
<div style="text-align: justify;">
<span id="internal-source-marker_0.2568958639167249" style="text-align: -webkit-auto;"><span style="font-weight: bold; vertical-align: baseline;"><br /></span></span></div>
<span id="internal-source-marker_0.2568958639167249" style="text-align: -webkit-auto;"><span style="font-weight: bold; vertical-align: baseline;">
</span><ul style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">PageSpeed</span><span style="vertical-align: baseline; white-space: pre-wrap;"> - </span><a href="https://developers.google.com/speed/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">https://developers.google.com/speed/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">YSlow</span><span style="vertical-align: baseline; white-space: pre-wrap;"> - </span><a href="http://developer.yahoo.com/yslow/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://developer.yahoo.com/yslow/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
</ul>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Após isso, comece realmente a melhorar sua performance!</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">Minify your files!!!</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">A primeira técnica e que considero a mais simples de todas, é minificar e agrupar seus arquivos estáticos. Mas o que são arquivos estáticos? Eles são como páginas estáticas (</span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">Static Web Pages</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[1]), ou seja seu conteúdo não muda de acordo com o acesso. Os exemplos mais comuns são arquivos javascript, css e imagens!</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Normalmente esses arquivos não são tratados para contemplar esse tipo de situação, e isso pode vir a se tornar um problema de </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">payload</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[2] conforme vamos adicionando mais e mais bibliotecas, classes e imagens sem otimiza-los.</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Algumas soluções para esse problema se resumem em minimizar manualmente os arquivos usando ferramentas como (estes são os top 4 na minha busca do Google) e posteriormente agrupando todos em 1 (um) só arquivo: </span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Javascript</span></div>
<div style="font-weight: bold; text-align: justify;">
<br /></div>
<ul style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://developer.yahoo.com/yui/compressor/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://developer.yahoo.com/yui/compressor/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://jscompress.com/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://jscompress.com/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://refresh-sf.com/yui/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://refresh-sf.com/yui/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://www.minifyjavascript.com/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://www.minifyjavascript.com/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
</ul>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">CSS:</span></div>
<div style="font-weight: bold; text-align: justify;">
<br /></div>
<ul style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://www.cssminifier.com/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://www.cssminifier.com/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://www.minifycss.com/css-compressor/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">http://www.minifycss.com/css-compressor/</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
</ul>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Dentre os outros milhões de ferramentas online, eles podem nos ajudar a melhorar a performance de nossa aplicação no que concerne no carregamento da bibliotecas e códigos que utilizamos, mas não são nem um pouco produtivos, pois devemos fazer manualmente essa cópia e compressão e ainda precisamos manter 2 (dois) arquivos (o original e o minificado).</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPlBiS68qCe7YF5tZCoHCvaMLFW7nsBL2ej8e3ZRq06NXvZb2hQshVMN1lh4w9AEDyG3mGy63_unqkTsm4kvdnjUhl05l3_K86n98JyseT8mTOXU23r41Wz8MWKngXwyult2Z4Gwkw2E0/s1600/minify.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPlBiS68qCe7YF5tZCoHCvaMLFW7nsBL2ej8e3ZRq06NXvZb2hQshVMN1lh4w9AEDyG3mGy63_unqkTsm4kvdnjUhl05l3_K86n98JyseT8mTOXU23r41Wz8MWKngXwyult2Z4Gwkw2E0/s320/minify.jpg" width="320" /></a><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Como melhorar isso? E sermos mais produtivos?</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Podemos utilizar ferramentas automáticas que façam isso, alternativas é o que não faltam também. Particularmente conheço muito poucas ferramentas desse tipo em </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">PHP</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">, mas uma me chamou ultimamente:</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="color: #333333; font-family: Consolas; vertical-align: baseline; white-space: pre-wrap;">MINIFY</span><span style="color: #333333; font-family: Consolas; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"> - </span><a href="https://github.com/mrclay/minify"><span style="color: #1155cc; font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">https://github.com/mrclay/minify</span></a><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">A idéia aqui é a mesma, otimizar e automatizar a minificação dos arquivos estáticos, lembrando que ele não serve para imagens, mas sim para javascript e css.</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Em outras linguagens temos alternativas ja incorporadas nos frameworks (que não é necessariamente o caso do </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">Zend Framework</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[3], mas o minify pode ser usado em conjunto[4]), por exemplo em </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">Django</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[5] temos um app chamado </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">django-compressor</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[6] que faz a minificação e agrupamento dos arquivos automaticamente, sendo necessário apenas ativar o package.</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Para imagens, podemos utilizar de alguns programas para compressão, alguns exemplos bem interessantes, sugeridos pelo Google são [7]:</span></div>
<div style="font-weight: bold; text-align: justify;">
<br /></div>
<ul style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="vertical-align: baseline; white-space: pre-wrap;">Imagens </span><span style="font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">JPEG</span><span style="vertical-align: baseline; white-space: pre-wrap;">:</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: circle; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://jpegclub.org/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">jpegtran</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: circle; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://freecode.com/projects/jpegoptim"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">jpegoptim</span><span style="color: black; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></a></div>
</li>
</ul>
<li style="font-family: Arial; font-weight: normal; list-style-type: disc; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="vertical-align: baseline; white-space: pre-wrap;">Imagens </span><span style="font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">PNG</span><span style="vertical-align: baseline; white-space: pre-wrap;">:</span></div>
</li>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li style="font-family: Arial; font-weight: normal; list-style-type: circle; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://optipng.sourceforge.net/"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">OptiPNG</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
<li style="font-family: Arial; font-weight: normal; list-style-type: circle; vertical-align: baseline;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="http://www.advsys.net/ken/util/pngout.htm"><span style="color: #1155cc; vertical-align: baseline; white-space: pre-wrap;">PNGOUT</span></a><span style="vertical-align: baseline; white-space: pre-wrap;"></span></div>
</li>
</ul>
</ul>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">GZIP[8] on the fly!</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Outra técnica bastante utilizada em sistema/sites da web é de comprimir seus arquivos, aqui vale a máxima de que 10% de redução pode diminuir em muito o payload de seu usuário!</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCIWhP2rK7S_-fFgkwNkUEBOuB8c9f-O1O2eMUDChbUuMPw5jJrnQFmB_ou9MGzPjpx2DzjZZFU9oDqT8dN0kHY5sOStuPTegQA0TQGkV6urkYnH-kftTbsZ_K0TQ5XK_xT_rNO4Qm5vc/s1600/gzip_img.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCIWhP2rK7S_-fFgkwNkUEBOuB8c9f-O1O2eMUDChbUuMPw5jJrnQFmB_ou9MGzPjpx2DzjZZFU9oDqT8dN0kHY5sOStuPTegQA0TQGkV6urkYnH-kftTbsZ_K0TQ5XK_xT_rNO4Qm5vc/s200/gzip_img.png" width="200" /></a><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Vou dar um exemplo bem simples e surpreendente, eu utilizo a biblioteca </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">ExtJs</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[9] que tem um arquivo .js de 1Mb! Isso mesmo, e é 1Mb ja minificado! Usando gzip diminuímos esse payload para 400Kb, ainda é muito? Pode ser, mais é um ganho de 50%. Ou seja 50% menos de carga que um usuário terá de carregar em cada acesso ao sistema.</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Devo dizer que o gzip não serve apenas para arquivos estáticos, podemos comprimir todos os arquivos e nossas respostas </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">AJAX</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[10] também, ou seja, todo nosso site será mais leve para o usuário carregar. O lado ruim? nosso servidor deve aguentar a carga para comprimir todos os dados antes de enviar de volta para nosso usuário.</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Para habilitar o gzip em nosso servidor apache devemos apenas habilitar o módulo mod_deflate! Simples não? Claro que tem-se muitas configurações, mas de modo simplista devemos apenas executar em shell:</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">$ a2enmod deflate</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Fazendo isso estamos prontos, todo o conteúdo do nosso site será compresso para cada requisição realizada. Outros servidores podem possuir outras configurações.</span></div>
<div dir="ltr" style="font-weight: bold; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;">
<span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Em Django podemos habilitar a compressão via gzip sem precisar interagir com o servidor, para isso basta habilitarmos o middleware </span><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap;">GZipMiddleware</span><span style="font-family: Arial; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">[11], fazendo com que nosso sistema use script’s em python para a compressão!</span></div>
<span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br />
<br /></div>
</span><span style="vertical-align: baseline;"><div style="text-align: justify;">
<br />
<br />
<div style="font-family: Arial;">
<span style="white-space: pre-wrap;"><b>Finalizando por aqui...
</b></span></div>
<span style="white-space: pre-wrap;"><b>
</b></span><span style="white-space: pre-wrap;">Seus usuários agradecem, mesmo não sabendo disso... :D!</span><br />
<br />
<div style="font-family: Arial;">
<span style="white-space: pre-wrap;">Estas são duas regras muito simples que podemos habilitar em nossos sistemas, fazendo com que a performance de carregamento seja melhorada.</span></div>
<div style="font-family: Arial;">
<span style="white-space: pre-wrap;">No próximo post vou tratar sobre o varnish cache e cache headers no apache!</span></div>
<br /></div>
</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">
</span><span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimYy2hzAnkEgF_uj3xSsp9S45ReKvlbo3ODBDVJ5IAXwM3TDPGCwyv6QANLdFVULF8rDfoV3C0U7KUT-fRlNXS6XhJBHWBqtaUVTQIRRi1E-TV3UQ940NYdWa0bxDJmZiDAn86i1VijL0/s1600/dilbert-collaboration.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimYy2hzAnkEgF_uj3xSsp9S45ReKvlbo3ODBDVJ5IAXwM3TDPGCwyv6QANLdFVULF8rDfoV3C0U7KUT-fRlNXS6XhJBHWBqtaUVTQIRRi1E-TV3UQ940NYdWa0bxDJmZiDAn86i1VijL0/s640/dilbert-collaboration.jpg" width="640" /></a></div>
<br /></div>
</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><div style="text-align: justify;">
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b><span style="font-weight: normal; vertical-align: baseline;"><br /></span></b>
<b id="internal-source-marker_0.2568958639167249"><span style="font-weight: normal; vertical-align: baseline;">falowaer</span></b></div>
</span><span style="font-weight: bold; vertical-align: baseline;"><div style="text-align: justify;">
<br /></div>
</span><span style="vertical-align: baseline;"><div style="text-align: justify;">
<div style="font-weight: bold;">
Referências:</div>
<div style="font-weight: bold;">
</div>
<u>[1] - <a href="http://en.wikipedia.org/wiki/Static_web_page">http://en.wikipedia.org/wiki/Static_web_page</a></u><br />
<u>[2] - <a href="http://pt.wikipedia.org/wiki/Payload">http://pt.wikipedia.org/wiki/Payload</a></u><br />
<u>[3] - <a href="http://framework.zend.com/">http://framework.zend.com/</a></u><br />
<u>[4] - <a href="http://www.marciopaiva.com/2011/11/05/solucao-para-minify-de-js-e-css-utilizando-zend-framework/">http://www.marciopaiva.com/2011/11/05/solucao-para-minify-de-js-e-css-utilizando-zend-framework/</a></u><br />
<u>[5] - <a href="https://www.djangoproject.com/">https://www.djangoproject.com/</a></u><br />
<u>[6] - <a href="http://django_compressor.readthedocs.org/en/latest/index.html">http://django_compressor.readthedocs.org/en/latest/index.html</a></u><br />
<u>[7] - <a href="https://developers.google.com/speed/docs/best-practices/payload#CompressImages">https://developers.google.com/speed/docs/best-practices/payload#CompressImages</a></u><br />
<u>[8] - <a href="http://en.wikipedia.org/wiki/Gzip">http://en.wikipedia.org/wiki/Gzip</a></u><br />
<u>[9] - <a href="http://docs.sencha.com/ext-js/4-1/">http://docs.sencha.com/ext-js/4-1/</a></u><br />
<u>[10] - <a href="http://pt.wikipedia.org/wiki/AJAX_(programa%C3%A7%C3%A3o)">http://pt.wikipedia.org/wiki/AJAX_(programa%C3%A7%C3%A3o)</a></u><br />
<u>[11] - <a href="https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip">https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip</a></u></div>
</span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-29900312511076252202012-08-09T15:05:00.004-03:002012-08-09T15:19:53.249-03:00Fazendo um app no Heroku<div style="text-align: center;">
<span style="font-family: Verdana, sans-serif; font-size: x-large;"><b>Fazendo um app no Heroku</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8JNjd3KWrjPU8eTMduskJIZETeuxTuo7uVGnzb_iu2sAw9tvc0ujVLccz3hM3EuplYbYIfTKU262svQhbzJDZxLVORNx8PdBIlURF8uEshA8NGTAQm9eZAUXTJVDciaVFxLHrFaD7SGM/s1600/hospedagem-de-sites-paginas.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8JNjd3KWrjPU8eTMduskJIZETeuxTuo7uVGnzb_iu2sAw9tvc0ujVLccz3hM3EuplYbYIfTKU262svQhbzJDZxLVORNx8PdBIlURF8uEshA8NGTAQm9eZAUXTJVDciaVFxLHrFaD7SGM/s200/hospedagem-de-sites-paginas.jpg" width="200" /></span></a><br />
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Fala pessoal?</span></div>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Fiquei de colocar aqui no blog os passos os quais utilizei para fazer um currículo digital, pois bem... chegou a hora!</span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Como eu havia mencionado em uma postagem passada eu utilizei de algumas tecnologias, citarei todas com respectivos links:</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://www.python.org/" target="_blank">python</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Usei python por gosto e simplicidade, o heroku aceita outras linguagens, dê uma olhada! <a href="https://devcenter.heroku.com/categories/python" target="_blank">Linguagens suportadas no Heroku</a></span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://pypi.python.org/pypi/virtualenv/" target="_blank">virtualenv</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Permite você criar ambientes separados em python, você pode escolher quais libs instalar, sem tê-las por todo o sistema. Funciona como um container para seu projeto.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://flask.pocoo.org/" target="_blank">flask</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Um micro framework em python, bem simples e rápido, com baterias não inclusas. Mas com muitas baterias a disposição.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://elsdoerfer.name/docs/flask-assets/" target="_blank">flask-assets</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Extensão do flask (uma dessas baterias não inclusas), que permite você agrupar e minificar arquivos estáticos do seu app.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://mongoengine.org/" target="_blank">mongoengine</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">"The object-document mapper to connect Python and MongoDB". Vai lhe ajudar a melhorar a sua interface de conexão entre o mongohq e seu app!</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://jquery.com/" target="_blank">jQuery</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Se você ainda não usa esta perdendo muito!</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://twitter.github.com/bootstrap/" target="_blank">twitter bootstrap</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Conjunto de classes css e plugins jquery que vão lhe ajudar a deixar seu app mais bonito e funcional. É esse micro framework jquery é do pessoal do twitter.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://fortawesome.github.com/Font-Awesome/" target="_blank">font awesome</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Fontes com ícones dos mais diversos, se você olhar não vai mais largar! ahhahahhahaha :D</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://git-scm.com/" target="_blank">git</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Ferramenta de versionamento.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="http://www.heroku.com/" target="_blank">heroku</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Nosso fornecedor de IaaS.</span></li>
</ul>
<li style="text-align: justify;"><span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><b><a href="https://addons.heroku.com/mongohq" target="_blank">mongohq</a></b></span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Rodar o mongodb nas nuvens! Uhu!</span></li>
</ul>
</ul>
<div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif; margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoZ6l7MkjVhHsBoThcPB_Y-DnSpZScSkYN9vhuddnR13y4uiBNMqNz_giBP4RuMZiadSb1xwzpOIXCRrOhyphenhyphenWoBnyZT0gabcZHcChFgkwh9fwGZAW0fY2YhRAh-FdTEhFYYvc1HRYFlII/s1600/heroku-logo.png" /></span></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Você pode estar se perguntando, "poxa vida, tenho de aprender tudo isso para colocar algo no ar la no heroku?".</span></div>
</div>
<div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Claro que não, o negócio é que eu quis experimentar um pouco mais, resolvi que iria colocar algumas coisas em um banco de dados <a href="http://en.wikipedia.org/wiki/NoSQL" target="_blank"><b>noSQL</b></a>, o que não é necessário.</span></div>
</div>
<div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Enfim, primeiro passo, foi criar localmente um ambiente (ok, não precisa ser apache pra isso, mas eu usei mesmo assim). O legal do flask e outros frameworks em python é que você pode subir um "web server" na linha de comando sem precisar configurar um apache da vida. Isso é um ponto positivo!</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Pra colocar um site la no heroku é bem simples, só seguir esse tuto na página deles: <a href="https://devcenter.heroku.com/articles/python/" target="_blank">Getting Started with Python on Heroku</a>.</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH2wrW8JPRM-32SSybgFTNj8jW1pGAX16RzgSK7Zk_x7TWadXYi_RwuWnky40auEnOhVMjzyKQvAzd_JwFnw_lmqfsVwWcCCknRC_BOslZ1I5pXVblNAzWwdFOtWcWnIJo2WLiaxQZ88s/s1600/mongohq.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH2wrW8JPRM-32SSybgFTNj8jW1pGAX16RzgSK7Zk_x7TWadXYi_RwuWnky40auEnOhVMjzyKQvAzd_JwFnw_lmqfsVwWcCCknRC_BOslZ1I5pXVblNAzWwdFOtWcWnIJo2WLiaxQZ88s/s200/mongohq.jpg" width="200" /></span></a><span style="font-family: Arial, Helvetica, sans-serif;">Depois de seguir estes passos bem simples do heroku e claro ter feito sua aplicação/site/whatever você pode ativar o mongohq. Para isso é só entrar na interface do heroku e solicitar a ativação do mongohq para sua nova app.</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">O heroku vai lhe retornar as informações de conexão com o banco, então você os coloca na aplicação. Como eu estou usando flask e o mongoengine, para cadastrar o banco de dados foi simples:</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i><br /></i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app = Flask(__name__)</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i></i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app.config["MONGODB_DB"] = "app5632158"</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app.config["MONGODB_USERNAME"] = "rdenadai@gmail.com"</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app.config["MONGODB_PASSWORD"] = "yhgb2398"</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app.config["MONGODB_HOST"] = "staff.mongohq.com"</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>app.config["MONGODB_PORT"] = "10050"</i></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><i>db = MongoEngine(app)</i></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Bem fácil não? Ainda estou usando o flask-assets que é uma extensão bem bacana que permite você juntar os arquivos css/js em um único só, melhorando assim a performance da sua app na hora de baixar os arquivos estáticos do servidor!</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
</div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">assets = Environment(app)</span></div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">js = Bundle('jquery.js', 'default.js', 'twitter-bootstrap.js', filters='jsmin', output='gen/packed.js')</span></div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">css = Bundle('default.css', 'normalize.css', 'font-awesome.css', 'twitter-bootstrap.css', filters='cssmin', output='gen/packed.css')</span></div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">assets.register('js_all', js)</span></div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">assets.register('css_all', css)</span></div>
<div style="color: #999999; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Feito isso no app.py do seu app, pra utilizar é só ir nos templates e colocar:</span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;">{% assets "css_all" %}</span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}" /></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;">{% endassets %}</span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;">{% assets "js_all" %}</span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><script type="text/javascript" language="javascript" src="{{ ASSET_URL }}"></script></span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;">{% endassets %}</span></div>
<div style="text-align: justify;">
<span style="color: #999999; font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Fazendo estes passos, que achei bem simples (depois que você aprende são bem simples mesmo!), coloquei no ar um app no heroku!</span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkC6BLpNzehqpLPvmcTnqNDppEQjO7wunY44lMYG3tiBIlXZv4ylKG7aBgcJDPJ9r4QJtN2wpNxw8Ztjb-GDWMEGK-gYwrit4CVdySQNu63mCuzIzS4kObqnOTBuPF0loUT1SfsinDg_k/s1600/dilbert_cloud.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="99" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkC6BLpNzehqpLPvmcTnqNDppEQjO7wunY44lMYG3tiBIlXZv4ylKG7aBgcJDPJ9r4QJtN2wpNxw8Ztjb-GDWMEGK-gYwrit4CVdySQNu63mCuzIzS4kObqnOTBuPF0loUT1SfsinDg_k/s320/dilbert_cloud.gif" width="320" /></span></a></div>
<div style="text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;">Só não vá correndo contar isso pro seu chefe...</span></div>
<div style="text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">Falowaer</span></div>
<br />
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-63073372328696914902012-07-26T13:51:00.005-03:002012-08-09T13:33:15.221-03:00Tradicional x Ágil<h2 style="text-align: center;">
<b>Tradicional x Ágil</b></h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-DmZV8T13eX3QgdgjlHOHDn5ZxSXcsOuyioYJK_39D13WCTp3tiBI8fwuELtuj7swS3jXJ3VwQSPFN8MkxjxIOKSyEWzYLjp8D0bcxaNkKbOxweYlqOTq32xjk_oAtrq38VGGKzyCG0g/s1600/0712_tradition_John_Walsh.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-DmZV8T13eX3QgdgjlHOHDn5ZxSXcsOuyioYJK_39D13WCTp3tiBI8fwuELtuj7swS3jXJ3VwQSPFN8MkxjxIOKSyEWzYLjp8D0bcxaNkKbOxweYlqOTq32xjk_oAtrq38VGGKzyCG0g/s200/0712_tradition_John_Walsh.jpg" width="200" /></a><br />
<div style="text-align: justify;">
<span style="background-color: white;">Bom, hoje vou falar de um tema muito recorrente em minha vida e minhas pesquisas na internet. A velha discussão sobre tradicional x ágil!</span></div>
<br />
<div style="text-align: justify;">
Não vou falar especificamente de CMMI/MPSBr contra SCRUM/XP nada disso, mas principalmente sobre modelos de pensamento tradicional contra o ágil!</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Acho engraçado o modismo exacerbado com relação a tecnologias e métodos, engraçado porque as pessoas não procuram se aprofundar nas questão desses modismos (seria um problema causado pela <a href="http://dicotomiadotrabalho.blogspot.com.br/2012/05/psicologia-da-pressa.html" target="_blank">Síndrome da Pressa</a>?) e simplesmente ignoram as premissas básicas ditadas por estes.</div>
<div style="text-align: justify;">
Nesse momento o pensamento ágil impera nessas pessoas!</div>
<br />
<div style="text-align: center;">
<b>"Precisamos aprender isto pois irá aumentar nossa produtividade!"</b></div>
<br />
<div style="text-align: justify;">
O imediatismo toma conta, assim verdadeira mentalização e aprendizado se perde, para dar lugar a "rápida escalada" da produtividade. Mas será que isso é mesmo o importante?</div>
<div style="text-align: justify;">
Na verdade o que fazemos é pegar todo nosso aprendizado, crenças e achismos tradicionais e colocar mais tradicionalismo em cima, achando que estamos melhorando, agilizando ou qualquer que seja a palavra. Mas a verdade é que não estamos. Estamos apenas colocando mais cobertura sobre um bolo de 1 metro de altura.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0U5duz7r24PDgLnVTQsoH4QiNeCl3TgC3-5w3ypQQ3HcPmBUCLsTfaSYmyllLNBLSV0raIHu2PEi_eQTMg2vNvVU1Fh8MN5Iw5m-wTtRRas0mNHoX9yMhjvFK2-ahWILvqGRlAidCPcU/s1600/1051.strip.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0U5duz7r24PDgLnVTQsoH4QiNeCl3TgC3-5w3ypQQ3HcPmBUCLsTfaSYmyllLNBLSV0raIHu2PEi_eQTMg2vNvVU1Fh8MN5Iw5m-wTtRRas0mNHoX9yMhjvFK2-ahWILvqGRlAidCPcU/s1600/1051.strip.gif" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
O problema é não conseguirmos sair de nossa zona de conforto, nosso Ok Plateau e outros mais nomes dados ao nosso verdadeiro medo (<a href="http://dicotomiadotrabalho.blogspot.com.br/2012/05/aprendizado-continuo.html" target="_blank">Aprendizado Contínuo</a>). Então surgem aquela amálgama de soluções lindas e perfeitas, misturando o pensamento Tradicional com o Ágil, fazendo não só aumentar a produtividade como manter os lindos e complexos processos do modo como estão.</div>
<div style="text-align: justify;">
As pessoas se enganam, o poder é o que conta mais, por isso os métodos tradicionais são tão fortes ainda nas empresas e essa amálgama de soluções surge. Manter o pensamento tradicional, mas tentando agiliza-los o máximo possível.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ThPOLSXWxdOR9UlRFHGc4KFxE_yv0V52XEixE3ZKkFFcgmoO1TwuC5OrropllbN23hqaH80P6dp97hM2wIX4i215H65ReLLdwVJHkOGHaMkPpvARW63gr3xOo4pssHRlWoWNX9jq36Y/s1600/handle-with-care.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ThPOLSXWxdOR9UlRFHGc4KFxE_yv0V52XEixE3ZKkFFcgmoO1TwuC5OrropllbN23hqaH80P6dp97hM2wIX4i215H65ReLLdwVJHkOGHaMkPpvARW63gr3xOo4pssHRlWoWNX9jq36Y/s200/handle-with-care.gif" width="150" /></a>Tudo isso só mostra que enquanto uns são extremistas demais (e corretos), outros ficam em cima do muro, destruindo e denegrindo a real imagem da agilidade. Escolha seu lado, ou você é tradicionalista ou agilista, esse meio termo, na verdade só serve para manter e postergar ainda mais o modelo mental tradicional e impedir o novo. Pare de querer ficar criando métricas e processos que impedem o real trabalho de ser feito! Não se esconda por trás dos processos, faça acontecer, crie e inove o quanto é necessário, não viaje na maionese, <a href="http://en.wikipedia.org/wiki/Lean_software_development" target="_blank"><b><span style="color: #cc0000;">LEAN</span></b></a> é a palavra para sua agilidade. Nada de ficar criando projetos monstros, meses de planejamento. <span style="color: #cc0000;"><b><a href="http://en.wikipedia.org/wiki/Minimum_viable_product" target="_blank"><span style="color: #cc0000;">MVP</span></a> nisso!</b> </span>simples, rápido, responsável e parceria.</div>
<div style="text-align: justify;">
Ensine seu cliente ou mande-o embora! Parceria, nada de você compra e eu forneço, se até as empresas estão tentando criar um ambiente social para seus produtos, porque a sua empresa quer ir na contra mão?</div>
<div style="text-align: justify;">
Será que não é hora da sua empresa (você) refletir os rumos que esta indo e verificar se o que se esta fazendo é correto? Lembra da nossa conversa sobre <a href="http://dicotomiadotrabalho.blogspot.com.br/2012/06/visao-missao-e-valor.html" target="_blank">Missão, Visão e Valor</a>? Hora de parar de se esconder atrás das portas, tirar os esqueletos do armário e corrigir o que esta de errado.</div>
<br />
<div style="text-align: center;">
<b><i>Nunca é tarde para recomeçar...</i></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO4ocTY_s4kgiQckGOQbWbr3GvoACDFSaXpGu0VAwC_3RS-Ad8MAzwH7FPMTySpfzdFZCEDzWJ6LBt-d2ZOmPe3uAsrqLihlp856MxN7QdRhJBbZs4irDsQuoVYjsQSpmZNUHguANfsHM/s1600/samuel-l-jackson-programming-agile.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO4ocTY_s4kgiQckGOQbWbr3GvoACDFSaXpGu0VAwC_3RS-Ad8MAzwH7FPMTySpfzdFZCEDzWJ6LBt-d2ZOmPe3uAsrqLihlp856MxN7QdRhJBbZs4irDsQuoVYjsQSpmZNUHguANfsHM/s400/samuel-l-jackson-programming-agile.jpg" width="400" /></a></div>
<br />
Falowaer!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-65447115866084246292012-07-13T13:16:00.002-03:002012-08-09T13:36:14.618-03:00Currículum Vitae<h2 style="text-align: center;">
Currículum Vitae</h2>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHMJffeIbv-trCRK1-kmnk8F3t5w6-963Crfjr-WwbfUaoLGIRSB6oiIPXElmefV0yL7Gy7rgnsw6MOb2r55R0xWdl_cI89lny1mSADMiW1sUR1JN_-JCl9D1hm96eYGJON8pttfOTKtI/s1600/documento2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHMJffeIbv-trCRK1-kmnk8F3t5w6-963Crfjr-WwbfUaoLGIRSB6oiIPXElmefV0yL7Gy7rgnsw6MOb2r55R0xWdl_cI89lny1mSADMiW1sUR1JN_-JCl9D1hm96eYGJON8pttfOTKtI/s320/documento2.jpg" width="320" /></a></div>
<div style="text-align: justify;">
Boas! Essa postagem será um pouco mais técnica. Na verdade, nos últimos dias eu fiquei colocando no ar um "site" que na verdade é um currículo online meu. Pois é, você pode se perguntar: Currículo online? Mas não tem vários sites que fazem isso?</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
A resposta é sim, e ao mesmo tempo não.</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Sim, existem vários sites que permitem você colocar la seu currículo, e muitos são bem bacanas! Mas ano passado, eu ouvi e vi um cara falar o seguinte:</div>
</div>
<div>
<div style="text-align: justify;">
"Então você trabalha com informática, e não tem um currículo online que você mesmo fez?"</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Fiquei pensando sobre o assunto e cheguei a conclusão de que um currículo online feito por mim mesmo, passa a idéia, de que:</div>
</div>
<div>
<ul>
<li style="text-align: justify;">Eu sei fazer design de um site, mesmo que pequeno;</li>
<li style="text-align: justify;">Sei codificar na linguagem que eu escolher pro meu "site";</li>
<li style="text-align: justify;">Sei usar o banco de dados o qual escolhi;</li>
<li style="text-align: justify;">Sei configurar, mesmo que basicamente um server.</li>
</ul>
<div>
<div style="text-align: justify;">
Realmente eu sei fazer tudo isso, mas como colocar em 1 página A4 todas essas informações e outras mais para alguém avaliar? Alguns podem até afirmar que um currículo extenso vai afugentar os contratantes, mas se você possuir as duas opções (um curriculo em pdf de 1 página A4, e um "site" com uma bela descrição), pode vir a facilitar o contratante, quem se interessar poderia ir la no seu "site" e ler mais sobre você.</div>
</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Perceba que a intenção não é ser um blog, mas talvez uma página agregadora, com informações extras que você queira colocar, no formato que você escolher!</div>
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Bom, finalmente resolvi fazer isso, e pra começar aprendendo mesmo, resolvi usar o <a href="http://www.heroku.com/" target="_blank">heroku</a>!</div>
</div>
<div>
<div style="text-align: justify;">
Como eu gosto muito de python e ja faz um tempinho que o heroku habilitou python la, resolvi que iria utilizar ambos!</div>
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhILiIoV8jUmwHyB3DS91q8svUo_5yjXpvWObtk9vcXTaMF5laMaHiEhjDzc3cveE80uwx57SY3fOWgWE76Tk76hlTj7x6j7mX_71mbiZSz_8rP7YD_csF23xqnoVcGKaKpO39nI-MPtfE/s1600/flask.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: justify;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhILiIoV8jUmwHyB3DS91q8svUo_5yjXpvWObtk9vcXTaMF5laMaHiEhjDzc3cveE80uwx57SY3fOWgWE76Tk76hlTj7x6j7mX_71mbiZSz_8rP7YD_csF23xqnoVcGKaKpO39nI-MPtfE/s320/flask.png" width="320" /></a></div>
<div style="text-align: justify;">
Mas ai fiquei com uma dúvida, seria ideal usar o <a href="https://www.djangoproject.com/" target="_blank">django</a> pra fazer uma mera página? Achei mesmo que não, e acabei escolhendo usar o <a href="http://flask.pocoo.org/" target="_blank">flask</a> e não me arrependo não. É um framework bem simples, leve e rápido de aprender.</div>
</div>
<div>
<div style="text-align: justify;">
Acabei o "site", ficou muito legal, mas sabe quando você pode melhorar? Foi o que fiz!</div>
</div>
<div>
<div style="text-align: justify;">
Resolvi colocar o <a href="http://www.mongodb.org/" target="_blank">mongodb</a> e o <a href="http://mongoengine.org/" target="_blank">mongoengine</a> rodando, para fazer algumas coisas simples e usar para evitar repetição de html (na parte das keywords e livros). Ficou jóia!</div>
</div>
<div>
<div style="text-align: justify;">
Com toda a certeza, ainda tem coisas que posso melhorar e acrescentar, como por exemplos os projetos que tenho online! É, eu tenho uns "programinhas" disponíveis na internet (mais especificamente no Google Code, mas vou coloca-los no github), que podem enriquecer ainda mais meu currículo online, sendo que no pdf A4 de 1 página não caberia (beleza que num tem tanto programa assim neh).</div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Resumindo? Não espero que consiga altos empregos com isso, mas acredito que possa dar um pouco mais de visibilidade para quem um dia poderá me contratar!</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnniEV1yPc8LNxdzLqFkNxKlJxpR3EZH4AIYs0D8nurC85Ty-UkRQrpBxaIgQ87Q8n7FxMc9-8Wo8K3uLCnuU3RGAcqdHhH3Ff-K5zYmAVg3ZIr-1g-p40i3ybz3u8YzM809VvkcwN8I4/s1600/2009042912401.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnniEV1yPc8LNxdzLqFkNxKlJxpR3EZH4AIYs0D8nurC85Ty-UkRQrpBxaIgQ87Q8n7FxMc9-8Wo8K3uLCnuU3RGAcqdHhH3Ff-K5zYmAVg3ZIr-1g-p40i3ybz3u8YzM809VvkcwN8I4/s320/2009042912401.jpg" width="320" /></a></div>
<br />
Quer ver como ficou o trabalho "pronto"? <a href="http://rdenadai.herokuapp.com/" target="_blank">Clique aqui!</a><br />
<br />
Na próxima postagem eu coloco todos os passos que fiz!<br />
<span style="background-color: white;">falowaer ;)</span><br />
<br />
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-28798947388940662892012-06-25T13:14:00.003-03:002012-06-25T13:32:16.043-03:00Visão, Missão e Valor<h2 style="text-align: center;">
<b>Visão, Missão e Valor</b></h2>
<div>
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSna_mSC4NwFGwwWXd9W9T6mNfouyYNogJRbuhCyRh2wBuGdDSh7zPAdiAmdnZtQkHDkFAX_cif3LoipUC6EJPHgdBylYCh6Y_qfsmy4AfUjIVey7Udo5LqsdpTJBwZSXVdxI0-v08bZ0/s1600/200407280017_15_0.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSna_mSC4NwFGwwWXd9W9T6mNfouyYNogJRbuhCyRh2wBuGdDSh7zPAdiAmdnZtQkHDkFAX_cif3LoipUC6EJPHgdBylYCh6Y_qfsmy4AfUjIVey7Udo5LqsdpTJBwZSXVdxI0-v08bZ0/s320/200407280017_15_0.gif" width="320" /></a></div>
<div style="text-align: justify;">
Boas, estive longe do blog por estas semanas, para escrever meu TCC da pós-graduação (o qual me tomou muito tempo), cujo tema era: Motivação nas Equipes de TI - Uma abordagem para formação de times de alto desempenho.</div>
<div style="text-align: justify;">
Em outro post e assim que ele for defendido, eu coloco o trabalho na integra, mas pretendo tratar de todos os aspectos do mesmo em postagens separadas.</div>
<div style="text-align: justify;">
Enfim, mas hoje estou aqui para falar de outro tema, muito importante! A visão, missão e valores das empresas. É um tema muito discutido, mas principalmente, um tema não difundido dentro das empresas, ou talvez até mesmo, difundido, mas não aplicado.</div>
<div style="text-align: justify;">
Acredito que eles podem mudar durante o tempo, de acordo com os aspectos objetivos de cada empregador, entretanto eles não devem nunca serem esquecidos ou mesmo não disseminados dentro das organizações!</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBcEtshlMxKs1k27rmPscaX_H55rd6qKMgoQLNo19yz106_TFgHxehWwdLLVtLw0uPXWoq-knX4LpyWri3V6vU-_h8AtZ_TTswlMUzhj9uf8HSvS104Zxnph0ooIEpRXAouVoI_2ChIq4/s1600/empresas-de-valor1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBcEtshlMxKs1k27rmPscaX_H55rd6qKMgoQLNo19yz106_TFgHxehWwdLLVtLw0uPXWoq-knX4LpyWri3V6vU-_h8AtZ_TTswlMUzhj9uf8HSvS104Zxnph0ooIEpRXAouVoI_2ChIq4/s320/empresas-de-valor1.jpg" width="320" /></a></div>
<div style="text-align: justify;">
Esses fatores são relevantes para os empregados e devem ser levados a sério pelos gestores e líderes dentro da organização, por isso mesmo, eles devem ser o mais claro, explicativo e pontual o possível, ficando disponível 24-7 para todos dentro da organização.</div>
<div style="text-align: justify;">
E não adianta fazer uma pagininha na internet ou na intranet da emprega, esses pontos devem ser colocados em cada porta, pois são eles que devem nortear a todos dentro da organização, dando as pessoas o senso de responsabilidade, engajamento e alinhamento.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Assim como os funcionários deve seguir esse pontos, os gestores e líderes devem fazer o mesmo! Então a missão da sua empresa é distribuir valor agregado em seus produtos? Nada de gestor vir pedir correndo pra você fazer aquele servicinho rápido, super urgente, para o cliente x. E esse é o ponto mais importante, parece que muitas vezes essas "regras" de como a empresa deve se posicionar, devem apenas ser seguidas pelos pobres escravos dos trabalhadores, enquanto que os gestores e líderes usufruem de sua posição hierárquica para mandar fazer e desfazer trabalhos que não estão alinhados com estes fatores.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpyE9WXsQsGu2_sY6jZMPOinLsztBJ2789g3W9bGv-hV6VadkcBn00SIa3lIh62_52gaE0zHHf2CC5g6dzDLfWY6LMrk34H1PInT9yDU9uBwryFY2OuXWM7F6YDI4LET2rVWbNCCxUR7o/s1600/sarney-presidente-de-novo.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpyE9WXsQsGu2_sY6jZMPOinLsztBJ2789g3W9bGv-hV6VadkcBn00SIa3lIh62_52gaE0zHHf2CC5g6dzDLfWY6LMrk34H1PInT9yDU9uBwryFY2OuXWM7F6YDI4LET2rVWbNCCxUR7o/s1600/sarney-presidente-de-novo.jpg" /></a></div>
<div style="text-align: justify;">
Até mesmo o presidente da organização, deveria ler e rever, vez ou outra esses fatores, pois se a empresa é dele, a responsabilidade da visão, missão e valor estarem alinhadas a visão, missão e valores dele próprio é o mais primordial e essencial ponto em questão! Pois caso contrário, se os mesmos não estiverem alinhados e atualizados, os indivíduos que trabalham na organização, vão começar a pensar que não existe organização real no negócio, e que apenas estão ali, para levantar o máximo de dinheiro possível para os benefícios do presidente.</div>
<div>
<br /></div>
<div>
Vou dar um exemplo bonito e clássico, apesar de muitas especulações e reviravoltas na diretoria nos últimos tempos o Google é ainda uma empresa de informática que tenta manter suas raízes intactas, apesar do grande crescimento que obteve.</div>
<div>
<br /></div>
<div>
<a href="http://www.google.com/intl/pt-BR/about/corporate/company/">http://www.google.com/intl/pt-BR/about/corporate/company/</a></div>
<div>
<br /></div>
<div>
Esta ae a filosofia da empresa, entendam o Google tem visão, missão e valor, mas acima de tudo eles tem uma filosofia que tenta seguir: <a href="http://www.google.com/intl/pt-BR/about/corporate/company/tenthings.html">http://www.google.com/intl/pt-BR/about/corporate/company/tenthings.html</a></div>
<div>
Será que a filosofia da sua empresa existe? Se existe, ela é BEM aplicada ou esta só no papel (sitezinho da internet e/ou intranet)? Os gestores e líderes buscam diariamente, e estão alinhados e engajados nessa filosofia? E claro, o mais importante de tudo, seus funcionários, sabem dela, aplicam ela e são contratados com características que facilitam eles alinharem seus objetivos a essas filosofias?</div>
<div>
<br /></div>
<div>
Bom, como não pode faltar, use ferramentes para lhe auxiliar a criar sua visão, missão e valor... escrever o que queremos as vezes pode ser bem complicado e difícil, então conte com toda ajuda que conseguir!</div>
<div>
<ul>
<li><span style="background-color: white;">Use o famoso CANVAS (Business Model Canvas - </span><a href="http://en.wikipedia.org/wiki/Business_Model_Canvas" style="background-color: white;">http://en.wikipedia.org/wiki/Business_Model_Canvas</a><span style="background-color: white;">);</span></li>
<li><span style="background-color: white;">Use o modelo Delta (<a href="http://en.wikipedia.org/wiki/Delta_model">http://en.wikipedia.org/wiki/Delta_model</a>);</span></li>
<li>Após fazer isso, distribua esses esquemas, faça a página de visão, missão e valor na internet e intranet;</li>
<li>Crie uma filosofia para sua empresa (essa é a parte mais difícil de todas);</li>
<li>Contrate pessoas que tenham perfil e características alinhadas com os itens definidos, não coloque qualquer um como gerente de recursos humanos;</li>
<li>E por fim, o mais importante, revisite a visão, missão e valor a cada 6 meses a 1 ano, e fiscalize se todos na empresa ainda possuem a mesma visão, missão e valor a qual você prega!</li>
</ul>
<div>
Bom trabalho a todos!</div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-91069362836874335882012-05-31T13:30:00.002-03:002012-05-31T13:30:28.142-03:00Aprendizado Contínuo<h2 style="text-align: center;">
<b>Aprendizado Contínuo</b></h2>
<div>
<b><br /></b></div>
<div>
Então você é daqueles que não gosta de estudar? Odeia pegar nos livros? Bom então essa publicação não é pra você! Mas não se preocupe, a vida esta repleta de pessoas que gosta/odeiam estudar, então com certeza um par você poderá encontrar.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4ddF_NK3Iv-4mljyOUbTvwOBMKASYZzV2gC6hZyFju-e5QJRyeapSLZt8WL1kBdQCL6FdKnVgaB1x0A3bMyoGhZZLYupQW_53GUCtTuPgFXAkR4mQhlgpVqVv5VfSbu0OdTvO6OcWpA/s1600/professor.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4ddF_NK3Iv-4mljyOUbTvwOBMKASYZzV2gC6hZyFju-e5QJRyeapSLZt8WL1kBdQCL6FdKnVgaB1x0A3bMyoGhZZLYupQW_53GUCtTuPgFXAkR4mQhlgpVqVv5VfSbu0OdTvO6OcWpA/s1600/professor.jpg" /></a></div>
<div>
Mas afinal de contas, o que nos leva a estudar?</div>
<div>
Para alguns a resposta é simples e imediata: "Estudo pois quero conseguir um emprego bom e ganhar muito dinheiro!".</div>
<div>
Parece ser uma boa resposta, e até mesmo simplista demais, afinal nem todo mundo que estuda ganha dinheiro e o inverno também é muito verdadeiro, nem todos que ganham muito dinheiro estudaram...</div>
<div>
Limitar nossos estudos e direcionamentos, pelo simples modo de ver a vida dessa maneira (estudar para ganhar dinheiro), faz-me pensar se as pessoas não vêem seus motivos de forma obscura demais.</div>
<div>
<br /></div>
<div>
<b>A verdadeira razão</b></div>
<div>
<b><br /></b></div>
<div>
Estudamos pelo simples fato de aprender, claro que aprendendo cada vez mais, e até mesmo especializando cada vez mais em um assunto, poderemos colher benefícios desse estudo, como um emprego melhor, uma idéia brilhante que nos faça ter muito dinheiro. Mas acredito, que não devemos estudar voltando nossa mente para esse fim, caso contrário, se não atingirmos esse objetivo, ficaremos frustrados e deixaremos de estudar, nos acomodando (ficamos no Ok Plateau).</div>
<div>
<br /></div>
<div>
Mas o que é esse Ok Plateau?</div>
<div>
Quando nos acomodamos, ou achamos que ja sabemos demais sobre determinado assunto, ou melhor, quando paramos de ficar melhor em algo. E estudar é isso, teoria e prática, ficar cada vez melhor sobre determinado assunto, tentando evitar o "Ok Plateau"</div>
<div>
<br /></div>
<div>
<div style="background-color: white; font-family: verdana, arial, helvetica, sans-serif; font-size: small; margin-bottom: 1em;">
<i><b>Q</b>: Can you explain the "OK Plateau?"</i></div>
<div style="background-color: white; font-family: verdana, arial, helvetica, sans-serif; font-size: small; margin-bottom: 1em;">
<i><b>A</b>: The OK Plateau is that place we all get to where we just stop getting better at something. Take typing, for example. You might type and type and type all day long, but once you reach a certain level, you just never get appreciably faster at it. That's because it's become automatic. You've moved it to the back of your mind's filing cabinet. If you want to become a faster typer, it's possible, of course. But you've got to bring the task back under your conscious control. You've got to push yourself past where you're comfortable. You have to watch yourself fail and learn from your mistakes. That's the way to get better at anything. And it's how I improved my memory. (Joshua Foer)</i></div>
</div>
<div>
<a href="http://www.amazon.com/Moonwalking-Einstein-Science-Remembering-Everything/dp/159420229X">http://www.amazon.com/Moonwalking-Einstein-Science-Remembering-Everything/dp/159420229X</a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirATtjCxte9rHQWGMP6eQKedGfOmrymu_lPMU_znzHLNZJy0hfn0tUwvtWJbkLTrHf7gbGVIYvjQZfwBzCGWjjsEk8OHRMg-u5Fa2L6gsWAAbKNLAsDcI0RMdK7reT9r4Pvt_1akH8e30/s1600/skill-graph.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirATtjCxte9rHQWGMP6eQKedGfOmrymu_lPMU_znzHLNZJy0hfn0tUwvtWJbkLTrHf7gbGVIYvjQZfwBzCGWjjsEk8OHRMg-u5Fa2L6gsWAAbKNLAsDcI0RMdK7reT9r4Pvt_1akH8e30/s320/skill-graph.png" width="320" /></a></div>
<div>
</div>
<div>
<br /></div>
<div>
Por conseguinte, devemos pensar, não, acreditar que estudamos para um objetivo a curto prazo (e não a longo prazo, como ganhar dinheiro), o objetivo de aprender mais e nos tornarmos melhores! Aceitando esse objetivo podemos mudar nosso conceito sobre o estudo e consequentemente sobre nós.</div>
<div>
<br /></div>
<div>
<b>Por onde começar?</b></div>
<div>
<b><br /></b></div>
<div>
Bom, legal, quero fazer isso, mas como faço?</div>
<div>
As possibilidades podem ser muitas, mas acredito que o melhor seria o seguinte:</div>
<div>
<ul>
<li>Procure identificar os objetos, temas, coisas que tem preferência;</li>
<li>Busque sempre informações sobre o tema;</li>
<li>Encontre as pessoas que são referência na área e siga-as como puder;</li>
<li>Procure por grupos para interagir, eles podem ser fontes de muitas informações;</li>
<li>E o principal, não importa o quão não goste de um tema, procure conhece-lo, pois o mesmo pode lhe abrir os olhos para outros assuntos!</li>
</ul>
Seguindo essa linha, um site muito legal que encontrei e que permite você testar seus conhecimentos sobre determinados temas, e quem sabe abrir sua mente para outros tantos é o P2PU (<a href="https://p2pu.org/">https://p2pu.org/</a>). Entre la e veja se tem algo que lhe interessa, você pode até mesmo se surpreender!</div>
<div>
<br /></div>
<div>
Keep Learning...</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zh3Fv54ufJwwCb9ftCohCtjrxvxR0CKMvU5Ll6E91s5ucJ39TeFPfGLI_Ak6wu_3aVdb89f7E0eE3QTvkXZoi3_VKdthbsQKMi6LDzV1zn3sq8s4_dBUa6hoDvX2LgGLiNph6GT-YxM/s1600/keep-learning-dl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zh3Fv54ufJwwCb9ftCohCtjrxvxR0CKMvU5Ll6E91s5ucJ39TeFPfGLI_Ak6wu_3aVdb89f7E0eE3QTvkXZoi3_VKdthbsQKMi6LDzV1zn3sq8s4_dBUa6hoDvX2LgGLiNph6GT-YxM/s320/keep-learning-dl.jpg" width="234" /></a></div>
<div style="text-align: left;">
</div>
</div>
<div>
falowaer</div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5160997068094325765.post-17664381968281455372012-05-24T22:26:00.002-03:002012-05-31T13:30:45.467-03:00A Síndrome da pressa<h2 style="text-align: center;">
<span style="font-size: x-large;">A síndrome da pressa.</span></h2>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b>O que impulsiona a sociedade?</b></div>
<div>
<br /></div>
<div>
Sempre gosto de inicializar minhas discussões com uma pergunta, por conseguinte, o que nos impulsiona? Seria nossa necessidade de crescimento, socialização?</div>
<div>
Nos dias atuais podemos obter todas essas necessidades e muitas outras em menor ou maior grau, e é nessa hora, na hora de conseguir essas necessidades que a psicologia da pressa impera. Nos forçamos a realizar diversas tarefas, corremos de um lado ao outro atrás de respostas mais rápidas (e por vezes nem tão seguras assim) para que essas necessidades sejam cumpridas.</div>
<div>
Menor tempo e esforço, esse sim é o grande ganho da psicologia da pressa, quanto mais rápido fazemos algo e em menor tempo, conseguiremos mais recompensas.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrYEIzlNApyGQqxbRnXtU9omWqk7Dkvl0dhbIHfhCKrR3ihCxIoAoQ78wRiNVgE-PVWFSw1gxdDY88sQNfSwdqSjjaXefMmlUBVGE2qHhLKoLtD9DKN0FbVU3hQJ9_r4y_PSwscnDF2B4/s1600/pressa.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrYEIzlNApyGQqxbRnXtU9omWqk7Dkvl0dhbIHfhCKrR3ihCxIoAoQ78wRiNVgE-PVWFSw1gxdDY88sQNfSwdqSjjaXefMmlUBVGE2qHhLKoLtD9DKN0FbVU3hQJ9_r4y_PSwscnDF2B4/s1600/pressa.jpg" /></a></div>
<div>
<br /></div>
<div>
<b>Mas será que toda essa pressa é realmente necessária?</b></div>
<div>
<br /></div>
<div>
Eis que nossa possível resposta a primeira pergunta nos direciona a acreditar que a pressa, aquela correria do dia dia é essencial em nossa vida.</div>
<div>
Entretanto devo discordar de que a pressa é essencial. Com essa pressa acabamos por não nos dedicarmos aos assuntos, nos aprofundamos muito pouco nas nossas dúvidas e acabamos perdendo nosso tempo com assuntos roteiros e sem sentido.</div>
<div>
<br /></div>
<div>
Peguemos um exemplo.</div>
<div>
<br /></div>
<div>
Se hoje você precisa aprender algo de novo, procurará em um local onde a pressa é sua melhor amiga. Sim, estou falando da internet... a internet hoje é a melhor e mais bem preparada arma da pressa, precisa encontrar algo em pouco tempo e com mínimo de esforço (lembra da discussão acima?), é só procurar na internet.</div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgol4quQhXVX4A4IKXZvPBroL6H8dEvtZdeDmbAdsVGH-KJ1a2tZHM8C3pua1qOLYbyEX5FNozxR9i1Ex2M-bAbRrdKxCFHgyFGv3V4Q7f54AmPRtUM44C0T87qdiDnYluSsT1NPltKc88/s1600/pressa2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgol4quQhXVX4A4IKXZvPBroL6H8dEvtZdeDmbAdsVGH-KJ1a2tZHM8C3pua1qOLYbyEX5FNozxR9i1Ex2M-bAbRrdKxCFHgyFGv3V4Q7f54AmPRtUM44C0T87qdiDnYluSsT1NPltKc88/s200/pressa2.jpg" width="200" /></a>Então entramos, e em alguns cliques, encontramos o assunto e lemos um pouco. É isso mesmo, lemos um pouco, a pressa, essa correria acaba por tornar a nós, meros não-leitores (se é que isso exista realmente). Não lemos mais livros porque demoram muito, gostamos de entrar na internet e ler alguns artigos, rápidos, esquecemos sobre o assunto 10 minutos depois. Essa pressa em buscar por outras coisas, acaba por fazer com que esqueçamos determinados assuntos que "aprendemos".</div>
<div>
<b>Nos tornamos "gênios" do nada!</b></div>
<div>
Não sabemos sobre determinado assunto, mas acreditamos que por ter lido um artigo de 50 linhas somos referência sobre.</div>
<div>
<br /></div>
<div>
Lembrando que nossa pressa esta intimamente ligada as diversas escolhas de nossa vida! Um video bem legal da RSA Animate fala sobre as escolhas! </div>
<div>
<b><br /></b></div>
<div>
<span style="color: #1155cc; font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><a href="http://www.youtube.com/watch?gl=BR&v=1bqMY82xzWo" rel="nofollow" target="_blank">RSA Animate - Choice</a></span></span></div>
<div>
<span style="color: #1155cc; font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
Infelizmente acabamos por levar essa pressa para todas as áreas de nossa vida, queremos fazer tudo rápido o tempo todo! Dirigimos nosso carro com pressa, para chegarmos logo onde queremos, afinal não temos tempo. Saímos da nossa academia com pressa, isso quando não ficamos mentalizando durante o exercício o que fazer após sair de la.</div>
<div>
<br /></div>
<div>
<b>De uma change a tranquilidade!</b></div>
<div>
<br /></div>
<div>
Esqueçamos por um instante toda nossa correria! Tomaremos um café da manhã tranquilo, dirigiremos tranquilamente para o trabalho, conversaremos com o cliente com calma (tentando não alarmar o mesmo, para ele não ter pressa, pois o trabalho não será entregue hoje, mas só amanhã), almoçaremos tranquilamente, iremos nos exercitar sem se preocupar com o trabalho ou o serviço de casa.</div>
<div>
<br /></div>
<div>
Temos de dar uma chance para nós mesmo, para vivermos... essa pressa que a sociedade nos impõe, e claro impomos em nós mesmos, pode trazer aquilo que não gostamos nem um pouco, o <b>STRESS</b>!</div>
<div>
Viva um pouco, aproveite os momentos, aprenda bem os assuntos que lhe atrai...</div>
<div>
<br /></div>
<div>
Como na música dos Engenheiros do Hawaii:</div>
<div>
<span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><i>"...</i></span><i><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">Eu posso estar completamente enganado</span></i></div>
<i><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">Eu posso estar correndo pro lado errado</span><br style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;" /><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">Mas "a dúvida é o preço da pureza"</span><br style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;" /><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">É inútil ter certeza</span><br style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;" /><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">Eu vejo as placas dizendo</span><br style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;" /><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">"não corra, não morra, não fume</span><span style="background-color: white; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">..."</span></i><br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRjLVlOH1tsxTd3rvP0mAGyrYRBrWqjM9vkabQvQytyPca93re-e3zoyphWOchidSTkccaeQ6fSYCFo2RoaBvoQGUKvkpNZt0lVkKbc8ymhZnnbxKf7USlHEs6ATCVhKl0VV-DJA4iDEM/s1600/pressa3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRjLVlOH1tsxTd3rvP0mAGyrYRBrWqjM9vkabQvQytyPca93re-e3zoyphWOchidSTkccaeQ6fSYCFo2RoaBvoQGUKvkpNZt0lVkKbc8ymhZnnbxKf7USlHEs6ATCVhKl0VV-DJA4iDEM/s400/pressa3.jpg" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
falowaer</div>Unknownnoreply@blogger.com0