Category Archives: Coding

All kinds of Programming.

Generate a dropdown list of timezones in php

By | February 14, 2018

Applications often allow users to select their timezones for reporting the proper time properly. Here is a quick function that can be used to generate a dropdown list of timezones that is easy to read and understand. <?php function get_timezones() { $o = array(); $t_zones = timezone_identifiers_list(); foreach($t_zones as $a) { $t = ''; try… Read More »

Php array of iso 639-1 language codes and names

By | September 2, 2023

Here is a php array containing the language codes and language names as specified by the iso 639-1 standard. Useful when . <?php /** ISO 639-1 Language Codes Useful in Locale analysis References : 1. http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes 2. http://blog.xoundboy.com/?p=235 */ $language_codes = array( 'en' => 'English' , 'aa' => 'Afar' , 'ab' => 'Abkhazian' , 'af'… Read More »

Generate code39/isbn barcodes in php with mpdf

By | May 27, 2013

Barcodes Barcodes are used in various business class applications to print information in encoded format such that it can be read later by barcode reading devices. Common places to see barcodes are product covers in shops, membership cards and documents like invoices etc. As php is now increasingly being used to develop such applications, barcodes… Read More »

How to Fetch Domain Whois Data with Sockets in Python

By | August 6, 2020

Whois The whois information of a domain name provides various details like registrar, owner, registration date, expiry date etc. The whois information is provided by the corresponding whois servers of the registrars. The information is available for free and most whois servers run a whois service on port 43 which provides whois data associated with… Read More »

How to Program UDP sockets in Python – Client and Server Code Example

By | August 7, 2020

UDP sockets UDP or user datagram protocol is an alternative protocol to its more common counterpart TCP. UDP like TCP is a protocol for packet transfer from 1 host to another, but has some important differences. UDP is a connection-less and non-stream oriented protocol. It means a UDP server just catches incoming packets from any… Read More »

Raw Socket Programming in Python on Linux – Code Examples

By | January 13, 2023

Raw sockets Raw sockets allow a program or application to provide custom headers for the specific protocol(tcp ip) which are otherwise provided by the kernel/os network stack. In more simple terms its for adding custom headers instead of headers provided by the underlying operating system. Raw socket support is available natively in the socket api… Read More »

Udp Socket Programming in Java – How to Code Client and Server

By | August 5, 2020

UDP – User Datagram Protocol sockets UDP is an alternative protocol to the more commonly used TCP protocol. It is a connection-less protocol where you directly send packets without have to establish a proper connection. UDP packets have smaller headers compared to TCP headers. Also data communication is faster since no acknowledgement is exchanged for… Read More »