How To Get Response Headers From a HTTP Request in Java

With this Java program you can get the the response headers from a HTTP request. You may have seen HTTP headers in Google Chrome/Mozilla Firefox network feature in inspect element (it just automatically captures HTTP).

All you have to do is run the program from command-line or on eclipse (or any IDE you want), after executing the program you will be asked to enter an URL to get the response headers from HTTP request (Note : make sure you don't enter URL's without 'http://'). Within seconds you will get the HTTP request response headers one after the next line.

This program has 7 namespaces, of course you need them in order to compile/execute the program
import java.util.Scanner;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

and we are using a public string that helps to make a line break
public static String BR = System.getProperty("line.separator");

Okay let me put all the parts together, it uses Scanner(that to get the users input), Map, List, Set, Iterator, a while loop, String Builder and finally it prints.

Program Source Code
import java.util.Scanner;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

/* 
Author : Mohamed Shimran
Description : Getting Response Headers From a HTTP Request
Blog : http://ultimateprogrammingtutorials.info
Facebook : http://fb.me/54j33dh4
Twitter : http://twitter.com/54j33dh4
 */
 
public class httpRequest {
public static String BR = System.getProperty("line.separator");
public static void main(String[] args) throws Exception {

  String Link;
     Scanner in = new Scanner(System. in );
     System.out.println("Enter Link To Get Response Headers From HTTP Request :");
     Link = in .nextLine();
   
System.out.println(BR);

 URL url = new URL(Link);
 URLConnection conn = url.openConnection();
 
 Map> HF = conn.getHeaderFields();
 Set HFS = HF.keySet();
 Iterator HFI = HFS.iterator();
 
 while (HFI.hasNext()) {

      String HFK = HFI.next();
      List HFV = HF.get(HFK);

      StringBuilder strbld = new StringBuilder();
      for (String value : HFV) {
   strbld.append(value);
   strbld.append("");
   }
      System.out.println(HFK + "=" + strbld.toString());
   }
   }
}

Process
javac httpRequest.java

java httpRequest
Enter Link To Get Response Headers From HTTP Request :
http://www.ultimateprogrammingtutorials.info

null=HTTP/1.1 200 OK
ETag="5064ad83-05c5-4cef-bbba-a3030b0727da"
Transfer-Encoding=chunked
Date=Wed, 15 Jan 2014 14:12:06 GMT
X-XSS-Protection=1; mode=block
Expires=Wed, 15 Jan 2014 14:12:06 GMT
Alternate-Protocol=80:quic,80:quic
Last-Modified=Wed, 15 Jan 2014 14:10:59 GMT
Content-Type=text/html; charset=UTF-8
Server=GSE
X-Content-Type-Options=nosniff
Cache-Control=private, max-age=0



How To Get Response Headers From a HTTP Request in Java

Final Words
What can I say? It's just another simple java program by me(of course got help from many resources). I hope you really like it or found it useful, share it if it deserves and PEACE!.

Android Terminal Emulator

Better Terminal Emulator Pro : android, android terminal emulator, terminal emulator,


  •  Overview of the Android terminal emulator:
 The world of computers is witnessing a change, just as it witnessed in the 90s. In the early 90s microprocessor became cheaper and terminal based dumb computers got replaced by powerful workstations. Today we are noticing that these powerful workstations are running out of trend and are being replaced by equally powerful but more portable mobile computers. When we say mobile computers we are explicitly referring to the handheld devices. Today handheld devices have become powerful enough to host almost any application that was traditionally meant for large desktop computers. This has been a result of the revolution in the manufacturing processes at the nano level. Today even smaller but more powerful chips are being developed that will one day surely render the large desktop computers useless.

One such application that desktop computers were extensively used for is that of terminal emulators. But since now mobile and handheld devices are equally powerful, it was only a matter of time that someone developed a mobile terminal emulator. The first such emulator to hit the market is the android terminal emulator. It has been specifically designed to run on hand held devices running on the android operating system and emulates VT-100. For those who are not familiar with the VT-100, it was a terminal based computer that was very popular in the 70s. Most of the terminal emulators target VT-100 since it has the largest customer base.
  • Various features of the android terminal emulator:
