MathJax

2017-10-09

Pythagorean triplets

PS: The equations are rendered using MathJax library. Please allow JS if you can't read equations properly.

While lying semi-awake in the morning, reading the first part of Bill Habbard's "Message Contains No Recognisable Symbols", the thoughts drifted to how in a right-angled triangle we have:
$$ a^2 + b^2 = c^2 $$

That led me to:
$$\begin{align}
a^2 &= c^2 - b^2 \\
&= (c + b) \cdot (c - b)
\end{align}$$
Now, we have triplets like $(3, 4, 5)$; $(5, 12, 13)$ etc. where 2 of the values are consecutive. What if we fix $ c - b = 1 $; that is, the hypotenuse and one of the bases. We get to:
$$\begin{align}
a^2 &= (c + b) \cdot 1 \\
&= ((b + 1) + b) \\
&= 2 \cdot b + 1
\end{align}$$
So, if I get any odd perfect square, I can always get its corresponding values to form a co-prime Pythagorean triplet (or a primitive triplet). To test it out, here is a list of first 10 such triplets:
$$
(3, 4, 5) \\
(5, 12, 13) \\
(7, 24, 25) \\
(9, 40, 41) \\
(11, 60, 61) \\
(13, 84, 85) \\
(15, 112, 113) \\
(17, 144, 145) \\
(19, 180, 181) \\
(21, 220, 221)
$$
Another interesting thing about these triplets is, the other two sides are the medians for our odd-square values. For eg. first odd-square is $9$. The other two sides will be around $\dfrac{9}{2} = 4.50$, which gives the other 2 sides: $4$ and $5$.

From another such triplet $ (x, y, z) $, you can arrive at the immediate next one as follows: $$ \left(x + 2, y + 2 \cdot (x + 1), z + 2 \cdot (x + 1) \right) $$

2016-02-01

Card game: Literature

I was recently introduced to a card name, 'Literature'. The game is really amazing and the rules are pretty simple. One can, of course, find the rules over at Wikipedia, but I'd still like to put them below.

Concept

The game can typically be summarised with 3 rules and 2 conditions. The game's setup is a little different from other games. Each suit is divided into two groups, namely low group and high group. They can also be referred by suffixing the individual suit's name: "high clubs" or "low clubs". What the group actually means is, one card is removed from each suit (generally 7s or 8s) splitting the suit in two groups (A-6 or 2-7 and 8-K or 9-A).

The game is played between 2 teams, with alternate players in the same teams. The number of players should be 4, 6, 8 or 12. The team with highest number of declared groups is the winner.

Conditions

  1. You can demand a card X from the opponent if and only if you have a card Y, belonging to the same group as X, in your hand.
  2. You'll have to give the card to your opponent if they ask for it and you do possess the card.

Rules

  1. In a player's turn, they can ask ANY of opponent for ANY specific card following the conditions as mentioned above. If the opponent does not posses the card, the opponent who was challenged gets the next turn and the player loses their own.
  2. If a player is in possession of the whole group, they can put the whole group on the table and declare it closed. The player's team has won that particular group for the game.
  3. If a player deduces (or guesses) that their team as a whole is in possession of a group, they can decide to declare it so. If the team does actually own the group, they have won that group. On the other hand, if even one card is possessed by the opposing team, the entire group is awarded to the opposing team.

Alteration

A possible alteration of the game (possible with 6 or more players) is that when declaring ownership of a group, the player needs to accurately mention which player of their team has which card. Failing to do so would either result in a penalty (awarding the opposite team with the group) or a loss (the group is discarded entirely from the game).

Another alteration could be introducing two joker cards instead of removing one from each suit, thereby ending in nine groups instead of eight. This will reduce the probability of the game ending in a draw/tie.

2014-02-07

Novels I read in the past year

I've always been an avid reader of novels and comics. Stories and their closure always attracts me towards themselves. Most recently (past 10-12 months), I've been reading quite a lot of novels. Here's a list of them, not in any order of preference:

Gallgher Girls* series (Carter Ally)
  • I'd Tell You I Love You, But Then I'd Have to Kill You
  • Cross My Heart and Hope to Spy
  • Don't Judge a Girl by Her Cover
  • Only the Good Spy Young
  • Out of Sight, Out of Time
Belgariad saga (David Eddings)
  • Pawn of Prophecy
  • Queen of Sorcery
  • Magician's Gambit
  • Castle of Wizardry
  • Enchanters' End Game
The Death-Gate Cycle (Margaret Weis and Tracy Hickman)
  • Dragon Wing
  • Elven Star
  • Fire Sea
  • Serpent Mage
  • The Hand of Chaos
  • Into the Labyrinth
  • The Seventh Gate
Artemis Fowl series (Eoin Colfer)
  • Artemis Fowl
  • The Arctic Incident
  • The Eternity Code
  • The Opal Deception
  • The Lost Colony
  • The Time Paradox
  • The Atlantis Complex
  • The Last Guardian
महासमर (English literal Mahasamar) (Narendra Kohli)
  • बंधन (Bandhan)
  • अधिकार (Adhikaar)
  • कर्म (Karm)
  • धर्म (Dharm)
  • अन्तराल (Antraal)
  • प्रच्छन्न (Prachhann)
  • प्रत्यक्ष (Pratyaksh)
  • निर्बन्ध (Nirbandh)
Malloreon saga (David Eddings)
  • Guardians of the West
  • King of the Murgos
  • Demon Lord of Karanda
  • Sorceress of Darshiva
  • The Seeress of Kell
Starcrossed trilogy (Josephine Angelini)
  • Starcrossed
  • Dreamless
  • Goddess
A Song of Ice and Fire series (George R. R. Martin)
  • A Game of Thrones
  • A Clash of Kings
  • A Storm of Swords
  • A Feast for Crows
  • A Dance with Dragons
The Wheel of Time series (Robert Jordan and Brandon Sanderson)
  • New Spring
  • The Eye of The World
  • The Great Hunt
  • The Dragon Reborn
  • The Shadow Rising
  • The Fires of Heaven
  • Lord of Chaos
  • A Crown of Swords
  • The Path of Daggers
  • Winter's Heart
  • Crossroads of Twilight
  • Knife of Dreams
  • The Gathering Storm
  • Towers of Midnight
  • A Memory of Light
Tales of Dunk and Egg novella (George R. R. Martin)
  • The Hedge Knight
  • The Sworn Sword
  • The Mystery Knight
Ender's Game* series (Orson Scott Card)
  • Ender's Game
  • Speaker For The Dead
  • Xenocide
House of Cards series (Michael Dobbs)
  • House of Cards
  • To Play The King
  • The Final Cut
The Riftwar Cycle* (Raymond E. Feist)
  • Magician: Apprentice (Magician - Book 1)
  • Magician: Master (Magician - Book 2)
  • Silverthorn
  • A Darkness at Sethanon
  • Daughter of The Empire **
Other various novels
  • Crime and Punishment (Fyodor Dostoyevsky)
  • Animal Farm (George Orwell)
  • American Psycho (Bret Easton Ellis)
  • Lord of The Flies (William Golding)
  • The Great Gatsby (F. Scott Fitzgerald)
  • Lolita (Vladimir Nabokov)
  • The Killer's Cousin (Nancy Werlin)
  • The Informers (Bret Easton Ellis)
  • Glamorama (Bret Easton Ellis)
  • The Casual Vacancy (J. K. Rowling)
  • Second Degree (Prashant John)
  • Of Course I Love You...! Till I Find Someone Better... (Durjoy Dutta and Maanvi Ahuja)
  • If It's Not Forever. It's Not Love. (Durjoy Datta and Nikita Singh)
  • Now That You're Rich . . . Let's Fall In Love (Durjoy Dutta and Maanvi Ahuja)
  • I'm not twenty four...I've been nineteen for five years... (Sachin Garg)



