Tuesday, 31 December 2013
Sunday, 29 December 2013
Snow Effect On The Blogger Mouse Cursor
- Add Snow Falling Effect In Blogger
- Go To Blogger > Layout
- Add a HTML / JavaScript Gadget
- Paste the following code in it,
- Leave the title empty and click Save.
<script type="text/javascript" src="http://dl.dropboxusercontent.com/s/ueqjg2s5b113nmt/079_green_00ff00_24work.blogspot.com.js"></script><a href="http://24work.blogspot.com/" target="_blank" title="Blogger Tricks"><img src="https://bitly.com/24workpng1" alt="Blogger Tricks" border="0" style="position: fixed; bottom: 10%; right: 0%; top: 0px;" ></a>
(OR)
if you want more Effects Click
ADD RUNNING TRUCKS IN BLOGGER
- Login to Blogger > Dashborad
- Click on Drop Down Menu and select Layout
- Add a HTML/JavaScript Gadget
- Paste below code in it.
<div style="position: fixed; z-index: 65535; left: 0px; bottom: -3px; width:100%;"> <marquee><a href="http://www.facebook.com/WidgetGenerators" target="blank"> <abbr title="Follow us at Facebook"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYeU4CkSZcyLthOhDuE4wdw09hjZHFomPuamCqqbbIAlahZUg9AN5HH_y6TkfMAgAShPXt2utTbooSLgO9luEqIfmXva7Wd6z3Tl2agfML8Xudn4NkyEfvZ81HT4277yPEy8Lasnu2S_8i/s1600/Social-Truck_fb2.png" width="120px" height="100px"/> </abbr> </a> <a href="http://feeds.feedburner.com/WidgetGenerators" target="blank"> <abbr title="Subscribe Our Feeds"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBR_4XRiiAek9k_qefDrOYaQpG4MhFmzc-rZLV2cWejHVnataDjLn5xDxCPKAPh9dOSYN91NmbQ13sQts_ReKqidqd2dIhSNBnYJhQmfESXT_52_Qb9xB9hGiRH85Q91MEqcBSREIgz8fm/s1600/Social-Truck_rss.png" width="120px" height="100px"/> </abbr> </a><a href="http://twitter.com/WidgetGenerator" target="blank"> <abbr title="Follow Us on Twitter"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHyPIQ1lLujSLOVZQJQ4q0SU3oU2w39oL8DkjmECrgUF0J9T3eX166uc_12SxcvOVviiE5TPeLZWx8dLwloYT6JI8dNMuNQMTeBQaSVpkSO9YruxUBO0AUZFI9D7HelS32V1emQXxZhXcP/s1600/Social-Truck_twi.png" width="120px" height="100px"/> </abbr> </a> </marquee></div>
- Save your Widget.
- Replace it WidgetGenerator with your Facebook Username
- Replace it WidgetGenerator with your Feed Burner Username.
- Replace it WidgetGenerator with your Twitter Username
Add Snow Effect to Website or BlogSpot
Add Snow Falling Effect In Blogger
- Go To Blogger > Layout
- Add a HTML / JavaScript Gadget
- Paste the following code in it,
- Leave the title empty and click Save.
<script src="https://raw.github.com/scottschiller/Snowstorm/master/snowstorm-min.js"></script>
(or)
<script type="text/javascript">
//Configure below to change URL path to the snow image
var snowsrc="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLUlJnmIM1O9sgBpoAr6gbmbawc5hHelUVsvLJ-3ISzbkI81-VQq1181hpm7LlMiutd3XY-RIFuuqObNrdI12RZK75FjVaofvw2qMCSae5yjIAyoBm43EA1RsihWULPXdUijMRGWImFkA/s400/snow.gif"
// Configure below to change number of snow to render
var no = 30;
// Configure whether snow should disappear after x seconds (0=never):
var hidesnowtime = 0;
// Configure how much snow should drop down before fading ("windowheight" or "pageheight")
var snowdistance = "pageheight";
///////////Stop Config//////////////////////////////////
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;
if (ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = iecompattest().clientWidth;
doc_height = iecompattest().clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "http://2.bp.blogspot.com/-MsCdyoGtGdA/UX5gk72qNoI/AAAAAAAAAfQ/LaKTmUG-aJM/s1600/snow+falling+effect.gif" : snowsrc
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ie4up||ns6up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
}
}
}
function snowIE_NS6() { // IE and NS6 main animation function
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}
function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}
if (ie4up||ns6up){
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
</script> - See more at: http://www.mybloggerwidgets.com/2013/04/add-snow-falling-effect-in-blogger.html#sthash.f73p6bHX.dpuf
Saturday, 21 December 2013
Add Floating Facebook Like Box For Blogger
STEP 1
1. Go
to Blogger Dashboard ---> Template
2. Please! download a copy of your template
3. Now click on Edit HTML
4. Use Ctrl+F to find </head>
5. Then copy and paste just above/before it, this code:
2. Please! download a copy of your template
3. Now click on Edit HTML
4. Use Ctrl+F to find </head>
5. Then copy and paste just above/before it, this code:
<script
src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'
type='text/javascript'/>
6. Save your template.
STEP 2
1. Now go to Layout--> click on "Add a gadget".
2. Select "html/java script" and add
the code given below and click save.
<script type="text/javascript">
/*<![CDATA[*/ jQuery(document).ready(function()
{jQuery(".abtlikebox").hover(function()
{jQuery(this).stop().animate({right: "0"}, "medium");},
function() {jQuery(this).stop().animate({right: "-250"},
"medium");}, 500);}); /*]]>*/ </script> <style
type="text/css"> .abtlikebox{background:
url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKJYA16dgOe8rl3MpMePTXOR__o-aU4tgA8H8tv1EMbH_KtB8KaCl9BSOPljfVHd_0uyY0hs9toC2UJZnWgzJ8NMR7CSY71RffQpzhb1gBK-oVMinya6CXi-V71jVRsSaCTCRqu9m2Ckk/s320/fb1-right.png")
no-repeat scroll left center transparent !important; float: right;height:
270px;padding: 0 5px 0 46px;width: 245px;z-index:
99999;position:fixed;right:-250px;top:20%;} .abtlikebox div{ padding: 0;
margin-right:-8px; border:4px solid #3b5998; background:#fafafa;}
.abtlikebox span{bottom: 4px;font: 8px "lucida
grande",tahoma,verdana,arial,sans-serif;position: absolute;right:
6px;text-align: right;z-index: 99999;} .abtlikebox span a{color:
gray;text-decoration:none;} .abtlikebox span
a:hover{text-decoration:underline;} } </style> <div
class="abtlikebox" style=""> <div>
<iframe
src="http://www.facebook.com/plugins/likebox.php?href=https://www.facebook.com/pages/Javapages4all/542211092478165&width=245&colorscheme=light&show_faces=true&border_color=white&connections=9&stream=false&header=false&height=270"
scrolling="no" frameborder="0" scrolling="no"
style="border: white; overflow: hidden; height: 270px; width:
245px;background:#fafafa;"></iframe><span>Widget by :<a
href="http://www.bbloggertutorials.blogspot.com"> BBloggerTutorials</a></span>
</div> </div>
Note: Replace https://www.facebook.com/pages/Javapages4all/542211092478165
with your
facebook page URL or user name.
Now you can see the result and be
happy
String Reverse in Java
package raja.JavaPages4all;
public class Exam {
/**
* @param args
*/
public static void main(String[] args)
{
Stringreverse();
}
private static void Stringreverse()
{
String str="Raja is a Good Boy";
String reverse=null;
/*
* String reverse using StringBuffer
*/
reverse=new StringBuffer(str).reverse().toString();
System.out.println("String reverse using StringBuffer ="+reverse);
/*
* String reverse using StringBuilder
*/
reverse=new StringBuilder(str).reverse().toString();
System.out.println("String reverse using StringBuilder ="+reverse);
/*
* String reverse Without using API
*/
reverse="";
for(int i=str.length()-1;i>=0;i--)
{
reverse+=str.charAt(i);
}
System.out.println("String reverse Without using API ="+reverse);
System.out.println("reverseRecursively ="+reverseRecursively(str));
}
public static String reverseRecursively(String str)
{
/*
* base case to handle one char string and empty string
*/
if (str.length() < 2)
{
return str;
}
String res=reverseRecursively(str.substring(1)) + str.charAt(0);
return res;
}
}
public class Exam {
/**
* @param args
*/
public static void main(String[] args)
{
Stringreverse();
}
private static void Stringreverse()
{
String str="Raja is a Good Boy";
String reverse=null;
/*
* String reverse using StringBuffer
*/
reverse=new StringBuffer(str).reverse().toString();
System.out.println("String reverse using StringBuffer ="+reverse);
/*
* String reverse using StringBuilder
*/
reverse=new StringBuilder(str).reverse().toString();
System.out.println("String reverse using StringBuilder ="+reverse);
/*
* String reverse Without using API
*/
reverse="";
for(int i=str.length()-1;i>=0;i--)
{
reverse+=str.charAt(i);
}
System.out.println("String reverse Without using API ="+reverse);
System.out.println("reverseRecursively ="+reverseRecursively(str));
}
public static String reverseRecursively(String str)
{
/*
* base case to handle one char string and empty string
*/
if (str.length() < 2)
{
return str;
}
String res=reverseRecursively(str.substring(1)) + str.charAt(0);
return res;
}
}
Tuesday, 17 December 2013
Add Flying Twitter Bird in Blogger
Log in to blogger >Template > Edit HTML
Now press CTRL+F and find the following code
</body>
Now paste following code just after </body>
<script src='https://sites.google.com/site/mmktricks/flyingtwitter.js' type='text/javascript'>
</script>
<script type='text/javascript'>
var twitterAccount = "your twitter username";
var tweetThisText = " <data:blog.pageTitle/> : <data:blog.url/> ";
tripleflapInit();
</script>
</script>
<script type='text/javascript'>
var twitterAccount = "your twitter username";
var tweetThisText = " <data:blog.pageTitle/> : <data:blog.url/> ";
tripleflapInit();
</script>
You have to replace your twitter username with the highlighted color text. Save the template and see a nice animated flying twitter bird
Thursday, 18 April 2013
key board raise and hide in Android
// -key board raise--
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isAcceptingText())
{
} else
{
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
{
} else
{
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
// -key board hide--
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Wednesday, 3 April 2013
Autoboxing and Unboxing
The Autoboxing and Unboxing was released with the Java 5.
Autoboxing
During assignment, the automatic transformation of primitive type(int, float, double etc.) into their object equivalents or wrapper type(Integer, Float, Double,etc) is known as Autoboxing.
Ex:
Integer intObject = 5; // autoboxing
During assignment or calling of constructor, the automatic transformation of wrapper types into their primitive equivalent is known as Unboxing.
Autoboxing
During assignment, the automatic transformation of primitive type(int, float, double etc.) into their object equivalents or wrapper type(Integer, Float, Double,etc) is known as Autoboxing.
Ex:
Integer intObject = 5; // autoboxing
auto-unboxing
During assignment or calling of constructor, the automatic transformation of wrapper types into their primitive equivalent is known as Unboxing.
Ex:
int inative = 0;
inative = new Integer(5); // auto-unboxing
Autoboxing also works with comparison
int a = 10;
Integer b = 10;
System.out.println(a==b); // true
How to create read only List, Map and Set in Java
// creating List in Java
List<String> names= new ArrayList<String>();
// initializing List in Java
names.add("Raja");
names.add("Ramesh");
names.add("Ramu");
Set<String> readOnlySet = new HashSet<String>(names);
//Set is not yet read-only you can still add elements into Set
readOnlySet.add("Ravi");
//making Set readonly in Java - no add remove or set operation permitted
readOnlySet = Collections.unmodifiableSet(readOnlySet);
//trying to add element in read only Set - java.lang.UnSupportedOperationException
readOnlySet.add("You can not add element in read Only Set");
//trying to remove element from read only set
readOnlySet.remove("Ramu");
//you can not remove elements from read only Set
Map<String, String> agesmap = new HashMap<String, String>();
agesmap.put("raja", "24");
//Map is not read only yet, you can still add entries into
agesmap.put("ramesh", "22");
System.out.println("Map in Java before making read only: " + contries);
//Making Map read only in Java
Map readOnlyMap = Collections.unmodifiableMap(agesmap);
//you can not put a new entry in read only Map in Java
readOnlyMap.put("ra", "33"); //java.lang.UnSupportedOperation
//you can not remove keys from read only Map in Java
readOnlyMap.remove("raja"); //java.lang.UnSupportedOperation
List<String> names= new ArrayList<String>();
// initializing List in Java
names.add("Raja");
names.add("Ramesh");
names.add("Ramu");
Set<String> readOnlySet = new HashSet<String>(names);
//Set is not yet read-only you can still add elements into Set
readOnlySet.add("Ravi");
//making Set readonly in Java - no add remove or set operation permitted
readOnlySet = Collections.unmodifiableSet(readOnlySet);
//trying to add element in read only Set - java.lang.UnSupportedOperationException
readOnlySet.add("You can not add element in read Only Set");
//trying to remove element from read only set
readOnlySet.remove("Ramu");
//you can not remove elements from read only Set
Map<String, String> agesmap = new HashMap<String, String>();
agesmap.put("raja", "24");
//Map is not read only yet, you can still add entries into
agesmap.put("ramesh", "22");
System.out.println("Map in Java before making read only: " + contries);
//Making Map read only in Java
Map readOnlyMap = Collections.unmodifiableMap(agesmap);
//you can not put a new entry in read only Map in Java
readOnlyMap.put("ra", "33"); //java.lang.UnSupportedOperation
//you can not remove keys from read only Map in Java
readOnlyMap.remove("raja"); //java.lang.UnSupportedOperation
Subscribe to:
Posts (Atom)