Dev Corner

Software Developer’s Notepad

Archive for the ‘Software Development’ Category

Data expressions can be used to describe structure of data. Read the rest of this entry »

Problem: You have a string encoded in UTF-8 and you need to convert it to two byte UTF encoded string. For example, you might want to display convert the string to CP1251 (Windows-1251) encoding using standard encoding tables. Read the rest of this entry »

PHP implements a bin2hex function that converts given binary string to hexadecimal string. Sometimes you need to solve the reverse task. You are given hexadecimal string and you need a PHP function that converts it to a binary string. Read the rest of this entry »

Input stream are useful as they encapsulate concrete implementation of a data source. You can change the data source without changing the application code. For example, you application reads data from a file. One day your boss decides that you need to retrieve information from a server located 1000 miles away. You just implement another class that implements the same input stream interface. The new class retrieves data from network instead of a local file. Read the rest of this entry »

Problem

How to join together two strings and how to make one long string from numerous pieces?
Read the rest of this entry »

Sometimes we should find what the is the type of a given variable. In JavaScript there is a simple way to solve this problem Read the rest of this entry »

Check if variable is a number in PHP

Posted by bateto under PHP

It is useful to know the type of the variables, with which you are operating. But in PHP there are not declarations, in which we point out what the type of the variable to be. Read the rest of this entry »

Shuffle 2D Array Java Algorithm

Posted by admin under Java

Problem

You are given a Java array. You need Java Code to shuffle array elements in random order. Read the rest of this entry »

Hello JavaScript!

Posted by admin under JavaScript

How to implement the simplest JavaScript code ? Read the rest of this entry »