Blogger Plug 'n' Play

NOTICE

Adfly Links not working Find Direct Links HERE

How to create a Force Download link for pdf file in JSP
















Create 2 Files 

 DownloadPage.JSP code :-


<a href='downloadPdf.jsp?file=FILE.pdf' >Download PDF File</a>

downloadPdf.JSP code :-




<%@ page import="java.util.*,java.io.*" %>               
          
<!--contents of download.jsp-->
<!--Assumes that file name is in the request objects query Parameter -->
<%
 //read the file name.
 
    //out.print("D:/Inder Folder/data/PDL Back UP/30 july/reverted OLD/Copy of PanjabDigi 8 june/PanjabDigi OLD WITH ADV SEARCH/web/webuser/exhibitions/" + request.getParameter("file") );

%>

<%
 File f = new File ("E:/PDLDataServer/Downloads/PdfFiles/" + request.getParameter("file") );
 //set the content type(can be excel/word/powerpoint etc..)
 response.setContentType ("application/pdf");
 //set the header and also the Name by which user will be prompted to save
 response.setHeader ("Content-Disposition", "attachment; filename=\""+request.getParameter("file")+"\"");
 
 //get the file name
 String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
 //OPen an input stream to the file and post the file contents thru the 
 //servlet output stream to the client m/c
 
  InputStream in = new FileInputStream(f);
  ServletOutputStream outs = response.getOutputStream();
  
  
  int bit = 256;
  int i = 0;
  try {
   while ((bit) >= 0) {
    bit = in.read();
    outs.write(bit);
   }
   //System.out.println("" +bit);
  } catch (IOException ioe) {
   ioe.printStackTrace(System.out);
  }
//  System.out.println( "n" + i + " bytes sent.");
//  System.out.println( "n" + f.length() + " bytes sent.");
  outs.flush();
  outs.close();
  in.close(); 

%>


Learn more »

How to Check if file or folder exist in JSP or Java
























<%
                    String path = "";
                    path = "D:\Folder\Data\2012\feb\Pan\PDml\001543\SomeFile.pdf";
                    File file=new File(path);
                    boolean exists = file.exists();
                    if (!exists) {
                   out.println("File not Available for Download");
                    }else{  // It returns true if File or directory exists
                   %>
                 
                   <a href=''><font class='blueList'>Download File</font> </a>
                 
                    <% }
                    %>


Learn more »

How to Force Format Pen-drive or Memory card using cmd or Command prompt in xp

press windows+R

type cmd in Run 

then paste below command using mouse

format G: /FS:FAT32 /x  

then Enter
Learn more »

How to send/forward Sms to Email in Samsung Monte or other Samsung mobiles















Open message then
Save it to Memo
 Now go to Memo there you will find your sms then Send this memo via Email....
 then you will get a .vnt file which means VNOTE download .vnt file from email.

 To open it Download Python Software from here http://www.python.org/download/

 And download a small script from here https://bitbucket.org/eug48/vnote2txt/downloads naming vnote2txt.py

 Now click on above script download and locate the downloaded .vnt file then this script will convert the .vnt file to text file...



 Credit to eug48 on link
Learn more »

How to call a java script function on clicking Enter an Input field
















Enter any thing in Text box then press Enter to execute






<form onSubmit='alerttest(this); return false'>       

 <input type="text">        

</form>





<script language="javascript">

  function alerttest()

  {

   alert("Executing jolly.exe !!!!");

   // function edited by Inderpreet singh

  }

</script>




Learn more »

Add jQuery Stcky Scroll Menu bar When Scroll down

















<!--[if lt IE 9]>
        <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <!-- required for this demo -->
        
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script>
            $(function() {
                // grab the initial top offset of the navigation 
                var sticky_navigation_offset_top = $('#sticky_navigation').offset().top;
                // our function that decides weather the navigation bar should have "fixed" css position or not.
                var sticky_navigation = function(){
                    var scroll_top = $(window).scrollTop(); // our current vertical position from the top
                    // if we've scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative
                    if (scroll_top > sticky_navigation_offset_top) { 
                        $('#sticky_navigation').css({ 'position': 'fixed'  });
                    } else {
                        $('#sticky_navigation').css({ 'position': 'relative', 'top':0 }); 
                    }   
                };
                // run our function on load
                sticky_navigation();
                // and run it again every time you scroll
                $(window).scroll(function() {
                    sticky_navigation();
                });
                // NOT required:
                // for this demo disable all links that point to "#"
                $('a[href="#"]').click(function(event){ 
                    event.preventDefault(); 
                });
            });
        </script>
  
  
  
<style type="text/css">
  
.demo_container {  }


