Posts

How to Create a Facebook Account

Image
Hey! young man, my guess is you have heard from one of your friend or relative about Facebook. And you want to create a Facebook account. But you don't know how to create it. Here I would help you step by step to do so. Facebook is a social networking website that helps you connect with you friends. To create a new facebook account, you just need to follow these steps: 1. Before creating facebook account, you should have your own email address. If you have it, fantastic! If not, go to gmail.com and create a new email address by clicking Sign Up link. 2.  Click here  or go to http://www.facebook.com , once web page is open, at first page (it is called Home Page), you will see a form. The form looks like this: 3. So just fill the form with asked information (name, email, password, gender, date of birth), and click Sign Up button. 4. After you submit the form (by clicking Sign Up button), Facebook company will send you an email at email address you written in form. Read tha...

How to Create Another Facebook Account

If you already have a Facebook account, but for some reason you need to create another Facebook account. There are following point to note, or way to create another account. 1. If you no longer need earlier account, you can delete that account and create new account using same email address you used with your first account. 2. If you want to create another account without deleting previous account. Facebook do not allow to create multiple accounts with same email address. You must have a new email address, if you don't have one, you should create new email address first. And then create another facebook account with new email address. They have done it to stop spam facebook accounts. Although, one can create new email and then new facebook account, but facebook had put this hurdle so that people avoid creating new accounts. Like one person has only one Social Security Number, same way, facebook also treat email as unique number to counts its 'population' i.e. users. Good lu...

When Servlets are Loaded

If you are developing web applications using Java based technologies, JSP or Servlets. You must be familiar with the loading time of Servlets. First lets see whats mean by loading. If you see the Servlet life cycle. Its as follows: 1. First of all init() method is called (this is called loading) 2. For each request, service() method is called. Which process the request and sends response to user. In case of HttpServlet, the service() method delegates the request processing to doGet(...) or doPost(...), depending on type of request. 3. When you undeploy you web app or stop Tomcat from running, destroy() method is called. You see, init() and destroy() are called only once, after you deploy your application. After serving user request, the servlet instance remains in memory to serve other requests. But the question is, when does the init() method is called first time, or when does the servlet loaded? If you do not do any explicit configuration, the servlet is loaded when first request com...

How Session Work in Web Applications and Why We Need It

Image
Term 'Session' is used in different contexts in computer science e.g. connection, telnet session, session layer, web session, etc. I would discuss the sessions in context of web applications only. There are following fundamental points related to sessions in web applicaitons: 1. What is a session in web application? 2. Why we need a session? 3. How session creation and identification work? 4. Where session data is stored? 5. How to Delete a session? Lets look at each part one-by-one: 1. What is a Session in Web Application? Web developer may need to store small data temporarily at server side, for each user who is interacting with the web application. Such data is stored in a session, so session is a temporary storage at web server. For each user, there is unique session are at server. During request processing of a particular user, the user's session is accessable in all web pages i.e. data stored in session by index.php can be accessed by products.php or a...

How To Improve Object Oriented Programming Skill Beyond Basics

Most software developers join industry after undergrad in CS. The Object Oriented Programming course we study in early BS semester covers only basics of Object Oriented Design. I had good luck to study Design Patterns in MS and other relates stuff by self study. The good thing is, there is nothing difficult of rocket science. If we just have some basic guidelines, we can explore things by our own. Here I would share very brief outline how we can switch our object oriented design skill to next level. Level - I: Object Oriented Programming Concepts Here comes the basics. We should study basic object oriented concepts. These are mostly covered in OOP course of undergrad level. Basic concepts, one must be familiar with at this level includes: Association Composition Aggregation Inheritance Polymorphism Encapsulation Abstraction Generalization Overloading Overriding Level - 2: Object Oriented Design (Patterns) There are some scenarios we frequently encounter during object orien...

My Experience on Cloud with Linode VPS - Its time to say THANKS to Linode

Image
About a year earlier, I developed a reviews portal for products, services and institutions using Java technologies (i.e. FaceRank.PK ), I was not sure how I would host it. Here is how I goes ... I explored different Java based web apps hosting providers. I was almost shocked to see, Java hosting was really very expensive as compare to PHP based hosting. I looked into shared Java hosting, but they didn't provided enough freedom e.g. to restart Tomcat anytime, update JDK, redeploy app. Dedicated hosting were expensive for me, then I explored different Virtual Hosting Providers. From those, I was inspired by users' opinion about Linode.com . I spend a lot of time on web, and I believe, if a lot of users are saying something about a particular provider, there must is something great about it. So I decided to try Linode.com I purchased Linode 768 package. Its almost a year now, guys! Linode is simply awesome. And only 4 times, I need to put support ticket, their response time was be...

How to Scale An Image Maintaining Aspect Ratio Using java-image-scaling API

Image
Below is the static function that I use to scale images in Java using Java Image Scaling 0.8.5 API . When user uploads a file, I pass that file as InputStream to this function, with StandardSize and ThumbSize, the function saves the images at passed fileStorePath with name "newFileName". It also maintains the aspect ratio for thumb and standard image both. import com.mortennobel.imagescaling.ResampleOp; import javax.imageio.ImageIO; // Import other classes here ... public class UtilMethods { public static void saveStandardAndThumbImage(String fileStorePath, String newFileName, InputStream imageInputStream, final int standardSize, final int thumbSize) throws Exception { BufferedImage srcImage = ImageIO.read(imageInputStream); String extension = newFileName.substring(newFileName.indexOf(".")+1, newFileName.length()); int actualHeight = srcImage.getHeight(); int actualWidth = srcImage.getW...