K-Flakes # 2010-11 : How to deal with - Valid internet website not getting loaded - problem

Recently, I found out having issue with my internet surfing with following symptoms - on all the web browsers, IE, Mozilla, Chrome on windows XP SP3.

A. Some of the websites were not getting loaded, with following errors - 

"OOpppss! Link appeared broken."
"Hostname not found."
"Cannot display page."

The error page may be different from browser to browser, but basically they say same thing, that the browser is not able to connect to the website.

B. Sometime web page loads, but not completely, and it appears horrible.

C. The page loads after you click 2-3 times refresh button.

D. Main Page loads, but other pages of the website do not load.

Below is the steps, which you can try to overcome this issue. I am putting all the steps corresponding to Windows XP, and IE 8. But I am sure that you can easily find the similar settings in Vista and other browsers.

1. Clean up Internet Temp directory. In IE go to Tools->Internet Options->General Tab. Click on delete button on the history section.

2. Scan your system for Malwares/Adwares - these are like viruses, and sometime they prevent you to access some sites. Note that if you think that your licensed version of Anti-Virus already take cares of these threats, then your perception is wrong; because in my case Norton, AVG and Mcafee ; all three failed to display those threats. MalwareBytes AntiMalware was able to detect some and SuperAntiSpyware was more effective.

Just download them; they are freeware; from their websites. Just google "MalwareByte AntiMalware" and "SuperAntiSpyware " and you should be able to land on appropriate websites.

Install them and scan your system. Hope they will be able to kill all such threat, if exists.

Now, see if your system works as expected.

If not, check for the below. 
- Find out if you are able to reach to the website through IP address. e.g. if you are not able to reach www.google.com, then open the below page:

or
or

I hope, you will be able to access one of these. If not try "nslookup" in any of the search engine, and you will get a list of websites for nslookup.

You will find a textbox on these website, where you can submit the website, you are trying to access; but browser not loading. e.g. in this case, I will put www.google.com. Please note that you should put only the main website address, not like www.abc.com/index.html . Just put www.abc.com
The nslookup will return you the IP address of the website. e.g. for www.google.com, you may get 74.125.53.106.

Now, go to web browser and type http://74.125.53.106
You should be able to get www.google.com. If you are able to get the blocked website by its IP address, it means that your system is either caching the website in negative DNS cache, or it is not able to use correct DNS service.

Try following:

1. Go to command prompt, by Strat->Run; type "cmd" and press enter.
Type "ipconfig /flushdns" followed by "ipconfig /registerdns".



C:\Documents and Settings\S>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Documents and Settings\S>ipconfig /registerdns

Windows IP Configuration

Registration of the DNS resource records for all adapters of this computer has been initiated. Any errors will be reported in the Event Viewer in 15 minutes..

Now, try again. If your problem is still unresolved, try following:

Go to start-> Settings -> Control Panel. Click on network connections. Right Click on your Local Area network connection and click on properties.

Click on Internet Protocol (TCP/IP) and lick on properties button.
Check the "Use DNS server" settings. Select the radio button "Use the following DNS server entries" and enter the following IP address:



 208.67.222.222 
 208.67.220.220


Those, who might be curious about, which IP address these are, I would like to tell that the IP addresses points to OpenDNS - resolver1.opendns.com. This is a DNS service provider organization. Please visit their website www.opendns.com for details. The above entry should work for across all the regions, so don't worry about that.


I hope, your problem should be taken care by some/all these steps.


Best of luck.




Contents are compiled from different resources. Respective copyrights are acknowledged.

k-Flakes # 2010-10 : Clipboard Hack Problem (Internet user security issue)

Clipboard Hack Problem - Shocking news about CTRL+C

Ctrl+C may be the most important work we do everyday. But it's not a very safe thing to do. Read on to know why. What happens when you press Ctrl+C while you are online. We do copy various data by Ctrl + C for pasting elsewhere. This copied data is stored in clipboard and is accessible from the net by a combination of Javascripts and ASP. This is called clipboard hack problem.

