browse by category or date

If you are familiar with HTML, I believe you should have used the <a /> tag before. In my own personal experience, I frequently use it for hyperlink to other pages, to launch email application and use it as a button.


<a href="other_page.html" target="_blank">Normal Link</a>


<a href="mailto:myemail@sodeve.net?subject=Product%20Enquiry">Contact Us</a>

<!-- This is how I create button in Bootstrap & Metronic theme -->
<a href="#" id="btnPrint" class="btn blue">Print</a>

Did you know that there are other protocols that we can use in HREF? Here’s what I found out recently.

1. Call Phone Number

We can create a hyperlink which will open the dialer to call a number. When the visitor click this hyperlink, it will automatically open up the phone program.

<a href="tel:64197576">Call 64197576</a>

Here’s what happen on my Android phone when I clicked above hyperlink.

Screenshot_2014-11-20-15-21-44

2. Send SMS

With this hyperlink, we can send SMS to a phone number.

<a href="sms:80264444?body=test%20sms%20by%20url">SMS Me</a>

SMS Me
Here’s what happen when I clicked above hyperlink.

Screenshot_2014-11-20-15-21-59

3. Call Skype Number

For Skype, we can configure to either use the phone number, or using the Skype name. We can also specifiy that we want to chat instead of calling. Here’s how:

<a href="skype:+6285714053333?call">Call Number with Skype</a>

<a href="skype:skype_name?call">Call Skype User</a>

<a href="skype:skype_name?chat">Chat with a Skype User</a>

What I don’t like with Skype is that will immediately call the number/contact. Who knows if the visitor is accidentally clicking the link, when the intended action was scrolling the page.

Screenshot_2014-11-20-16-15-55Screenshot_2014-11-20-16-19-57Screenshot_2014-11-20-16-22-04

4. Launch Map

Before the explosion of smartphone, showing locations in a website means embedding the map in the page. In smartphone screen, this is not advisable. The small screen-estate would not enough for the embedded map. So what we should is creating a hyperlink which will auto launch the map application.


<a href="maps:q=11%20Bedok%20North%20Ave%204">11 Bedok North Ave 4</a>

<!-- Should works everywhere -->
<a href="geo:1.334586, 103.950130">11 Bedok North Ave 4</a>

MAPS: 11 Bedok North Ave 4
GEO: 11 Bedok North Ave 4

Only GEO works in my Android phone.

Screenshot_2014-11-20-17-18-34

That’s all folks. I hope it helps, cheers!

Source: Wikipedia

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Long time ago, I build an Ubuntu Linux virtual machine which was projected to be a reverse proxy server. It was my personal project which my boss gave the green light. Due to the urgency of other projects, I had to postpone it.

Now I decided to revisit this project because soon, we’re going to open up one of our intranet application to the public. Since I felt the machine quite out-dated, I decide to update it

$ sudo apt-get update

Sadly it didn’t work.

ubuntu-apt-get-update

Hmm weird.. But I can ping 8.8.8.8 (Google public DNS)

ubuntu-ping.8.8.8.8

So it means I don’t have DNS which will resolve the domain name to IP address. Thus I need to edit /etc/resolv.conf

sudo nano /etc/resolv.conf

Then added the following lines:

nameserver 8.8.8.8 #Google DNS
nameserver 8.8.4.4 #Google DNS
nameserver 208.67.222.222 #Open DNS
nameserver 208.67.220.220 #Open DNS

That’s it. No reboot required.

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Recently I was tasked to develop an application to keep track the outgoing items from the warehouse. Since it was style like a POS machine, I need to limit the instance of Windows Form application to only one.

To do this we’re going to need a “locking” mechanism. So before launching the Form, we need to check whether the lock is ON or OFF. We can use Mutex object as the lock.

public Mutex(
	bool initiallyOwned,
	string name
)
initiallyOwned
Type: System.Boolean

true to give the calling thread initial ownership of the named system mutex if the named system mutex is created as a result of this call; otherwise, false.

name
Type: System.String

The name of the Mutex. If the value is null, the Mutex is unnamed.

To ensure the unique-ness of Mutex’s name, I used GUID as name (in Visual Studio, Tools -> Create GUID)

vs-guid

This is the final code:

using System;
using System.Threading;
using System.Windows.Forms;

namespace MyPOS
{
	static class Program
	{
		static Mutex mutex = new Mutex(true, "{37D26ECE-1F4F-42BC-9C23-11A9DAA8DCCA}");

		[STAThread]
		static void Main()
		{
			//Grab the lock
			if (mutex.WaitOne(TimeSpan.Zero, true))			
				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new Form1());

				//when the application is finished, release the lock
				mutex.ReleaseMutex();
			}
			else
			{
				//Lock is already used
				MessageBox.Show("Only one instance allowed");
			}
		}
	}
}

I hope it helps, cheers!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: