<?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 Emre BALAK on Medium]]></title>
        <description><![CDATA[Stories by Emre BALAK on Medium]]></description>
        <link>https://medium.com/@emrebalak?source=rss-4bcc5608f0d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zgmpvrVOrHvmv6KA</url>
            <title>Stories by Emre BALAK on Medium</title>
            <link>https://medium.com/@emrebalak?source=rss-4bcc5608f0d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 09:45:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emrebalak/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[Find The Hidden Face in Aphex Twin’s Famous Song with Python]]></title>
            <link>https://medium.com/analytics-vidhya/find-the-hidden-face-in-aphex-twins-famous-song-with-python-cca8a9864284?source=rss-4bcc5608f0d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cca8a9864284</guid>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[spectrogram]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Emre BALAK]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 09:55:32 GMT</pubDate>
            <atom:updated>2020-06-21T16:36:05.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAGFLN-qepTSG4j9XkK8wA.png" /></figure><p>It might sound weird at first but one of Aphex Twin’s famous song’s name ision editor has reviewed your ΔMi−1 = −∂Σn=1NDi[n][Σj∈C{i}Fji[n − 1] + Fexti[[n−1]]. The name is obviously an equation, however, it is a mystery that whether this equation makes sense or not.</p><p>There is something which is more interesting than the song’s name. The artist hid a face in the song which can be seen by creating a <strong>spectrogram</strong> and analyzing it in log scale. But what is spectrogram?</p><p><strong>Spectrogram </strong>can be called as <strong>v</strong>isual representation of frequencies of a given signal with time<strong>. </strong>In a spectrogram representation plot, one axis represents the time, the second axis represents frequencies and the colors represent magnitude (amplitude) of the observed frequency at a particular time. An example spectrogram representation example is below. and bright colors represent strong frequencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*-Su9AwGFtTAFo3EzSYTGMQ.png" /></figure><p>We will now create a spectrogram and show the hidden face in the song. To do this, we will do following steps :</p><ul><li>Read left stereo of .wav file (last 36 seconds of song where the hidden face is) by the help of read function of scipy.io.wavfile library and take left stereo.</li><li>Normalize the signal according to its max value.</li><li>Define two parameters:<br>– Window Size: Size of the rectangular window.<br>– Step: It is unnecessary to calculate the FFTs for every data point. Thus, starting from 0 th data point, you should decide on next data points according to step value.</li><li>Extract windows and make hanning window multiplied it with amplitudes before passing it to FFT to handle discontinuity of small signal.</li><li>Work on the first half of FFT and calculate absolute values.</li><li>Use 10 * log10(x + c) to smooth the data for a better representation.</li><li>The final 2D spectrogram matrix whichh rows and columns represent window frame number and frequency bin, values represent the strength of the frequencies is created.</li><li>Use pcolormesh function of matplotlib is to obtain a visual from the data.</li><li>The artist hid the face into log scale. So, ’y scale’ is selected as<br>’symlog.</li></ul><p>That’s it, now we can show the hidden face artist hid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*liE7V8FIAxybOEDXUWKMZg.png" /></figure><p>Here is the Python implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b47aff6e4a4930b40b012d4e15f54d4/href">https://medium.com/media/2b47aff6e4a4930b40b012d4e15f54d4/href</a></iframe><p><em>If you liked the article, wouldn’t you like to clap and share it with others? Giving me feedback by commenting makes me very happy.</em></p><p>You can also contact with me on one of the channels below to criticize, contribute, ask questions or ask for help.</p><p><a href="https://github.com/emrebalak"><strong>GitHub</strong></a><strong> | </strong><a href="https://www.linkedin.com/in/emrebalak/"><strong>LinkedIn</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cca8a9864284" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/find-the-hidden-face-in-aphex-twins-famous-song-with-python-cca8a9864284">Find The Hidden Face in Aphex Twin’s Famous Song with Python</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Projesinde Parola ve Anahtarların Güvenli Kullanımı]]></title>
            <link>https://medium.com/@emrebalak/python-projesinde-parola-ve-anahtarlar%C4%B1n-g%C3%BCvenli-kullan%C4%B1m%C4%B1-96bfcc201b60?source=rss-4bcc5608f0d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/96bfcc201b60</guid>
            <category><![CDATA[yazılım]]></category>
            <category><![CDATA[kodlama]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[güvenlik]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <dc:creator><![CDATA[Emre BALAK]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 10:40:13 GMT</pubDate>
            <atom:updated>2020-06-24T07:09:22.707Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ySs72Cb0b2-8fwFdbYrM_g.png" /></figure><p>Bir Python projesi yazdınız ve <a href="http://github.com/"><strong>Github</strong></a> üzerinden paylaşmak istiyorsunuz ya da herhangi bir sebepten yazdığınız projeyi başkalarıyla paylaşmanız gerekiyor. Fakat yazdığınız proje, içerisinde parola ve anahtarlar gibi çeşitli kimlik bilgilerini barındırıyor. Bu kimlik bilgilerini başkalarıyla paylaşmadan projemizde nasıl kullanabiliriz? Gizli bilgilerimizi projemizin içine doğrudan yazmalı mıyız?</p><figure><img alt="Kimlik bilgilerini paylaşan vs paylaşmayan" src="https://cdn-images-1.medium.com/max/893/1*UUz7jUft_dg4dmp6gTZhyA.png" /><figcaption>Kimlik bilgilerini paylaşan vs paylaşmayan</figcaption></figure><p>Kimlik bilgilerinin bir projedeki en kolay kullanım yolu hardcoded (kodun doğrudan projenin içine gömülmesi) şeklindedir. Fakat kodunuzu bir şekilde halka açık yaptığınızda gizli bilgilerinizi projeyi gören herkesle paylaşmış olursunuz. Bunu engellemenin birkaç yolu bulunuyor. Ben de yazımda bu yollardan en kullanışlı ve güvenli olduğunu düşündüğüm .env dosyası kullanımından bahsedeceğim.</p><p>Yol haritamız şu şekilde olacak:</p><ul><li>.env dosyası oluşturma ve kimlik bilgilerini buraya kaydetme.</li><li>Projenin, .env dosyasını okumasına izin veren <em>python-dotenv </em>paketininin kurulumu</li><li>.env dosyasındaki kimlik bilgilerine erişim</li></ul><p>Şimdi bir örnekle bu kullanımı görelim.</p><h3><strong>.env Dosyası Oluşturma</strong></h3><p>Örneğin projemizde, internette her yerden, her boyutta veri almak ve depolamak için oluşturulmuş bir nesne depolama hizmeti olan Amazon S3 Servisi’ni kullanıyoruz.</p><p>Öncelikle, proje klasöründe <em>.env </em>adında bir dosya oluşturarak bu servisi kullanabilmek için ihtiyacımız olan kimlik bilgilerini aşağıdaki gibi tanımlıyoruz. Parola bilgileri örnektir. ;)</p><p><strong>Önemli not:</strong> .env dosyasını .gitignore dosyasına eklemeyi unutmayın!</p><figure><img alt="kimlik bilgelerini tanımladığımız .env dosyası" src="https://cdn-images-1.medium.com/max/665/1*K4mf4d_bULZADpIYqXddkA.png" /><figcaption>Kimlik bilgelerini tanımladığımız .env dosyası</figcaption></figure><h3>python-dotenv Paketinin Kurulumu</h3><p>Şimdi, <strong><em>python-dotenv</em></strong> paketini yüklememiz gerekiyor. Bu paket, Python projesinin <em>.env</em> dosyasını okumasına izin veren bir Python paketidir. Bu paket sayesinde bir <em>.env</em> dosyası aranacak ve eğer bulunursa içindeki değişkenler uygulamaya gösterilecektir. Aşağıda görüldüğü indirilebilir.</p><pre>$ pip install -U python-dotenv</pre><h3>.env Dosyasındaki Bilgilere Erişim</h3><p>Yukarıda ortam değişkenleri(environmental variables) şeklinde oluşturduğumuz kimlik bilgilerinde projemizde bir şekilde erişmemiz gerekiyor. Bu kısım ise işin en basit kısmı.</p><p>Öncelikle, ortam değişkenlerine erişebilmek için <strong><em>os </em></strong>modülünü import etmemiz gerekiyor. Ardından <strong><em>os.environ.get() </em></strong>fonksiyonuna, ulaşmak istediğimiz kimlik bilgisini parametre olarak veriyoruz. Temiz bir görünüm ve anlaşılırlık için bir config.py dosyası içerisinde bahsettiklerimi yapıyoruz.</p><figure><img alt="ortam değişkenlerine eriştiğimiz config.py dosyası" src="https://cdn-images-1.medium.com/max/562/1*4SMsA3PQp--Dfv7u_jr30w.png" /><figcaption>Ortam değişkenlerine eriştiğimiz config.py dosyası</figcaption></figure><p>Ve son olarak projemizin istediğimiz herhangi bir yerinde bu config dosyasını import ederek gerekli bilgileri kullanabiliriz. Aşağıda Amazon S3 Servisi için gerekli olan boto3 client ve s3 bucket kimlik bilgilerine örnek bir kullanım olarak görebiliriz.</p><figure><img alt="Kimlik bilgilerinin proje içerisinde kullanımı" src="https://cdn-images-1.medium.com/max/641/1*gs35sZZqoR1lJ37uYVME3Q.png" /><figcaption>Kimlik bilgilerinin proje içerisinde kullanımı</figcaption></figure><p><em>Yazıyı beğendiyseniz alkış atmayı ve başkaları ile paylaşmayı düşünmez misiniz? Yorum yaparak bana geri bildirimlerde bulunmanız beni çok mutlu eder.</em></p><p>Ayrıca eleştirmek, katkıda bulunmak, soru sormak veya yardım istemek için aşağıdaki kanallardan birinden iletişime geçebilirsiniz.</p><p><a href="https://github.com/emrebalak"><strong>GitHub</strong></a><strong> | </strong><a href="https://www.linkedin.com/in/emrebalak/"><strong>LinkedIn</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96bfcc201b60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>