Skip to content

Instantly share code, notes, and snippets.

String folderNameDecoded = new String(folder_name.getBytes(Charset.forName("UTF-8")), Charset.forName("ISO-8859-1")); 4:59 PM
For textareas, you need to replace newline chars as follows:
response.getWriter().print(new FolderService().getFolderDocs(parent_id,project_id,business_id,false, 0).replaceAll("\n", "\\\\n"));
//struts.properties
struts.i18n.encoding=ISO-8859-1
@shaik2many
shaik2many / oracle-view-security.sql
Created January 12, 2015 20:10
Oracle security view
CREATE OR REPLACE VIEW VIEW_SECURITY_ALL AS
WITH allprojbus AS (
SELECT project_id, business_id, updated_on FROM projBus pb
), alluserrights AS (
SELECT * FROM userright
WHERE RIGHT_ID <> 'NONE' AND RIGHT_ID <> 'EXTER'
), rank1 AS ( --specific project and specific business
SELECT ur.sso_id, ur.project_id, ur.business_id, allpb.updated_on
FROM alluserrights ur
JOIN allprojbus allpb ON (ur.project_id = allpb.project_id AND ur.business_id = allpb.business_id)
@shaik2many
shaik2many / jquery-autocomplete-category
Created January 12, 2015 20:06
jquery autocomplete category
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> http://jsfiddle.net/jensbits/bM7ck/3/ - jsFiddle demo by jensbits</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script>
<link rel="stylesheet" type="text/css" href="/css/normalize.css">
@shaik2many
shaik2many / linux-shell-script-path
Created December 22, 2014 20:16
linux setting shell path
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.)
@shaik2many
shaik2many / hadoop-install
Last active August 29, 2015 14:11
linux hadoop installation commands
$ 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)
@shaik2many
shaik2many / large-excel-xlbs
Created December 8, 2014 15:49
xlbs format
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...
@shaik2many
shaik2many / windows-commands
Created December 7, 2014 20:41
common windows commmands
devmgmt.msc
control printers
%temp%
msconfig
@shaik2many
shaik2many / coding-standards
Created November 20, 2014 23:10
coding standards
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)
@shaik2many
shaik2many / html-color-contrast.html
Created November 20, 2014 22:57
html color contrast
<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>
@shaik2many
shaik2many / unicode
Created November 19, 2014 15:15
unicode chars
Unicode Symbol Decimal html Description
U+00A1 ¡ &#161; &iexcl; Inverted Exclamation Mark
U+00A2 ¢ &#162; &cent; Cent sign
U+00A3 £ &#163; &pound; Pound sign
U+00A4 ¤ &#164; &curren; Currency sign
U+00A5 ¥ &#165; &yen; Yen sign
U+00A6 ¦ &#166; &brvbar; Broken bar
U+00A7 § &#167; &sect; Section sign
U+00A8 ¨ &#168; &uml; Diaeresis
U+00A9 © &#169; &copy; Copyright sign