#sticky_navigation { height:50px;}
  </style>
  
  <br>
  Header
  <br>
  Header
  <br>
  Header
  <br>
  Header
  <br>
  
  
  
           <div id="sticky_navigation">
                                                <div class="demo_container" >
            
            Content To be Stick Goes HERE
            
            
            </DIV>
            </DIV>
  
  

  Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>Blah
  <br>


Learn more »

Goto anchor label name in a page by entering value in a textbox using AJAX and JavaScript

After finding a lot I found page which creates the URL in real-time as we type in text box and create a Hash URL which also helps to go a name label in a page. For any help on this you can ask me in comments . Here is the link http://nat.truemesh.com/stairmaster.html
Learn more »

Error in connecting JSP with MYSQL database table Resolved !

Ok Here the Solution to connect MYSQL with JSP above given program

First open Netbeans

Click on SERVICES
then Right Click on the server like for me its "Apache Tomcat" then select __Edit Server.XML__


Add below Line at line 39 i think between GlobalNamingResources tags

    <Resource name="jdbc/DATABASENAME" type="javax.sql.DataSource" maxActive="4" maxIdle="2" username="root" password="" maxWait="23000" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/DATABASENAME"></Resource>

and Save it

Now select Projects

then right Click on the project you are working and select Properties

Now in Libraries Under Compile tab click Add JAR

Then locate your "mysql-connector-java-5.1.18-bin.jar" Download it from Here if you don't have

then click ok

then restart server 

then Its Done !
Learn more »

"TATA Docomo Chhodo Andolan" Due to NO 3G for 2G Join on Facebook

Lets Join 



To show your support against the step taken by DOCOMO to not provide 3G signal to any body using 2G plans.

Show your view join on this page to show your views...
Learn more »

How to Open popup in chrome without scrollbars, Disable Resize of popup and Auto resize according to content

         UPDATED NOW WORKING 


Today I am going to show a tutorials which is a deadly need for many webmasters these days.

Chrome is the most popular browser used by many users these days. Popup is a thing which is used by from Facebook to simple advertisers. Sometimes situations may arise when we want features in opened popup windows.

We Usually ask some Questions related to Popups specially for Chrome:

  • How to disable scroll-bars in chrome popup ?
  • How to prevent Re-size of popup window opened ?
  • How to Auto Re-size Popup window according to the content inside it ?

Is it possible to answer above Questions ?


Now its a YES.

Here we go ....

All changes or Additions will be done in the page which will open inside the Popup Window.

Step 1)

Add Below code in file from where Pop Window will open or having click to pop like Button

<head>

    <script type="text/javascript">

        <!--

        function myPopup2() {

            window.open( "pop.html", "myWindow",

            "status = 1, height = 300, width = 300, resizable = 0" )

        }

        //-->

    </script>

</head>

<body>

    <form>

        <input type="button" onClick="myPopup2()" value="POP2!">

    </form>

    <p onClick="myPopup2()">CLICK ME TOO!</p>

</body>&#8203;




Step 2) 

Now add Below code in the file [ pop.html ]  which will open in the pop up window

You can any type of content in place of GREEN code below
<script src="http://remove-chrome-scroll-bars.googlecode.com/files/control_popup.js"></script>

<img width="400px" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzwWK0QeYBssg0UmOvYxQIPyvuQlSJYSJjMRFwgS5Fs7xXbgLu50NOalWAILSK_1Cc9mGJTOC_iyhn0359z6VTBK8oWurTdfKwCSqyN1-wvho3bSMO9YvUTg02hn5D-3mwQyh-R2IpyvA/s320/57screen-cut.png">

<b>Blogger Plug n Play</b> You Can't Hide Me :>

Learn more »

How to show link title in other local languages like punjabi, hindi etc which are not supported by windows title

Some sites which use local languages can't use title attributes of anchor tag  in some text as it starts showing BOXES in place of text.



So here is the solution





















Use BELOW CSS code

<style type="text/css">
a.tooltip span {display:none; padding:1px 1px; margin-left:60px;}
a.tooltip:hover span{display:inline; position:absolute; border:1px solid #000000; font-size:12px; background:#FFFFE1; color:#000000; box-shadow: 2px 2px 1px #888888;}
</style>

And use below code Where we want to show tooltip


<a href="#"  class="tooltip";  > Hover Here  <span> Tool tip Msg HRERE </span> </a>

I hope this would be the best solution :)
Learn more »

How to download YouTube video direct in 3gp format on computer using firefox to play in mobile without any conversion. Secret reviled



Ok YouTube lovers here is the trick to download 3gp good quality videos direct from YouTube to your computer ( pc ) so that they can run directly in your mobile without any conversion. Please comment your experience after trying this :)