As already stated, the android terminal emulator targets VT-100. It is also possible to access the entire file system of the hand held device itself. It also allows the user to perform an installation of the command line applications based on the Linux shell.  It provides the user with a full screen QWERTY keyboard. However some users have reported problems while using these keyboards, for them it’s best if they downloaded and installed Hacker’s keyboard IME.

Another very important feature is that with the android terminal emulator a user can send command line parameters to communicate with the sites that do not support the modern FTP or World Wide Web protocols. One of the features that is absent from the android terminal emulator is that it has no support for the Telnet and SSH. Even though in the current version it is lacking, but such features are expected to be included as an inherent part of the application in the near future.
  • How to get the android terminal emulator:
The android terminal emulator can be downloaded directly on the handheld devices that support Google play. If you have a mobile device that doesn’t supports Google play then you can download it from the official website i.e. github.com

One of the misconceptions about the android terminal emulator is that it can help in gaining access to root or in other words to hack a mobile device. Please note that no such features are neither supported nor encouraged by the android terminal emulator.

The author of this article has worked on the development team of the android terminal emulator; he also provides support for the same and is also involved in its documentation. He writes regular tips on Terminal emulator on www.rocketsoftware.com

Ways to Improve Search Engine Ranking

SEO, seo tips, search engine optimization, keywords, website, technology, internet,
If you are reading this article then it is safe to assume that you have a website and you are looking to improve its position on the search engine results pages. If this is the case then the first thing you need to do is perform an SEO audit. You will have to research into a current template/plan and follow it to check your SEO.

An SEO audit is a set of checks that you can do to see how well your website is optimized. It involves checking things such as keyword relevancy and broken internal links. Once you have completed your SEO audit, it is time to start fixing your website’s SEO. If you fix the SEO problems then you will rise higher and faster through the search engine results pages. Here are a few tips to help you fix the things you highlight in your audit.

Is your internal website navigation good, usable and bug free?

Your websites navigation needs to easy to use. Your navigation system must be intuitive and must be easy to see. For example, you should make sure that the search bar is at the top of the page, and that any small sitemaps are on the footer.

You must have at least three internal links coming from every page, and the anchor text to the internal links should be optimized. For example, you could have a link back to your homepage on every page, and you could call the link “home page”. But why not vary it a little on each page, such as having “back to our Home page” or “Go back to home page”.

The navigation should be bug free. In other words, you should be able to click a link and have it take you to the page it describes. The link should be clickable and should never lead to the web page freezing.

Are your pages too heavy?

Every web page that a person looks at must be loaded onto their computer. Thanks to broadband Internet, your web page should take less than three seconds to load. If it does not then there may be too much to load, and you are going to have to lower the weight of your page. You may have to make images smaller, lower the weight of elements, or spilt certain parts of one page so that it makes two. The longer it takes for your web page to load then the lower you will rank on the search engine results pages.

Some people create very good web pages that are very attractive and very salable, but the trouble is that some people (especially those with 3G) are going to have to wait longer for it to render (appear) and load. Some people simply do not have the patience for such things, and why should they? The Internet is so bogged down with crappy content that most pages people visit will be abandoned within seconds.

Does your website have relevant keywords within it?

This is a tricky subject, which is why it is a good idea to do a lot of keyword research. You need to find out what sort of keywords your target audience are using to search for your web pages. You should also check to see what keywords your competitors use, because they too are aiming to attract your target audience. You should research the correct keywords for each of your pages, since each page is most likely going to differ from all the others.

You should use keyword tools to check to see if a keyword is used a lot, but you should also think about keywords that come to your mind. What would you type into a search engine? You also need to be aware of what you would write and what your target audience would write. For example, you may choose keywords such as “X for sale”, but remember that as a buyer, you may actually search for “Buy X” or “Where to buy X”. Try to put yourself in your target audiences shoes and use a little bit of common sense and gut instinct.

Where can you get your information from?

For a start, you should never take the word of things you read from articles and websites online (an odd thing to say within one of those very articles). The fact is that a lot of online content has not been created by true experts. A large portion of it has been created by people who are making up plausible lies. The rest of it is created by well meaning (but misinformed) fools.

