Delete Git Branch

Git Branch

1. Checkout "MyBranch" before deleting {OldBranch}. It makes "MyBranch" current/working branch.
     $ git checkout {MyBranch}
2. Delete local "MyBranch". This is the safest option for deleting a local branch since branch doesn't get deleted if there is any unmerged changes exist.

Using Git Branches

Software Engineers deal with git branches pretty much every day. Git branches are an integral part of our everyday workflow. To keep it as a reference, we will talk about some every day required git commands for branching including how to create a branch, checkout branch and finally, how git merge can integrate the history of independent branches.

Git Branch
[ Color coded serial numbers represent Git Flow ]
1. List all of the branches in a repository.
     $ git branch
2. Create a new branch called "MyBranch".

URL Decoder

In many cases, we may find data escaped. Especially for the data that are represented by an unreserved character. Most of the unreserved characters are automatically encoded by some systems. We know that, the characters allowed in a URI are can be either reserved or unreserved. Any character that is not an alphabetic character, a number, or a special character that is being used outside its normal context is should be encoded. "%7e" is sometimes used instead of "~" in an http URL path. Considering every possible scenarios, if you need to decode your URI, use the tool below_

Enter your encoded URL:

unescape():

decodeURI():

decodeURIComponent() (recommended):

URL Encoder

If you are a web developer or blogger, you need to put together a string for using it in a URL in many cases. To do that, you have to be very careful, you have to account some special characters that have special meanings in URL such as question marks or ampersands or multi-bytes Unicode characters that must be encoded properly to be expressed properly inside a URL. If you want to make sure that your URL follows proper rules, this is a handy encoder to check with.

     Test characters: ~!@#$%^&*=+(){}[],?/:;'\"\\
[ Outputs will be the encoded values of Test Characters unless input value is provided ]

Enter your URL:

escape():

encodeURI():

encodeURIComponent() (recommended):

Compare unescape(), decodeURI(), and decodeURIComponent()


unescape() Method
     Test characters: ~!@#$%^&*=+(){}[],?/:;'\"\\
We know that escape() method returns a string of the argument with all spaces, punctuation, accented characters and any non-ASCII characters replaced with %HexNumber. The function unescape() does simply the opposite. It takes the encoded version of a string and reverse the string back to its decoded original state. By the way, both of these methods does not work with Unicode strings and both have been deprecated. The syntax of this function is_
     unescape(string);
For examine, using escape() on the Test Characters will give the following encoded string. Using this encoded string in the input box and decoding will return the original Test String.
     %7E%21@%23%24%25%5E%26*%3D+%28%29%7B%7D%5B%5D%2C%3F/%3A%3B%27%22%5C

Compare escape(), encodeURI(), and encodeURIComponent()


escape() Method

The escape() function computes a new string in Unicode format where certain characters have been replaced by a hexadecimal escape sequence. It encodes all the spaces, punctuation, accented characters, and any other non-ASCII characters. It doesn't encode all the special characters, such as @*_+-./. It replaces characters with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, # is returned as %23.
Test characters: ~!@#$%^&*=+(){}[],?/:;'\"\\

Display Alphabets by setInterval() Function


United States Time Zones

HTML Code Decoder

We talked about HTML encoding and create a handy tool on HTML Code Encoder post. We talked about why encoding is important and why we can't ignore that. However, decoded HTML code is also needed in many cases. Specially, we need to decode our old code to update or modify to make it more user friendly. If we want to update our cool project on blog or site, we need a decoder for encoded code.



Check out HTML Code Encoder.

HTML Code Encoder

Encoding HTML code is important in many cases. We know that browsers may get the encoding wrong. Symbols might get mixed up or might show as unknown character. Encoding data converts potentially unsafe characters into their HTML-encoded equivalent. If you just paste 3 byte characters of some encoding into your HTML code without escaping them, things might get ugly. Its good habit to encode your HTML code. Below is a little tool to help you out. Copy your HTML code in the textbox, encode using encode button and click or focus the textbox to select encoded version of your code to copy. Its that simple!



Check out HTML Code Decoder.

Find 'bin' Folder on Mac

Before talking about finding bin folder on Mac, we should know something simple. There is a unique behavior of UNIX system. System directories (/usr, /var, /etc) are always hidden on Mac by default, and this is the reason why we can not navigate to these directories through Finder. If you are an advanced user, you need to get into these folders sometime since these hold many license and configuration files inside. Below are some ways to get into these directories quickly_ 

1. Open Finder and press COMMAND + SHIFT + G. Following dialog box opens_
Find 'bin' Folder on Mac

JavaScript setInterval() Method

JavaScript setInterval() method either call a function evaluates an expression at specified number of milliseconds. This method continues to call/evaluate the expression until window is called. Another way to stop this method is by calling clearInterval() method. Below is a working demo of this useful method.

Hit start..

How to Edit the Hosts File on Mac

In many cases, we need to know whats going on with internet on our Mac. Well, we can take a look at DNS (Domain Name System) and associated cache file. There is another way to get this task done, using Hosts file. Hosts file is always hidden on Mac's /etc folder. It carries hostnames with certain IP address. Our OS and browsers come and check this file for desired hostname with IP address. In particularly, once we write URL on browser's address bar, OS gets in this file for corresponding mapping before going to the DNS server to look for IP address. By the way, hosts file can be used to override the default DNS information.

     Most of the Mac users don't need to worry or touch the Hosts file. Its always ready to get done what it meant to do. However, we need to touch this file in certain cases. We know, it can redirect a domain. Suppose, we are testing a developing server and we don't want others to access it using DNS. We can use Hosts file to make a domain redirect to local address on our machine, we will be able to test our code offline before it becomes online for users.