Just try this:
1. Copy any text by Ctrl + C
2. Click the Link: http://www.sourcecodesworld.com/special/clipboard.asp
3. You will see the text you copied was accessed by this web page.

Surprised! I know you are because i was also surprised to see it. Do not keep sensitive data (like passwords, credit card numbers, PIN etc.) in the clipboard while surfing the web. It is extremely easy to extract the text stored in the clipboard to steal your sensitive information. Forward this information to as many friends as you can, to save them from online frauds!

It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your possible sensitive data to a database on another server.

How Cipboard Hack is done?

The Clipboard hack is done by the following Source Code:


How to safeguard yourself from Clipboard Hack Problem?

To avoid clipboard hack problem, do the following:
1. Go to internet options->security.
2. Press custom level.
3. In the security settings, select disable under Allow paste operations via script. (Scripting sub heading)

Now the contents of your clipboard are safe.

Interestingly, this hack works only on internet explorer, and not on Mozilla Firefox browser. Please forward this article to as many friends as you can to make them aware of this issue with CTRL+C.


Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes # 2010-9: Approaches to interoperate java libraries with .Net application

Approaches to interoperate java libraries with .Net application 


Following can be the way to interoperate java libraries and .Net.

  1. In-proc Approach
The In-proc approach works by bringing together the .Net VM and Java VM into one process. The Java procedure calls .Net procedure via common area, like shared memory or through a communication channel. This approach is very efficient and optimized, but very complex underneath.

1.    Dynamically linking of Java libraries into .Net application.
IKVM.NET is an ongoing open-source project that translates Java bytecodes to MSIL as needed at runtime. IKVM.NET should allow any Java code to run on the .NET platform.

-        Open source project, available free of cost even for commercial usages (As per license agreement)
-        The most developed 3rd party API for Java-.Net interoperability.

Cons:
-        We need to test it thoroughly, as the project is still under development.
-        While online community support is available, there is no commercial support.

-        This is also an open source project, freely available.
-        We can consider this one among In-proc call, as its Beta version release is more promising than IKVM.NET.
-        Its architect is different and less complex as compared to IKVM.Net.
-        The beta version was released in 2004, so need to check if it works fine with Java 5 features.


