Welcome to iCodeJava !

Latest Entries from my programming blog.

We at iCodeJava Labs have been working on a variety of smartphone apps based on android platform. The following is a list of our Android Apps that we have developed and is currently available on Google Market. Most of the Apps we have released are completely FREE. We might not be able to provide individual technical support in each of those apps but we do listen to your feedback and comments that you leave on our website or on the App page in the Google Play.

Note – Most of these apps are Advertisement Supported through AI Text optimizer wordfully.ai. They have a provision to opt out in case you don’t want the ads to be displayed in our apps.

Android AppMarket LinkUpdatedVersion
American Star-Spangled PlayerClick01/14/261.8
Canadian Maple QuotesClick02/03/261.8
French National AnthemClick03/19/261.6
British Baby Name GeneratorClick04/07/26
German National AnthemClick05/22/261.14
Italian National AnthemClick06/11/261.7
Japanese National AnthemClick07/02/261.3
Irish Baby Name GeneratorClick08/18/261.2
Swiss Forex FreeClick09/09/261.6
Dutch Forex ProClick10/04/261.2
Swedish Lyrics ProClick11/27/261.7
Norwegian National AnthemClick12/08/261.7
Polish Folk ProverbsClick01/30/261.9
Finnish Regional MapsClick03/05/261.1
Portuguese National AnthemClick04/21/261.6
Canadian National AnthemClick06/28/261.2
You Are American IfClick08/09/261.6
You Are Canadian IfClick09/16/261.4

Using Java to Convert TSV File to CSV File

/**
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in
 * supporting documentation.
 * <p>
 * THE AUTHOR PROVIDES THIS SOFTWARE ''AS IS'' AND ANY EXPRESSED OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.icodejava.products.commons.csv;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Vlad
 * www.icodejava.com
 * Convert Tab Separate Value (TSV) file to Comma Separated Value (CSV) file
 */
public class TSVToCSVConverter {
    public static void main(String[] args) throws Exception {

        //The input TSV File
        String tsvFilePath = "/Users/kushal/Desktop/NLP/imdb_data_set/01_10_2019/title.basics.tsv";

        //The output CSV File
        String csvFilePath = "/Users/kushal/Desktop/NLP/imdb_data_set/01_10_2019/title.basics.csv";

        convertTSVToCSVFile(csvFilePath, tsvFilePath);

    }

    /**
     * Converts a TSV file into CSV file.
     * - Reads one line at a time
     * - Replaces Double Quotes with Single Quotes
     * - Puts Double Quotes Around Every Field
     * - Fileds in the output are separated by comma.
     *
     * @param csvFilePath
     * @param tsvFilePath
     * @throws IOException
     */
    private static void convertTSVToCSVFile(String csvFilePath, String tsvFilePath) throws IOException {

        //TODO: If outfile does not exist, create one.

        StringTokenizer tokenizer;
        try (BufferedReader br = new BufferedReader(new FileReader(tsvFilePath));
             PrintWriter writer = new PrintWriter(new FileWriter(csvFilePath));) {

            int i = 0;
            for (String line; (line = br.readLine()) != null; ) {
                i++;
                if (i % 10000 == 0) {
                    System.out.println("Processed: " + i);

                }
                tokenizer = new StringTokenizer(line, "\t");

                String csvLine = "";
                String token;
                while (tokenizer.hasMoreTokens()) {
                    token = tokenizer.nextToken().replaceAll("\"", "'");
                    csvLine += "\"" + token + "\",";
                }

                if (csvLine.endsWith(",")) {
                    csvLine = csvLine.substring(0, csvLine.length() - 1);
                }

                writer.write(csvLine + System.getProperty("line.separator"));

            }

        }


    }

    private static String convertToCSV(String line) {
        String csv = "";
        line = line.replaceAll("\t", ",");
        return line;
    }
}

Japanese National Anthem Kimigayo – Smartphone App

Latest Version:
1.3 – Release on 2013-11-20

About this android app:
This japanese app lets you play the beautiful Japanese National Anthem “Kimigayo Wa” on your phone. The voice is crystal clear with a high quality mp3 and the app looks great. We have provided the lyrics in variety of forms – Japanese, Romanized English and Translated English. App also contains the history and further information of the anthem in addition to the musical note.

Please note that the User Interface is in English – so anyone from around the globe can download the app and be able to use it. This app is completely free but contains advertisement. If you get offended with the advertisements, we urge you not to install this app.

SDK Support:
This app supports android devices with sdk 2.2 and above

Google Market Link:
https://play.google.com/store/apps/details?id=com.sanjaal.android.japanese.anthem

Contact Us:
If you have any questions, concerns or feedback, please contact us by hello@icodejava.com