JavaScript Output

There are several ways to generate output in JavaScript. Each and every scenario depends on our need. These are_

     innerHTML
     document.write()
     console.log()
     window.alert()

Mac Functions for Need of Snipping Tool

Snipping Tool is very popular little utility for Windows users. You can take screenshot with required dimension with it. Is there any option on Mac that can replace this tool?
Well, absolutely. Mac has Grab, which does the same. We will talk about Grab in detail on other post. Right now, we will list couple of options below that are pretty handy_

  • Full Screen:  By pressing COMMAND+SHIFT+3, we can save a screenshot for entire screen to the Desktop.
  • Part of Screen: We can snip a specific area of the screen to the Desktop by pressing COMMAND+SHIFT+4 simultaneously. Once the cursor icon changes to " + ", we need to create a box around the desired section of the screen and release.
  • The third option is GRAB that we mentioned earlier. Its a very light but very useful tool that is the best alternative for Windows Snipping Tool.

Triangular Number


Triangular Number

Triangular Form: [A x (A + 1) / 2]
A =
=>
=>

Tweet with 280 Characters

Twitter declared 280 characters limit for tweeting (current 140) but all users will not be able to use the offer yet. Its only for test on selected accounts. However, there is a workaround. @Prof9 created a little client side script that does the trick_

_Download Tampermonkey and install it on your browser. 
_Head to this Gist, click the “raw” button, and install script to Tampermonkey.
_Create tweet with more than 140 characters, make sure the script in running in Tampermonkey. 
_You have to refresh the page every time you jump on different pages. 
_This is pretty harmless script, only bypasses the tweet button limit.
_Happy Tweeting!!!

Tic Tac Toe

Tic Tac Toe
TIC TAC TOE
X wins: 0
O wins: 0
Draws: 0

Age Calculator_Basic


Age Calculator_Basic

Date Format: Month/Date/Year
Birth Date
Recent DateUse Today
=>
[ Round down ]
=>

Syntax Highlighting on Blogger with Github Gist

Here is the most convenient way to syntax highlighting on a blogger post..

       1. Go to https://gist.github.com/
       2. Create a gist with your code. Use 'Create Public Gist' button to make it public.
       3. Copy the embed script.
       4. Paste the link on your blogger post in HTML editing mode.

Click Count with JavaScript


Button was clicked - 0 - times.


     The above click event can easily be triggered by a little script. We can use that for our blog or in web game to collect click. Check out the following script_

     Here we used getElementById() to get certain elements and set an onClick() attribute and incremented the count number. This the most easiest way to get this task done. However, there are so many other ways too.

Move Image with JavaScript

What it can't do? Well, I was talking about jQuery. It is a tremendous library. CSS wasn't able to create complex animations at some point, and then jQuery appeared to help it out. jQuery created a wrapper method, called animate(). It can apply custom animation to the elements in the set. It provides a set of CSS style properties that they can reach the end of the animation. By the way, only numeric values are allowed to be animated, such as left: "+=350" in our case. String values cannot be animated like background-color:black, except for the strings "show", "hide" and "toggle". These values only allow hiding and showing the animated element. There is a working example below_

Explore the Blog...arrow

Quadratic Equation Calculator

Quadratic Equation Calculator

Quadratic Form: Ax2 + Bx + C = 0
A =
B =
C =
X_Min =
X_Max =
=>
=>

Once You Get Hacked

  • Turn off the Wi-Fi connection and pull the network cable.
  • Shutdown. Take off the hard drive quickly.
  • Connect the drive to another machine as a non-bootable drive and scan for infection.
  • Make a backup.
  • Put the drive back to the old machine and completely wipe the hard drive. Also consider repartition and format.
  • Reinstall OS from trusted source. Must install updates.
  • Install all the security softwares prior to any other programs.
  • Scan you backed up files to other machine and copy over.
  • Don’t forget a complete backup.

    Make Windows 10 PC Faster

    Many of us believe that Windows 7 and XP are best in terms of UI and hardware management. Updating was under control that we knew what is going on. On the other hand, Windows 10 is somewhat a “bulky” OS. So many of us are having performance issues which are pretty annoying especially for the former Windows 7 users. However, by taking couple of simple steps can increase our PC's performance significantly. Here are some..

    Best Programmer Joke _ int page[4];

    Java ProblemFactory Photo
    Java ProblemFactory Photo

    How to Print Contents from Certain DIV

    Time to time we get into such situation when we need to print part of our webpage where pop-up is restricted. Well JavaScript will be the answer. Here is a little script that raise the DIV dynamically and print. It is very effective cross browser script. Feel free implementing it as a starter..

    Another example_

    =>

    In Java 3 = 12..

    In Java, the output:

         System.out.println(1 + 2 + " = " + 1 + 2);
    
    => 3 = 12

    Why??
    Because Java starts treating everything as a String once it has found a string in System.out statement. Interesting, huh...
     

    
    

    Can the Product of Two Polynomials Result in a Single Term?

         By assuming that we are talking about polynomials with real coefficients. Suppose that the polynomials are, 

    P(x) = axp +  ...  +  bxq
    Q(x) = cxr +  ...  +  dxs
    Where . . .

    Grab The Button...

    Grab the above button and add to your blog or website to get easy access to Virtual Species. Simply click the textbox, copy the code and paste where you want to see the button. That's it!