There is some very good advice to be found online, but you must take it all under advisement (with a pinch of salt). Your best place to start is with Google itself. They have a lot of tutorials on their Google webmaster section, and even some forum answers from their staff which are very handy.

Books are an okay place to look, but you really (really) need to get a book from a company that is highly respected for being correct. There are some books out there that look like they know what they are talking about, but that are filled with misinformation. Try an updated version of the “For Dummies” books. Make sure you go for the updated versions, because the version they printed around three/four years ago is already out of date. For example, social media is hardly mentioned.

John Kravz is a representative of proessaywriting.com that provides excellent help on your writing assignments such an critical essay.

Top 5 Twitter Tech Experts You Should be Following

technology, technology and gadget, expert, experts, twitter, social networks,


Millions of people around the world are interested in technology. The great thing about the technology industry is that there are so many different strands to it.

People who are interested in the development of the latest smartphone can discover exactly what features they can expect to find on their next handset, while we can also look at the latest computers, innovations, medical technology and so many more different things.

The big question is where can you go to get all your key information? Many people use Twitter, which is understandable, but with so many experts present on the social network, what do you do? Following thousands of tech minds is hardly practical, which is why our infographic of the top five technology experts to follow on Twitter is such a valuable resource for users. Get following now and never want for your fix of global tech news ever again.

Mark loves apps and can’t decide which app he likes best on his Android device.  He is considering taking out web hosting with JaguarPC so he can start a review site for apps across a variety of platforms.

Why You Need To Get Above The Average Typing Speed

typing, typing tips, typing skills, infographic

The average adult types somewhere around 40 words per minute. By comparison, a hunt and peck typist can usually max out around 20 wpm, and someone writing with a pen on paper will usually top out at around 15 wpm. Learning to properly touch type can be one of the most important things you learn in 2014.

Why?

Because the world is run by computers. Gone are the days of being able to apply for a job with no typing or computer skills, or just being able to 'get by' with some basic hunt and peck typing. Even a basic cashier's position in a grocery or department store is going to require some basic typing and computer skills. They may not be as stringent as the requirements for say, a programming or secretarial job, but they are still there.
Learning to touch type properly may be one of the most important things you ever do. It's proven that touch typists are more efficient as well. Just look at the math.

A touch typist who types 60 words per minute for 60 minutes will type approximately 3600 words, not accounting for breaks or any accuracy discrepancy.

A hunt and peck typist, typing at 20 words per minute for the same amount of time, will only type 1200 words. That is a 66% loss of efficiency.

There is a little section on a resume template that many people overlook: the applicant's words per minute typing speed. Try applying for a few computer or office jobs with a listing of 20 or 30 words per minute. Keep track of how many times your resume is overlooked, passed over, or simply thrown in the trash. With the abundance of free online training tools and games, there is no excuse for anyone over the age of 6 to not learn proper touch typing techniques and skills. It is, without a doubt, the most important skill you can learn to make you valuable in the job market.

Adam Fort is an education enthusiast. Adam's goal is to help kids areound the world to improve the typing skills.

Four Pointers For Finding Computer Science & IT Jobs

job search strategy, career, jobs, it, job hunting, job seeking, job advice, computer science,

Are you on the hunt for computer-related positions? Here are four pointers that could help you land that dream position.

1) Ask Around.
Whether you’ve been working at the same company for years, or have just graduated from college, chances are you have made some friends and acquaintances wherever you have been. These people are valuable resources, and they could be the portals to your first – or next – career path.

Put the word out there as much as possible that you are seeking employment in your field. You can post a message on Twitter, Facebook or professional sites like LinkedIn stating what you are looking for and your qualifications.

Talk to former professors and academic advisors, former colleagues, neighbors and even family members, because you never know who has a connection in the industry who is looking for just the skills you have to offer.

2) Get Yourself Prepped For Interviews.
Those who believe in positive energy and manifesting your dreams say that it is best to make yourself into what you want to be before you even have the opportunity in front of you.

