Pages

Tuesday, 29 September 2015

Generating a Random Number (Integer) In Java

Hi all,


Today at work I just wanted to generate a Random Integer number. It was pretty easy but sometimes it may get little bit tricky. For this you need to import  to your class.

Suppose you want to generate Random numbers between a MAX and a MIN value. 

If you want to generate a number between 1 and 10, It would be like below;

Read More

Monday, 28 September 2015

How to create WAR (.war) file in Eclipse of Dynamic Web Project

Hi all, today I am going to build a war(.war) file from your dynamic web project using Eclipse. You can follow these easy steps as mentioned below,

  • First open your project in Eclipse
  • Then right click on your project, from it choose export then WAR file.
Q

  • From the opened "Export" dialogue bog, Select your web project then the destination where you need to save the WAR file.
  • If you have any preferences, Select "Target Runtime" and "Export source files".


  • Then click finish. Your WAR file will be created on the folder you have given earlier.
Read More

Thursday, 26 February 2015

How to Download Image using an URL (C#)


Hi All, Today I am going discuss how to get a Image from a remote location using an URL. This is very easily can be done using two .Net Classes called HttpWebRequest and HttpWebResponse

 

You need to have following References to make above code work;


Here a HTTP web request is generated using your URL and response is assigned to a System.IO.Stream object. Then your familiar System.Drawing.Image class has a method to convert that stream Object to an Image Object. That's all now you have the image in the remote location downloaded to your program.


Read More