*: I lost interest in finishing them or I couldn't find the later books.
**: Currently reading as on 2014-02-07

2013-05-28

Opera Next 15: Chromium implemented

It has been a long time since my last blog entry. I could find nothing to write about (or maybe think about). Now, that Opera has finally incorporated Web-kit (that is; in simple terms; engine being used Chrome) and are probably moving to be open source, I definitely found something.

It was released publicly on Opera Blogs by the team about the release of Opera Next 15. I was shocked to notice the largest file size of Opera's installer with a size increasing 20 MB (24 MB, tbh). While normally these are kept generally below 15 MB for international release.
After a busy Winter here in the Desktop department at Opera we are finally ready to lift the covers of the latest preview of the next generation of our Web browsers. Today we are releasing Opera Next 15 for Windows and Mac.
Though a Linux release is not yet out, it has been mentioned in comments that "We’re not releasing a Linux version today. It is an important market for us, and we are still working on it."

Thank you Opera team for this new UI and other changes in your release. This release is based on Chromium/Blink. So far, I have liked what I noticed in the browser. The UserAgent string for this browser is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.20 Safari/537.36 OPR/15.0.1147.18 (Edition Next)
Along with that, here is a concise list of features I noticed:
  • Really fast management and transfers in tabs
  • Stash
  • Discover
  • Speed dial includes bookmarks
  • Off road mode
  • Any page can be added directly to speed-dial by one click
  • Better displaying of tabs (as compared to older releases)
  • Opera's internal email client M2 is a separate product
  • A completely new and quite improved help index
  • The settings page is a copy of Google's Chrome browser
  • Go to Speed Dial button available near address bar
  • Speed Dial can also manage folders/directories
  • Chrome's web inspector
  • n-different "opera.exe" entries in the Task Manager
And that is about it. I couldn't find a single feature change that I could either care about or comprehend. But, on the other hand, since it is just the "FIRST" release with these changes, Opera is sure to implement many of the features. The list of unavailable features is quite long but the most important to me amongst them include:

  • Mouse Gestures
  • Tab stacking
  • Dragonfly
  • Panels (Press F4 in older Opera browsers if you are unaware of what they are) - This includes chat client, contact manager, mail client, notes etc.
  • RSS Feeds parser (No, XML parser just doesn't cut it for me)
  • Custom shortcuts (such as Ctrl + Shift + V for Paste and Go )
  • Old password manager
  • Search engine management
  • Closed tab list in the title bar
  • Option to add Status bar/View bar
  • Sessions Manager
The above list is just what I'd like back in beta release of Opera. All the very best Opera team. Thanks a lot for the awesome user experiences as always. At the end, I'd just quote a comment from the aforementioned blog post.
If I wanted an UI for idiots I would use an browser with such UI! I've installed OperaNext and... well, I see chrome... and simply cant use it!

2011-10-31

Chat Logging bot for DC++

First Things First
  1. I don't know it the bot will work with any other hub software or protocol other than YnHub (which uses NMDC protocol).
  2. The bot has been tested only in DCDM++ v 0.401, and it is still working fine on a system with 768 MB RAM and a crappy processor.
Functions of Bot:
  1. Able to log the complete main-chat, upto the maximum length of 800 characters each line.
  2. Stores the chat log in files names as <day>_<month>_<year>.txt format.
  3. The storing and opening is set in dcpp Listener, so the file get created automatically when the system time beomes 00:00 hours.
  4. There is a user score generator and top chatters facility available.
Required:

  1. DCDM++ client. (Preferably 0.041)
  2. A working hub (to test, or log on).
  3. Folders made in the following manners: "<year>\<month>". I have it prepared for 12 years.
  4. A file named "ChatLogHelp.txt" with following data inside it:


Okay, so now, what we need is the main LUA script which will work. Here'e that too:

Blog Headlines

Harry Potter's Blog