Here i will explain this tut. in steps 

Requirement : Here the most basic requirement is you must have Firefox installed. 

Step 1) Download and install following two Addons from firefox addon store



There working can be read from download pages so lets go further

Step 2) In Mozilla go to Tools >> Default User Agents >> Choose iPhone3.0 










Step 3) Go to YouTube.com search the video you want to download then click the thumbnail then is will display that video in play box to top. Click the round play button image.

Same time you will see FlashGot (add on we downloaded in step1) blinking



 will show that is has captured a video in 3GP format as shown in figure below just click the video you want then it will start downloading




Thats it ...

Please comment about your experience :)


Learn more »

Best PHP language editor with auto tag completion, simultaneous error correction and free ...

Learn more »

How to Open and download ovi store applications on computer ( PC ) as on mobile

Nokia ovi store is house of thousands of interesting applications, which can be used to download apps on mobile or send to mobile if opened through pc, but what if we don't have GPRS activated on our mobile, What if we want to download applications form ovi store directly on pc ?

Here is the hack to make this possible for the users for Mozilla Firefox

Step 1

Open Mozilla Firefox and download this Add on (User Agent Switcher) and then restart it

Step 2

Now create a new Notepad file, Paste below given code in it then save it as ovi.xml

<useragentswitcher>

<useragent description="5310" useragent="Nokia5310XpressMusic/1.0 Profile/MIDP-2.1 Configuration/CLDC-1.1" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>

</useragentswitcher>


(NOTE : Please change the Nokia mobile model in the code)

Step 3

In Mozilla go to Tools > Default User Agents > Edit User Agents.. > Click Import then open the ovi.xml file which we created in step 2 Then Click OK

Step 4

Go to Tools > Default User Agents and Choose your Mobile Model Now Open Ovi Store homepage

Its Done !


Learn more »

Horizontal auto Image strip Scroller/Slider with speed control based on jQuery

After a long gap I today I am going to publish this post I hope you will like this very much as I was also searching such a thing for a long time

This is a cool horizontal auto scroll image slider whose speed changes with the movement of cursor this is very flexible as we can change every property very easily , In this post I will not give tutorial But I will redirect you to the page where I found this thing so enjoy using it .

Don't forget to comeback and comment :)

Visit This Link 
Learn more »

Feeling Bored ? Join FB Mobile Chat Rooms letOut.in

Learn more »

How To See Which Process or Program is Using My Internet Bandwith

There are some background processes like Updates, Which aromatically execute and waste our data transfer and slows-down the data transfer speed And also sometimes programs like Trojan Horses which creep into your system and turns it into hell .


There is small Software or program which lists all the processes which are using TCP/IP usage.


WHAT IT TELLS ?

  • Gives information about Programs using Data.
  • It gives location of that program.
  • You can terminate that program by simply right clicking it.


You Can Download that Program from Below Link
Learn more »

Software to Pick/Find/Select Colors anywhere from Screen and also Display color codes

Color Mania is very special and useful software. We see many new colors on web-pages images and games but if we want that color we should know the color code also.We can apply that color in coding by using there codes.This software proves very useful.

It has a color picker by selecting that we can pick color and its code very easily.We can also select new colors as well.





This is very small but useful application download from below link :)

Learn more »

Download Oxford jar Eng-Eng Dictionary For Java Enabled Mobiles

After searching a lot I found only these two fully loaded English to English dictionaries for my jave mobile.These are ad-ware Free and proves very useful on the go.

Learn more »

How To Use Two Classes Together in a Division

Sometimes a situation may arise to use more then on class in attribute.But how can we achieve this during CSS coding ? In CSS we are allowed to do it.

If we have two Classes as
1)
 class="slider" 
2)
 class="toggle" 


Then We can apply these as
Learn more »

Where To Upload Javascripts,Rar,CSS Files And Other Files To Use As Direct Link

In blogger we can only upload images in any number or size, But what about other files like text files, Java scripts, CSS, RAR files etc

There are some sites which provides a special domain name and also a storage space for our files with extensions described above.But I prefer Below one Because It provides maximum storage spage with unlimited bandwidth.

Learn more »

Best Software To Compress Images In Bulk Of Any Type Retaining Original Quality And Dimensions

Image Optimizer is a small size ( 1.22 MB) software. After Installation When ever you right click any image or a folder containing images, an option Optimize This will appear.After clicking it a new folder is created on the same location with optimized images.

Features

  • It is Fast
  • Optimizes images with a right click
  • 9MB image optimizes to 60 KB retaining Dimensions and Quality Intact

Learn more »