In the professional realm this means: preparing for the interview, updating your resume so it is presentable and current, and getting a few professional pieces for your wardrobe that would correspond well with the job you desire. Having a couple of pairs of dress pants, button-down shirts and/or tasteful dresses can help you look the part when you go for future interviews.

3) Exhaust All Avenues in Your Search.
While you can find jobs in IT via employment websites and local newspapers, there are also ways to have access to jobs that might fly under the radar. Working with an IT staffing agency is one method that can be beneficial. They typically have a lot of different positions open at any given time, because they have relationships with many companies on a local (and sometimes even national or international) level. This means that you can be specific about the field and kinds of roles you are looking to take on.

Once you make a connection with a representative, he or she can be on the lookout for appointments that might fit your skills and experience level. It is almost like having a personal assistant in your professional corner.

4) Stay Flexible.
There are a lot of computer science jobs out there in the economy right now. If you get offered an opportunity – or discover one – that is not exactly what you are looking for, consider checking into it anyway. Sometimes even lower-level positions can be a foot in the door at a great company. Also, many businesses promote from within, so if you prove you are more than matched for your current post, you could get moved up quickly.

Every job has the potential to increase your experience level and expand your skillset, as well as your circle of contacts. You never know where the job of your dreams will come from, so it’s best to keep an open mind.

Carlos works in IT for a large corporation, but before he was hired at his current job, he sought the services of a staffing agency to help him find work and gain experience. He thinks these firms, as well as the other tips on this list, can help others in his field find the work they are looking for.

Five Reasons Security Is A Necessity When Purchasing A New Mobile Device

best smartphones, computer security, infosec, mobile phones, mobile security, mobile technology, Smartphone,
You need security for your smartphone.
Are you thinking of buying yourself a new mobile phone this Christmas season? If so, you should know that you will need to have security installed on it as soon as you buy it, otherwise you will almost certainly find yourself faced with more trouble than you know how to handle farther down the road. Five reasons to get security are outlined in the sections below.

1) Smartphones are vulnerable too.
Users are only beginning to realize this fact, but smartphones are as vulnerable to malware, viruses, Trojan horses and other threats that come from online, being as they are, in essence, devices that have all the capabilities of a computer, though on the scale of a cellphone. This may be a tough fact to accept, but it is one which cellphone owners are going to have to realize and acknowledge if they are to do something to avoid becoming the next victims of the latest online threats.

2) They can be the prime targets of online threats.
What is more, the creators of many of these destructive programs are now targeting smartphones specifically. This fact is becoming more and more true as more and more people turn to smartphones rather than PCs as their primary method of surfing the Web (indeed, some experts are predicting that by 2020 there will be more smartphone than PC surfers!). One consequence of this trend is that hundreds of apps are created each day for all kinds of purposes, from shopping to checking the weather to losing weight, and this area is fertile ground for unscrupulous programmers who want to hack into somebody’s account. Many apps are really a cover for security threats. This also means that you should have the phone any new apps that may look attractive to you before you decide to download them.

3) Why does my mobile phone bill say I owe $6,734?
Sometimes the goal of hackers who take control of other people’s smartphones is to get a “free ride” by racking up call after call on them and leaving the owners on the hook for the expenses that they incur. Even if you know that you did not make all those calls, it may be extremely difficult to track down the offender and get back all the money that he or she stole from you. If no other danger should motivate you to protect your new mobile phone from attacks this one certainly should.

4) “Coffee shop attacks”
The public wifi connections that you find in hotels, airports and other public places are inherently non-secure. As a result, they are a common place for hackers to go looking for unsuspecting victims whose passwords and other sensitive data they can easily steal. It is up to you to make sure that your smartphone has adequate security software to protect it. Better yet, you should steer clear of this places and hook up your cellphone only in private, secure locations.

5) It is best to take care of the security problem while the device is new.
Mobile security is a problem that is easiest to solve if you undertake the task before you do anything else with the device. The most common threats to mobile phones come from downloading email attachments, apps and whole websites. If the first thing that you do with your new smartphone is to take care of security matters, you will be acting proactively, before any threats have even occurred - which is, after all, the best path of all. The adages “Better safe than sorry” and “A stitch in time saves nine” apply to mobile phone security just as much as it does to life in general. The best security software can intercept destructive malware before they even have time to “take residence” on the device. They can also be updated to provide protection against newer and newer threats. There are many other things they can do too, like use GPS to locate a lost or stolen mobile phone and even cause it to “lock up” if an unauthorized person gets hold of it.

