Search Results For : tutorial

Quick note on Web.config file

A quick note on Web.config file in the ASP.NET project. It is worth noting that the file is a XML File (read this for more info – https://msdn.microsoft.com/en-us/library/ff400235.aspx )

One issue that hindered my process earlier was that the content in the value has special character it in, particularly, one of my SQL server’s password has a special character in it.

I would have to go and replace them accordingly. For instance, my password is <Password1& (note that < and ” is inclusive), i would have to change it to
&lt;Password1&amp;

You can refer to the list here – https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Office Excel – CONCAT Function

Microsoft releases new iterations of Microsoft Office suite every three years for desktop and Microsoft Office 365 is the subscription based cloud version of their Office software. Earlier in 2016, Microsoft released the 2016 edition of Office and some updates to Office 365 which added new features in Excel. Some very useful functions like the CONCAT and TEXTJOIN functions are added which make concatenating or joining text very easier with multiple cells or strings in your spreadsheet. These functions are only available in the latest Office 2016 desktop installation and Office 365 subscription. To show these new functions, here is the Excel CONCAT and TEXTJOIN function tutorial. I am breaking them into 2 different tutorials for ease of access.

Through the Office Excel CONCAT function, you can connect two or more text in different cells in your spreadsheet. When you connect two text, they are just joined together with no separation or space between them. Here is the tutorial on how to use Excel CONCAT function:

The format of the Excel CONCAT function is:
CONCAT(text1, text2, … , textN)

Where “text1” is the first string or cell and “textN” is the nth string or cell which you want to concatenate.

  1. In your Excel spreadsheet, see which cells or strings you want to concatenate.
  2. Then select a cell where you want to display the concatenated text.
  3. For example, in this following example spreadsheet, we want to concatenate the text in cells A11 through D11 and we want to display the output in cell F11.
  4. Select the cell F11 and enter the CONCAT function in the formula bar above the spreadsheet:
  5. =CONCAT(A11,B11,C11,D11)

  6. After entering the function, you will see the result in cell F11:
  7. Excel Concat

    Excel Concat

  8. As you can see in the example, the data in cells A11 through D11 is now concatenated in cell F11 and there are no spaces between the text.
  9. You can do this with numbers as well, like in the result shown in cell F12:
  10. Excel Concat

    Excel Concat

  11. If you enter a cell in the function which is empty, the function will not show anything from that cell in the output:
  12. Excel Concat

    Excel Concat

  13. You can also directly add a string in the function, as shown in the following example:
  14. Excel Concat

    Excel Concat

—–
You can view more Office Excel Tutorials in the link too!

Unable to see .htaccess or dot files in File Manager, cPanel

I was attempting to “edit” .htaccess file to make some url redirection for a page and I realised I wasn’t unable to locate the file in my web root. The first instinct is that I didn’t have any .htaccess file and I decided to create one. However, I was given an error that ERROR: Could not create file “.htaccess” in path. File exists..

This indeed confused me as I cannot locate the file. Upon further probing, I realised what was wrong. You have to check on the option Show Hidden Files (dotfiles) when you open up File Manager in your cPanel.

Tick the options Show Hidden Files (dotfiles).

Tick the options Show Hidden Files (dotfiles).

Converting Binary to Gray Codes

I am doing one of the tutorial in CS2100 in NUS SoC and one of the questions require us to convert between binary and gray codes.

I have decided to write a simple tutorial on how to convert from binary to gray codes.

What is Gray Code?
“….is a binary numeral system where two successive values differ in only one bit. The reflected binary code was originally designed to prevent spurious output from electromechanical switches.”
~http://en.wikipedia.org/wiki/Gray_code

What is Binary Code?
A binary code represents text or computer processor instructions using the binary number system’s two binary digits, 0 and 1.
~http://en.wikipedia.org/wiki/Binary_code

Before we start, lets look at an Exclusive OR, XOR(sometimes EOR gate, or EXOR gate)’s truth table.

The whole concept on how to do the conversion between the 2 number system heavily uses the XOR truth table.

 

 

 

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 1 – Prepare a table like this

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 2 – Copy down the Most Significant Bit (MSB) of Binary onto Gray Code row

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 3 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 4 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 5 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 6 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 7 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Binary to Gray Code Conversion

Binary to Gray Code Conversion : Step 8 – Get the MSB and next MSB of Binary and XOR them and copy its result down

Gray Code to Binary Conversion

Gray Code to Binary Conversion : Step 1 – Prepare a table like this

Gray Code to Binary Conversion

Gray Code to Binary Conversion : Step 2 – Copy up the Most Significant Bit (MSB) of Gray Code onto Binary row

Gray Code to Binary Conversion

Gray Code to Binary Conversion : Step 3 – Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Gray Code to Binary Conversion

Gray Code to Binary Conversion: Step 4 – Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Gray Code to Binary Conversion

Gray Code to Binary Conversion: Step 5 – Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Gray Code to Binary Conversion

Gray Code to Binary Conversion: Step 6 – Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Gray Code to Binary Conversion

Gray Code to Binary Conversion: Step 7 – Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Gray Code to Binary Conversion

Gray Code to Binary Conversion: Step 8- Take the MSB of Binary and next most MSB of Gray Code and XOR them. Copy its result upwards.

Address in address bar in right to left

I am sure this will be useful to some of my audience who may have similar experience as me.

There was this one day when I accidently click on some stuffs(which till date is still unknown to me what I did) and I accidently changed a setting which I shouldn’t had.

This causes my address bar to be reading from right to left as you can see below

To solve it, right click on the address bar and uncheck “Right to Left Reading Order”