Skip to main content

Posts

Showing posts from December, 2019

Slideshow on Google Images

I opened Google Images and searched for Batman , which is probably my favourite Super Hero. I had connected my laptop to a TV screen and I wanted to see all the images as a slideshow. And, just like many other posts in this blog, I started using the Chrome Developer Tools. I clicked on the first image. The image was being displayed on the side and a button to move to the next image came in. I right-clicked on the button and did an Inspect  and I found that the button was having classes  KJaJCe irc-rab . I ran the following command to see if there are other elements with the same class. document.getElementsByClassName('KJaJCe irc-rab') I saw that there were three elements, but the button to go to the next image was always having an index of 1 . So, I went ahead and did the following: a = document.getElementsByClassName('KJaJCe irc-rab')[1]; a.click(); Each time I ran a.click  it showed me the next pic on the right-hand side and I was convinced that if I...

Creating a Neural Network to Predict Periodic Data

Two years ago, Arijit Mondal,  a professor of mine who was teaching us a course on Deep Learning, asked a question on how to make a Neural Network that can predict periodic data. The students started shouting out their own version of answers, most of them involved the usage of some form of recurrent neural network structure. I had a different answer. I was not a very good student during my initial semesters during my bachelors. I missed several classes due to the lack of motivation which were supplemented by the change in environmental condition that I had been used to growing up. But, I could recollect some of the things that were discussed in a Math course, which was regarding fourier series. Just by using a bunch of sine waves, the series was able to approximate many functions to an excellent accuracy. How is this any different from the Universal Approximation Theorem that was tought during the initial lectures of this course? It striked me - the easiest way neural network...

Transferring Files between Computers and Phones using Wi-Fi

Phones are essentially miniaturized computers. If you connect your phone to a monitor, keyboard and mouse, it essentially becomes a computer. In this article, let us discuss about how to use an Android phone or a computer as a server and transfer the data into another phone or computer. Doing this procedure on an Android device, you just need to install the app named Termux, which provides you with a Linux Terminal on Android. If you don't have python installed already, install it using apt-get or apt  using the respective commands listed below on your Linux Terminal or Termux. Note that admin privileges may be required to do so. apt install python apt-get install python After you are done installing, before you create the server, you need to know what your IP address is so that other devices can access it. To obtain the IP address, simply type in the following command: ifconfig  In this case, the highlighted portion in the image above is the IP Address, 192.16...

Extracting Stock Price Data Trend from Google Search to Train LSTM Network

I am not very good with designing my own neural networks. I have attempted to create a few in the past, some worked out fine for proving certain points that I wanted to make, but whenever I tried to make something to participate in a competition, things were not very well. In this post, I do not intent on creating an LSTM based neural network to predict stock prices, rather simply use Google as a tool to extract the stock trends from the graphs. To get started, search for "Amazon stock price" on google. You would be able to see a pretty nice graph. On right clicking on the graph and clicking on Inspect  and reading through Elements in the Developer tools, it can be observed that the graph is rendered using  Scalable Vector Graphics or SVG . This is an XML-based vector image format and the data required to create such a graphic would be available in a format that we'll be able to read. I also observed that the required SVG image has a class name  uch-psvg and the...

Sending a Facebook Message Challenge: Harder than it looks

I have been having conversations with a friend regarding how easy it is to use JavaScript to automate a lot of processes that we usually do, why it is easier to program in an interpreted language than compiled language, etc. Pondering about these conversations, I challenged myself to send a message to my girlfriend on Facebook Messenger using JavaScript console alone. Before I started, these are the ground rules that I set: I can use both keyboard and mouse, but the usage should be restricted to the JavaScript console alone. No other tab in the developer tools other than JavaScript console shall be used. I shall start with about:blank  as the start page. The first step is to open Messenger. That step was pretty easy considering the fact that I already knew how to use the window object to my advantage. I used the following command to open Messenger. window.location.href = "http://www.messenger.com"; Luckily, I had already logged into Facebook and the cookies w...

Creating awesome text banners in Linux Terminal

In several opensource projects that we see around in the web, certain developers prefer to add banners like the following at the top of the source code. These do look cool, but I have often wondered why anyone would waste so much time making things like these. As I have been surfing around the web, I happened to see Linux Terminal apps that generates these for you. I have used them to generate such banners for the BuddyGo . Figlet: To install Figlet, use the following command (if you have apt-get): sudo apt-get install figlet Toilet To install Toilet, type the following in your linux command line: sudo apt-get install toilet Banner: To install Banner, type the following in your linux command line: sudo apt-get install sysvbanner Now, you can also contribute to the Open Source community in style. Make contributions on GitHub, BitBucket, or whichever platform you are using.

How to Create your own Ad Blocker Chrome Extension

Not very long ago, I read an article stating that Google banned advertisement blockers from its stores. There are several websites which does not let you in if you have an Ad blocker extension installed on your browser. I have not investigated on how these websites detect that, nor do I know whether our own version of advertisement blocker would be immune to that. But, isn't it fun to build something like this on our own? As the first step, I found a random website that has a Google Ad. I right clicked on the Google Ad and clicked on Inspect button. As I moved up the Elements inspector, I found that the id of the advertisement starts with "google_ads_". Therefore, I opened the console and typed in the following command: div = document.querySelector('[id^="google_ads_"]') This selected the div  that contained the advertisement. I went ahead and typed in the following command that would remove the div from the page. div.parentElement.remove...

How to remove Blogger (or any free blogging platform) credits from the footer

I am not sure if removing the footer credits is legal or not, but I just wanted to try doing it. As I searched the internet, I found several pages describing how it could be done by making some adjustments in CSS. However, I could not find an article which uses simple JavaScript commands to do the same. So, I decided the write this. As you can see now, my footer does have Powered By Blogger credit signature. I am intending on keeping it that way until I am sure that removing it would not get me into any legal issues. I am just writing this article for the educational purposes. Right click on the Powered By Blogger  button and click on Inspect to have Chrome Developer tools loaded with the div that holds the credit content. You can see that the element should have a content similar to the following. Notice that the div is having a class value blogger . We can use this to our advantage. <div class="blogger"> <a href="https://www.blogger.com...

The GitHub Experiment

Before deciding to move BuddyGo to Blogger, I had a crazy idea of creating a blogging scipt which enables micro-blog posts to be places anywhere on the page and could be dragged around. The posts could also be connected with each other; something like trees and nodes that one may learn in Graph Theory. The website takes content from an XML file and display it on the website. This means that I could host my HTML, CSS and JavaScript content on GitHub and technically have the XML files exist elsewhere. The XML file could also be generated by a backend script. Check it out at: https://zenineasa.github.io/buddygoBlog/ Source code: https://github.com/zenineasa/buddygoBlog Feel free to download and play around with it. I would encourage people to ask questions about the code.

BuddyGo on Blogger

For the past many months, I have been thinking about reviving BuddyGo. But I could not find a good idea to pivot it to. I think this blog would likely contain contents ranging from tech to food/restaurant reviews to conspiracy theories that I come up with. Let's get started.