Posts

What is the point of using abstract methods?

Say you have a three printers that you would need to write a driver for, Lexmark , Canon , and HP . All three printers will have the print() and getSystemResource() methods. However, only print() will be different for each printer. getSystemResource() remains the same throughout the three printers. You also have another concern, you would like to apply polymorphism. So since getSystemResource() is the same for all three printers, so this can be pushed up to the super class to be implemented, in Java, this can be done via making this abstract in the super class, and in making a method abstract in a super class, the class itself needs to be abstract as well. public abstract class Printer { public void getSystemResource (){ // real implementation of getting system resources } public abstract void print (); } public class Canon extends Printer { public void print (){ // here you will provide the implementation of p

Wordpress widgets not saving?

Sometimes in word press you can face a scenario where you are not able to save widgets items. I face the same problem where i wasnt able to save a "text" widget. After spending few hours on google i found the solution, which helped me to resolve the issue. I am copying down the solution which worked for me Go to Appearence --> Widgets Then at the top right of the screen you should see a tab that says Screen Options. Click on that, then a link will appear in the top left of your screen that says ‘Enable Accessibility Mode’ and click on that and give it a try. Try to save a widget now. This solution worked perfectly for me, there are few other solutions too which are covered on this blog. If there is any question please feel free to ask on twitter. Thanks

Yahoo Emails/mails Going to Trash, Yahoo No Email in Inbox/Sent

Image
Hi. Today i came across to a shocking situation when one of my friend's yahoo inbox/sent item everything was empty. Also The emails were not sending and  the receiving emails were moving to trash. So i thought to write a blog about it to Help everyone. First thing to do is go to your Account Info, Enter your password 2nd Change your password and also check your RESET INFO. And also open UPDATE YOUR CONTACT INFORMATION. And Check for all emails address. If you don't know any remove it  and also add your Cell number and save it. =============================================================== The above part was how to secure the compromised email. Now the Below part is how to fix all the changing made by hacker. Go back to your mail panel and click on that Gear button and click on Settings and go to Accounts . And click on Edit . If there is any Reply to Address remove it. And if the radio button is on FORWARD change it to POP.  And Click on Save and Save. F

IIS w3svc error

Problem Statement: I am trying to start my website in IIS, whenever i try to start my website i get the following error "Cannot start service w3svc on computer" I tried to start "World wide web publishing service", but i wasnt able to start it as it said "Error 1068: The dependency service or group failed to start". Meanwhile when i checked my log i found this error, "The World Wide Web Publishing Service service depends on the HTTP service which failed to start because of the following error: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it." Please help me, i am badly caught with this error, i hhave spent a week researching this error but havnt found a solution yet. Solution: Well finally after a week struggle, i came to a solution. I am listing down the steps which i followed to solve my error 1- Confirm that "Windows Management Instrumentation"

#2006 MySQL Server has gone away error in Wamp

Error Description: Im using wamp / xamp server . When i try to import a sql file, either through MySQL Query Browser or PHPMyAdmin,i get the following error. Error 2006 : MySQL Server has gone away .   Solution: You need to change max_allowed_packet, and the error will be fixed. File Path: This configuration file is located at «XAMPP install directory, this is C:\XAMPP by default» \mysql\bin\my.ini . # note the change has to be made at this section [ mysqld ] port = 3306 socket = "/xampp/mysql/mysql.sock" basedir = "/xampp/mysql" tmpdir = "/xampp/tmp" datadir = "/xampp/mysql/data" skip-locking key_buffer = 16 M # it was 1 M by default max_allowed_packet = 2 M table_cache = 64 sort_buffer_size = 512 K net_buffer_length = 8 K read_buffer_size = 256 K read_rnd_buffer_size = 512 K myisam_sort_buffer_size = 8 M        

What does a "Great Software" means?

Answer for this question varies from person to person, for a client or a user a great software should always does what is supposed to be, it should complete all the processes without being cracked and produce expected results. For a programmer point of view a great software is one which is strictly following object oriented principals, there is no duplicate code and each object is controlling its behavior. I tried to give you just an idea about a great software, what does great software means to you, please write it down in comments.

SQL Joins

Image
Below is the nice little explanation of SQL joins, do read it and share it with your friends.

RFID IMPLICATION WITH CLOUD

This research paper is written by me in my university days, i am sharing it out with other peoples, please share your views in comments. Asad Malik 1.       ABSTRACT: Radio Frequency Identification (RFID) uses radio waves to track the movement of products. The item is identified by a unique number that is passed on easily to a pc. Middle size companies are experiencing RFID execution limitations.   The limitations are poor processing power, limited computational resources; poor data management etc., because of these issues RFID is not able to deliver what it is capable of, hence businesses are finding it difficult to adopt it. In this paper I have proposed a cloud platform for RFID system which will help RFID solution providers to meet RFID limitations and provide solutions which can meet the requirements of the businesses. Our platform will help meet the challenges which are un-answered yet and are affecting the reputation of radio frequency identification. Our platform wi

Difference between abstraction and encapsulation?

This is indeed the most asked question in object oriented world. After sometime i came to final conclusion and now i am able to define these 2 concepts precisely 1- Abstraction: Abstraction allows you to focus on what the object does, instead of going into its implementation details For example: var string = 5; int number = convert.toint32(string); Now you know that using convert.toint32 method, you can convert string to int, you know what this object does, but at the same time you don't know its implementation details. Implementation details of this object is hidden from the user, this is abstraction. 2- Encapsulation: It means hiding the implementation or internal details of how object does something. For example: if you look at the abstraction example, convert.toint32 implementation is hidden from outside world. This is very simple example of encapsulation.

View Facebook DP (Display Picture) in Full Form.

Image
Hi Today i will Show you how to view the small Facebook Display picture in full form of it. Requirements: 1. Nothing just browser like firefox or google chrome. Steps: 1. Open the profile you want to view its Display Picture in full form 2. Right click on DP and copy Image location (firefox), or Copy Image URL (chrome)              Using Firefox                                                               Using Google Chrome   3. Open the link in new Tab it should be like this https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2 /c3.0.174.174/s160x160 /427836_47098733234228_125520545 _a.jpg 4. Now u have to do these changs remove /c3.0.174.174/s160x160 from the link means the link will become like this: https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2 / 427836_47098733234228_125520545_a.jpg 5. At the end of link replace _a.jpg with _n.jpg (if in ur case its _s.jpg also replace it _n.jpg) your link will become like this: https://fbcdn-profile-a.aka

Get First parameter from url (JavaScript Solution)

Today i ran into problem of how to retrieve the first parameter from a url after "/". I have designed a simple solution, you can see live demo of it here . I am also coying the code below var url = window.location.pathname; // returns the full URL var splittedurl = url.split('/'); var firstparameter = splittedurl[1]; // returns first parameter after url alert(firstparameter); Thanks. You can ask any question freely in comments.