<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by jCi on Medium]]></title>
        <description><![CDATA[Stories by jCi on Medium]]></description>
        <link>https://medium.com/@jci?source=rss-82defa873749------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jXS8yJcOnWRbA3Db.jpg</url>
            <title>Stories by jCi on Medium</title>
            <link>https://medium.com/@jci?source=rss-82defa873749------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:16:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jci/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Talking about 3d printing like pretending that I know what I’m talking about…]]></title>
            <link>https://medium.com/@jci/talking-about-3d-printing-like-pretending-that-i-know-what-im-talking-about-ebfd129457a9?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebfd129457a9</guid>
            <category><![CDATA[3d-printing]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Tue, 05 Nov 2019 03:06:24 GMT</pubDate>
            <atom:updated>2019-11-05T03:07:44.306Z</atom:updated>
            <content:encoded><![CDATA[<p>Quick.</p><p>When I was a kid, always had the fascination with toys with engines and small gears. You know, <em>remote control cars</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*LdMQuy2hkVYXyB8-Cjfn9w.png" /><figcaption>Called “remote controlled car” but it was really “shortly wired potentiometer”</figcaption></figure><p>As as you can expect, this thing <strong>broke</strong>. Cannot be repaired as I wanted. Unfortunately, it has not been preserved through time. That makes me a little sad being an adult. But still, what bothered me at that time was the <strong><em>manufacturing process</em> </strong>of plastic stuff.</p><p>So, if you are curious how toys are made, here’s a quick rundown.</p><h3><strong>Molding</strong></h3><p>In the toy factory, a prototype is modeled. Sometimes clay. Usually with discarded materials or other toys. Check the…uhm, series <strong><em>“The toys that made us”</em></strong>. In the Masters Of The Universe episode, they <strong>frankenstein’d</strong> the shit out of other toys to make ends meet. Like Battle Cat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*r2ImrnEeN1rtBS-JDqe2eg.png" /></figure><p>Depicted here, Battle Cat.</p><p>It was a discarded tiger from other line and new pieces were added to allow He-man ride it. When it was bundled with a He-man figurine, you got a box with this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*xU3IRmg3mdBzF5tn87D0Wg.png" /><figcaption>Those were the times…</figcaption></figure><p>Omitting He-man, all the pieces here were manufactured using a mold. A metallic mold with two or more pieces put together. There, hot plastic is injected and after cooling down, all metal parts are separated and the plastic piece falls into a conveyor belt or any reservoir. A shit ton of engineering, so to speak.</p><p>These molds can be made with different processes.</p><ul><li>Use a solid block of metal and drill the <em>shit out of it</em> until getting the piece wanted. Usually, this process uses a <strong>CNC</strong> (computer numerical control) machine and is used mostly for pieces that have a lot of right angles. Let’s say a plastic box or a ruler.</li><li>Made the mold! For figurines and toys. Remember that they used clay? Well, first create a cast of the figure using a polymer clay. Something that can withstand <strong>MOLTEN FUCKING IRON</strong>. If you’re wondering, it’s 1500C. Then drill the holes for material injection, add some supports, bolts and Bob’s your uncle.</li></ul><p>Technically speaking now, we need <strong>metallurgy</strong>, <strong>plastic material knowledge</strong>, <strong>clay modelling hacks</strong> and of course having all the necessary infrastructure.</p><blockquote>That could make any 12 year old frustrated trying to make his own <strong>toys</strong> (me). And wood was not an option.</blockquote><p>2019 now.</p><p>Understood that there are, at least, <em>two processes</em>, to build stuff.</p><ul><li><strong>Subtractive process </strong>: a big chunk of something is filed, drilled or whatever, as fuck.</li><li><strong>Additive process</strong> : like plastic injection, but you need a mold.</li></ul><p>Well, not anymore!</p><p>3D printing is basically dropping hot small lines of plastic on a surface that follow a path on all axes (X, Y and Z) with these simple rules:</p><ul><li>Horizontal Path, on the X and Y axes. Namely, “path”</li><li>Vertical Path, on the Z axis. Namely, “layer”.</li></ul><p>Shape is being defined on the horizontal path and the vertical path creates the height of the final product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*B3MyZslLY_4F-NYwl0OjGA.png" /></figure><p>In layman terms, 3d printing is just making an infinite sandwich made with a fuck load of layers using only a teeny tiny string made of hot cheese that draws a shape (or follows a path). For some reason, it has some interesting results.</p><blockquote>10 year old me would have learnt CAD now to start printing stuff.</blockquote><p>Long story short.</p><p>Cybermonday. 3d printer on sale. Being downtown. Good idea! Quick! To the store! Hi! Get me that. I am pretty sure. <em>Shut up and take my money</em>, now! Don’t put wrapper on it. That’s OK, I have a bag. 10 kg box. Ouch, heavy. Got home. Open box. Find out that I need to assemble it first. Yikes. Got hungry. Buy spring rolls. Got me some beers also. Need tools. Have them. Start assembly. Got thirsty in the middle. Do. <strong>NOT</strong>. Get. Frustrated. <strong>Please</strong>. <strong>INSTRUCTION MANUAL IS FOR PUSSIES</strong>. Micro SD card? Hell yeah! <strong>WHY CAN’T I DO THIS SIMPLE THING WITH MY HAND SHAKING AS FUCK?!?! </strong>What is this? Oh, calibration first. Uhm. Need filaments, I guess.</p><p>Did it in around 3 or 4 hours. Who cares.</p><p>It is the Ender 3 model from Creality. It’s a cheap 3d printer, but it fucking rocks.</p><p>So, if you plan to buy one, make sure you have some <strong>basic tools</strong>. Like screwdriver, some gaffer tape and a magnetized surface. And a big, tidy, empty desk. Of course, had only the tools but not a desk that can be called “organized”. Comes with the territory.</p><p>I assembled it. Calibrated it. And started printing.</p><p>And BOY OH BOY. What a fantastic tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*ndV9JyvBag8CS7kncASR1A.png" /></figure><p>Had some serious questions on “where to start?”. Here are my tips.</p><ul><li>Your first print will <strong>FUCKING SUCK</strong>. Don’t get frustrated.</li><li>Your second, third and fourth print will <strong>FUCKING SUCK EVEN MORE</strong>. That’s because you are using the filament from the printer’s factory. Drop that shit and buy some decent filament. Also, don’t get frustrated.</li><li>At this point, you’ll see all the <strong>small details</strong> that the prints have. Strains running around the hot bed, a blob of shit on the hot bed and maybe a non functional thing. Time to start planning ahead.</li></ul><blockquote>First thing first : print as much as you can with the small white filament that came with the printer. You’re gonna need it.</blockquote><p>Remember that I mentioned that this is a sandwich? The extruder head…oh, boy. Have to explain that?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*HchTttGLNnzhS7fVG69PDw.png" /><figcaption>TL;DR. You monsters.</figcaption></figure><h3><strong>My tips!</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_TCV681b_fDs61OJtJ0DQ.png" /><figcaption>Kinda OK with the supports. Could have been worst…?!</figcaption></figure><ul><li>Get to know the nozzle width FIRST! It’s the pointy, hot thing where the hot filament goes down. Ender 3 comes with a pair of <strong>0.02mm nozzles</strong>. Learnt it via trial and error.</li><li>NEVER install the software that came with it! Use <strong>Ultimaker Cura</strong> instead.</li><li>If you want, connect it to a computer. That thing will have to be operative as long as the printer is running. So, if you’re are in a hurry, buy a <strong>CRAP. TON. OF. MICRO. SDs</strong>. You’ll thank me later.</li><li>This thing comes with a spatula (called scraper, but spatula is funnier). As you know, <strong>sandwiches are fragile</strong>. Have you tried to kick a Subway Sandwich? It will eventually become pieces of bread and shit spread all over the place. This spatula does that. If you want to make sure printed pieces don’t get destroyed, file the spatula to have a razor blade.</li><li>Calibrate the monster regularly. At least once a week. Use a level and some paper. Extruder head should touch the hot bed lightly. And here’s why you need paper. And knowing the nozzle width. Just to make sure that the filament that comes out from the extruder <strong>does not hang</strong>.</li><li>Learn first how to use the printer software (I SAID CURA!). Learn the fillings, the layer height, the printer speed and like a ton of shit. Don’t start with the piece design. Open your browser and go to <a href="https://www.thingiverse.com/">thingiverse</a> FIRST! Interesting stuff there. Learn how to print stuff from others FIRST.</li><li>Give away your good prints. That’s risky, but gratifying. Why? It gives value on the product. Buy some weird ass colored filament and use to print shitloads of useless crap. Gears, puzzles, tests and so on. But having them as gifts will actually make you a better person. Also, you can get invited for some tea.</li><li>And with practice comes perfection.</li></ul><p>Now go print some shit. I did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*H_lwV-eFtEcuDDrae8oN8A.jpeg" /><figcaption>Duck season? Goose season?</figcaption></figure><p>I have just a request when a print is finished.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FN95IYeuvDMg%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DN95IYeuvDMg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FN95IYeuvDMg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ebcc86141803a754c5bae5305052292/href">https://medium.com/media/8ebcc86141803a754c5bae5305052292/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebfd129457a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking security seriously, pretending that it is not important]]></title>
            <link>https://medium.com/@jci/taking-security-seriously-pretending-that-it-is-not-important-148b789891ac?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/148b789891ac</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Sat, 20 Apr 2019 01:41:18 GMT</pubDate>
            <atom:updated>2019-04-20T01:41:18.655Z</atom:updated>
            <content:encoded><![CDATA[<p>Last couple of months (read : 6) have been “complicated”…</p><p>First, my parents are currently living in Santiago. It just takes me minutes from my apartment to theirs. So, I can enjoy the small things of life with them. Even watch “The Mentalist”. Cool series!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4gyHF-Gp7gc3VqGVg8YOw.jpeg" /><figcaption>Yup. Heinie. Hours before Christmas, having a cold one.</figcaption></figure><p>In other news, I started to lose weight like a madman.</p><p>But what brings us here.</p><p>Long story short, I needed a cheap-o security system, probably Open Source or as extensible as possible, with just ONE DAMN WIRE only. After a few hours of crunching, let me introduce to you…</p><p>Securitron 4000!</p><p>It started life as a small plastic box, a Raspberry Pi A+and an internal Raspi Cam (UC-365).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aypxOd-SueeOcxfLHyOlJw.jpeg" /><figcaption>All assembled before laun…waaait a minute…</figcaption></figure><p>After sealing the box with the camera, I realized something not obvious:</p><p>DAMNED THING DOES NOT HAVE WIRELESS.</p><p>So, adding a wireless dongle later it started to show images on the screen. WRONG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4-VyVsWoXVEJcCKicrHjA.jpeg" /></figure><p>raspistill is an internal app from Raspbian to read from the internal buffer of the camera and pipe it back to a file. But I needed it to act like a webcam.</p><p>Some research later, I stumbled into this command line:</p><p># modprobe bcm2835-v4l2</p><p>Pretty obvious. Add the module to /etc/modules-load.d/webcam.conf and reboot. Nice. A /dev/video device file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljN4xUrk6XSYtcAdLaGnGA.jpeg" /><figcaption>raspi-still and don’t mind the box fuckfest in the back</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuncjJ1ZuNl6sX0tCEjWlA.jpeg" /><figcaption>…and now from Kamerka.</figcaption></figure><p>So, a win finally!</p><p>Installed Zoneminder on a 16gb drive and assembled everything back again. Went to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEj5-b9GX0PmauoJ2iU-kA.jpeg" /></figure><p>But.</p><p>Damn box was too small for the Wifi dongle attached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0dzhZjnrMPajKBdMaUVRg.jpeg" /><figcaption>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</figcaption></figure><p>After getting some beautifying sleep and post midday nap, I decided to use a bigger box, dremel the shit out of the box for the cabling and use a bigger Raspi (Raspberry Pi 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihYkNvz6xgQ1YQLZY944HQ.jpeg" /><figcaption>Functional prototype.</figcaption></figure><p>Well, there was a silver lining in the installation and configuration. I did the configuration on the same Raspi that night. I hoped to move all the crap to the RaspiA+ at the end, but getting a bigger box I would have plenty of space.</p><p>Bigger box, use some more instant glue, some double sided tape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4iroMmp_qjsCFInstdRuw.jpeg" /><figcaption>Say hello to my little friend!</figcaption></figure><p>If you want to do the same with the same or similar hardware, please pretty please read the following:</p><ul><li>Video Encoding is a killer on the Raspi. Avoid it. If you really really need it, install ffmpeg (does not come as a requirement for Zoneminder).</li><li>Change the swap path to another directory. It comes as “/tmp/zm” out of the box. Create a directory somewhere, vandalize the permissions (chmod 777 directory) and use that. DON’T. USE. /DEV/SHM. You’ll run with buffer overruns all day</li><li>Change the capture FPS to a decent value. Sometimes it picks over 30 fps (?!). Set all the analysis and capture values not bigger than 15.</li><li>Run some maintenance tasks to delete old alarms and stuff. Don’t set it to “all panic sensitive mode” or you’ll run out of disk really fast.</li><li>Get some AWS S3 space and upload all the events there from Zoneminder. That’s in case the thing goes “missing”.</li><li>Oh, and finally. Hide the box inside something that does not look suspicious. I had to use that box because it was the only one lying around the house, the old box (THE DAMN SMALL BOX!!!) fit perfectly inside a clock housing.</li><li>And hide all the red lights (from the Raspi and the camera) before going live</li></ul><p>Did I mention I got thinner?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=148b789891ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wearing an eye patch makes you look slick most of the time]]></title>
            <link>https://medium.com/@jci/wearing-an-eye-patch-makes-you-look-slick-most-of-the-time-927d979117d6?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/927d979117d6</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[atari]]></category>
            <category><![CDATA[emuparadise]]></category>
            <category><![CDATA[emulation]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Thu, 09 Aug 2018 01:46:04 GMT</pubDate>
            <atom:updated>2018-08-09T23:00:37.507Z</atom:updated>
            <content:encoded><![CDATA[<p>TL;DR : Piracy.</p><p>This is a nostalgic story about myself and one of the things that stole most of my time while freefalling into adulthood : games.</p><p><strong>Foreword.</strong></p><p>Got my first computer EVER on 1985. <strong>THAT’S A SHITLOAD OF TIME AGO</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*Da88RaJQAup1yCTf5zM5NQ.png" /><figcaption>Just look at this beauty.</figcaption></figure><p>Let’s recap historically.</p><p>Atari <strong>*was*</strong> the leading brand in home computing at that time, just because getting a real computer was worth a car. For realsies.</p><p>IBM PC was awfully expensive at that time, IBM was releasing the PC Jr. (someone smoke bad weed) and the first IBM PC clones started to appear worldwide. But not in this country!</p><p>All that because of something no-one cares about now : <strong>1982 was a shitty year for economic growth in Chile</strong>. Around 25% unemployment levels, growth was negative and chilean peso just crashed in flames. So it was kinda <strong>expensive</strong> to make this market interesting for the computing era. And to add insult to the injury, as I said before,<strong> Atari was the leading brand in home computing</strong> in 1985 in Chile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*nYbsP1goGWIWzq_KAIjDHw.png" /></figure><blockquote>Some years later I read that it was a bubble : Atari was stuck with Warner, bankruptcy and Jack Tramiel. He was the former Commodore founder and he is responsible, single handed, of the success of the MOS 6502, the brains of Atari home computers (XL, XE), Commodore and Nintendo. Whoa.</blockquote><p>There was (in chronologigal order, for the chilean market)the Atari 2600, Atari 400, Atari 800, Atari 600XL, Atari 800XL and Atari 130XE (that came later, around 1987 if memory serves me correctly).</p><p>Backwards compatibility? <strong>FUCK IT</strong>. 2600 cartridges were a thing from the past and did not work on later models.</p><p>Cartridges were <strong>fucking</strong> expensive.</p><p>And the games were…somewhat crappy, even for those times. There are youtube careers focusing on this point, tho.</p><blockquote>Of course, there were additional models of Atari branded computers, like the 5600 or the 7200. But never saw them on a store. Not even the fucking Jaguar.</blockquote><p>The main distributor for Chile was COELSA. They did an awesome job adding a cassette tape with your new Atari 800XL, so you need to buy an Atari Tape Player (Atari 1010), to get into it. You think that loading times were bad? Wait till you test the awesum’ Atari Disk Drive 1050.</p><p>So, you have a shitload of disks and tapes? Then get some games!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*eJ8j4HcFPlcy4-zD.jpg" /></figure><p>No internet? Sure. just go to a friend’s house, fire up any dual tape radio equipment and you’re in the zone. Speaking completely honest here, there were few copy protection measures implemented on disks or tapes. Of course stumbled into some in my teenage years. The ones I can recall:</p><ul><li><strong>Tape speed changes</strong> : some guys with lots of time hacked a XC-12 tape drive to receive data from the computer and allow to change the buffer speed. Normal tape drives did not work that way, payload was controlled by code but tape speed was fixed.</li><li><strong>Baud change on the payload</strong> : a fancy name for the “long beep”. A typical beep from the tape took some bytes. Let’s say 512. if you wanted to implement something like a loader screen or block counting code, you need to put shitloads of code before running the game. That shit could not fit on 512 bytes, even of they tried. But there were some fancy ones on the market, like Turbo Software tapes, that implemented a Pong-like 1-player/2-player game before the game loaded. But trying to copy the game using conventional methods (using the computer) failed. Using a dual tape recorded was needed.</li><li><strong>Bad/faulty sector on disks</strong>, the classic one. Loader goes into memory, asks the disk drive to go to a specific sector of the disk and reads it like 10 times. If it’s faulty, the value returned to the loader should be random. If it’s not, it was a fixed value. If it was fixed, the disk was pirated and boom game over. Usually filling with NOOP that code bypasses it.</li><li><strong>Disk serial number imprinted on the code</strong> of the first loading payload of a disk. Yeah, hardcoded!</li></ul><p>Whoa, we’re talking about DRM shit from the eighties!</p><blockquote>In case you’re interested, I am now doing some muscle work and trying to figure out how an Atari disk drive worked. Stay tuned.</blockquote><p>A light jump later, I had a PC. And some JPGs. Got a C compiler (Borland) and tinkered with a JPG to BMP library to display stuff on 256-color mode. Recalling what I did at that time blows my mind. Necessity is the mother of inventions. Keyword : Erika Eleniak.</p><p>Games. Yes.</p><p>Bought Doom. Did not run on my 386-SX computer. So I got a DX co-processor. It ran like shit but had tons of fun. UFO Enemy Unknown? I’m on it. Wolfenstein 3d? Hell yeah. Pinball dreams?! I WAS HOOKED ON THAT SHIT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*fWKaBsSMtzQFXDK6pCnY6g.png" /></figure><p>Of course got some additional games as gifts, but they were crappy or simply not worthy.</p><p>None of the games above had any copy protection method. At all. All sold on (most of them) unmarked Verbatim 3 1/2&quot; disks.</p><p>And then, <strong><em>one internet age later</em></strong>, I heard about<a href="https://en.wikipedia.org/wiki/Nicola_Salmoria"> this weird italian guy that wanted to run arcade games in your PC</a>. Wait, what?!</p><p><strong>Second foreword.</strong></p><p>Did you know that the selling point of those computers was the “arcade experience” but at home? Of course, an arcade machine was light years behind from a home computer, but ahead in terms of fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*dosN6c3giULsnhjU_Z0eig.png" /><figcaption>THIS.</figcaption></figure><p>Here’s the thing. If you wanted to play, let’s say Pacman, in your computer, here are the paths:</p><ul><li><strong>Code</strong> the absolute living hell out of it.</li><li><strong>Emulate</strong> all the binary code from the memory dumps from the arcade machine.</li><li><strong>Buy a Pacman arcade machine</strong> and forget about the computer.</li></ul><p>The last choice was the most attractive one, but…imagine yourself, being in your twenties, with no money and one of those machines cost the same as a home computer? For just one game?! Fuck it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*jnrSAHJyR__2MCD9.jpg" /></figure><p>First one is _THE_ definitive answer if you want to do everything DIY. But not everyone is skilled enough to code. So, if you have some time, just grab some beer and start coding! BTW I made my own tetris game. That shit is on Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*QXn_44OXShENTLoL.jpg" /><figcaption>Finest port ever.</figcaption></figure><p>Well, the second one is the interesting part. You need to code something that interprets binary code from the memory dumps of the arcade machine, write some equivalent code, make it somewhat compatible, understand what goes in and out, fiddle with memory management issues, use a native library to draw shit on a screen, understand portion of dead end code that go nowhere (trap falls or trap doors, piracy, you know?) and finally manage all that shit that the arcade machine does, like sound, timing, graphics and read the damn stick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yUyKOMrGVW-sEICH.JPG" /><figcaption>This. But on code.</figcaption></figure><p>Did I say one italian guy began all this? Nicolia Salmoria started <strong>MAME</strong>. Can’t tell if he was trolling everyone (if you ask me, it’s a clever trolling move) or he just wanted to play Pacman on his computer.</p><p>One internet age later, ROM dumps were all over the internets.</p><p>But before going on, that was THE real arcade experience at home. <em>With some caveats…</em></p><p><strong>Intellectual property.</strong></p><p>You did something for a company. That company holds what’s being done.</p><blockquote>ROMs? Yup. <br>Board design? Yup.<br>Even the fucking design of a leaflet.</blockquote><p>Companies hold the pan by the handle, everytime. <strong>MAME</strong> just bypassed a particular detail. MAME brough a middle man, almost without legal issues, that allows the player to use <strong>a copyrighted ROM <em>for personal use</em></strong>. This precedent was used when Bleem! got sued. The emulator used only original games (but was cracked afterwards), allowed to run games on PC!</p><blockquote>For you fucking millenial : <a href="https://en.wikipedia.org/wiki/Bleem!">Bleem!</a> was an emulator PS1 games. That was mind boggling on the 2000s! Fucking Grand Turismo on PC!!!<strong> METAL GEAR FUCKING SOLID, DUDE!</strong> Unfortunately, Sony was on the call and sued them. The reason : unfair competition. Lawsuit was so fucking vicious that Bleem’s whole budget was spent on the trial. Bleem won, but failed to make a profit after all this fuckery and closed after a year. Bummer.</blockquote><p>Code belongs to the ones that produced it. Kinda fair game.</p><p>But. An arcade machine is too expensive. Cumbersome to repair. CRTs are on the fall. Are you lectured on electronics?</p><p>Not everyone is tapping dat ass. But there are some unsung heroes, like Chile Arcade and Retroware. Weird ass fucking hackers that have made Atari their personal byatch. Met some of them and they are mad scientist material, for real.</p><p><strong>Hats off to you, guys.</strong></p><p><strong>Last foreword.</strong></p><p><strong>Legacy</strong>. A cool word that links “old shit” and “shit from the past”. Things going electronically are cheap as fuck. Just an example : how much a Gigabyte on Amazon does cost? NOTHING. What’s the cost of a Gigabyte on a real hard drive? Pennies. One 4GB thumb drive can hold the entire Atari collection and then some.</p><p>That <strong>is</strong> preservation of history. Kinda like Wikipedia, but with games.</p><p>But people always find the way to twist shit and make things uncomfortable for everyone else.</p><p>Just in case. Have you noticed a pattern on this writing here? Here it is : we are technologically bounded on physical media. That give us a sense of ownership, even if we did not produce it. But that “thing” is perennial. It can go bursting in flames someday and there will be no force on Earth to stop it.</p><p>I enjoyed arcade games. Spent thousands on them. I loved Atari games, even if they were crappy. Hell, I have some 2600 cartridges stored just in case they become collector items!</p><p>Today, <strong>Emuparadise announced they will close their doors</strong>.</p><p>If you had any sympathy with old games, old hardware and old systems, you’ll feel disappointed.</p><p><strong>Things will get lost on time</strong>. The original arcade design for <strong>Pacman</strong>? Pfft, gone. At this time, there are no original Pacman machines with all the original boards. In 15 years, <strong>no arcade machine will be deemed as “original”</strong>, not even from the manufacturer. 3d printing has done an awesome job restoring pinball machines, but like Theseus’s paradox : is it the same machine? This makes me nostalgic of the good ole times, the ones when men were men and wrote their own operating system. But the future is bleak.</p><p>Distributing a ROM, technically, is piracy. It’s not your work. Original copyright holders can act in the full extent of the law to enforce their copyright. And it’s fair game. Even for me. Thing is, Namco has gone so many iterations (it’s called Bandai Namco now?!) that their entire arcade division must be just one inflatable doll sitting on a desk in an empty building.</p><p>Old game companies do not care. One of the few that care is Sega. For fuck’s sake, SEGA?!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGpzH0WJ52kc&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGpzH0WJ52kc&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FGpzH0WJ52kc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1640c3b6d32840d2eb2594a1b7eaa54c/href">https://medium.com/media/1640c3b6d32840d2eb2594a1b7eaa54c/href</a></iframe><p>Just check <a href="https://nerdist.com/50-classic-sega-genesis-games-ps4-x-box-one/">this</a>. For the love of games, do it. It’s a complete pack of games (around 50?) for PS4 with even online multiplayer. That’s the way you should say <em>“I care about my intellectual property. I hold it, I can do whatever I want with it. But instead of shitting all over you, I decided to hire a team of wonderful and skilled people to bring those games that will go straight into your feels”.</em></p><p>My heart is kinda divided. I’m down with copyright, but I’m also down with insurgency. But the law always get in the middle and it’s the useful tool to enforce stuff. The leverage we need, not the one we want.</p><p><strong>Emuparadise</strong>, drinks are on me tonight. Sleep tight, guys.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927d979117d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Music fingerprinting by pretending you know what you’re doing]]></title>
            <link>https://medium.com/@jci/music-fingerprinting-by-pretending-you-know-what-youre-doing-9f0557cfa583?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f0557cfa583</guid>
            <category><![CDATA[echoprint]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[fingerprint]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 07:37:09 GMT</pubDate>
            <atom:updated>2018-07-04T06:15:28.736Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Update : I’ll be doing the same exercise with some open source alternatives. More to come…</blockquote><p>TL;DR : audio identification sometimes works, sometimes it does not.</p><blockquote><em>It’s been a month of lack of sleep, beer, winter-y cold days, rain and killing two ESP-12F because I’m an idiot.</em></blockquote><p>At my parents’ house, there’s a <strong>Bosca</strong> fireplace, keeping the house warm and fuzzy. You need some dry wood for that! (free advice). During some idle afternoons, VH-1 has some segments (videograms?) that run old 70s-80s-90s video clips lasting for an hour or two. My dad is <em>reluctant</em> to watch those.</p><blockquote>Just for the record : that dude just hears classical music to chill out for hours. Mom falls sleep the first 15 minutes and I can withstand it for two hours. And it’s not the fucking Mozart effect [ read : does not exist ]. His Tune-in favorite stations are the Classical Music genre and <a href="http://www.beethovenfm.cl/">Beethoven Radio in Chile</a>.</blockquote><p>70s-80s-90s were part of my childhood and pre-adulthood. Yeah, I’ve said before I’m old. Just to make things straight, I was born the same month that AC/DC’s “T.N.T.” album was released. Aaand he watches all the video clips from that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*NvrWWSQd0e0C4M7rlvD9fw.png" /></figure><p>I started to bet my dad that I can identify any song, band and possibly the release year without getting on the internet, blindfolded. Using any online service (Shazam, again), the percentage was 98%, just missing because the background noise was too high.</p><p>Hmm. Is there anything “intelligent” that does it?.</p><p>My <strong>first</strong> question to myself was “<strong>how can we (humans) identify songs?</strong>”.</p><p><strong>First</strong>, humans are <strong><em>pattern recognition machines</em></strong>. Some studies suggest it helped understanding the difference between two particular events, that could be somehow connected but the correlation between them is not clear. There are some really good reading material for the curious mind, so here it is:</p><ul><li><a href="https://medium.com/@kevin_ashton/how-experts-think-91b443104b92">How experts think?</a></li><li><a href="https://www.amazon.com/New-Kind-Science-Stephen-Wolfram/dp/1579550088%3FSubscriptionId%3D0G81C5DAZ03ZR9WH9X82%26tag%3Dzemanta-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1579550088">A New Kind Of Science, by Stephen Wolfram</a></li><li><a href="https://arrow.dit.ie/cgi/viewcontent.cgi?article=1009&amp;context=fema">Human Patter Recognition in Data Sonification (paper)</a></li></ul><p><strong>Second</strong> : we can understand <strong>spoken words</strong> in songs.</p><p>There are roughly 6200 languages around the globe, chinese being predominant because of numbers (1.2 billion). Second is…spanish? (could not find another reaffirming data). Source is <a href="https://www.infoplease.com/arts-entertainment/writing-and-language/most-widely-spoken-languages-world">here</a>.</p><p>Songs work even if we cannot understand what’s being said. We need to <a href="https://www.youtube.com/watch?v=bwnksI2ZoJI">speak it back</a> to learn it. It’s the “feedback learning process”. It can be skipped safely for this example. Think “despacito” in <a href="https://www.youtube.com/watch?v=XihEj0OVBuA">youtube</a> for that, if you need some examples. It’s short for “if we hear it, we can say it…most of the time”.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMlW7T0SUH0E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMlW7T0SUH0E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMlW7T0SUH0E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d25e2397b42b9ceb12fce4f90904549/href">https://medium.com/media/7d25e2397b42b9ceb12fce4f90904549/href</a></iframe><p><strong>Third</strong> : we can <em>understand rhythm</em> and extrapolate what can happen with the current data we have. Here are some <strong>catchy</strong> examples, some taken from <a href="https://www.youtube.com/watch?v=CcqUv3mBK3o">this video</a>:</p><ul><li><a href="https://www.youtube.com/watch?v=bESGLojNYSo">“Poker Face”</a> by Lady Gaga.</li><li>“All About That Bass” by Meghan Trainor.</li><li><a href="https://www.youtube.com/watch?v=KCkmIyC6v00">“Tubthumping”</a> by Chumbawamba. (hey, this song appeared on one FIFA game!)</li><li>“Blue” by Eiffel 65.</li><li><a href="https://www.youtube.com/watch?v=xat1GVnl8-k">“Bad Touch”</a> by Bloodhound Gang.</li><li>Whatever that got into radio produced by Vengaboys. It’s no joke.</li><li><a href="https://www.youtube.com/watch?v=_JphDdGV2TU">“Baby Got Back”</a> by Sir Mix-a-Lot.</li></ul><blockquote>I cannot deny that the last song is awesome and cannot lie about it. <strong><em>And Uh, double Uh, Uh-Uh.</em></strong></blockquote><p>All previous songs have the same element : <strong>predictability</strong>. A pattern will appear, we may or may not identify it. And then, the cycle gets repeated. We get used to the next pattern that will show again and again. <strong>BTW : </strong><a href="https://www.youtube.com/watch?v=eOAUkCX93WA"><strong>that’s how pop music works</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*7JWK9-R9HhjqgOeiC5XFtQ.png" /><figcaption>Just ask the experts.</figcaption></figure><p>The <strong>original</strong> question still remains : <em>can a machine identify songs then? </em>The answer is <strong><em>“yes, but with a catch”</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*Cd3mck5C1Pj9XHMWNhegjQ.jpeg" /><figcaption>And they said that nothing can be accomplished with a little BAC in the blood. By the way, that’s a cheapo portable BAC detector using Arduino.</figcaption></figure><p>Starting with “how can a computer hear”, <a href="https://www.idmt.fraunhofer.de/en/Press_and_Media/insight_into_our_research/insight_computer_hearing.html">this</a> is the first Gorgle result.</p><p>Audio is digitally converted from analog sources. You have a wave, it resonates into “something” (microphone), this creates an electromagnetic pulse and can be read with a analog-to-digital converter. Layman terms for a sound card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*ylt2R-vjmzS-6n1y88-RlA.png" /><figcaption>Source : <a href="https://www.ictlounge.com/html/analogue_and_digital_data.htm">https://www.ictlounge.com/html/analogue_and_digital_data.htm</a></figcaption></figure><p>Data is then stored in binary form that can be processed later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*PM6-J1-7rXGlnBO8iIh5Iw.png" /></figure><p>First, the waveform. It’s a time domain display, a display of amplitude vs time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*S3_lWxdGo3zaDJwF0qdVkQ.png" /></figure><p>A spectrogram is a visual representation of sound intensity as it varies through time.</p><p>As far as I can recall, “viewing” for a computer is way way more easier than “listening”.</p><p>To achieve detection, we need first to create how music will be stored. That’s done creating a hash of a song. Get ready, this is getting into JSON domains…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*Zmb03Q9u0UeEcD-54c8xIg.png" /><figcaption>Wow. Long hash.</figcaption></figure><p>The segment “code” is the way that the song is stored. For that, the song is encoded into a string. For that, it uses <strong>Ffmpeg</strong> (whattha?!) and encodes the result into a <em>base64</em> string. You need to store that somewhere.</p><p>Once the information is stored can be searched freely. How? Using the same method : create a hash of a sample, use it as a sample and search it using fuzzy logic. Search results should spit some score of confidence. And boom. There you have it.</p><p>There’s also a <em>silver lining here</em>. The identification process should be prone to background noise or any other disruptive elements (let’s call it “trickery”). Also, it should be as unique as possible (which it’s almost a silver bullet, but does not work. More on that later).</p><p>Process is a three-step method : code generation (hashing the song), ingestion (feeding a process with the resulting data to be stored) and lookup (search and score result).</p><p>For this demonstration, I’ll use Echoprint. Developed originally by Echo Nest, now part of Spotify.</p><h3>Feeding the beast</h3><p>First, we need to gather some curated music. Oh, we have some…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*YkrhBx2ZpG4hoi69c8Pbfg.png" /><figcaption>If you can potentially see where I am heading with this, feel free to contact me.</figcaption></figure><p>Clone the <a href="https://github.com/spotify/echoprint-server">echoprint server</a> and <a href="https://github.com/spotify/echoprint-codegen/">echoprint codegen</a> repos for great justice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*N4YdC2kdtEEGj24JSl9qZQ.png" /></figure><p>Build that stuff, install it somewhere safe (/usr/local should not be a cesspool of worms at this time…) and make sure that the Python libraries are actually working. Read the documentation for each project before! (Don’t forget the setup.py process)</p><p>Now, with a little non sequitur magic from the command line:</p><p>jci@/media/somewhere:$ find /media/MP3/N/ -name “*.mp3” | echoprint-codegen -s &gt; fingerprint.json</p><p>File fingerprint.json should contain the hashes of the files.</p><p>Now, the fun part. Taking stuff out and creating another database file with <strong><em>ONLY</em></strong> the hashes.</p><p>jci@/media/somewhere:$ cat fingerprint.json | jq -r ‘.[].code’ | egrep -v null$ &gt; database_audio.fingerprint</p><p>Feed the binary search index with:</p><p>jci@/media/somewhere:$ cat database_audio.fingerprint | echoprint-inverted-index index.bin</p><p>And run it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*9vTNk2rQZiShxl-k7D1Erw.png" /><figcaption>Don’t mind the tornado errors.</figcaption></figure><p>This “echoprint-rest-service” works as a REST service (mega DUH!). It can be queried via curl on the following URLS:</p><ul><li>/query/jaccard</li><li>/query/set_int</li><li>/query/set_int_norm_length_first</li></ul><p>The <strong>only one</strong> with consistent data for me is the first one : <a href="https://en.wikipedia.org/wiki/Jaccard_index">Jaccard</a>. It uses a matching index value, uses statistics and tries to compute the distance of the set and the matching results.</p><p>As the service is running, I cannot use the same source files for identification. Let’s use some source, like a movie with licensed music from the same artist…</p><p>…well, whaddayaknow?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*blbQtq42Q76SX-Ji.jpg" /><figcaption>What a coinkidink.</figcaption></figure><p>Using a sample from the movie, then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PJSUPwZc5PTyoxg8uPesA.png" /></figure><p>And creating the hash for this sample:</p><p>jci@/tmp:$ echoprint-codegen sample.mp3 | jq -r ‘.[0].code’ &gt; search.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*HPGqWaKo3XVAVzCqUVk-QA.png" /></figure><p>And the identification should be working now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*EQlNgj7i6BkFfkdGqiDjXQ.png" /></figure><p>Now comes the boring part.</p><p>We need to find the indexes with the higher scores. Index 35 should be line 37 of our JSON file. Well, <em>told ya before</em>.</p><p>We have a dummy line “[“ to write the beginning of the whole JSON payload and the line numbers should start in line zero. So index 35 is line 37. Basic nerd math.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*v_gZJD5VEie1FGbVVtNOCA.png" /><figcaption>First result. Bullseye!</figcaption></figure><p>Using set_int method gives a relatively closer number…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*lM1wlLOfNgwyBBcGWpJODA.png" /><figcaption>I used some examples while I was drunk. So forgive the similarity payload. I was not reading the documentation properly.</figcaption></figure><p>The first one was the closest one. Let’s go for the second result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*baGTWu66bmHeBO6O54PuXQ.png" /></figure><p><strong>It works!</strong></p><p>Let’s vandalize the sample, just for fun.</p><p>Opened it with Audacity, changed the sampling rate and added some noise to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*xRXcTGJ4avdzP_P7fb80TA.png" /></figure><p>Mono, 8k, with some distortion and artifacts from the resampling. What could go wrong?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*LQwBsTGSZGGn5tfeA3Gg5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*NEfkEQ1CIPm2L5PRiehUxw.png" /></figure><p>Score dropped from 205 to 120. But still, still inside the soft spot of the two results.</p><p>Let’s do the same with another sample of the movie. This time, with more background noise. And a completely different performer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*YNFeTEEOxmHoFNNV" /><figcaption>Just in case.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*lZprre8InGBwHXM0axOa1g.png" /></figure><p>And we get different results. This is what I said before was “trickery”.</p><p>So, let’s increase the sample size. It was originally 19 seconds. This one is 40 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*cbLcolPxlGuv2xBCZtYpMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*XWDdmPDa03P2C_sAcKFZ3A.png" /></figure><p>A completely different result. And it was not because of the background noise, not because the sample rate (unmodified from the movie) and not because the audio processing process. It was only due to the change of performer. Voice is similar, but <em>“something is still out of sight”</em> for echoprint. And the <strong>sample size</strong> changed(19 seconds versus 40 seconds).</p><p>So there you have it.</p><p>There are some interesting points that I’d like to cover before finishing.</p><ul><li>Spotify (what a guess) owns the code now. “Surprisingly” there’s no code addition since 2016, or even before. I wonder why…</li><li>Python echoprint library lacks a hell lot of care. Had to actually add some trap code (not exceptions) because a large library or a segfault can make echoprint-codegen run out of memory and spit a “null” every once in a while. Of course adding some “egreps” on the feeding CLI magic solves it, but <strong>COME ON! It’s 1996 all over again?!</strong></li><li>Indexing has his share of problems as well. After indexing 2444 songs (no joke), it crashes in flames. Tried it all : creating the fingerprinting somewhere else (another computer) and then reindexing (did not work). Rebooting between usages (nope). Gave up eventually but before setting my computer on fire I decided to run the usual profiling stuff. That also gave me another reason to burn the computer once and for all.</li><li>I haven’t run any other conclusive test with the sample size with Shazam or other ID service. These tests failed with 19 seconds, but 40 seconds (let’s say 30 second sample size as average) seems to be hitting the detection sweet spot. And 30 seconds it’s a lot for a 4:30 song…</li></ul><p>Seems the burnout is real. Yuk.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f0557cfa583" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2018 officially sucks, but on a brighter note…]]></title>
            <link>https://medium.com/@jci/2018-officially-sucks-but-on-a-brighter-note-87afdb9c78dc?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/87afdb9c78dc</guid>
            <category><![CDATA[unemployment]]></category>
            <category><![CDATA[boredom]]></category>
            <category><![CDATA[electribe]]></category>
            <category><![CDATA[korg]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Thu, 31 May 2018 04:24:19 GMT</pubDate>
            <atom:updated>2018-05-31T04:24:19.945Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been two months since I’ve been <em>“enjoying”</em> the benefits of unemployment. For once, I can say <strong>“this has been all my fault”</strong>. That’s why I declared myself <em>a professional idiot</em>. But, hey, people can be stupid if they want to. In the future there are plans to replace some behavior from my side, but not this time, tho.</p><p>So.</p><p>I was back into my horrible sleep cycle (from years ago) from <em>“can’t tell how many hours to sleep”</em> to <em>“when or how to wake up”</em>.</p><p>I’ve seen my plans get <strong>smashed</strong> in front of me but, at the same time, seeing opportunities elsewhere. But as I mentioned, <strong>I am an idiot</strong>. No need to argue. You can figure out the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*barhswWGVahNXFOvwIbZUQ.png" /><figcaption>Hello Darkness, My old friend. One year later and you survived.</figcaption></figure><blockquote>Emphasis on the idiot side of myself.</blockquote><p>One thing I can confess here. I have been absolutely <strong>bored as fuck</strong>. Not bored as <em>“I have absolutely nothing to do”</em>. Bored as in <em>“why should I do this?”</em>. Some questionings about my career and thinking that computing, IT and some other things that have kept me with a job <strong><em>just don’t fucking matter</em></strong>. At all.</p><p>Hard drive is making funny noises and refusing to work? <strong>Pffft</strong>. Computer getting slowed down just because?. <strong>Meh</strong>. CTRL-C + CTRL-V in GNOME not working at all? <strong>Reinstall that shit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aOgtx7iX09jV-8xNgSW7w.png" /><figcaption>Typical sandwich with a pinch of failure.</figcaption></figure><p>But then, I decided to take a time-out.</p><p>Went to the coast side for a while. Only boring part was I had no internal power at all to do anything. Not even getting out of bed. Still, I needed that.</p><p>Went back to Santiago and tried to decide what to do with my life, as everything was feeding boredom. Aaand, as Jon Snow never figured out, winter is coming. I fucking hate winter. All my own delayed projects were sent to the <strong><em>“whenever I have time”</em></strong> folder.</p><p>My old pal Fernando has helped on the reversal process : trying to get me on my feet and try again. Not for the <strong>lulz</strong>, but to get me on mah feet again. Just for the sake of doing stuff again. Whatever the concept of <em>“stuff”</em> meant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAbPro-H8XqVnGoBXWtIUA.png" /></figure><p>Suddenly, something magical happened. I was <em>actually</em> concerned about the things that weren’t working at home. I thought <em>“what the hell”</em>.</p><p>Hard drive failing? I realized that it was the <a href="https://www.backblaze.com/blog/3tb-hard-drive-failure/">infamous 3 TB drive</a> that plagued <strong>everywhere</strong> and was installed on the same external drive I was using. But the error ratio was rather low. Managed to run a couple of <em>smartctl</em> tests with no physical damage. Copied everything (about 1.5Tb) elsewhere, format the hard drive, cleaned the circuits (both internal and the caddie) and finally checked the power supply. Found out the PS was <strong>faulty</strong>.</p><p><strong>Quick fix:</strong> soldering gun, breaking the PS, not buying a new one and recycling another from another external disk. Veredict : <strong>SUCCESS</strong>.</p><blockquote>Feels good, man.</blockquote><p>Now, a blast from the past.</p><p>Some years ago (2007? 2009?) I was in a bus in the south side of Santiago (Vicu~a Mackenna) going back home. Suddenly, I saw thru the window an outlet for musical instruments. I thought “what the hell” and went there.</p><p>And I bought this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*eITBoimzS4soo55TqUBEUw.png" /><figcaption>Same model.</figcaption></figure><p>When checking it, the salesman said that the equipment was faulty and was categorized as “second hand”, which means <strong>NO WARRANTY</strong>. Took me a while after tinkering with it and problems whatsoever. So, I took the credit card and paid for it.</p><p>R U ready for this?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joXs3QRP5Opj_9aPFYSCTA.png" /><figcaption>HOLY SHIT IT WAS EXPENSIVE! :(</figcaption></figure><p>Went back home. Played with it a couple of hours. User’s manual was cryptic.</p><p>But for the correct operation of the device I needed some “external storage”. That’s to upload samples, record songs, dump samples and so on.</p><p>And at that precise time I started the weirdest goose chase in Santiago. I am talking about this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*9BuK5_cvxePtC0zAO60Mvw.png" /></figure><p>That’s a type of card last time I saw being used on a proper device was <strong>2001</strong>!</p><p>Some old shitty storage with almost no support (at that time), made for a <strong>selected</strong> [sic] group of devices (<em>Fuji and Olympus</em>). <strong><em>SD was considered an industry standard, cameras with Compact Flash were still in the market and cellphones with SD/MSD started to get popular</em></strong>.</p><p>And no place in Santiago had these <strong>abominations</strong>. Yikes.</p><p>What the hell. <strong>Amazon</strong> to the rescue.</p><p>US $100 later, bought a couple of 64Mb XD cards, a 128Mb SMC card, one XD-SMC adapter and one USB XD-SMC adapter. And I was ready to play with my latest toy to record some songs and do some stu…..</p><p><strong>Er.7. on the display.</strong></p><p>The fuck?!</p><p>Tried without any luck to make the damn thing to format any of the cards I bought. It was total failure, <strong>with a pinch of disappointment</strong>. After a while just got bored, put the Electribe away and stored the memory cards somewhere safe.</p><p><strong>Until today.</strong></p><p>Long story short.</p><p>This has been the most complicated piece of hardware I have. It requires a <strong>long reading</strong> of the manual just to make it properly work. Making a song? A lot more. Uploading samples? Not even a possibility. Card reader does not work at all becau…</p><blockquote>I thought <em>“what the hell”</em>.</blockquote><p>Wanted to use it to make some songs. Learn with some tutorials. Got it. But the memory card issue…</p><p>Let’s tear this shit apart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaROpq-axe-Ox_6_HOTWWw.png" /><figcaption>The culprit in the front seat.</figcaption></figure><p>Took me a while to take the card reader out and test a couple of times.</p><p><em>Still nothing. Er. 7 again.</em></p><p>Then the <em>“mechatronics engineer”</em> kicked in. He suggested:</p><blockquote><strong>“why don’t you measure continuity, just in case?”</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjyBEa2U2ZwJ9vMAdKeYqA.png" /><figcaption>Tools of the trade</figcaption></figure><p>The culprit could be <strong>the SMC connector and the board in the Electribe</strong>. I used <strong>Contact Cleaner</strong> (not pictured here) just in case. Nope. Nothing.</p><p>So… I measured continuity. And oh boy, the SMC reader did not get any reading to send to the board. Could be …</p><blockquote>Here are my thoughts : someone took this thing apart because reasons and got to the same stage I was. As he assembled everything back again, the SMC reader never worked again. So, he reassembled it, went back to the store with a memory card, showing it did not work and asked for a refund.</blockquote><blockquote>That’s my theory.</blockquote><p>Ribbon cable was installed <strong><em>backwards</em></strong>. Putting everything back together correctly, using one memory card and…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXg17jhulLrjEgnSw0HGYg.png" /><figcaption>HELL FUCKING YEAH.</figcaption></figure><p>This was not showing before.</p><p>Assemble it back!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1VW-6D93K63dJ6KQ3qiBA.png" /><figcaption>Saving songs works now!</figcaption></figure><p>Veredict : <strong>SUCCESS</strong>.</p><p>I had to call Fernando to tell him about the (very annoying) good news.</p><p>What a ride.</p><p><strong>My suggestions?</strong></p><ul><li>Get yourself some proper tools</li><li>Get yourself some contact cleaner. Not WD-40.</li><li>Get yourself some support people that can help you get on track</li></ul><p>I don’t think that I’m prepared <strong>now</strong> to go back to be a functioning member of society. But, after everything that has happened last month, my only thought is <em>“what the hell”</em>. I just have to try.</p><p>Oh, just for the curious.</p><ul><li>Computer slowed down? I had a virtual machine running that I forgot and was downloading updates. Yikes. And docker was also running with some containers.</li><li>CTRL-C issue? That’s the most stupid issue. TigerVNC steals the focus/clipboard to pass it to the other side. Once exiting it, everything worked again.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87afdb9c78dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sorry to interrupt, but…your wrong]]></title>
            <link>https://medium.com/@jci/sorry-to-interrupt-but-your-wrong-531ad1341453?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/531ad1341453</guid>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Thu, 29 Mar 2018 01:48:46 GMT</pubDate>
            <atom:updated>2018-03-29T02:06:51.091Z</atom:updated>
            <content:encoded><![CDATA[<p>(Se que lo de arriba esta escrito mal. Sorry for english speakers that follow this space on teh internets, but I need to get this outta my chest).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*hAFsNB2SDaV_4LO20q9VXw.jpeg" /><figcaption>Take it from a self-certified keymaker.</figcaption></figure><p>Acabo de leer algo que me causo cierto nivel de poco agrado…</p><p>El link por aca.</p><p><a href="https://medium.com/mejorindustriati/por-qu%C3%A9-regalar-tu-c%C3%B3digo-es-una-buena-idea-6f0ca7f8cd49">Por qué regalar tu código es una buena idea</a></p><p>Partamos por una cosa basica que es codigo.</p><p>Crear “algo” por crearlo, solo tiene sentido para el que lo crea. Crear “algo” por querer resolver un problema propio solo tiene sentido para el que lo crea. Resolver un problema con codigo que le puede servir a otros <strong>es la harina de un costal muy muy distinto.</strong></p><p>Le tenemos open source, le tenemos codigo con GPL y hasta le tenimos codigo con licencia BSD. No voy a ponerme a hablar de licencias por que el papel es corto y mi capacidad de retencion de datos a esta hora es corta.</p><p>Pero todos los que partimos en informatica lo hicimos con un proposito y con alguna herramienta. Unos aprendieron Windows usando Regedit. Otros lo hicieron con cosas tan rancias como GNOME 1.X o bien con software legacy (here!).</p><p>Define lo que aprendimos con la herramienta. O bien, <em>“si aprendemos a ser martillos, todos nuestros problemas se van a convertir en clavos”</em>.</p><p>Compartir ese conocimiento es otro cuento. Aqui es donde <em>le dentra</em> el <strong>Open Source </strong><em>(de aqui en adelante codigo GPL, BSD o cualquiera con licencias no restrictivas)</em>. Lo que cambia son las motivaciones.</p><p>Sin alargarme con estupideces y con respecto al post,…</p><blockquote><strong>1.- La vergüenza te empuja.</strong></blockquote><p>La verguenza no es un motor. Nunca lo ha sido para mi. Si fuera asi, habria desempe~ado mis roles de una forma donde involucre la minima cantidad de ropa posible. Pero no es asi.</p><blockquote><strong>2. Mejora tu karma.</strong></blockquote><p>Debatible.</p><blockquote><strong>3. Recibes ayuda.</strong></blockquote><p>Absolutamente debatible. Y aqui le dentramos nuevamente al open source. Hay miles de proyectos donde la cantidad de amor tiende al limite 0. No es por que lances un proyecto open source es que termine siendo la palabra en boca en los desarrolladores. Es un punto crucial donde el factor fundamen…</p><blockquote><strong>4. Te obligas a documentar y encapsular.</strong></blockquote><p>No! No es un punto crucial donde el factor fundamental del proyecto es algo netamen…</p><blockquote><strong>5. No pierdes nada</strong></blockquote><p>Por la cresta! No es ese el punto! El punto es que si quieres que tu proyecto sea realmente usable es que entiendas que las necesida…</p><blockquote><strong>6. Se te acaba la sensación de culpa</strong></blockquote><p>Me doy.</p><p>Muchos tienden a confundir sacrificio con exito (les doy un ejemplito? un presidente actual de los Yunaited Esteits confunde estos terminos!)…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9_8dSiQBXog%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9_8dSiQBXog&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9_8dSiQBXog%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c27c53ff6e0bcd8faabcc5cfb569c3d2/href">https://medium.com/media/c27c53ff6e0bcd8faabcc5cfb569c3d2/href</a></iframe><p>Si quieren hablar de consecuencias por hacer algo Open Source, entiendan que las consecuencias no son imaginables, no son controlables, no son lo que realmente querian y peor aun, pueden traer consecuencias que no esperaban.</p><p>El amiguito del post hablo de <em>razones</em>. Yo digo que lo que dijo son <em>consecuencias</em>.</p><p>Son cosas que son sintacticamente debatibles. Por algo mis papas me hicieron leerme hasta el cansancio el <em>Sopena</em> de <strong>sinonimos y antonimos</strong>.</p><p>Para mi, <strong>son dos verbos distintos.</strong></p><p>Hablamos de dos cosas al mismo tiempo.</p><p>Si quieres lanzar una cosa open source, hazlo y ya. Si alguien contribuye, es por que le fue util. Ninguna de las consecuencias de arriba (y no motivaciones) pasan y ya. No hay que ser un mechatronic engineer para eso.</p><p><em>Sopena</em>, mijitos. <em>Sopena</em>.</p><p>Sinonimos y antonimos.</p><p>Ahora, si me vienen a huevear los pollos por los acentos, estoy en Linux con un teclado en ingles donde el dia que me chupe un huevo xinput le pongo la conversion a espa~ol. Si, la E~e es con el tilde.</p><p>Now, back with the usual schedule of security and shit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=531ad1341453" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Count all your blessings and add some water.]]></title>
            <link>https://medium.com/@jci/count-all-your-blessings-and-add-some-water-e8eb91527e74?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8eb91527e74</guid>
            <category><![CDATA[make]]></category>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Tue, 19 Sep 2017 01:08:37 GMT</pubDate>
            <atom:updated>2017-09-19T01:08:37.326Z</atom:updated>
            <content:encoded><![CDATA[<p>Remember some time ago that I was working with Arduino?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*B3r8xs08K6_nqyZ_bA6Uxw.png" /><figcaption>Me, every time I fire the Arduino IDE and code some crap.</figcaption></figure><p>Well, it got someway out of hand.</p><p>Exhibit A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhYXZghRvIWn4q_SfKkifA.jpeg" /><figcaption>Get a notepad and some free time and design a circuit. And doodle.</figcaption></figure><p>Well, some context to the story.</p><p>I bought a second hand LED display that should be “programmable”. Via a Windows software with broken translation. Read the “online manual” and figure out that I need to save the files on a USB drive and put them on the side of the board.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5pQx7pgEiVmb4s6zWhMvw.jpeg" /><figcaption>This one.</figcaption></figure><p>Heavily undocumented and, of course, no reference on how the hell does it work.</p><p>So, twenty beers later and some fiddling on the internet, found out this was a all-in-one LED board coordinator that prints some message that are stored on its internal memory. You can add GIFs, it has an RTC (Real-time clock) to display the current time (duh) and some other fancy stuff. But no other way to program it than putting a USB drive and power the thing on.</p><p>Oh, and it uses a female USB port. So connecting it to a computer would be completely useless.</p><p>So, let’s do something about it.</p><p>Find the LED matrix manual online, check.<br>Find the pinout of the connector, check.<br>Build a circuit and connect it to an Arduino.</p><p>Check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l7Uwi3yiXHH4esAZ0v8ddA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-k3ZJCpNZntYbYF_w_CgAg.jpeg" /><figcaption>Finished product.</figcaption></figure><p>And waddayaknow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56O3v_CjJocS3Ghy98N8BQ.jpeg" /><figcaption>The arduino is on the right.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*3IT_b1YqVecShH5AaK36pQ.jpeg" /><figcaption>Here’s the culprit.</figcaption></figure><p>After my father went into surgery about two weeks ago (which I will discuss some other time), I’ve been going to my systers’ regularly. I dropped there my box with tools and Arduino stuff.</p><p>Add some afternoons listening to classical music on a big soundboard, I was focused enough to connect these things together. And, man. It’s too fun to stop and focus on something else.</p><p>But. I. managed. to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*EvivtI6CLf5dQiFuq-XkPg.jpeg" /><figcaption>Privacy is first!</figcaption></figure><p>You may think that this is pretty stupid (even better if you know about Arduino). Get this : months ago, this was voodoo to me.</p><p>On that picture, I am uploading code not to the Arduino, but to a <strong>ESP8266 module</strong> that will run that code.</p><p>Arduino only works as a serial backpack!</p><p>(Took me a while to find out you need to put GPIO0 to GND when booting to set it into programming mode)</p><p>So, to be clear on everything : lately my brain has gone into hyperdrive mode. I’m planning to do some works on my apartment. Can be completed without buying some additional stuff (<em>yeah, right!</em>) but I am on it.</p><p>But I am having a lot of questions right now.</p><p>Starting with…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JlKTsMeYu_J_VLI_0ssbg.jpeg" /><figcaption>Nightmare fuel, part one.</figcaption></figure><p>Why the fuck I have an Elmo?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8eb91527e74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you trying to use a silver bullet this time? (Part one)]]></title>
            <link>https://medium.com/@jci/are-you-trying-to-use-a-silver-bullet-this-time-part-one-fb8beb7e76d8?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb8beb7e76d8</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Sat, 03 Jun 2017 05:40:56 GMT</pubDate>
            <atom:updated>2017-06-03T05:40:56.536Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m writing this at my parent’s house. Watching “The Interview”. Sipping a cold one. After working in the afternoon making some changes in my folks’ bathroom (Will talk about this some other day). Just finished tidying up a box full of arduino-raspies-sensors-cabling-lotsofcrap and listening to a political live stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dQ7jAAUWmtQZepZQm9tk1w.png" /><figcaption>Exhibit A</figcaption></figure><p>Enough of electronics. Let’s focus onto what brought us here tonight : high availability.</p><p>This should be the first of (four?) many articles regarding high availability serving web applications. It’s coming near home : due to NDAs involved, cannot talk the what, the who, the when, the why or the whatever. But I promise to be as specific as possible regarding web applications, programs used, configurations that can be shared and my own personal story.</p><p>Here we go.</p><p>In my defense, here’s a motto I always use : “this should not be a silver bullet”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*xARMFLHfcZRidPkJ.jpg" /><figcaption>I’ll be crapping myself waking up to this image.</figcaption></figure><p>A silver bullet is a concept mainly used as “the kitchen sink and then some”. For non initiated with this lingo, what I’m saying is “this is not Mentholatum”. It’s an ointment that cures all diseases. If not used properly, may make things worse.</p><p>So, the question. How can I make my web application with high availability in mind? For that, we’ll take two paths. One, custom applications. And the other, some other people’s applications.</p><p>Custom applications suffer one particular problem.</p><p>They are not coded with an eye to the future. No scalability is being taken care unless something happens in the middle and many many things need to be rewritten for scalability in mind.</p><p>So, custom apps do manage sessions. Of course, you want to track if two or more people are buying different items of your custom store. For that, handling of sessions should be taken in consideration. For PHP, you can actually bypass this having a central session handler using memcached or redis. You may get away with many things, but forgetting some important thing that has not been taken in consideration:</p><blockquote><strong>How does my custom application behave on a single node?</strong></blockquote><p>First, in case you want to serve your application on several nodes, you need to be sure that the application behaves correctly on a single node <strong>first</strong>.</p><p>In case you’re wondering, enter profiling.</p><p>Just to make things clear, I’m now using the PHP example from now on. But with any couple of google searches, can be adapted for any other application. Except Java apps. You’re on your own.</p><p>Profiling is the art to measure the complexity of your application at a certain time. Web applications are a completely fruit from another tree, as they have two basic components:</p><ul><li>Server component</li><li>Client component</li></ul><p>Many technologies have been thrown to this mix : AJAX, Javascript, Asymmetric stuff that nobody understands, persistent information, Websockets, web browser support…my head spins just thinking about any of them.</p><p>All of those are added at the moment when you want to serve your own application as fast as possible, as responsive as possible and, as available as possible.</p><p>For the client side, many web browsers add their own set of tools to get a birds eye view of “what the hell is going on right now”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cVQEKX1TNl2spXj7.jpg" /><figcaption>This is complicated for my small brain</figcaption></figure><p>You will have to take your time to understand fancy graphs, stopping times, deadlocks, mutexes and code that never made it.</p><p>First ingredient to the mix is…</p><blockquote>“Master all the tools that serve your needs. If you cannot master them, get someone that does”.</blockquote><p>It is mind-boggling the amount of tools needed at this moment. And we’re only talking about the client side!</p><p>One link that I found today is this:</p><p><a href="https://medium.freecodecamp.com/what-exactly-is-client-side-rendering-and-hows-it-different-from-server-side-rendering-bd5c786b340d">Client-side vs. server-side rendering: why it’s not all black and white</a></p><p>Client-side rendering vs Server-side rendering, just to take them into account.</p><p>Now that we’ve tackled that, let’s go to the next. Server processing.</p><p>Remember I’ve said that you need to know how your application behaves on a single node? Then you have application profiling.</p><p>For PHP, you can use Webgrind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2xfWdNccJzPCCDxk.png" /></figure><p>This helps you to show where your code is being slow or where the basic bottlenecks are in the code. Here’s the second ingredient:</p><blockquote>If your code is not modular enough, profiling will be a bitch.</blockquote><p>Code being modular means that repeatable functions should be separated from the main code, make one single function (with argument modifications) that’s being called to do the same operation. This helps to actually pinpoint the bottlenecks. You may stumble into an if, case, switch or while instruction that is being picked up. But if your code is not modular enough, that same loop that you repeat ever and ever again will be optimized via a file by file basis. Read : many people will optimize something that can be rewritten in one single piece of code that one person will optimize.</p><p>Some people will say “you’ve discovered America using a map”.</p><p>But making code modular enough will require a shit load of code review. And that’s needed to actually pinpoint those repetitive functions that can be moved to a helper class or helper function. You name it.</p><p>Next ingredient?</p><blockquote>Code review is always needed, before and after profiling.</blockquote><p>You can get away with it using a few egreps. Or using the search capability of your “preferred web version of the version control system being used”.</p><p>Few modifications later, code is acting better than before. But as your code needs data from some other elements (database, for short), you may stumble upon some troubling shit.</p><p>Next ingredient before the example:</p><blockquote>If something is running slow, it can be anything. It takes a keen eye to blame what makes the application slow, but only if that keen eye is a master of that trade.</blockquote><p>One coder may blame the database for the slowness. One DBA may blame the application for slowness. But if any of them gives a technical explanation of things going slow, you’re knee deep into shit. I call this “the blame game”.</p><p>During a non-productive meeting, if a developer says “the app is slow because getting the data from the database is slow”, you’ll lose two hours of clusterfucks of explanations that will get you nowhere. It’s like “the app is slow because of reasons”. DBA may do the same, blaming the developer for not making the queries correctly. Two hours lost during a meeting and it’s not even a code review.</p><p>If the developer shows a profiled page (or portion) with a direct finger at the “mysql_select_db” instruction, things change. Some trained DBA will get you some “explain” or “tkprof” outputs saying that the query was not constructed correctly. <strong>Ends will meet!</strong></p><blockquote>So, it’s not the developer’s role to tell DBA that the database is not running fast enough. And it’s not DBA’s role to tell the application is not running fast enough.</blockquote><p>Still reading? Good. It gets worse.</p><p>So.</p><p>Obtaining data and processing data are two different tasks. On the same information pipeline.</p><p>Blame can be thrown between teams like a tossed ragdoll.</p><p>For the recap, and that makes the end of chapter one:</p><ul><li>You cannot have a definitive solution to tackle the high availability problem</li><li>Master the tools or get someone that does (application, database, other)</li><li>Rewrite the code to avoid profiling repetitions</li><li>Code review should be done regularly</li><li>Code and Data profiling should be done by separate elements</li></ul><p>Next entry will be how to make this clusterfuck available to everyone.</p><blockquote>Disclaimer : there are a lot of things that I swept under the rug. As it is regarding web apps, some of them will be covered on the next entry. Sorry if I forgot them, but my alcohol level went from tipsy to hammered while typing this.</blockquote><p>Back to Arduino.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb8beb7e76d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So, what comes next?]]></title>
            <link>https://medium.com/@jci/so-what-comes-next-1fb1e8516fec?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fb1e8516fec</guid>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 04:55:18 GMT</pubDate>
            <atom:updated>2017-06-01T04:55:18.748Z</atom:updated>
            <content:encoded><![CDATA[<p>TL;DR : getting personal here, yo.</p><p>Picture <em>this</em> for a moment : just yourself, against the world, nothing to lose and being able to do <strong>absolutely anything</strong> without being refrained. Got the picture? Good. Now, tell me : what is that thing that is stopping you from doing it?</p><p>Back to my personal story.</p><p>I’m old as fuck.</p><p>But it’s not the age, it’s the mileage, they say.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*mDPO01o3GpNmoRiVkFlJIg.gif" /></figure><p>If something is even stopping you from doing whatever the fuck you want to do, will you <strong>drop</strong> that thing?</p><p>It was after an enlightenment session with a green house (will publish that story some other day, promise) that I realized that there’s absolutely nothing that can stop me from doing anything I wanted, but myself.</p><p>Of course, there are some logistics limitations.</p><p>Let’s say <em>money, time, leisure, life, commitments, responsibilities</em> and so on. But the “ye ole me” won’t drop those things to become something else. May become a hobo or something else.</p><p>And there’s a strange feeling that yells from the back of my head. It says <em>“be free”</em>. Sometimes, <em>“overcome this”</em>. Or <em>“hold my beer”</em> (usually, a bad idea).</p><p>That same little voice started yelling louder since months. And it yelled “learn”. Louder than before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*QQ5wgG9todcJwxvCciby5w.png" /><figcaption>Picture : for starters.</figcaption></figure><blockquote>For the record : I do not have voices in my head. And they said that I should say this publicly.</blockquote><p>Entering Arduino.</p><p>Having a robot pal is one of my childhood’s dream. Remember that show, “Whiz Kids”, from the 80&#39;s? Told you I’m old before.</p><p>Arduino is the nicest way from being an illiterate fuck about electronics to “Mechatronic Engineer” in 10 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*pR1KXwo5oVXdcc5Z6_h6dw.png" /><figcaption>Literally, this is on my LinkedIn page. Nah, just kidding.</figcaption></figure><p>Got me one of their starter kits.</p><p>And. <em>I. Fucking. Loved. It.</em></p><p>My previous experience with these kind of electronics was to repair one TV that refused to turn on. Some soldering after finding the cold solder piece and one boom later, I had a TV working. It was part of a joke that backfired to some previous colleagues. Now, Arduino comes in a new form : solderless, connection oriented tinkering, getting things done via software (is this awesome or what?), encouraging the user to use basically C-like syntax (IS THIS AWESOME OR WHAT?) and being classroom friendly.</p><p>Classroom friendly. Keep this in mind from now on.</p><p>It’s mind-boggling that something <em>so simple</em> comes in a simpler form. And I’m not even joking.</p><p>If you have some Arduino or Raspy experience, you’ll find my words “cute” or “newb”.</p><p>But again : two months ago, Arduino was a thing coming from the heavens of teh internets and it worked <strong>because</strong> of the the heavens of teh internets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*F0NrQWhLzbKRFUZ510JncQ.jpeg" /><figcaption>I’m not even fucking kidding here. That’s one of the images when searching “heavens from the internets”.</figcaption></figure><p>So, simpler form? How?</p><ul><li>The variety is <strong>fucking mind-blowing</strong>. Uno, Mega, Duemilanova. Hell. Yeah. Open source, baby!</li><li>You can <strong>connect</strong> lots and lots of things there. Even things <em>not even designed</em> to be connected there.</li><li>Solder free configuration. Hell, get your discarded protoboard and use it!</li><li>It has a solder friendly configuration. At the same time.</li><li>You can recycle your old USB-B cables from your discarded printer or discarded whatever USB crap you bought.</li><li>You can recycle some 9v or 12v DC transformer you have lying around. <strong>Note : I have a shitload of those.</strong></li><li>Interact with technology that was not even developed originally for it. <strong>Bluetooth</strong>? (Raspy has it, but Arduino needs some external dongles). <strong>Wifi</strong>? (Again). <strong>GPS</strong>? (Again). <strong>GSM</strong>? (Again). You name it.</li><li>Analog and digital pin-outs living<em> with each other</em> and YOU can control <em>how to use them, </em><strong><em>BOTH</em></strong><em>?</em>. Count me in.</li><li><strong>Shield cards</strong>. Oh yeah, man. Dude, I’m now having a toast for the guy that designed any of shield cards available. Protoboards are so cumbersome. Shield cards are the <strong><em>shiznit</em></strong>.</li><li>You can actually teach<em> “Electronics 101”</em> with the <em>RV and I</em> relationship, <strong>in the same sentence!</strong> With real resistors. And some <em>real</em> equipment. With real results!</li><li>It’s <em>open source</em>. Starting from the board (that’s why there are so many knockoffs and some of them are really good!) and the specs (helping anyone to build modules for Arduino), possibilities are endless.</li><li>Did I mentioned before that I am an advocate for free software and open source?</li><li><strong>Fucking</strong>. <strong>Cheap</strong>. Anything with controlled automation in the 90’s was expensive.</li></ul><p>A 40-year guy can <em>actually</em> learn from all the previous points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IpOjsLPl48Nzryge_oy_xw.jpeg" /><figcaption>Never. Encourage. Me. Ever. Again.</figcaption></figure><p>So. I’m 40.</p><blockquote>(In my defense, I say that I am 28 because I look young but since last week I’m starting to believe that keeping that cover will require to tell my age is actually 32)</blockquote><p>But.</p><p><strong>I’m learning.</strong></p><p>With it.</p><p><strong>And enjoying this.</strong></p><p>Not part of my job of course.</p><p>Half of the ride is about <strong>having fun. Or NOT having fun.</strong></p><p>That’s what the voice in my head never told me.</p><p>The road to enlightenment is not about the fun. It is about <strong>the path</strong>. Not reaching the starting point or the end, it was about the ride.</p><p>And, believe me, it’s been <em>a hell of a ride</em>.</p><p>I should not take a ride like this at my age. I’m not a kid. I’m old, remember?</p><p>But I’m <em>sure as hell</em> that I’m going to enjoy it. Hell fucking yeah.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fb1e8516fec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remember the story about ghosts and shit? IT GOT REAL, YO]]></title>
            <link>https://medium.com/@jci/remember-the-story-about-ghosts-and-shit-it-got-real-yo-75cc695b2c8c?source=rss-82defa873749------2</link>
            <guid isPermaLink="false">https://medium.com/p/75cc695b2c8c</guid>
            <category><![CDATA[entropy]]></category>
            <category><![CDATA[physics]]></category>
            <dc:creator><![CDATA[jCi]]></dc:creator>
            <pubDate>Tue, 28 Feb 2017 03:22:27 GMT</pubDate>
            <atom:updated>2017-02-28T04:10:52.950Z</atom:updated>
            <content:encoded><![CDATA[<p>Yes.</p><p>Remember the story that had ghosts, our intrepid heroes Wimpy and Fast Hand and the most corny poltergeist ever?</p><p>Well, it got out of hand!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*jPLW5CLFMJKndchBJUhCrA.png" /><figcaption>“Someone opened the door of this house to the Devil”. I’m not even joking.</figcaption></figure><p>Are you not entertained?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*ZzbaHsPV2ImQVSNUPnbYgw.png" /><figcaption>A. Fucking. Medium.</figcaption></figure><p>This started as a personal level trolling from a friend. He knows I cannot resist debunk shit like this. And while I was doing some research regarding a fridge and levers, got a little tipsy on beer…</p><p>…and that compels me to write the following.</p><p>Many non-physics initiated are not familiar with the laws of thermodynamics. Let me tell you something. If you can prove Einstein’s wrong, go ahead. You can find a theory or a complementary equation that resolves why light, with virtually no mass, gets distorted by the disturbance of gravity in certain circumstances. (Read : there’s already one, I’m fucking with you). But if you plan to prove the laws of thermodynamics wrong, you’re on your own, buddy. This same phrase, almost verbatim, was from an astrophysicist. A very famous one. He has a podcast. And he’s friend with Bill Nye.</p><p>Well, back to subject.</p><p>Thermodynamics explain the interactions between three distinguishable things in the universe that are very related and have some particular interactions. Those are energy, temperature and entropy.</p><p>The first law is similar to Lavoisier’s law regarding matter. Matter does not gets created or destroyed onto nothing or from nothing, it only transforms. Well, energy has the same treatment. You cannot create energy from nothing and cannot be destroyed.</p><p>Second law says that the entropy on a closed system (will get to this later) will increase over time.</p><p>Third law states that the entropy level of a system that goes gradually onto absolute zero on temperature gets near a constant value.</p><p>Now, the first law and ghosts.</p><p>Suppose there’s a ghost in your house. If you believe in that shit, you’re on your own. But for the sake of this explanation, let’s suppose a ghost is a castaway energy concentrated in something. Like a “possessed” thing. If we apply the first law, where did the energy come from?</p><p>And if this ghosts decides (which requires a form of conscient thought) to move some shit around your house. That means that energy has to be converted from potential elastic energy to kinetic energy (read : books being thrown away, pot lids being thrown away and shit), and possibly our ghost will use his stored energy to pull this stunt.</p><p>Read this : it’s fucking impossible.</p><p>First, the ghost should be an entity that can HOLD energy. Shitloads of it. That of course have the uncommon effect that those shitloads of some type of energy will transform onto another form of energy. Heat, light, radiation, near infrared shit, UBER infrared shit…and it could be perceived easily by a common instrument such as a cellphone or any webcam, at anytime, anywhere.</p><p>But as far as I know, there are no record of something like that ON TAPE that can be independently verified as “WE KNOW SHIT ABOUT THIS”.</p><p>And the transformation of that energy to other types of energy is the explanation of the second law. Two in one, byotch!</p><p>In better words,</p><blockquote>If ghosts were formed of energy and not matter they would lose energy because of the second law of thermodynamics. It would, therefore, be impossible for them to maintain their structure and order for any significant period of time. If they were interacting with the world they would be moving themselves, or other objects, and perhaps emitting light or sound. Hence due to the First and second law they would fade out of existence. Haunted Houses are popularly conceived with, so-called, regular hauntings, but this is impossible since the ghost would lose energy and disappear from existence. The only way to make haunting possible would be for ghosts to draw energy from the environment in order to sustain their existence.</blockquote><p>The third one is absolutely irrelevant for the ghost explanation. It is only valid when you’re super freezing some gas. But as I am slightly drunk, let’s say that if you could achieve the absolute zero (-273.something C) you can actually convert gas onto a sludge that is not even liquid. All electron activity will cease (!!!) and the interaction between gas molecules stop. You have created an ice cream out of gas. But it’s not solid nor liquid. Some complicated thing that I cannot fathom.</p><p>Then, ghosts.</p><p>They belong to the folklore. All cultures have a way to honor the dead and their impact on the living. Some cultures and religions believe in the Afterlife (whatever that means) but in one way or another, they believe in the presence of the spirit, soul or whatever that is, as an eternal element that cannot be destroyed.</p><p>And that makes me thing about the fragility of the man.</p><p>As the poster in Mulder’s office (TEH X FIELS), “I want to believe”. And that’s it. We want to believe that there is something beyond our own understanding. That death is not the end of life but the beginning of a new process, or that our actions can be measured if we’ve been naughty or nice, kinda Santa scale, but with more devastating consequences.</p><p>Our human nature is fucking flawed. As fuck. We cannot see infrared light and our field of vision is marginal compared to some feline predators. Felines can see during the night due to the tapetum, a thin layer of reflective tissue that help bounce some IR radiation to slow it down and convert it to visible light. How cool is that! And snakes! Snakes can perceive infrared radiation and movement with the same glands located under their eyes. Add the fact that the smell sense is located in the tongue and not in the nose. Our canine companions can smell 3 parts PER FUCKING MILLION of a particular scent and they can distinguish over nine thousand of them. How fucking awesome is that! But we, humans?</p><p>Just some facts. For human, the image projected in the eye is inverted, top is bottom. But there’s no specific element in the brain that composes the right image. Also, if you look down with your eyes, you can barely see your nose. And there’s a part of your brain that’s doing some REAL TIME PHOTOSHOP that deletes and recreates the image without the nose!</p><p>We can be tricked. A slight of hand and a wow later, you’ll feel dumb. That’s “magic”. It can be explained. But the real mystery of it resides on the trickery! On ways people can be fooled, one way or the other.</p><p>We can be fooled. Optical illusions? Got you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/0*A67k2SxceQKowKdk.gif" /><figcaption>This. Does this make me look fat?</figcaption></figure><p>Our brains look for patterns, but on the image above, they try to search for the correct one, discard it, then get to the new one, then discard it…a gazillion times per minute. And it makes me uncomfortable as hell.</p><p>And at the end, we want answers. There are mysteries on the universe that are absolutely ready to be explained. But they cannot have the Occam Razor’s treatment. We absolutely need to have some critical thinking and dispose all previous knowledge about a phenomenon and start thinking with a clean slate, have some ready tools and perform experimental research. Well, some things are born out of luck (read: story of post-it from 3M) but not many of them, as the conception took some research and experimentation.</p><p>And, for fuck’s sake, don’t take anything for granted. Like a poltergeist video! It’s absolutely possible to fake them. Hell, I am actually on the middle of making one video exposing that! (Will tell later the results, but having some Raspies and relays laying around, who knows…?)</p><p>Critical thinking, people. Please, use it.</p><p>Oh, wait.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUx1cjUBYy_bfJbOEKJ59Q.png" /></figure><p>Fucking journalists.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75cc695b2c8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>