Is the 'instanceof' operator discouraged ?

Hi,
I have heard that the instanceof operator is not recommended and should be used only as a last resort. Can someone throw some light into it ? is there an alternative ?
thanx and regards

hi,
thanx for the response.
well, the BaseException and its subclasses belong to a different applicaiton, and my application calls this application thru remote interface.
For each of the 5 sub-exceptions, we need to log a different message, and then propogate the same to our client.
There is too much code repetetion-- My session bean has 10 methods, each of these catch the 5 sub-classes, log a message and throw a new exception.
To avoid code repetetion, i ll catch the BaseException in each of the 10 methods of session bean, and then in the catch block, i ll call a method say -- handleExeption, which will identify the type of exception and take the action that were taken earlier by the multiple catch blocks.
Now, I need to use the instanceof operator to identify the specific type of exception. Will it be recommended practice ?
thanx and regards

Similar Messages

  • Avoiding using instanceof operator

    I've heard that using the instanceof operator isn't such a great code technique, and since I'm in the design phase, I feel like I should be able to avoid this. Right now, part of my design requires use of the instanceof operator as well as casting.
    Let's say you have a common notifier interface and two abstract classes which extend from this interface:
    com.example.Notifier Interface:
    public void doNotify(Notification notif, List notifiables);
    public boolean canSend(Notification notif, Notifiable person);
    com.example.SerialNotifier (abstract)
    public void doNotify(Notification notif, List people)
        for (Iterator itList = people.iterator(); itList.hasNext();)
             Notifiable person = (Notifiable)itList.next();
             doNotify(person, notif);
    public abstract doNotify(Notification notif, Notifiable person);
    com.example.MulticastNotifier (abstract)
    public abstract void doNotify(Notification notif, List notifiables);MulticastNotifier purposefully doesn't define a way to send a message to a single person, so that developers don't implement a non-multicast solution for a multicast protocol.
    Here's the part that seems to require an "instanceof" clause. Now let's say you have a list of Notifiers. The list of notifiers is mixed, containing both Serial and Multicast Notifiers. Before you send out the notification, you need to filter the list (because for example, someone doesn't want to be notified at all):
        for (Iterator itNotifiers = notifiers.iterator(); itNotifiers.hasNext();)
             Notifier notifier= (Notifier)itNotifiers.next();
             List buildPeopleList = new ArrayList();
             for (Iterator itPeople = people.iterator(); itPeople.hasNext())
                   Notifiable person= (Notifiable)itPeople.next();
                   if (notifier.canSend(person, notification))
                           if (notifier instanceof MulticastNotifier)
                                  buildPeopleList.add(person);
                           } else
                                   SerialNotifier serialNotif = (SerialNotifier)notifier;
                                   serialNotif.doNotify(notification, person);
             if (notifier instanceof MulticastNotifier)
                      notifier.doNotify(notification, buildPeopleList)
        }Is this bad design? Another option is to just iterate through the list essentially twice, but this is of course, less efficient for the serial notifier case:
        for (Iterator itNotifiers = notifiers.iterator(); itNotifiers.hasNext();)
             Notifier notifier= (Notifier)itNotifiers.next();
             List buildPeopleList = new ArrayList();
             for (Iterator itPeople = people.iterator(); itPeople.hasNext())
                   Notifiable person= (Notifiable)itPeople.next();
                   if (notifier.canSend(person, notification))
                           buildPeopleList.add(person);
             notifier.doNotify(notification, buildPeopleList);
        }Any suggestions?

    I'm not sure what you mean. I moved a loop from your
    code to a different class. AFAICT, it's a
    one-for-one. My solution has the same number of
    iterations as yours.Yeah, your code is actually missing a loop, because, as I explained earlier, the design supports filtering at both a parent notifier and a child notifier. To filter, it needs to loop through the list of people
    So, your code actually will look like: (forgive me, doing code in a textarea is kinda a pain)
    public void ParentNotifier implements Notifier
    // member var for simplicity
    protected Filter myFilter = new ExampleFilter();
    protected List notifiers = // list of notifiers
    public void doNotify(Notification n, List people)
      List intermediateList= new ArrayList();
      for (Iterator itPeople = people.iterator(); itPeople.hasNext();)
            Notifiable person = (Notifiable); itPeople.next()
            if (myFilter.canSend(n, person) // parent's filter
                 intermediateList.add(person);
       for (Iterator itNotifiers = notifiers.iterator(); itNotifiers.hasNext();)
                    Notifier notif = (Notifier)itNotifiers.next();
                    notif.doNotify(n, intermediateList); // 2nd loop is in here where additional filtering takes place
    }If you assume a serial notifier, you don't need this additional iteration:
    public void ParentNotifier implements Notifier
    // member var for simplicity
    protected Filter myFilter = new ExampleFilter();
    protected List notifiers = // list of notifiers
    public void doNotify(Notification n, List people)
      for (Iterator itPeople = people.iterator(); itPeople.hasNext();)
            Notifiable person = (Notifiable); itPeople.next()
            if (myFilter.canSend(n, person) // parent's filter
                 for (Iterator itNotifiers = notifiers.iterator(); itNotifiers.hasNext();)
                         Notifier notif = (Notifier)itNotifiers.next();
                         // PROBLEM HERE: assumes serial notifier
                         notif.doNotify(n, person); // child will do own filtering
    }Edit: Corrected logic error in code

  • Java InstanceOf operator

    I am writing a program that runs on a simulated network, that exposes my data to potential corruption. So, if I send an object across the network and some of the bytes in that object get corrupted will the instanceof operator still recognize that object as a member of a particular class even though some of the data is corrupted, or does it depend on which actual bytes are corrupted?

    When an object is serialized part of what's sent is the name of the class, and that's all that determines what class of object it will attempt to reconstruct..
    If you're using an unreliable connection stream then you should probably add a CRC check of some kind. Most of the channels you migh use have that built in.

  • Instanceof operator, please help!

    I am reading the codes written by others. I am confused on instanceof operator here.
    (A instanceof B) where A and B are interfaces. I found a definition in a book such that the
    instanceof operator returns true or false based on whether the object is an instance of the named
    class or any of that class's subclass. However, I didn't find the relationship between A and B is
    established in the codes. In this case, I wonder if instanceof operator can still be used because I am thinking that it will always evaluate to be false.
    Thank you for your help!
    Cathy

    The instanceof operator can always be used - a return value of false is still a valid return value!
    However, when it comes to interfaces it is possible for a class to implement both interfaces even though there may be no direct relationship between those interfaces.
    Have a look at this:
    public interface MyInterface
    public interface YourInterface
    public class MyClass implements MyInterface, YourInterface
    }There is no relationship between the two interfaces but I can still do this:
    public void check(MyInterface myObj)
      if(obj instanceof YourInterface)
        YourInterface yourObj = (YourInterface)myObj;
        System.out.println("Woo hoo - an instance of MyInterface that's also an instance of YourInterface!");
    }Essentially the instanceof operator is asking if the value passed can be cast to something else for the method to use it more specifically.
    There could be classes other than MyClass that implement both interfaces, particularly if a system is designed to be flexible.
    I hope this makes sense!

  • How do I clone a fully operational system that relies on Windows 7 for the underlying operating system?

    I'm a retired IT professional desiring to assist a friend who owns a small business who recently experienced very malicious attacks on her computers from unknown parties operating anonymously on the Internet. Because
    of her lack of preparation for such events, her future ability to continue to conduct her business was seriously threatened. The incident revealed, to my friend, the need to be prepared to deal with spontaneously occurring problems that create suspicious conditions
    that arise with modern computer software before they can be analyzed in a sufficiently comprehensive manner to have an opinion regarding the appropriate course of action for obtaining a permanent remedy. In that, the ability to quickly react on the basis of
    only suspicion is the goal.
    I want to recommend an approach that involves maintaining an offline image of an operational system that is capable of running any of her computers. This image needs to include all of the software required to run
    her business. In that, it is not limited to the operating system. This single image could then be used to restore any computer to a known reliable state should the need arise. This technique will also insure that each computer has sufficiently similar capability
    to allow them to substitute for each other. Insofar as image restoration is itself an operation susceptible to causing unacceptable business delay I'm also recommending that each of the identical computers (i.e., from a hardware perspective) operate in a multi-boot
    environment where a virtually offline backup can be instantiated via a simple reboot (i.e., an operation that all users of the Windows operating systems turn to when strange behavior is first observed). My intention is to limit the cloned system (i.e., partition
    or C: drive) to the operational software. The business data along with storage for temporary data will be isolated on other partitions (i.e, mounted with other drive letters) accessible by each instance of the software eligible for multi-boot operation.
    This kind of operation is something that I know how to setup on older versions of the Windows operating system. However, Microsoft has now dropped support for all of those operating systems and my much more limited
    experience with the currently supported operating systems reveals that changes to the boot process will necessitate making changes to the specific preparations needed to build such an environment.
    Before recommending that my friend replace all of her computers with new ones, that includes paying for new operating system (i.e., Windows) licenses, I need some assurance that the new operating systems are as
    good as the old ones in this respect. These need to be relatively inexpensive desktop computers and we're only talking about a few of them. Let's say fewer than half a dozen. My friend is a sole proprietor and even though her business has become completely
    dependent on what was once called personal computers she must operate on a fairly tight budget. This especially includes the budget for technology.
    The articles I've been able to find on the Microsoft support websites seem to treat multi-boot as a situation where someone is running different versions of possibly difference operating systems whereas my need
    to produce a single image that will both run on multiple computers as well as multiple partitions on the same computer. I'd appreciate finding some technical advice that applies to building such a system using a supported version of Windows.

    I tried the image creation/restoration described by Jared.  I don't think it makes much sense to rely on an operational system to do such a restoration therefore I opted for method 3 which involves using a "System Repair Disk".  My first
    reaction is what a crude tool.  The image creation process had no trouble putting the image on a simple network share.  However, it appeared as though the restoration couldn't even connect with the device.  I then copied the files to a USB drive. 
    In this case the repair disk said it couldn't find the files even though they were there.  It offered no mechanism to even look and see what was there.  It appears as though it will only find the image if it is located in a folder by the certain
    name used on creation and it is in root directory.  Not very handy.
    As ugly as all that was when we finally come to the point of making the restore it looks like the only option is to restore the entire disk, which in my case would mean also restoring both the windows partition and the recovery partition.  This just
    isn't what I want to do.  It is also something I wouldn't even consider doing unless it was the only possible way to recover from a failed hard drive.
    In summary, unless I've completely failed to notice how it works that just isn't going to work.
    I hope there is something better than this.  What about WinPE and ImageX?
    Absent anything useful from Microsoft it will be necessary to try using other software.  Time to try Acronis!  I guess.

  • Why the 'LIKE' operator takes so much time to run?

    I have a table T with 3 columns and 3 indexes:
    CREATE TABLE T
    id VARCHAR2(38) NOT NULL,
    fid VARCHAR2(38) NOT NULL,
    val NVARCHAR2(2000) NOT NULL
    ALTER TABLE T ADD (CONSTRAINT pk_t PRIMARY KEY (id,fid));
    CREATE INDEX t_fid ON T(fid);
    CREATE INDEX t_val ON T(val);
    Then I have the following two queries which differ in only one place - the 1st one uses the '=' operator whereas the 2nd uses 'LIKE'. Both queries have the identical execution plan and return one identical row. However, the 1st query takes almost 0 second to execute, and the 2nd one takes more than 12 seconds, on a pretty beefy machine. I had played with the target text, like placing '%' here and/or there, and observed the similar timing every time.
    So I am wondering what I should change to make the 'LIKE' operator run as fast as the '=' operator. I know CONTEXT/CATALOG index is a viable approach, but I am just trying to find out if there is a simpler alternative, such as a better use of the index t_val.
    1) Query with '=' operator
    SELECT id
    FROM T
    WHERE fid = '{999AE6E4-1ED9-459B-9BB0-45C913668C8C}'
    AND val = '3504038055275883124';
    2) Query with 'LIKE' operator
    SELECT id
    FROM T
    WHERE fid = '{999AE6E4-1ED9-459B-9BB0-45C913668C8C}'
    AND val LIKE '3504038055275883124';
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=1 Card=1 Bytes=99)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T' (Cost=1 Card=1 Bytes=99)
    2 1 INDEX (RANGE SCAN) OF 'T_VAL' (NON-UNIQUE) (Cost=4 Card=12)

    I will for sure try to change the order of the PK and see whether there will be any impact to the performance.
    In our application, val is much closer to a unique value than fid. In the example query, the execution plan showed that the index on val was indeed used in the execution of the query. That's why the 1st query took almost no time to return (our table T has more than 6 million rows).
    I was hoping the 'LIKE' operator would utilize the t_val index effectively and provide similar performance to the '=' operator. But apparently that's not the case, or needs some tricks.

  • How do I use the ? operator in JSF tag attributes?

    I want to do something like this:
    <h:inputText styleClass="${myBean.valid ? 'styleA' : styleB'}" ...>
    What do I have to do to use this Expression language?
    With the #{...} expression the ? operator doesnt seem to be available.
    When I use the ${...} expression I am getting this error:
    javax.servlet.ServletException: ServletException in '/WEB-INF/body/Test.jsp': /WEB-INF/body/Test.jsp(12,5) According to TLD or attribute directive in tag file, attribute styleClass does not accept any expressions
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
    Can anybody please help?
    Thanks!

    Personally, i'd do:
    <h:inputText styleClass="styleA" rendered="#{myBean.valid}"/>
    <h:inputText styleClass="styleB" rendered="#{!myBean.valid}"/>

  • Why does the new operating system not delete the moved files from their original location - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it

    Why does the new operating system not delete the moved files from their original locations - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it - also, when transferring large amounts of files it becomes a very large problem remembering which files were transferred and which not.

    You're going to need to be more specific, as I'm not quite sure I understand what you're talking about.
    If you're referring to copying from an external hard drive or flash drive, and you want to actually move files rather than copy them, you can hold down the option key to force it to do a "move" rather than a "copy." This is not new behavior, though... the Mac OS has worked this way as long as I can recall (and I've been using it since 1984).
    If you're having a problem with trying to move files from one place to another on a single drive causing them to be copied instead, that is likely because of some permissions issue preventing you from actually being able to move them.

  • SQL Azure - Intermittent The wait operation timed out

    I have a website engine which runs a few hundred "white label" sites. It's hosted on Azure with a SQL Azure Business database. Generally everything is fine - it all works and runs at a good speed.
    However, throughout the day I get maybe 40 or 50 of the error:
    System.ComponentModel.Win32Exception: The wait operation timed out
    Please don't refer me to the connectivity blog at http://blogs.msdn.com/b/sqlazure/archive/2010/03/22/9982979.aspx as this seems to refer to problems where you just can't connect. My problem is that it's fine most of the time, but I still get these
    intermittently.
    This is sometimes on the main database, but we're also using a database for sessions and this gets the errors too. Both databases are on the same server.
    I also get errors like: 
    An existing connection was forcibly closed by the remote host
    and:
    System.Data.SqlClient.SqlException: The service has encountered an error processing your request. Please try again. Error code 40143. A severe error occurred on the current command. The results, if any, should be discarded.
    and, when evil bots are hammering the site:
    System.Data.SqlClient.SqlException: Resource ID : 1. The request limit for the database is 180 and has been reached. See 'http://go.microsoft.com/fwlink/?LinkId=267637' for assistance.
    Each website can potentially have a Google footprint of around 10,000 pages. The result it that bots are hitting the sites regularly, indexing lots of pages for hundreds of sites. I also have some worker roles doing data work. The database is clearly busy!
    I am hoping to add 2 or 3 times the number of sites that I currently have to the "engine". 
    I am looking at efficiency where possible, but the sites are clearly under a fair load from bots and visitors.
    My question is, will one of the upgrades from Business to S2, P1, P2 or P3 resolve these problems? The financial cost of these database instances stagger greatly so I wouldn't want to update and find I'm left with the same problems but am paying many times
    more each month.
    Thank you in advance.

    Hello,
    For Web/Business edition database, the maximum limit of concurrent requests is 180. Beyond this limit, you will receive error.
    The Max woker threads for Standard(S2) is 100, you should upgrade your database to Permium tier.
    The concurrent requests limit of premium database varies depending on the reservation size of a premium database. For example, for P1, the max worker threads is 200.
    Reference:Azure SQL Database Resource Governance
    Azure SQL Database Service Tiers and Performance Levels
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • I just bought a new MacBook Pro and it came with the old operating system, how do I upgrade it to the latest one without having to purchase it?

    Hi,
    Im a new Mac user. I currently just bought a new MacBook Pro. The first computer I got apparently had a problem with the flex, so I had to go change it for a new one. The first one had the latest operating system, the second one the store gave me didn't, yet it's still a brand new computer, so I don't see why I should have to pay for the new operating system, which should already come with my brand new computer. So I am trying to contact apple so they may give me permission to download it from the app store for free, due to this inconvenience and first bad experience. The vendor tells me that sometimes new computers may come with old operating systems because they're from an old batch of new computers. Oh and by the way, I'm from Honduras, and bought it at Jetstereo, in Tegucigalpa (the capital). This store is a licensed distributor.
    Hope someone can help me,
    Ankie Zapata

    Go to the Mac App Store main page and click on Support under Quick Links.
    (82704)

  • How to change the 'Default operating mode' of a mapping on the repository and not from the client

    Hi everybody,
    I am using OWB 11.2.0.3 and under the mapping's configuration property, I have the necessity to change the Run time parameter "Default operating mode" to SET_BASED in almost all my mappings.
    Because I have 745 mappings in which the Default operating mode is different from SET_BASED, instead to open 745 times the 'Configure' and update manually the value, is there a way to update safely these values (with an oracle predefined script) directly on the repository ?
    I know that exists a view called CMPSTRINGPROPERTYVALUE_V based on a table called CMPSCOPrpClasses, but changing this table it's very complicated for me because contains only keys and then I don't know in which way is connected with all the other structures....
    If somebody knows a method more efficient to do these updates on the repository and not from OWB client I will appreciated it!
    Thanks in advance
    Alessandro

    Urgent... help!!! Thanks
    in short, my server log says transaction access mode is "read only", so my calling home.create() always triggers a transaction rollback. How to change the access mode to "read write"?
    Is possible to work out through one of the descriptor files? Or ini settings of the underlying pointbase database? Or any other way around?

  • Problem with the PUT operation some files won't transfer help please

    Hi everyone,
    I am using DWCS3 on OS X Leoard 10.5 and MAMP
    I am putting together a basic index.html page and then I want to template it. Pretty basic stuff.
    However when I want to view the index.html page in my MAMP testing server, In the middle of the PUT operation I get a message saying;
    File activity incomplete 1 file or folder was not completed.
    index.html - Put operation successful
    - error occurred - An error occurred - cannot put .  An unknown error occurred.
    css:index.css - same - not transferred
    SpryAssets:SpryMenuBar.js - same - not transferred
    SpryAssets:SpryMenuBarHorizontal.css - same - not transferred
    SpryAssets:SpryMenuBarDown.gif - same - not transferred
    SpryAssets:SpryMenuBarRight.gif - same - not transferred
    SpryAssets:SpryMenuBarDownHover.gif - same - not transferred
    SpryAssets:SpryMenuBarRightHover.gif - same - not transferred
    SpryAssets:SpryMenuBarVertical.css - same - not transferred
    File activity incomplete. 1 file(s) or folder(s) were not completed.
    Files updated: 1
    Files skipped: 8
    Files with errors: 1
    Finished: 23/07/2010 13:30
    I am aware that files are not transferring over to the testing server but I don't understand why or how to fix the problem. I don't think the problem lies with the path from Dreamweaver to the testing server because I have been working on the page and viewing it in the testing server. It's only just started displaying the message above and not passing some of the files over. It will for example pass the index.css page over.
    I have copied the code over for index.html, SpryMenuBar.js, SpryMenuBarHorizontal.ccs and SpryMenuBarVertical.css.
    In the hope that someone will not mind taking a look at this for me.
    Below is the code for my home page in case the problem lies here
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Home Page Geoff Hyde is Innocent</title>
    <link href="//index.html" rel="stylesheet" type="text/css" media="all" />
    <link href="css/index.css" rel="stylesheet" type="text/css" />
    <!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixLtHdr #sidebar1 { width: 230px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixLtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixLtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="twoColFixLtHdr">
    <div id="container">
      <div id="header">
        <h1><u>Geoff Hyde is Innocent!</u></h1>
        <!-- end #header -->
      </div>
      <div id="nav">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="index.html" title="Home page">Home</a> </li>
          <li><a href="about.html" title="About the campaign">About us</a> </li>
          <li><a href="updates1.html" title="links to updates" class="MenuBarItemSubmenu">Updates</a>
            <ul>
              <li><a href="confisupdate.html" title="Confiscation update">Confiscation</a></li>
              <li><a href="appealupdate.html" title="Appeal update">Appeal</a></li>
              <li><a href="petitionupdate.html" title="Petition update">Petition</a></li>
              <li><a href="newspdf.html" title="News articles">News articles</a></li>
            </ul>
          </li>
          <li><a href="charity.html" title="About charity for Geoff Hyde" class="MenuBarItemSubmenu">Charity</a>
              <ul>
                <li><a href="friends.html" title="About the people supporting Geoff Hyde" class="MenuBarItemSubmenu">Friends</a>
                    <ul>
                      <li><a href="#">Item 3.1.1</a></li>
                      <li><a href="#">Item 3.1.2</a></li>
                    </ul>
                </li>
                </ul>
          </li>
          <li><a href="#" title="Links to the petition">Petition</a></li>
        </ul>
      </div>
      <br/>
      <div id="sidebar1">
        <h3> </h3>
        <ul id="MenuBar2" class="MenuBarVertical">
              <li><a href="case.html" title="What happened on 27 Feb">The case</a>          </li>
          <li><a href="invest1.html" title="Links to investigation" class="MenuBarItemSubmenu">Investigation</a>
            <ul>
              <li><a href="tipoff.html" title="Some things we are not allowed to know">Tip off</a></li>
              <li><a href="whyg.html" title="Why arrest Geoff?">Why Geoff</a></li>
              <li><a href="int27.html" title="27 minute interview">27 minutes</a></li>
              <li><a href="cops.html" title="What the Police did not do">Police</a></li>
            </ul>
          </li>
          <li><a href="evi.html" title="Links to evidence" class="MenuBarItemSubmenu">Evidence</a>
              <ul>
                <li><a href="calls.htnl" title="Fictional phone calls">Phone calls</a>            </li>
                <li><a href="timing.html" title="It's all in the timing">Timing</a></li>
                <li><a href="lie.html" title="Can you convict on a lie">Lucas directive</a></li>
                <li><a href="all.html" title="That's all folks">That's all</a></li>
            </ul>
          </li>
          <li><a href="confis.html" title="Links to Confiscation" class="MenuBarItemSubmenu">Confiscation</a>
              <ul>
                <li><a href="claners.html" title="Taken to the cleaners">Cleaners</a></li>
                <li><a href="ruin.html" title="Family faces ruin">Ruin</a></li>
                <li><a href="won.html" title="We won the Confiscation">We won</a></li>
            </ul>
          </li>
          <li><a href="biog.html" title="About Geoff Hyde">Biography</a></li>
          <li><a href="#" title="Link to the Petition">Petition</a></li>
          <li><a href="friends.html" title="About the Charity Friends of Geoff Hyde" class="MenuBarItemSubmenu">Charity</a>
            <ul>
              <li><a href="supp.html" title="About the people who supprt Geoff Hyde">Supporters</a></li>
            </ul>
          </li>
          <li><a href="about.html" title="About the Geoff Hyde is Innocent campaign">About us</a></li>
        </ul>
        <h3> </h3>
        <!-- end #sidebar1 --></div>
      <div id="mainContent">
        <h1>An Innocent Man</h1>
        <p>On February 27, 2006, haulier Geoff Hyde took a call on his mobile. Taking that call changed his life forever; because it ended up with the 59-year-old grandfather with no previous convictions to his name being found guilty of drug smuggling. He was sentenced to 22 years in prison. This website is devoted to showing how the Crown Prosecution Service conspired to put an innocent man behind bars, and once they did set about siezing the fruits of nearly four decades of hard work.</p>
        <h2> </h2>
      <!-- end #mainContent --></div>
        <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
      <div id="footer">
        <p>&copy;copyright2010</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    This is the SpryMenuBar.js code which is not being transferred
    var Spry;
    if(!Spry)
        Spry = {};
    if(!Spry.Widget)
        Spry.Widget = {};
    // Constructor for Menu Bar
    // element should be an ID of an unordered list (<ul> tag)
    // preloadImage1 and preloadImage2 are images for the rollover state of a menu
    Spry.Widget.MenuBar = function(element, opts)
        this.init(element, opts);
    Spry.Widget.MenuBar.prototype.init = function(element, opts)
        this.element = this.getElement(element);
        // represents the current (sub)menu we are operating on
        this.currMenu = null;
        var isie = (typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE');
        if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (isie && typeof document.uniqueID == 'undefined'))
            // bail on older unsupported browsers
            return;
        // load hover images now
        if(opts)
            for(var k in opts)
                var rollover = new Image;
                rollover.src = opts[k];
        if(this.element)
            this.currMenu = this.element;
            var items = this.element.getElementsByTagName('li');
            for(var i=0; i<items.length; i++)
                this.initialize(items[i], element, isie);
                if(isie)
                    this.addClassName(items[i], "MenuBarItemIE");
                    items[i].style.position = "static";
            if(isie)
                if(this.hasClassName(this.element, "MenuBarVertical"))
                    this.element.style.position = "relative";
                var linkitems = this.element.getElementsByTagName('a');
                for(var i=0; i<linkitems.length; i++)
                    linkitems[i].style.position = "relative";
    Spry.Widget.MenuBar.prototype.getElement = function(ele)
        if (ele && typeof ele == "string")
            return document.getElementById(ele);
        return ele;
    Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
        if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
            return false;
        return true;
    Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
        if (!ele || !className || this.hasClassName(ele, className))
            return;
        ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
        if (!ele || !className || !this.hasClassName(ele, className))
            return;
        ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    // addEventListener for Menu Bar
    // attach an event to a tag without creating obtrusive HTML code
    Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
        try
            if (element.addEventListener)
                element.addEventListener(eventType, handler, capture);
            else if (element.attachEvent)
                element.attachEvent('on' + eventType, handler);
        catch (e) {}
    // createIframeLayer for Menu Bar
    // creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
    Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
        var layer = document.createElement('iframe');
        layer.tabIndex = '-1';
        layer.src = 'javascript:false;';
        menu.parentNode.appendChild(layer);
        layer.style.left = menu.offsetLeft + 'px';
        layer.style.top = menu.offsetTop + 'px';
        layer.style.width = menu.offsetWidth + 'px';
        layer.style.height = menu.offsetHeight + 'px';
    // removeIframeLayer for Menu Bar
    // removes an IFRAME underneath a menu to reveal any form controls and ActiveX
    Spry.Widget.MenuBar.prototype.removeIframeLayer =  function(menu)
        var layers = menu.parentNode.getElementsByTagName('iframe');
        while(layers.length > 0)
            layers[0].parentNode.removeChild(layers[0]);
    // clearMenus for Menu Bar
    // root is the top level unordered list (<ul> tag)
    Spry.Widget.MenuBar.prototype.clearMenus = function(root)
        var menus = root.getElementsByTagName('ul');
        for(var i=0; i<menus.length; i++)
            this.hideSubmenu(menus[i]);
        this.removeClassName(this.element, "MenuBarActive");
    // bubbledTextEvent for Menu Bar
    // identify bubbled up text events in Safari so we can ignore them
    Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
        return (navigator.vendor == 'Apple Computer, Inc.' && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget)));
    // showSubmenu for Menu Bar
    // set the proper CSS class on this menu to show it
    Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
        if(this.currMenu)
            this.clearMenus(this.currMenu);
            this.currMenu = null;
        if(menu)
            this.addClassName(menu, "MenuBarSubmenuVisible");
            if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
                if(!this.hasClassName(this.element, "MenuBarHorizontal") || menu.parentNode.parentNode != this.element)
                    menu.style.top = menu.parentNode.offsetTop + 'px';
            if(typeof document.uniqueID != "undefined")
                this.createIframeLayer(menu);
        this.addClassName(this.element, "MenuBarActive");
    // hideSubmenu for Menu Bar
    // remove the proper CSS class on this menu to hide it
    Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
        if(menu)
            this.removeClassName(menu, "MenuBarSubmenuVisible");
            if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
                menu.style.top = '';
                menu.style.left = '';
            this.removeIframeLayer(menu);
    // initialize for Menu Bar
    // create event listeners for the Menu Bar widget so we can properly
    // show and hide submenus
    Spry.Widget.MenuBar.prototype.initialize = function(listitem, element, isie)
        var opentime, closetime;
        var link = listitem.getElementsByTagName('a')[0];
        var submenus = listitem.getElementsByTagName('ul');
        var menu = (submenus.length > 0 ? submenus[0] : null);
        var hasSubMenu = false;
        if(menu)
            this.addClassName(link, "MenuBarItemSubmenu");
            hasSubMenu = true;
        if(!isie)
            // define a simple function that comes standard in IE to determine
            // if a node is within another node
            listitem.contains = function(testNode)
                // this refers to the list item
                if(testNode == null)
                    return false;
                if(testNode == this)
                    return true;
                else
                    return this.contains(testNode.parentNode);
        // need to save this for scope further down
        var self = this;
        this.addEventListener(listitem, 'mouseover', function(e)
            if(self.bubbledTextEvent())
                // ignore bubbled text events
                return;
            clearTimeout(closetime);
            if(self.currMenu == listitem)
                self.currMenu = null;
            // show menu highlighting
            self.addClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
            if(menu && !self.hasClassName(menu, "MenuBarSubmenuVisible"))
                opentime = window.setTimeout(function(){self.showSubmenu(menu);}, 250);
        }, false);
        this.addEventListener(listitem, 'mouseout', function(e)
            if(self.bubbledTextEvent())
                // ignore bubbled text events
                return;
            var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
            if(!listitem.contains(related))
                clearTimeout(opentime);
                self.currMenu = listitem;
                // remove menu highlighting
                self.removeClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
                if(menu)
                    closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, 600);
        }, false);
    The code below is the SpryMenuBarHorizontal.css
    @charset "UTF-8";
    /* SpryMenuBarHorizontal.css - Revision: Spry Preview Release 1.4 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    LAYOUT INFORMATION: describes box model, positioning, z-order
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        cursor: default;
        width: 780px;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
        z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: 156px;
        float: left;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        z-index: 1020;
        cursor: default;
        width: 156px;
        position: absolute;
        left: -1000em;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
        width: 156px;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
        position: absolute;
        margin: -5% 0 0 95%;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
        left: auto;
        top: 0;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
        border: 1px solid #CCC;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
        display: block;
        cursor: pointer;
        background-color: #CC0000;
        padding: 0.5em 0.75em;
        color: #FFFFFF;
        text-decoration: none;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
        background-color: #000000;
        color: #FFF;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
        background-color: #33C;
        color: #FFF;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
        background-image: url(SpryMenuBarDown.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
        background-image: url(SpryMenuBarRight.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
        background-image: url(SpryMenuBarDownHover.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
        background-image: url(SpryMenuBarRightHover.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
        position: absolute;
        z-index: 1010;
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
        ul.MenuBarHorizontal li.MenuBarItemIE
            display: inline;
            f\loat: left;
            background: #FFF;
    Below is the code for SpryMenuBarVertical.css
    @charset "UTF-8";
    /* SpryMenuBarVertical.css - Revision: Spry Preview Release 1.4 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    LAYOUT INFORMATION: describes box model, positioning, z-order
    /* The outermost container of the Menu Bar, a fixed width box with no margin or padding */
    ul.MenuBarVertical
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        cursor: default;
        width: 8em;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
        z-index: 1000;
    /* Menu item containers, position children relative to this container and are same fixed width as parent */
    ul.MenuBarVertical li
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: 8em;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarVertical ul
        margin: -5% 0 0 95%;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: absolute;
        z-index: 1020;
        cursor: default;
        width: 8.2em;
        left: -1000em;
        top: 0;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarVertical ul.MenuBarSubmenuVisible
        left: 0;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarVertical ul li
        width: 8.2em;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Outermost menu container has borders on all sides */
    ul.MenuBarVertical
        border: 1px solid #CCC;
    /* Submenu containers have borders on all sides */
    ul.MenuBarVertical ul
        border: 1px solid #CCC;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarVertical a
        display: block;
        cursor: pointer;
        background-color: #000000;
        padding: 0.5em 0.75em;
        color: #FFFFFF;
        text-decoration: none;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus
        background-color: #666666;
        color: #FFF;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible
        background-color: #33C;
        color: #FFF;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarVertical a.MenuBarItemSubmenu
        background-image: url(SpryMenuBarRight.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarVertical a.MenuBarItemSubmenuHover
        background-image: url(SpryMenuBarRightHover.gif);
        background-repeat: no-repeat;
        background-position: 95% 50%;
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarVertical iframe
        position: absolute;
        z-index: 1010;
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
        ul.MenuBarVertical li.MenuBarItemIE
            display: inline;
            f\loat: left;
            background: #FFF;

    I've only encountered two instances where the PUT operation failed on certain files. One, the server does not like the particular file type, and two, when the file was open in another program.
    Other than that, I could only guess that it may have something else to do with the web server configuration and not DW.

  • How can I restore my iPhone 3Gs after I tried to update to the new operating system.

    I tried to upgrade my 3Gs to the new operating system(IOS5) and I got some kind of unknown error.  I told iTunes to do the back up before doing the upgrade.  The phone is stuck in restore mode with the "connect to iTunes" logo displayed.
    I have the latest version of iTunes on my computer. I've restarted my computer.  The iTunes doesnt seem to see the iPhone, but when I connect the phone to the computer I hear the recognition jingle by the comoputer, the one you hear when when a piece of equipment is connected to the computer.  In addition, when i look at "my computer"  I dont see the iPhone in the selections of items connected to the computer.
    I have tried all the reset proceducures with turning the phone off and using the home key.
    Does anybody have any suggestions?

    Hi,
    See Here for
    Unable to Update or Restore
    http://support.apple.com/kb/HT1808

  • I just installed the Lion operating system, basically to upgrade my iPhone. I didn't realize that my Microsoft Office 2004 application would no longer work. I have been using Word for my writing and I receive most of my emails with Word attachments. I hav

    I just installed the Lion operating system, basically to upgrade my iPhone. I didn't realize that my Microsoft Office 2004 application would no longer work. I have been using Word for my writing and I receive most of my emails with Word attachments. I have been using Apple products for years, always touting their reliability and customer service. I am not a techie, I just want to be able to do what I do on the computer and Apple always fulfilled my needs. Now I am told because of some operating system gobbledygook, I have to go out and purchase new software to use Word. This is despicable. I see no particular benefit to using Lion, but I do see a lot of detriments. Apple now seems to have turned into Microsoft, making software obsolete so they can make more money and to **** with the customer. You can be sure that my next computer will be a PC. I have completely lost confidence in Apple.

    I seem to never tire of saying this. It was for Apple when they first announced 10.7 to disclose this. Yes, it was widely reported -- or rather, rumored -- but not by Apple. And many people who have gotten caught by this assumed that Apple itself would have told them beforehand about the loss of this very important feature which they had come to rely on. As far as I know, not even in fine print, does this appear anywhere on the Lion announcement or any of its links.
    I am not saying Apple had to continue Rosetta in Lion, or forever, just that if it was going to be dropped, it should have been made known.
    As relative "insiders" we should not forget that many people don't have the time, habit or interest to do this kind of research. I think it is a breach of trust that Apple has never directly made this announcement or given people the opportunity to decide beforehand if giving up their PPC apps for a new OS is a worthwhile tradeoff.

  • How can I use the update operation in a VC Model

    Hello experts,
    i try to to use the update operation in my VC model.  I have developed an AS wich return a table. Now i want to update a table row. So I add the update operation to my model. But it doesn´t work. I mapped all attribute between the table and the update service. The event name is submit.
    Another strange thing is: If i try to update in the service browser it cames the error message that the vandatory attribute ... is missing.
    Any ideas??
    Thanks
    Marco

    Hi Marco,
    In this case it is possible that your update service requires a mandatory parameter which you are not providing.
    When you drag your service onto the VC screen, right click on the service and test it.It will give you a clear picture of which parameters are required by the service and besides you can also use some test data to check if the service is working properly.
    Do let me know if this helps.
    Thanks,
    Gaurav.

Maybe you are looking for

  • Microsoft Office 2013

    I would be interested to see if anyone has upgraded to Office 2013. Having purchased Office 2010 Home and Business in December, I had eligibility to upgrade to Office 2013. The process went smoothly, even with a 10 minute interruption of the Broadban

  • The app Grab has stopped working

    The Apple app, Grab, is one of my favorites. But suddenly, it has stopped working. When I capture a screen shot, the shot appears blank.

  • Why can't I download preordered album

    IT says purchased on iTunes and I have the two songs that were available early so I know I bought it. It doesn't show up in my purchased or downloaded. On the album it has the show complete album option and when I click it each song has the buy butto

  • Calling simple URL from servlet.

    Hello, i need your help. I must call a simple URL (for example) "www.sun.com" from my servlet. How can i do this ? Sorry for stupid question, but i don't know how... Dmitri.

  • What the heck is going on with Finder?

    Guys, I don't even know where to begin... something is seriously wrong with Finder. No, it's not Google Drive. It's something bigger than that.. I'm talking big. Windows are closing, programs are freezing, it's getting crazy. How much longer can this