3.    CodeMesh JuggerNet (http://www.codemesh.com/)  and JNBridge (http://www.jnbridge.com)
This is a commercial product with similar functionality to JNI.NET.


  1. Out-proc Approach
The Out-proc approach allows two different processes talk with each other through a channel understood by both the system. E.g. Java and .Net can communicate together using xml messages.

1.    Webservices
Web services are intended to provide a standards-based mechanism for allowing cross-platform components to interoperate.

- Web services are designed for loosely coupled interactions that are infrequent and coarse-grained: therefore they're not appropriate for applications that require frequent and fine-grained calls between Java and .NET classes.

- If you need to expose a rich interface for a large number of Java classes and objects, or you need to allow the .NET client process to create Java objects through the standard constructor (new) mechanism, Web services won't work.

- Web services use a SOAP-based communications mechanism that's inherently slower than alternative binary communications mechanisms.

- Web services are also not well-suited for passing custom objects between Java and .NET as parameters and return values.

  1. RPC (Remote Procedure Calls) with CORBA

The CORBA architecture provides us with common platform for remote procedure call between heterogeneous systems. However the java implementation of CORBA is freely available, very few .Net implementation are available.

    1. CORBA for .Net functionality is commercially available through MiddCor from MiddTec.
    2. Remoting.Corba (http://sourceforge.net/projects/remoting-corba/) is an open source project that aims to bring CORBA to .NET. It's still in beta phase.

  1. Using a shared database and messaging queue
This is a workaround alternative for designing applications in .Net and Java, which works together. On a broad level, one process put data/object into a middle layer (a database or messaging queue); while other process consume the data and vice-versa.

-        The approach is one of the simplest, but may not be suitable in many cases.
-        Requires additional middleware system, which will incur additional cost.


  1. Other Approaches

    1. Using Visual J#

-        .NET supports development of systems using multiple languages concurrently. One way to support Java/.NET interoperability is to translate the Java code directly into .NET's MSIL (Microsoft Intermediate Language) rather than into Java bytecodes.

-        Unfortunately, J# a significant limitation: it's legally limited to the Java supported by JDK 1.1.4 plus JDK1.2's collection classes. When the Java code you need uses more advanced features, including just about any J2EE feature such as EJBs or servlets, J# isn't a good choice.

Contents are compiled from different resources. Respective copyrights are acknowledged.

We forget that the water cycle and the life cycle are one.

Friends... I know this is an unusual post w.r.t the goal of this forum. But through this post, I would like to spread awareness about the current water problem across Globe, and I would term it as 'Slow-Coming Global Disaster'.

If we dont awake now, may be our next generation would find it difficult to see their next generation.
------------------------


We forget that the water cycle and the life cycle are one. – Jacques Cousteau

The biggest users of water on the islands are homes & tourist accommodations. Now some places in the US have no choice but to watch their water consumption because of drought. Here are some easy to follow tips to save water and money.

Kitchen Tips
1.      Soak pots and pans before washing. When washing dishes by hand, fill one sink or basin with soapy water.
2.      Fill the basin or a pan with water to wash fruits and vegetables.
3.      Keep a pitcher of water in the refrigerator rather than running tap water until it is cool enough to drink.
4.      When buying a new dishwasher, consider purchasing a water-saving model.
5.      Wash only full loads in the dishwasher.
Bathroom Tips
1.      Replace older, larger-use toilets with the newer ultra-low flush models.
2.      Do NOT use the toilet to dispose of paper, facial tissues, or cigarettes. Take a five-minute shower.
3.      Install a low-flow showerhead. It can save about half the amount of water you typically use in the shower, while still providing a refreshing, cleansing shower.
4.      Turn the tap water off while brushing your teeth,  shaving, or washing your face.
5.      If the toilet flush handle frequently sticks in the flush position, letting water run constantly, replace or adjust it.
Laundry Room Tips
1.      When buying a new clothes washer, consider purchasing a water-saving model. New horizontal axis models can save up to 40 percent of the water used by a conventional model.
2.      Wash only full loads in the clothes washer. 
Outdoor Tips
1.      Don't overwater your landscape. It can cause yellowing leaves or poor plant health.
2.      Using a running hose to wash your car can waste about 400 litres of water. Using a bucket with a sponge plus a trigger nozzle on the hose will save you about 300 of those litres.
3.      If you own a pool, be sure to use a pool cover when it's not in use. This will cut down on evaporation losses and will keep it cleaner and warmer.

Using some of these tips will surely save some water and hopefully some cash in the process.

Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes 2010-8 : Understanding Finance - What is an Escrow account?


Understanding Finance - What is an Escrow account?


“Escrow” is a financial asset held by a party on behalf of the other two different parties, in a transaction. The asset remains with the escrow service until the transactional obligations are fulfilled by the parties. Typically funds are kept in escrow account. Securities, funds and other assets can be held in escrow. The Escrow account providers (generally a bank) charges a commission in lieu of their services.

Example:
An escrow account can be used in the sale of a house. If there are conditions to the sale (like passing of an inspection); the buyer and seller may agree to use escrow. In this case, the buyer of the property will deposit the payment amount for the house in an escrow account held by a trusted party. This assures the seller - in the process of allowing the house to be inspected - that the buyer is capable of making payment. Once all of the conditions to the sale are satisfied, the escrow transfers the payment to the seller, and title is transferred to the buyer.


Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes # 2010-7 : Region Code Error in playing DVD/VCD: What is and how to fix?


Region Code Error in playing DVD/VCD: What is and how to fix?

There have been instances when you will find ‘Region Code Error’ while attempting to play movies DVD/VCD purchased. This content here is to provide information which will help understand the problem and take action to enjoy the movies having this issue.

Every movie VCD/DVD is stored in a format, which have been adopted in the country. E.g. the movie format in a DVD/VCD purchased in India may not be compatible with the standard used in Japan. Ideally all DVD players manufactured in a country should ideally be capable of playing back the standard formats. However, some models of DVD players which are purchased abroad; or made for any other countries, may not accept the DVD formats of your country.

This is experienced through the following symptoms:
·         ‘Region Code Error’ displayed on the TV screen
·         ‘Cannot Play Disc’ displayed on the TV screen
·         Screen goes blank.

In the event of any of the above symptoms being encountered, please do the following:
·         Contact the retailer from where the player was purchased, or better still, the manufacturer. The region code can be reset through simple operations using the DVD remote.

Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes # 2010-6 : Javascript Code to determine through, if ActiveX is disabled in Internet Explorer (IE)


Javascript Code to determine through, if ActiveX is disabled in Internet Explorer (IE)

It is not possible to change the security settings in IE through javascript; otherwise it will defeat its purpose to save your PC from malicious code to run. However, you can check if the ActiveX is disabled by the user through javascript and accordingly can request user to enable it first.

var objShell;
try
{
objShell = new ActiveXObject("WScript.Shell");
}
catch(e)
{
//ActiveX is disabled or not allowed on prompt.
//Display instructions requesting user to modify settings.
}


Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes # 2010-5: Tips to create a good PPT presentation (Computer based presentation)


Tips to create a good computer-based presentation (like MS-Power Point presentation)


·         The principle of MECE, mutually exclusive but collective exhaustive. A McKinsey concept. Ensures completeness in the message without repetition.

·         Difference between a slide pack that is used to make a presentation versus a slide pack that is used as a document. The former needs to be brief and concise (Here we are concerned with the former).

·         Too much text in a presentation leads the audience confused as to whether to listen to you or look at the slides.

·         A picture is worth 1000 words. However 1000 pictures are worth nothing. Complicated diagrams that look like a map of London Metro can be distracting.

·         Usage of bullet points with single line sentences.

·         Not more than 5 bullet points per heading. 3 are ideal. In my opinion any idea illustrated by more than 5 bullet points tends to dilute it.

·         The presenter should prepare his own slides just as a paratrooper should pack his own parachute.

·         There are two kinds of presentation flows. Inductive and deductive. The former presents the bigger picture first and then provides the supporting details. The latter provides the details and then proceeds to deduce the conclusion. The method one deploys depends on the presenter’s thought process and the audience.

Contents are compiled from different resources. Respective copyrights are acknowledged.

K-Flakes # 2010-4 : Java Logger API: Creating log in custom


Java Logger API: Creating log in custom format (e.g. CSV format, HTML format)

Java logger API provides built-in support to log error/warning messages. The default format of logging is “simple text format” (java.util.logging.SimpleFormatter) and “XML format” (java.util.logging.XMLFormatter). 
 
However, the logging can be done in any format by creating custom formatter. Following are some simple step to create a custom formatter.
 
1. Extend the abstract class java.util.logging.Formatter and use following methods:
 
a)                       abstract String format(LogRecord record)
-   Abstract class, must be overridden.
-   Format the given log record and return the formatted string.
-   The java.util.logging.LogRecord object contains all the logging data; like log level, time, source class/method names, thread id/name etc.
 
b)                       String formatMessage(LogRecord record): Localize and format the message string from a log record.
-   Localize and format the message string from a log record. This method is provided as a convenience for Formatter subclasses to use when they are performing formatting.
-   Implementation is optional. Should be called from the “format” method.
 