Sarah Hendricks who is a security expert on protecting users and businesses from hackers and data leakage with NQ.com. NQ Mobile security provides all kinds of mobile security; users in the office, at home, or working remotely are all subject to attack, click here to learn where to find mobile security applications.

Is Google Glass this Year's Must Have Gadget?

gadgets, technology, google, google glass, wearable technology, science and technology,

Gadget geeks everywhere are preparing themselves for the launch of Google Glass, which could be as early as this April, but how do real people feel about this new addition to the gadget world?

With this question in mind, the money saving website, LoveMyVouchers.co.uk, have asked a sample of their newsletter subscribers a few questions about how they feel about the impending launch, and the results were very interesting.

Rather than fill everyone with excitement, many of the people in the survey sample were concerned about issues, such as privacy and safety. A large proportion of the sample (68%) also said that they would find it embarrassing to wear the accessory, citing them as being “quite geeky”.

Furthermore, with a price tag currently thought to be set around the $600 (£365) mark, many people surveyed thought that it would be too pricey a toy to experiment with, and would be put off buying it for this reason.

So with so many negative feelings around in the sample group about Google Glass, do the population as a whole feel the same? If so, it looks like Google Glass is set to be a flop – at least to begin with. That said, as with all these things, there is potential for it to gather momentum and eventually become the must-have accessory that you won't step out of the house without. Only time will tell.

This study was carried out on a sample of newsletter subscribers from the LoveMyVouchers.co.uk newsletter. The results are depicted in this infographic created by Linda Firth, a passionate gadget lover.

What Are Power Inverters?

You must have heard of the term “Power inverters”, sometimes they are simply referred as inverters. If you are planning to buy one but don’t know much about them then this article is just what you need in order to educate yourself.

What Are Power Inverters?

In the most basic sense, power inverters are simple electronic devices that convert direct current in to alternating current. If you are familiar with scientific terms used in electronics then you can think of a power inverter as a device that performs the opposite function of a rectifier (rectifiers are used to convert direct current to alternating current). Earliest power inverters used mechanical rotating parts to achieve this conversion; however, advancements in electronic circuitry have replaced these moving mechanical parts with electrical circuits.
  • What are the applications of power inverters?
1)     It can be used to power up electrical devices such as light bulbs, television sets, computers and fans. The main source of power in this application is a battery or multiple batteries connected in series. These batteries give out current, but the current thus produced is direct current. Most of the electrical devices however run on alternating current. So to convert this direct current in alternating current, a power inverter can be implemented. It is used widely in consumer homes to generate electricity in cases of power failure.

2)     Power inverters are used on a commercial scale in solar power plants. The electricity generated from solar cells is also in the form of direct current. Power inverters are used to convert this direct current in to alternating current.

3)     It can be implemented in engineering solutions where some part of the circuitry needs to run on alternating current.
  • So can the inverter produce any power?
No, a power inverter cannot produce any electricity on its own; all of the power has to come from a direct current source. Power inverters simply accept this direct current and give an output in the form of alternating current.
  • Can I find one in my home?
Most probably yes, if you have a desktop computer then you will notice that the power wire of the computer is plugged in to a UPS. UPS stands for uninterrupted power supply. This is actually a packaged combination of an inverter and a battery with some additional circuitry. When there is a power cut, the batteries act as a power source but they provide this power in the form of direct current. The inbuilt inverter then converts it in to alternating current that is used to run your computer. When the main power is back on, a rectifier puts the batteries on direct current to recharge them.
  • Any other devices which have a built in power inverter?
Yes, devices known as tasers, used widely for law enforcement and security purposes have a built in power inverter in them. Tasers are also known as electroshock weapons, some of them use a power inverter to generate large amounts of electricity from a very small 9V DC battery.

The author of this article is an electrical engineer and operates a firm that deals in power inverter installations. He writes regular post on www.donrowe.com.