Difference between \n and \r?

In terms of ascii code, it’s 3 — since they’re 10 and 13 respectively;-). But seriously, there are many: in Unix and all Unix-like systems, \n is the code for end-of-line, \r means nothing special as a consequence, in C and most languages that somehow copy it (even remotely), \n is the standard escape sequence for end of line (translated to/from … Read more

Byte and char conversion in Java

A character in Java is a Unicode code-unit which is treated as an unsigned number. So if you perform c = (char)b the value you get is 2^16 – 56 or 65536 – 56. Or more precisely, the byte is first converted to a signed integer with the value 0xFFFFFFC8 using sign extension in a widening conversion. This in turn is … Read more

PHP: date function to get month of the current date

See http://php.net/date date(‘m’) or date(‘n’) or date(‘F’) … Update m Numeric representation of a month, with leading zeros 01 through 12 n Numeric representation of a month, without leading zeros 1 through 12 F Alphabetic representation of a month January through December ….see the docs link for even more options.

Install pip for python 3.5

Check: /usr/local/lib/python3.5/dist-packages You’ll either have Pip there or easy_install(part of Pythons setup tools), which can be used to install Pip: Or you can try: Another option is attempting to install from a repository, the package name depends on your distribution: Edit: Try this correction for easy install: I’m assuming that’s the directory it’s installed to. Also, … Read more

Windows batch – concatenate multiple text files into one

Windows type command works similarly to UNIX cat. Example 1: Merge with file names (This will merge file1.csv & file2.csv to create concat.csv) Example 2: Merge files with pattern (This will merge all files with csv extension and create concat.csv) When using asterisk(*) to concatenate all files. Please DON’T use same extension for target file(Eg. .csv). There should be some difference … Read more

How to read file from relative path in Java project? java.io.File cannot find the path specified

If it’s already in the classpath, then just obtain it from the classpath instead of from the disk file system. Don’t fiddle with relative paths in java.io.File. They are dependent on the current working directory over which you have totally no control from inside the Java code. Assuming that ListStopWords.txt is in the same package as your FileLoader class, then … Read more