Contextmenus.js
Purely Javascript based solution allowing for easy creation of right-click context menus. Browse the code on GitHub. Demo
So, Haider posted on his Facebook timeline, a link to his then newly setup github repo which he had named “rightclick.js.” It was pretty clear what it was about so I gave his code a look. He is using JQuery, and (for some reason unclear to me,) NodeJS.
This morning, I decided to make my own in pure Javascript. I started around afternoon and got done with it a couple of hours ago. I wanted to call it contextmenu.js but there already exists a script by that name, and thus, out of respect, I renamed mine to contextmenus.js. The code happens to be a couple of files that together take up a total of 1812 Bytes of disk space. Everything that you need to know, in order to get it to work for you, is explained in the README.md on the GitHub page.
Progresive Web Apps
You are using a computing device, be it a smartphone, a tablet, a desktop computer. It’s new, shiny, with little or no applications installed, _apart from the bloatware that the manufacturer could have generously shipped with it. _You fire up Facebook in a web browser, like a couple of pictures, post a status, have a small chat with a friend, and then after a while, you close the tab and lock your phone. After a while you do it again, and this time, you spend a whole hour scrolling through the news feed, and then once again you close the tab, and lock your device.
Now while it’s locked, and still connected, your device makes a decision. Assuming that you like Facebook, it adds a Facebook icon to your homescreen, or your app-drawer, for easy access to facebook.com. So the next time you unlock your iPhone, you simply tap on that icon, and it opens facebook.com in your default web browser. You love it.. It’s just a simple link, but it already feels great, and it could be better. Soon enough, after another day’s usage of the site, you notice that tapping the app icon no longer opens a browser window with facebook.com. Instead, you get a window solely running Facebook like it’s a standalone native application for your operating-system.
Read Full PostPhysics 9702 Winter 2015 qp13 Q37
37 A network of resistors, each of resistance 1 Ω, is connected as shown.
The current passing through the end resistor is 1 A. What is the potential difference (p.d.) V across the input terminals?
A: 2V
B: 5V
C: 8V
D: 13 V
From Windows 8 to 10 – The excitements and the disappointments.
tl;dr
I have been a Linux user for the past few years, but I grew up using Windows, and I have always been closely interested in it’s progress and moves.
When Windows 8 came out, I was like the only person I knew who didn’t hate the Metro. All my friends thought it was ridiculous, and truth be told, it was. It seemed as if they had forgotten that people neither have a bunch of huge touchscreens lying around in their place nor do they love the desktop experience in full touch, and Windows 8 was a weird cross between an OS optimized for touchscreen, and an OS that didn’t look like it would ever work well with touchscreens.
Accessing the desktop by clicking on a tile at the bottom left corner of the screen was oddly disturbing.. it felt like the desktop had lost it’s old integrity.. Like it was only a tile among many, like it was just another app like the ones accessed by clicking the other tiles. Furthermore, at times, it was hard to decide which world to live in: the metro, that had a really long way to go, and was far from mature, or the desktop that we’d both loved and hated for ages. For Developers, it both sucked and was an opportunity at the same time. They had a new platform to master; some would go on to proudly declare themselves to be of the first 100 developers for Windows apps. Some developers saw it as mere clutter. Another language and platform to come across and not-read articles of.
The question was: “Why?”
Read Full PostCan machines think?
Back in 1950, Turing’s paper, titled “Computer machinery and Intelligence,” was published in journal called “Mind,” and it was one of the things that can be credited for changing the way people thought about machines. Some readers were awestruck, while others only saw gibberish.
The paper, in a fair-amount of detail, spoke of computers, and the possibility of them being indistinguishable from a human in the future. The present day, may or may not be the future in question, but we have most definitely made a fine dent. Turing spoke of storage, and memory and processing and instructions, and of word, _in the second part of his article titled “_Digital Computers.” The model of computing defined in his article is what we know today as the Turing Machine.
The part on digital computers was preceded by “The Imitation Game.” You might be familiar with the 2014 movie of the same name, starring Benedict Cumberbatch as a young Alan Turing who builds an intelligent-machine so as to be able to decrypt the messages encrypted by the german Enigma machine. The Imitation Game, which is defined finely in his article, is what could be used as a Turing Test, so as to determine how close a machine is to imitating the behavior and thinking capability of a human being, and whether or not it could possibly hoodwink a human into mistaking itself for a human. The Turing Test is a popular topic for discussion among enthusiasts, and developers perform different forms of it on their AI creations to this day.
I could go on for a while, but there’s honestly no point to it, and your time could be better spent reading the original article.
Fixing the brightness issue on Ubuntu 16.04
- The issue: Random flickering when changing the brightness using the function key, while the change wasn’t steady. The slider in system settings allowed me to change the brightness normally.
- The machine: Dell Inspiron N5110
The first solution I tried was creating the /usr/share/X11/xorg.conf.d/20-intel.conf file with the following lines:
Section "Device"<br />
Identifier "card0"<br />
Driver "intel"<br />
Option "Backlight" intel_backlight"<br />
BusID "PCI:0:2:0"<br />
EndSection
This didn’t change anything. So I tried following “dushnabe’s” suggestion on this thread. Which too didn’t make any difference really. The problem, as I saw it was that I appeared to be using both intel_backlight and acpi_video0. Both use different ranges of values to change the brightness. Hence the flickering. It became clear that I had to force the usage of just one, and that’s exactly what the fix in that answer was supposed to do. Except that for some reason it wasn’t working.
After googling further on this, I landed on this page and I saw the list of kernel parameters that had to do with the backlight. I rebooted a couple of times, each time trying a different parameter, and finally,
acpi_backlight=native
is what did the trick. I noticed that it doesn’t allow me to change brightness on login screen, but after login, there was no flickering, and when I ran ls /sys/class/backlight/
, I saw that it no longer returned acpi_video0. The only issue I have right now is that there is no fixed minimum. Sometimes, it decreases to a reasonable minimum, while at other times, it results in a blackout, and I have to manually adjust it using the slider in system settings or using xbrightness..
To replicate this process, all you need to do:
- Fire up a terminal
- sudo nano /etc/default/grub
- At the very end of the string
GRUB\_CMDLINE\_LINUX_DEFAULT
, (which in my case was “quiet splash,”) addacpi_backlight=native.
The final string, in my case, looks like “quiet splash acpi_backlight=native
“ - Close and save the file, and run
sudo update-grub
and then reboot.
In the event that this doesn’t work, it’d be worth your time to try out the rest of the kernel parameters. You don’t have to modify the grub file every time. Instead you can choose to modify kernel parameters before boot. This you can do by pressing “c” on the grub screen and typing the desired parameter, in the correct place, right after “splash.”
Under-steer vs Over-steer & Torque vs Horsepower
Under-steer is when you hit the wall with the front of the car.
Over-steer is when you hit the wall with the rear of the car.Horsepower is how fast you hit the wall.
Torque is how far you take the wall with you.
Hands on with Ubuntu 16.04 “Xenial Xerus”
Being one of those idiots who started downloading the ISO way before the link was even officially added to the download page, I do have a couple of reasons to regret doing so. I was on a slightly messed up 14.04 that appeared to have deteriorated over time, and I had been considering a reinstall, but had been putting it off because I had decided to wait until after the release of Xenial.
So, fast forwarding to when I was done installing it. As per habit, the moment it was installed I fired up a terminal and at the same time opened Firefox.. The first thing I noticed was that the terminal had a green font on the “user@conputer:~$,” and then I ran an apt-get update, which obviously was stupid as it had just been released, and a while before or after it I also noticed that the terminal seemed to insist that I use “apt” _in commands in place of “apt-get.” _I don’t honestly know what inspired this change, but just another minor.
Two changes that we had been hearing about since way before the release were:
Read Full PostNostalgia
is a bitch.
Alexarank.io
On January 3rd, I launched a tool, that’s hosted at; yep, that’s right. You guessed it: alexarank.io. What the tool does, is pretty simple. It tracks the global Alexa ranks for domains, and shows the change over time in a chart. It’s not exactly tracking every damn domain on the web, but nothing prevents it from doing so. Except that someone, and I mean anyone who cares enough, has to submit the domain once, and that very instant, the tool would start tracking the domain.
On December 27th, Amin messaged me and shared his desire for tool that would track changes in Alexa ranks for particular domains. On the slightest effort at googling, we both discovered a shitty tool that offered to do so at some price I didn’t even bother to remember. Alexa itself offers to do that for you, but they too, yep you guessed it, do it for a fee. So I say to Amin, _we need to make a free alternative, _and we immediately start concepting, and after a while we started playing with code. Within the next few days we had a working buggy prototype up, but it was uglier than you could possibly imagine, so we fixed the bugs, and made it look presentable and on the 3rd day of 2016 we registered the domain and it was up.