This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SysOutToFile { | |
| public void test() { | |
| String line = System.getProperty("line.separator"); | |
| PrintStream out = new PrintStream(new FileOutputStream("C:/migration-out.txt")); | |
| PrintStream err = new PrintStream(new FileOutputStream("C:/migration-err.txt")); | |
| System.setOut(out); | |
| System.setErr(err); | |
| out.flush(); | |
| err.flush(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * http://stackoverflow.com/questions/1062113/fastest-way-to-write-huge-data-in-text-file-java | |
| * | |
| * I have to write huge data in text[csv] file. I used BufferedWriter to write the data and it | |
| * took around 40 secs to write 174 mb of data. Is this the fastest speed java can offer? | |
| * bufferedWriter = new BufferedWriter ( new FileWriter ( "fileName.csv" ) ); | |
| * | |
| * You might try removing the BufferedWriter and just using the FileWriter directly. On a modern system | |
| * there's a good chance you're just writing to the drive's cache memory anyway. | |
| * It takes me in the range of 4-5 seconds to write 175MB (4 million strings) -- this is on a dual-core 2.4GHz Dell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://abc.com/seek/comet-binary/update?stream.body={%22delete%22:{%22query%22:%22text:\%22503%20Service%20Temporarily%20Unavailable\%22%22}}&commit=true | |
| http://abc.com/seek/comet-binary/update?stream.body={"delete":{"query":"*:*"}}&commit=true | |
| http://abc.com/seek/comet-binary/update?stream.body={"delete":{"query":"text:\"503 Service Temporarily\""}}&commit=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Unicode Symbol Decimal html Description | |
| U+00A1 ¡ ¡ ¡ Inverted Exclamation Mark | |
| U+00A2 ¢ ¢ ¢ Cent sign | |
| U+00A3 £ £ £ Pound sign | |
| U+00A4 ¤ ¤ ¤ Currency sign | |
| U+00A5 ¥ ¥ ¥ Yen sign | |
| U+00A6 ¦ ¦ ¦ Broken bar | |
| U+00A7 § § § Section sign | |
| U+00A8 ¨ ¨ ¨ Diaeresis | |
| U+00A9 © © © Copyright sign |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table style="width:100%"> | |
| <tr> | |
| <td style="background-color:#22436B">22436B</td> | |
| <td style="background-color:#3B73B9">3B73B9</td> | |
| <td style="background-color:#89ABD5">89ABD5</td> | |
| </tr> | |
| <tr> | |
| <td style="background-color:#056083">056083</td> | |
| <td style="background-color:#08A5E1">08A5E1</td> | |
| <td style="background-color:#6BC9ED">6BC9ED</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) Try to attain no warning symbol in the code (Unused variables, non-required imports) | |
| 2) System.out.println statements | |
| 3) Indentation | |
| 4) Naming convention | |
| 5) Info vs Debug messages | |
| 6) Log only when required – goal is easy debugging | |
| 7) Exceptional handling chain | |
| 8) Front end Exceptional handling (similar to what google does) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| devmgmt.msc | |
| control printers | |
| %temp% | |
| msconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Save time and Space with the excel .xlbs format | |
| Do you have large excel files that take GB of space in your HD, they are impossible to send and take 2 minutes to open? | |
| then wait no more.. save them in .xlbs format: | |
| in excel, select file -> save as, and save them as .xlbs, it's the excel binary format, and it's fully compatible with office 2010... your files will be smaller, and they will take only 25% of the time to load... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo -s | |
| $ dpkg -l (gives list of all installed packages) | |
| $ /etc/init-d/networking restart | |
| $ service ssh restart | |
| $ vi /etc/apt/sources.list.d/cdh3.list | |
| (make sure u have "deb http://archive.cloudera.com/debian lucid-cdh3u5 contrib") | |
| $pwd (print working directory) | |
| $clear (clear CLI - command line interface) | |
| $ls -a (list hidden and unhidden files) | |
| $ls -al (combine both a and l flags after - symbol; l - prints all details) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Step1: $vi /home/user1/scripts/my_script.sh | |
| #!/bin/bash | |
| # My first script | |
| echo "Hello World!" | |
| **Setting permissions** | |
| Step2: $chmod 755 my_script (The "755" will give you read, write, and execute permission. | |
| Everybody else will get only read and execute permission. If you want your script to be private (i.e., only you can read and execute), use "700" instead.) |