c)                       String getHead(Handler h)
-   Return the header string for a set of formatted records.
-   The Handler object connects to the channel/stream/media; over which the log will be written.
-   Not required an explicit call. Automatically called when the handler using this formatter is created.
-   Implementation is optional. Default implementation returns empty string.
 
d)                       String getTail(Handler h)
-   Return the tail string for a set of formatted records.
-   The Handler object connects to the channel/stream/media; over which the log will be written.
-   Not required an explicit call. Automatically called when the handler using this formatter is closed.
-   Implementation is optional. Default implementation returns empty string.
-------------------------------------------------------------------------
Source code example (Tested on Java 5)
-------------------------------------------------------------------------
package com.gyani;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

//This custom formatter formats parts of a log record to a single line
class CustomHtmlFormatter extends Formatter
{
 // This method is called for every log records
 public String format(LogRecord rec)
 {
  StringBuffer buffer = new StringBuffer(1000);
  // Bold any levels >= WARNING
  buffer.append("");
  buffer.append("");

  if (rec.getLevel().intValue() >= Level.WARNING.intValue())
  {
   buffer.append("");
   buffer.append(rec.getLevel());
   buffer.append("");
  } else
  {
   buffer.append(rec.getLevel());
  }
  buffer.append("");
  buffer.append("");
  buffer.append(calcDate(rec.getMillis()));
  buffer.append(' ');
  buffer.append(formatMessage(rec));
  buffer.append('\n');
  buffer.append("");
  buffer.append("\n");
  return buffer.toString();
 }