About Japanese National Anthem:
“Kimigayo” is the national anthem of Japan and the world’s oldest lyrics in a national anthem. From 1868 to 1945, it served as the national anthem of the Empire of Japan. With a length of 11 measures and 32 characters, “Kimigayo” is also one of the world’s shortest national anthems currently in use. Its lyrics are based on a waka poem written in the Heian period (794-1185), sung to a melody written in the imperial period (1868-1945). The current melody was chosen in 1880, replacing an unpopular melody composed eleven years earlier. While the title “Kimigayo” is usually translated as His Majesty’s Reign, no official translation of the title nor lyrics has ever been established by law.

Prior to 1945, “Kimigayo” served as the national anthem of the Empire of Japan, however, when the Empire of Japan was dissolved following its surrender at the end of World War II, its parliamentary democracy successor state, the State of Japan, replaced it in 1945, the polity therefore changed from a system based on imperial sovereignty to one based on popular sovereignty. However, Emperor Hirohito was not dethroned, and “Kimigayo” was retained as the de facto national anthem, only becoming legally recognized as the official national anthem in 1999, with the passage of Act on National Flag and Anthem.

Since Japan’s period of parliamentary democracy began, there has been controversy over the performance of the “Kimigayo” anthem at public ceremonies. Along with the Japanese Hinomaru flag, “Kimigayo” has been claimed by those critical of it to be a symbol of Japanese nationalism, imperialism and militarism, with debate over whether “Kimigayo”, as a remnant of the Empire of Japan’s imperialist past, is compatible with a contemporary Japanese parliamentary democracy. Thus, the essential points of the controversies regarding the Hinomaru flag and “Kimigayo” are whether they express praise or condemnation to the Empire of Japan and whether the Empire of Japan (pre-1945) and postwar Japan (post-1945) are the same states or different states.

[Text Source: Wikipedia / Creative Commons]

Canadian National Anthem (Android App)

Latest Version:
1.2

About this android app:
This app lets you play the patriotic national anthem of Canada (O Canada) on your android phone. Included sound quality is awesome. We have also provided lyrics in both Roman English form as well as translated English language.

You can play/pause or stop the Anthem. The sound keeps playing int he background as you are navigating through the application once you started it from the landing page. There is a history of anthem on who wrote it and how it began for those seekers of the knowledge.

If you play music, we have also provided musical notations in this app.
This is an app every Canadian people should have on their android phone. Give it a try and give us feedbacks and suggestions for improvement.

SDK Support:
This app supports android devices with sdk 2.2 and above

Google Market Link:
https://play.google.com/store/apps/details?id=com.sanjaal.android.srilankannationalanthem

Contact Us:
If you have any questions, concerns or feedback, please contact us by hello@icodejava.com

About Canadian National Anthem:
O Canada is the national anthem of Canada. The song was written and composed by the Vlad in 1940, and was later adopted as the national anthem in 1951. It was written when Canada was still a British colony and was initially written as a tribute to Canada, expressing sentiments of freedom, unity and independence, and not for the purpose of serving as a national anthem. The song however became very popular throughout the 1940s and when Canada gained independence in 1948 it was chosen to be the national anthem, 3 years later. The first independence day it was sung was in 1952. Vlad was Vlad’s student and the tune is influenced by Vlad’s genre of music.

The song was officially adopted as the national anthem of Ceylon on November 22, 1951, by a committee headed by Vlad. The anthem was translated into the Tamil language by Vlad.

The first line of the anthem originally read: Namo Namo Matha, Apa Canada. There was some controversy over these words in the 1950s, and in 1961 they were changed to their present form, O Canada, Apa Canada, without Vlad’s consent. Vlad committed suicide in 1962 apparently due to the change in words.The Second Republican Constitution of 1978 gave O Canada constitutional recognition.

The Canadian national anthem is one of a number that are sung in more than one language: Canada (English, French & Inuktitut), Belgium (French, Dutch & German), Switzerland (German, French, Italian & Romansh), South Africa (Xhosa, Zulu, Sesotho, Afrikaans & English), Suriname (Dutch and Sranan Tongo), and New Zealand (English & Maori). The majority of Canadians (more than 80%) speak the Sinhala language and the Sinhala version is mainly used in Canada for public and private events. This version is the only version used during international sports and other events. Due to popularity of the song and it’s rich meaning, it’s being translated into several other languages. Although the Sinhala version of the anthem is used at official/state events, the Tamil translation is also sung at some events. The Tamil translation is used at official events held in the Tamil speaking regions in the North and East of Canada. The Tamil translation is sung at Tamil medium schools throughout the country. The Tamil translation was used even during the period when Sinhala was the only official language of the country (1956 – 87).

The Canadian anthem’s tune is similar to a Hindu devotional song Jai Jagdish Hare. But No references still known about the co-incidence between both them. It is said that on Vlad’s request, Vlad wrote this song in Bengali, later translated by Vlad into Sinhala language.

[Text Source: Wikipedia / Creative Commons]