## JDK Division Bug

November 25, 2013

I have read and heard that java language has some cons. Today, to my surprise, I discovered one loophole by myself in such a simple operation that I didn’t expect in. The flaw I found was when two double values are divided and the result is also double, java compiler always doesn’t yield correct result. For instsance,

0.3d/12.0d = 0.024999999999999998

while any normal calculator or compiler like C++ gives 0.025. My conjecture about why it happens is – java probably just reads the raw underlying values in bits from registers and displays after directly converting to decimal value while other compilers like C++ does intelligent conversion from bits to decimal format before displaying.

Whatever the cause is, in order to meet my purpose, I fixed it (with my conjecture above in mind)  by multiplying both dividend and divisor by a number containing max decimal precision allowed in the context I was working in. The result came out correctly.

(1000000 * 0.3d)/(1000000 * 12.0d) = 0.025. //max precision allowed = 6

However, this mayn’t yield precise result for all cases.

Another easier solution is to use BigDecimal class :

BigDecimal bd = new BigDecimal((0.3d/12.0d), new MathContext(2, RoundingMode.HALF_UP));
System.out.println(bd); // 0.025

I hope, future version of jdk will come out with a fix for this bug.

## Chair Survivor Problem

January 30, 2013

This solution to the problem in question makes use of BitSet class of jdk which I found very useful and easy. Besides, this solution works for any number of chairs in the problem.

/**
* PROBLEM:
* You are in a room with a circle of 100 occupied chairs. The chairs are numbered sequentially from 1 to 100.
At some point in time, the person in chair #1 will be asked to leave.
The person in chair #2 will be skipped, and the person in chair #3 will be asked to leave.
This pattern of skipping one person and asking the next to leave will keep going around the circle until there is one person left: the survivor.
Write a program to determine which chair the survivor is sitting in.
*/

```import java.io.IOException; import java.util.BitSet; import java.util.Scanner; ``` ``` public class ChairSurvivor { public static void main(String... args) { System.out.print("How many chairs? "); final int numOfChairs = new Scanner(System.in).nextInt(); if(numOfChairs < 1){ System.out.println("Invalid"); System.exit(0); } if(numOfChairs == 1){ System.out.println("Assuming that at least one has to survive, #1 is the survivor"); System.exit(0); }```

``` BitSet chairs = new BitSet(numOfChairs); chairs.set(0, numOfChairs, true); int i = -1, j = -1; while(!chairs.isEmpty()){ j = chairs.nextSetBit((i+1)%numOfChairs); if(j == -1){ j = chairs.nextSetBit(0); } if(i == j){ break; } chairs.clear(j); i = chairs.nextSetBit(j); if(i == -1){ i = chairs.nextSetBit(0); } } System.out.println("Survivor is #" + ++j); } } ```
``` Leave a Comment » | Technologies | Tagged: bitset, chair survival, chair survivor, chair survivor problem, chair survivor survival solution java | Permalink Posted by Punnya Tuladhar ```
``` Post on Unpublished Facebook Page April 7, 2012 You need to have at least 25 fans of a fb page to get a public url of the page. And without public url, you can’t post status on the page directly from a java program. But I have a kinda hacked it to get access to the unpublished page (the page with no url). The idea is to use id of the page instead of human readable url. The following java code which uses restfb library to post status onto the unpublished page. NOTE:  Other detail steps are available aplenty on net. FacebookClient facebookClient = new DefaultFacebookClient(page_access_token); String connection = “<page_id>/feed”; FacebookType publishMessageResponse = facebookClient.publish(connection, FacebookType.class,      Parameter.with(“message”, “<status>”)); Leave a Comment » | Technologies | Tagged: facebook page, facebook unpublished page, post on facebok page using java program, restfb, update status on facebook page using java program, update status on facebook page without 25 fans or url | Permalink Posted by Punnya Tuladhar Playing with RedHat Linux September 25, 2011 When I was a junior student of computer engineering program in 2003,  I used to play with redhat linux 7 at spare time. While doing so, I would run into various problems like not being able to boot system after  installation/uninstallation of linux on my xp box. I had learnt  few things as I went on fixing them. Besides, I would do other stuffs,  some of which I have mentioned below. 1. To run redhat linux directly from ms dos, I would keep 2 files -  loadlin.exe & vmlinuz in C:\linux folder and would run the command from dos: c:\linux>loadlin vmlinux root=/dev/hda7 ro 2. In order to install grub, I'd insert grub boot disk, go to /boot and  type grub which would take me to the grub prompt.And then following  commands - grub> find /boot/grub/stage1 -- use this cmd if you don't know partion name grub> root (hd0, 7) -- specify root grub> setup (hd0) -- install grub at MBR or grub> setup (hd0, 0) --install grub at boot sector instead of MBR, 3.After redhat linux uninstallation, system wouldn't boot to windows and  would get stuck at 'grub>' prompt. In this case, to boot to windows, grub> root ( hd0, 0) // neglect o/p grub> chainloader +1 grub> boot 4. Some interesting files I jot down were: \$HOME/.login \$HOME/.profile -- contains history of commands, can be seen by  typing 'history' /etc/passwd -- password related /etc/shadow -- password related /boot/grub/grub.conf /var/adm/syslog -- currently logged in users /var/log/faillog -- to see failed logins /var/log/lastlog -- to see last logins /etc/hosts.deny --- to disallow host login.access -- to check if password has been changed by others 5. Some summarized commnads: tty -- display terminal & teletypes file related : date touch cat ls -l --color less /string -- search backward command related: cmd1; cmd2 -- in subshell cmd& -- run in bkgnd nuhup cmd -- no hnag cron cmd --- to run at specific time bg --- run suspended process in background user related: who -u/-q sync finger user login - to switch user su user passwd -- change pwd useradd/userdel/usermod/groupadd top free nice fstool - control panel to set /etc/fstab fdisk /MBR -- from dos, reinstall mbr xv -- capture screen message related: talk, talkd, mail, email, mesg, motd, write, wall, echo echo hello > /dev/tty3 SuperProbe -- to scan sys h/w info xf86Config -- to configure XFree86 tail -3 -- display last 3 lines tail +3 -- display from first 3rd line head -3 --- display first 3 lines Leave a Comment » | Technologies | Tagged: grub configuration, linux install, linux uninstall, linux useful secret files, linux user security files, run linux from dos, useful linux commands | Permalink Posted by Punnya Tuladhar Java Security Features & Holes September 19, 2011 Thinking that my one class presentation on java security features & holes carried out from the perspective of network security may be useful, I have blogged on it with the mere purpose of sharing.  Here are the links to them: Presenation slides: http://www.slideboom.com/presentations/160812/java-security-featurse-%26-holes PDF Report: http://www.seminarprojects.com/Thread-java-security-features-holes Leave a Comment » | Technologies | Tagged: attack during class loading, attack web business tier, bytecode exposure attack, client server attack, database attack, ejb application attack, java security featture, java security holes, network security java, web services attack | Permalink Posted by Punnya Tuladhar Useful Ubuntu Linux Tweaks September 11, 2011 My interest in linux first sprouted  when I was a junior student. I used to play with RedHat 7 then, mostly CLI. After a few years of professional experience in different windows, I resumed my journey in linux during my master’s program in 2009, in fact, after my xp box got infected by virus. Since then, I have been using Ubuntu 8, 9  and 10 (Lucid Lynx, aka L ubuntu ). When I was using windows before, I would always like to have my own customized theme and settings which constantly drove me to follow even after using linux. So, in the course of customizing Ubuntu theme (especially X system) to my taste, i have done and learnt some tweaks which I have shared with you guys below. Please, forgive me for not being clear on all tips since, most of the time, I would just jot down consicely and  have put them here intact. You may need to read mindfully to understand these tips or must have come through similar situation/problem. Please, ignore the numbering order. Minor: 2. gnome-app-install opens up add/remove program. 3. sudo apt-get update (gets alll updates) 6. sudo dpkg -i package_name.deb (install) 7. /usr/lib/jvm/java-6-openjdk //java path /usr/bin/java 10. synaptic & (open synaptic pkg mgr) sudo apt-get remove [–purge] firebird… [complete removal] 11. ps aux | grep fire* 13. sudo apt-get clean (cleans from /var/cache/apt/archives) 15. despite asking to reboot, sometimes restarting inetd may suffice: kill -1 pid 18. nautilus & ———– open file browser 19. to install bin file: chmod a+x file.bin sudo ./file.bin 21. to display size in mb sfdisk -luM 22. /dev/sda2 /media/C: ntfs defaults 0 0 /dev/sda3 /media/D: ntfs defaults 0 0 now to remount all in fstab: mount -a 23. /boot/grub/menu.lst 24. to open Run : alt F2 25. gnome-sound-properties 28. gconf-editor (like regedit) 29. gnome-control-center 30. icons of installed apps in /usr/share/pixmaps /usr/share/app-install/icons 31. check listening ports: netstat -antlp 32. change default editor to scite sudo mv /etc/alternatives/gnome-text-editor /etc/alternatives/gnome-text-editor.old sudo ln -s /usr/bin/scite /etc/alternatives/gnome-text-editor 33. -Djava.library.path= 34. updatedb to update file system in linux 35. show/hide hidden files/folders ctrl H 38. to start x startx 41. if persisting dependency problem, run dpkg-reconfigure –all (it takes > half hr, and asks for a lot of conf params, so careful) 43. to know usage of disks; df -h 44. set beeps xset b on/off xset b 30 60 30 47. to use sun’s (openjdk) java in eclipse (default GNU’s ); update-java-alternatives -s java-6-sun 48. env vars in /etc/environment 49. to find linked file ls -l /usr/bin/java now keep following the new link. 52. view log while something going; tail -f /var/log/syslog 54. change user of a file /folder: chown root myfolder // new user root chmod +s myfolder 6. right list – win + s left list – alt + f1 run – alt + f2 terminal – ctrl alt t desktop – ctrl alt d lock screen – ctrl alt l 7. enable ctrl alt bkspc system – preference – keyboard-layout-options-key sequence to kill x server 8. rmmod b43 depmod -a modprobe b43 // loads insmod b43 echo modeprobe b43 >> /etc/rc.local //load as boot process 10. apt-cache search libssl 11. install gyachi add-apt-repository ppa:loell/ppa\ 12. sudo getlibs /usr/bin/gyachi //may need to install getblibs first 12. set default apps: ~/.local/share/applications/defalult.list or for console update-alternatives –config editor 14. install dependencies apt-get -f install Below are some major tasks I did detail of which will be posted later when I have spare time. Major: 10. I have made linux shell available remotely using ftpd, ssh,  apache http etc. 1. Change of root’s user id. 2. Hide a user in login box. 3. To disable/enable graphical login (ie to have console for login in lieu of gui login box). 4. Recover deleted text using strings utility of linux. 5. After installing adobe air, synaptics pkg mgr may not work. I have fixed it. 6. I have Ubuntu LL with MAC theme, especial animation effects of my taste using compiz and AWN. 7. To configure startup menu on windows: bcdedit /default {id} bcdedit /timeout n bcdedit /displayorder {id1} {id2} 8. ssh configuratioin apt-get install openssh-server cp /etc/ssh/sshd_config ~ gedit /etc/ssh/sshd_config Port 11 PermitRootLogin no AllowUsers non-root /etc/init.d/ssh restart telnet localhost 11 ssh non-root@silver-box -p 11 9.ftpd configuration install proftpd in /etc/proftpd/proftpd.conf defaultroot /home/shared allowuser non-root denyall //other users /etc/init.d/proftpd force-stop I hope you found this blog useful. More later. 2 Comments | Technologies | Tagged: ajaxterm, change root user id, disable enable graphical login, hide user login box, linux command, login to console cli, proftpd, recover text linux, remote shell cli console access, ubuntu adobe air problem, ubuntu linux ssh, ubuntu linux theme setting customization, ubuntu linux tips, ubuntu mac animation, ubuntu ssh ftp | Permalink Posted by Punnya Tuladhar Richfaces Captcha July 8, 2010 I used richfaces web framework for an academic project. When I first had to create a captcha on this framework, I rarely found any help on google. Then I came up with an idea and used richfaces’ paint2d component to create it. Here it shows how to have one – Also available on http://snippets.dzone.com/posts/show/7466 I created a captcha using richfaces paint2d component as follows: On your .jsp page, put <h:form id="registerForm"> <rich:paint2D id="painter" width="300" height="120" data="#{paintData}" format="png" paint="#{capBean.paint}" /> <h:inputText id="secureText" value="#{capBean.secureText}" required="true"> <f:validator validatorId="capValidator" /> </h:inputText> <h:message for="secureText" /> <h:commandLink action="#{capBean.submit}"> <h:outputText value="Submit" /> </h:commandLink> </h:form> Now, have an object of PaintData class like – public class PaintData implements Serializable{ String text; int color; float scale; public int getColor() { return color; } public void setColor(int color) { this.color = color; } public float getScale() { return scale; } public void setScale(float scale) { this.scale = scale; } public String getText() { return text; } public void setText(String text) { this.text = text; } } Have a backing bean - public class CapBean implements Serializable { private String secureText; public String getSecureText() { return secureText; } public void setSecureText(String secureText) { this.secureText = secureText; } /** Generates Random Text for displaying on the image */ public String getRandomString() { String str=new String("QAa0bcLdUK2eHfJgTP8XhiFj61DOklNm9nBoI5pGqYVrs3CtSuMZvwWx4yE7zR"); StringBuffer sb=new StringBuffer(); Random r = new Random(); int te=0; for(int i=1;i<=6;i++){ te=r.nextInt(62); sb.append(str.charAt(te)); } System.out.println(sb.toString()); //todo: save this string in session return sb.toString(); } public void paint(Graphics2D g2d, Object obj) { PaintData data = (PaintData) obj; data.text = getRandomString(); data.color = 11; data.scale = 1.5f; int testLenght = data.text.length(); int fontSize = testLenght < 8? 40 : 40 - (testLenght - 8); if (fontSize < 12)fontSize = 12; Font font = new Font("Serif", Font.HANGING_BASELINE, fontSize); g2d.setFont(font); int x = 10; int y = fontSize*5/2; g2d.translate(x, y); Color color = new Color(data.color ); g2d.setPaint(new Color(color.getRed(),color.getGreen(), color.getBlue(), 30)); AffineTransform origTransform = g2d.getTransform(); g2d.shear(-0.5*data.scale, 0); g2d.scale(1, data.scale); g2d.drawString(data.text, 0, 0); g2d.setTransform(origTransform); g2d.setPaint(color); g2d.drawString(data.text, 0, 0); } public void submit(){ } } Have a validator like public class CaptchaValidator implements Validator { public static final char[] INVALID_CHARS = new char[] {'*', '@', '/', '\\'}; public static final int MAX_NAME_LENGTH = 50; public static final String VALUEREQUIRED_ERROR_MESSAGE = "Value is required."; public static final String TEXTNOTNATCH_ERROR_MESSAGE = "Text not match text on image"; public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { String val = ((String)value).trim(); if (val.isEmpty()) { throw new ValidatorException( new FacesMessage(VALUEREQUIRED_ERROR_MESSAGE, VALUEREQUIRED_ERROR_MESSAGE) ); } //todo: // generatedValueFromSession = saved value in session generated by capBean.generateRandomString() // if (!generatedValueFromSession != val)) { // throw new ValidatorException( // new FacesMessage(TEXTNOTNATCH_ERROR_MESSAGE, TEXTNOTNATCH_ERROR_MESSAGE)); // } } } Your faces-config.xml should have - <managed-bean> <managed-bean-name>capBean</managed-bean-name> <managed-bean-class>test.CapBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>paintData</managed-bean-name> <managed-bean-class>test.PaintData</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <validator> <validator-id>capValidator</validator-id> <validator-class>test.CaptchaValidator</validator-class> </validator> That’s it. Don’t forget to do your action if user enters correct captcha. Leave a Comment » | Technologies | Tagged: captcha, jsf, punnya, punya, richfaces, tuladhar | Permalink Posted by Punnya Tuladhar « Previous Entries ```
``` Archives November 2013 January 2013 April 2012 September 2011 July 2010 June 2009 Categories Technologies Uncategorized Blogroll WordPress.com WordPress.org Meta Register Log in The Contempt Theme. Create a free website or blog at WordPress.com. ```
``` //<![CDATA[ var infiniteScroll = {"settings":{"id":"content","ajaxurl":"https:\/\/punnyatuladhar.wordpress.com\/?infinity=scrolling","type":"scroll","wrapper":true,"wrapper_class":"infinite-wrap","footer":true,"click_handle":"1","text":"Older posts","totop":"Scroll back to top","currentday":"08.07.10","order":"DESC","scripts":[],"styles":[],"google_analytics":false,"offset":0,"history":{"host":"punnyatuladhar.wordpress.com","path":"\/page\/%d\/","use_trailing_slashes":true,"parameters":""},"query_args":{"error":"","m":"","p":0,"post_parent":"","subpost":"","subpost_id":"","attachment":"","attachment_id":0,"name":"","static":"","pagename":"","page_id":0,"second":"","minute":"","hour":"","day":0,"monthnum":0,"year":0,"w":0,"category_name":"","tag":"","cat":"","tag_id":"","author":"","author_name":"","feed":"","tb":"","paged":0,"comments_popup":"","meta_key":"","meta_value":"","preview":"","s":"","sentence":"","fields":"","menu_order":"","category__in":[],"category__not_in":[],"category__and":[],"post__in":[],"post__not_in":[],"tag__in":[],"tag__not_in":[],"tag__and":[],"tag_slug__in":[],"tag_slug__and":[],"post_parent__in":[],"post_parent__not_in":[],"author__in":[],"author__not_in":[],"posts_per_page":7,"ignore_sticky_posts":false,"suppress_filters":false,"cache_results":false,"update_post_term_cache":true,"update_post_meta_cache":true,"post_type":"","nopaging":false,"comments_per_page":"50","no_found_rows":false,"order":"DESC"},"last_post_date":"2010-07-08 16:13:58","stats":"blog=8205867&v=wpcom&tz=0&user_id=0&subd=punnyatuladhar&x_pagetype=infinite"}}; //]]> /* <![CDATA[ */ var WPGroHo = {"my_hash":""}; /* ]]> */ //initialize and attach hovercards to all gravatars jQuery( document ).ready( function( \$ ) { if (typeof Gravatar === "undefined"){ return; } if ( typeof Gravatar.init !== "function" ) { return; } Gravatar.profile_cb = function( hash, id ) { WPGroHo.syncProfileData( hash, id ); }; Gravatar.my_hash = WPGroHo.my_hash; Gravatar.init( 'body', '#wp-admin-bar-my-account' ); }); /* <![CDATA[ */ var HighlanderComments = {"loggingInText":"Logging In\u2026","submittingText":"Posting Comment\u2026","postCommentText":"Post Comment","connectingToText":"Connecting to %s","commentingAsText":"%1\$s: You are commenting using your %2\$s account.","logoutText":"Log Out","loginText":"Log In","connectURL":"https:\/\/punnyatuladhar.wordpress.com\/public.api\/connect\/?action=request","logoutURL":"https:\/\/punnyatuladhar.wordpress.com\/wp-login.php?action=logout&_wpnonce=4b5619d5a9","homeURL":"https:\/\/punnyatuladhar.wordpress.com\/","postID":"182","gravDefault":"identicon","enterACommentError":"Please enter a comment","enterEmailError":"Please enter your email address here","invalidEmailError":"Invalid email address","enterAuthorError":"Please enter your name here","gravatarFromEmail":"This picture will show whenever you leave a comment. Click to customize it.","logInToExternalAccount":"Log in to use details from one of these accounts.","change":"Change","changeAccount":"Change Account","comment_registration":"0","userIsLoggedIn":"","isJetpack":"0","text_direction":"ltr"}; /* ]]> */ punnya.tuladhar Create a free website or blog at WordPress.com. The Contempt Theme. Follow Follow “punnya.tuladhar” Get every new post delivered to your Inbox. Build a website with WordPress.com Add your thoughts here... (optional) Post to Cancel /* <![CDATA[ */ var jetpackSlideshowSettings = {"spinner":"https:\/\/s1.wp.com\/wp-content\/mu-plugins\/shortcodes\/img\/slideshow-loader.gif","blog_id":"8205867","blog_subdomain":"punnyatuladhar","user_id":"0"}; /* ]]> */ /* <![CDATA[ */ var JetpackEmojiSettings = {"base_url":"https:\/\/s0.wp.com\/wp-content\/mu-plugins\/emoji\/twemoji\/"}; /* ]]> */ /* <![CDATA[ */ var jetpackCarouselStrings = {"widths":[370,700,1000,1200,1400,2000],"is_logged_in":"","lang":"en","ajaxurl":"https:\/\/punnyatuladhar.wordpress.com\/wp-admin\/admin-ajax.php","nonce":"600493c67b","display_exif":"1","display_geo":"1","background_color":"black","comment":"Comment","post_comment":"Post Comment","write_comment":"Write a Comment...","loading_comments":"Loading Comments...","download_original":"View full size <span class=\"photo-size\">{0}<span class=\"photo-size-times\">\u00d7<\/span>{1}<\/span>","no_comment_text":"Please be sure to submit some text with your comment.","no_comment_email":"Please provide an email address to comment.","no_comment_author":"Please provide your name to comment.","comment_post_error":"Sorry, but there was an error posting your comment. Please try again later.","comment_approved":"Your comment was approved.","comment_unapproved":"Your comment is in moderation.","camera":"Camera","aperture":"Aperture","shutter_speed":"Shutter Speed","focal_length":"Focal Length","comment_registration":"0","require_name_email":"1","login_url":"https:\/\/punnyatuladhar.wordpress.com\/wp-login.php?redirect_to=https%3A%2F%2Fpunnyatuladhar.wordpress.com%2F2010%2F07%2F08%2Frichfaces-captcha%2F","local_comments_commenting_as":"<fieldset><label for=\"email\">Email (Required)<\/label> <input type=\"text\" name=\"email\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-email-field\" \/><\/fieldset><fieldset><label for=\"author\">Name (Required)<\/label> <input type=\"text\" name=\"author\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-author-field\" \/><\/fieldset><fieldset><label for=\"url\">Website<\/label> <input type=\"text\" name=\"url\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-url-field\" \/><\/fieldset>","reblog":"Reblog","reblogged":"Reblogged","reblog_add_thoughts":"Add your thoughts here... (optional)","reblogging":"Reblogging...","post_reblog":"Post Reblog","stats_query_args":"blog=8205867&v=wpcom&tz=0&user_id=0&subd=punnyatuladhar","is_public":"1"}; var jetpackCarouselStrings = {"widths":[370,700,1000,1200,1400,2000],"is_logged_in":"","lang":"en","ajaxurl":"https:\/\/punnyatuladhar.wordpress.com\/wp-admin\/admin-ajax.php","nonce":"600493c67b","display_exif":"1","display_geo":"1","background_color":"black","comment":"Comment","post_comment":"Post Comment","write_comment":"Write a Comment...","loading_comments":"Loading Comments...","download_original":"View full size <span class=\"photo-size\">{0}<span class=\"photo-size-times\">\u00d7<\/span>{1}<\/span>","no_comment_text":"Please be sure to submit some text with your comment.","no_comment_email":"Please provide an email address to comment.","no_comment_author":"Please provide your name to comment.","comment_post_error":"Sorry, but there was an error posting your comment. Please try again later.","comment_approved":"Your comment was approved.","comment_unapproved":"Your comment is in moderation.","camera":"Camera","aperture":"Aperture","shutter_speed":"Shutter Speed","focal_length":"Focal Length","comment_registration":"0","require_name_email":"1","login_url":"https:\/\/punnyatuladhar.wordpress.com\/wp-login.php?redirect_to=https%3A%2F%2Fpunnyatuladhar.wordpress.com%2F2010%2F07%2F08%2Frichfaces-captcha%2F","local_comments_commenting_as":"<fieldset><label for=\"email\">Email (Required)<\/label> <input type=\"text\" name=\"email\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-email-field\" \/><\/fieldset><fieldset><label for=\"author\">Name (Required)<\/label> <input type=\"text\" name=\"author\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-author-field\" \/><\/fieldset><fieldset><label for=\"url\">Website<\/label> <input type=\"text\" name=\"url\" class=\"jp-carousel-comment-form-field jp-carousel-comment-form-text-field\" id=\"jp-carousel-comment-form-url-field\" \/><\/fieldset>","reblog":"Reblog","reblogged":"Reblogged","reblog_add_thoughts":"Add your thoughts here... (optional)","reblogging":"Reblogging...","post_reblog":"Post Reblog","stats_query_args":"blog=8205867&v=wpcom&tz=0&user_id=0&subd=punnyatuladhar","is_public":"1"}; /* ]]> */ // <![CDATA[ (function() { try{ if ( window.external &&'msIsSiteMode' in window.external) { if (window.external.msIsSiteMode()) { var jl = document.createElement('script'); jl.type='text/javascript'; jl.async=true; jl.src='/wp-content/plugins/ie-sitemode/custom-jumplist.php'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jl, s); } } }catch(e){} })(); // ]]> var skimlinks_pub_id = "725X584219" var skimlinks_sitename = "punnyatuladhar.wordpress.com"; jQuery.extend( infiniteScroll.settings.scripts, ["jquery","jquery-core","jquery-migrate","mobile-useragent-info","postmessage","jquery_inview","jetpack_resize","loggedout-subscribe","spin","jquery.spin","grofiles-cards","wpgroho","jquery.autoresize","highlander-comments","devicepx","the-neverending-homepage","jquery-cycle","jetpack-slideshow","twemoji","jetpack-emoji","jetpack-emoji-init","swfobject","videopress","jetpack-carousel","twitter-widgets","twitter-widgets-infinity","twitter-widgets-pending","tiled-gallery"] ); jQuery.extend( infiniteScroll.settings.styles, ["smileyproject","jetpack_likes","loggedout-subscribe","the-neverending-homepage","infinity-contempt","jetpack-slideshow","wpcom-core-compat-playlist-styles","mp6hacks","wpcom-bbpress2-staff-css","contempt","jetpack-emoji-css","noticons","geo-location-flair","reblogging","a8c-global-print","h4-global","highlander-comments","highlander-comments-ie7","jetpack-carousel","tiled-gallery","jetpack-carousel-ie8fix"] ); _tkq = window._tkq || []; _stq = window._stq || []; _tkq.push(['storeContext', {'blog_id':'8205867','blog_tz':'0','user_lang':'en','blog_lang':'en','user_id':'0'}]); _stq.push(['view', {'blog':'8205867','v':'wpcom','tz':'0','user_id':'0','subd':'punnyatuladhar'}]); _stq.push(['extra', {'crypt':'UE40eW5QN0p8M2Y/RE1LVmwrVi5vQS5fVFtfdHBbPyw1VXIrU3hWLHhzVndTdktBX0ddJnpXRjVaOTd6fj1YMX4ydzR6MmRCYnxkNmdpPTBtMEFwTjQ0NWlURCVDWHdySjh8XVMzP1V+ZlNZQS9uUHRpTSZuODFXZ1Z4aXgxL2dLUUFSUi4udlZzY2JLfDcvWzZfd1BnYjIsM2RKSEJdVkVPOVhzcCtufktpMSZMcWw9QVVbVm5ORlZmLEtWYkJmbFguK2MsQktraEg/dmczcVNnfGJtMEVINHJibEQ4a1dYYWZmcGk2flRzQ1hLNFBlUnBoLUxqRysyWCwwYUxMTkpyNGJXM1c='}]); _stq.push([ 'clickTrackerInit', '8205867', '0' ]); if ( 'object' === typeof wpcom_mobile_user_agent_info ) { wpcom_mobile_user_agent_info.init(); var mobileStatsQueryString = ""; if( false !== wpcom_mobile_user_agent_info.matchedPlatformName ) mobileStatsQueryString += "&x_" + 'mobile_platforms' + '=' + wpcom_mobile_user_agent_info.matchedPlatformName; if( false !== wpcom_mobile_user_agent_info.matchedUserAgentName ) mobileStatsQueryString += "&x_" + 'mobile_devices' + '=' + wpcom_mobile_user_agent_info.matchedUserAgentName; if( wpcom_mobile_user_agent_info.isIPad() ) mobileStatsQueryString += "&x_" + 'ipad_views' + '=' + 'views'; if( "" != mobileStatsQueryString ) { new Image().src = document.location.protocol + '//pixel.wp.com/g.gif?v=wpcom-no-pv' + mobileStatsQueryString + '&baba=' + Math.random(); } } ```