 private String calcDate(long millisecs)
 {
  SimpleDateFormat date_format = new SimpleDateFormat("MMM dd,yyyy HH:mm");
  Date resultdate = new Date(millisecs);
  return date_format.format(resultdate);
 }

 // This method is called just after the handler using this
 // formatter is created
 public String getHead(Handler h)
 {
  return "\n\n" + (new Date()) + "\n\n\n
\n"
    + "\n  "     + "
\n";  }   // This method is called just after the handler using this  // formatter is closed  public String getTail(Handler h)  {   return "
TimeLog Message
\n
\n\n"; } public String formatMessage(LogRecord record){ return ".......Hello Gyani...."; } } class MyLogger { static private FileHandler fileTxt; static private SimpleFormatter formatterTxt; static private FileHandler fileHTML; static private Formatter formatterHTML; static public void setup(Logger logger) throws IOException { // Create Logger logger.setLevel(Level.INFO); fileTxt = new FileHandler("C:\\Gyani\\Logging.txt"); fileHTML = new FileHandler("C:\\Gyani\\Logging.html"); // Create txt Formatter formatterTxt = new SimpleFormatter(); fileTxt.setFormatter(formatterTxt); logger.addHandler(fileTxt); // Create HTML Formatter formatterHTML = new CustomHtmlFormatter(); fileHTML.setFormatter(formatterHTML); logger.addHandler(fileHTML); } } public class UseLogger { // Always use the classname, this way you can refactor private final static Logger LOGGER = Logger.getLogger(UseLogger.class .getName()); public UseLogger(){ try { MyLogger.setup(LOGGER); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Problems with creating the log files"); } } public void writeLog() { // Set the LogLevel to Severe, only severe Messages will be written LOGGER.setLevel(Level.SEVERE); LOGGER.severe("Info Log"); LOGGER.warning("Info Log"); LOGGER.info("Info Log"); LOGGER.finest("Really not important"); // Set the LogLevel to Info, severe, warning and info will be written // Finest is still not written LOGGER.setLevel(Level.INFO); LOGGER.severe("Info Log"); LOGGER.warning("Info Log"); LOGGER.info("Info Log"); LOGGER.finest("Really not important"); } public static void main(String[] args) { UseLogger logger = new UseLogger(); logger.writeLog(); } } -----------------------------------------------------------------------------

Contents are compiled from different resources. Respective copyrights are acknowledged.