Thursday, May 3, 2018

Compiler, Obect Code / Relocatable Code, Linker

When we compile a C source file using GNU C compiler, it compiles our code into an assembly source. Then, the assembly source is assembled by the assembler (included with gcc (GNU C compiler)). It generates the object code (relocatable format machine code), and it is usually not directly executable. Next, the linker links libraries. Libraries are also in relocatable format, this is why we compile libraries with -shared / -fpic / -fPIC flags.

The linking process checks the library name that we included in the source file and it also checks whether the library is available in the system's default library path /usr/lib (GNU/Linux) if not, we can pass the specific libraries as an argument to gcc with -I flag (gcc -I/home/shuja/Documents/ ) 

finally, the linker links our sources(object codes) with libraries and generates the executable.
C Source File
 Assembly Source (generated  by GNU C compiler)
Disassembled object code (Disassembled because object code isn't human readable)
test.c - C source, test.s - assembly source, test.o - object code, exic - exicutable, test.bin - flat binary file
System default library path /usr/lib (GNU Linux)

Tuesday, December 12, 2017

Open Sri Lankan Bank Account Online and Get Free Virtual Debit Card FriMi

Open a Nation Trust Bank account online and get a Free Virtual Debit Card.

Nation Trust Bank is the first Srilankan bank that offers, Online Account opening without any document or signature. They promote their Online Account opening & maintaining service as "FriMi". There are no differences between the online opened account and the General Savings account, but the interesting thing is the Online Account does not have a physical debit card, but you can withdraw money through any Nation Trust Bank ATM, using FriMi  Android / iOS App. You will get a free virtual debit card for online payments. You can check your card details (Card number, CVV etc..) via the App. When you register to FriMi, you can choose your own FriMi account number, and you will get your actual Nation Trust Bank account number after the complete registration. Some of the advantages of FriMi are bellow.

  • You do not have to deposit a single Rupee for opening a FriMi account.  
  • No minimum monthly balance to maintain the account. 
  • No, any Monthly/Annual Fee.
  • No any Fee for Virtual, Debit Card (issuance/renewal)
  • You will get an actual Nation Trust Bank Account.
  • You can Transfer Money to FriMi Users using FriMi ID/Bank Account number, and other Nation Trust Bank customers, using their bank account number. Also, you can transfer money to other banks through CEFT. 
  • Nation Trust Bank Do not charge Fee for Inter Bank Transactions through CEFT (Lanka Pay). 
  • You can pay Utility Bills and TopUp your phones.
  • You will get a free virtual debit card for online payments. (You can use it to, PayPal, eBay etc... )
          • & Many more...
To open a "FriMi" account you need an Andriod Phone or iOS Phone. Generally, you can not use FriMi with a superuser accessible (rooted) device, because FriMi checks the "SafetyNet" test in order to the Central Bank regulations. If you are a techie guy you can use FriMi with a rooted device, but I do not recommend it.
Download & install FriMi App via Google Play or Apple AppStore and open the FriMi App, then tap on "Join Now" button then skip the Introduction window and then carefully read the CUSTOMER TERMS AND CONDITIONS, tap on "I Accept". Then you will get the steps of the registration process, Tap on "OK, Got it!".
  1. You need to take a selfie in a good light and background condition. 
  2. Take, clear shots of both sides of your NIC, Driving License or Passport.
  3. Insert your real data. Name, Employment etc...
  4. Chose your own FriMi id, PIN number and name your device (Eg: Samsung).
After the registration process, you can do the transactions up to Rs. 25 000 until your account is fully upgraded. The upgrade will be done over the phone. Nation Trust bank gives you a call within office hours for the verification & upgrade. After the verification call, you can see your actual Nation Trust Bank account number via FriMi app. If you miss the verification call, simply call back to the FriMi customer care number or send a WhatsApp message to FriMi, they will call you back.

To Get Your Actual Bank Account Number.
(Tap on Top Up --> Other Top-Up Options --> Other Bank)
Click on Image to Enlarge 

You can deposit money using FriMi ID or Actual account number through any NTB Branch, IBAN or CDM.

To check your Virtual Debit Card details 
(Tap on Main Menu --> Cards)

Due to "FriMi" now Sri Lankans can do online shopping like eBay without filling paper documents for opening bank accounts & no waiting for debit cards. Because we can get a free virtual debit card instantly with FriMi.

If you want to check your debit card statement for website verifications (PayPal, Skrill, etc...),  Sign Up to Nation Trust My Bank website using your actual bank account number provided by FriMi and check recent transactions. Otherwise, it will be printed in your monthly eStatement.
                                                           FriMi Debit Card Statement. Click on Image to Enlarge. 

*FriMi is a Trade Mark of Nation Trust Bank FriMi 

Monday, October 30, 2017

Java Byte Code, Interpreter and JIT

Generally, when a program is compiled to an intermediate level and then interpreted by a virtual machine, it runs slower than it would run if compiled to machine code.
However, with Java, the differential between the two is not important for general purpose. Because byte-codes are highly optimized, the use of byte-code enables the Java Virtual Machine to execute programs much faster than you might expect.
Java is also designed as an interpreted language, so java does not have anything to stop (on the fly) compilation of byte-code into machine code, to improve performance.
For this reason, the HotSpot technology was introduced after Java’s initial release.
HotSpot provides a Just In Time (JIT) compiler for bytecode. When a JIT compiler is part of the JVM, selected set of bytecode are compiled into executable code in real time, on a piece, by, piece, demand basis. 
It is important to understand that it is not practical to compile a whole Java program into machine code all at once, because Java performs several run-time checks that can be done only at run time. Instead, a JIT compiler compiles code as it is needed, during execution. Furthermore, not whole the bytecode of a programme are compiled, only those that will benefit from compilation. The remaining code is simply interpreted line by line. 
However, the JIT approach still yields a significant performance increment. Even when dynamic compilation is applied to bytecode, the portability and safety features are still apply, because the Java Virtual Machine is still in charge of the execution environment.

Wednesday, September 7, 2016

How to get free US Phone number online.

These days, people love to use multiple numbers with their phones, and use conventional phone calls with their personal computers, tablet devices etc... . In this post you will see how to setup SIP account with your Smart Phone or Computer and associate a US phone number and an International Inum number to your SIP account. first of all you need to know a bit about SIP.

According to Wikipedia.
The Session Initiation Protocol (SIP) is a communications protocol for signaling and controlling multimedia communication sessions. The most common applications of SIP are in Internet telephony for voice and video calls, as well as instant messaging, over Internet Protocol (IP) networks."
So basically it is an IP based communication protocol. You can use it with your SmartPhone or Computer very easily, for that you need a SIP service provider.

Sunday, August 21, 2016

No one loved Kingswood more devotedly than he

During World War I, Kingswood enlisted a group of present boys as cadet officers to fight on behalf of the Crown, the son of a family that was close to Kingswood — Brian Leslie De Vos 
Kingswood For Ever The Story of Kingswood Kandy - Chapter Kingswood and The World War - Page 98 
Brian Leslie de Vos Kingswood
"The thirteenth and last for mention is Brian Leslie de Vos who was wounded in action on the 28th March 1918 and died on the following day of his wounds. No one loved Kingswood more devotedly than he. He was entirely our own; he exulted in being ours and entirely ours. Every letter of his from the Front, to whomever written, had some endearing reference to the school. He was wounded once in France, and wrote afterwards : "I now have in my possession a copy of the Kingswood Song, stained with blood. It was on my person when I was wounded. It is the souvenir I value most. Can you get me the music of the Kingswood Song? Oh! for a Kingswood day again!" He left Kandy on the 18th October 1915. We saw him off with "all the honours" at the Railway Station. "K.F.E., Leslie," said a teacher to him as the train started. "Always K.F.E., Sir," was his reply."

Monday, December 14, 2015

Mobile Data For Tourists In Sri Lanka

Sri Lanka has the cheapest mobile data and calling plans in the world. You can't buy any unlimited 3G/4G mobile data or calling plan from any carrier. LankaBell - WIMAX Is the only company offering fixed line unlimited data only for Sri Lankan citizens,  starting from 3000 LKR / 23 USD

Sri Lankan mobile carriers has special tourists plans. If you want to use data, do not buy them, because tourist plan will have only IDD calling offers, These days people are using data based communication services like Hangouts, Duo, Allo, Whatsapp, Viber etc.. so I think buying a tourist plan is a bad idea.  If you want to get cheap IDD calls, you can buy special offered IDD topup voucher card for local prepaid plan.

Wednesday, July 8, 2015

Department for Persons Registration of Sri Lanka

Yesterday I went to the Department for Persons Registration to get new NIC for my lost NIC. I reached there at 9.00 AM. I had to stand in a long que for about 30 minutes. Then they gave me a number card and they told that they will call me to the counter according to that number. They called me at 11.30 AM. I paid the fee. When I gave my file I told them, there is a correction to be made in my name. They told me that it is not a problem, we enter your name as it is in the birth certificate. Then I was standing for a long time, and at last they announced my name at 3.30 PM. Finally I got my NIC but my name was not corrected. What they did was, they copied the details from my old NIC and pasted it in the new card. (CTRL+C, CTRL+V)