Need help on overridding

I have listed couple of my questions on overridding here.
class ParentClass{
     void method1(Object b){
     System.err.println("in object");     
     void method1(Double d){
          System.err.println("in double");
public class ChildClass extends ParentClass{
     public static void main(String args[]){
          ChildClass c = new ChildClass();
          c.method1(null);  // *Question 1*      
                       c.method1(3);    // *Question 2*     
Question 1 - Will print "in Double" ? Why not it prints "in Object" ?
Question 2 - Will print "in Object" its an int value how it prints object?

Questions 2 and 3 are due to auto-boxing. When you try to assign a primitive to a reference type (which is what is happening when you include it as an argument to a method that takes an Object, etc), the primitive is "auto-boxed" to its primitive wrapper class, in this case, int to Integer. Since Integer is not a double, Question 2 links to method1(Object) as that is the only candidate. Likewise, in Question 3, method1(Integer) is the most specific matching signature, so it is chosen.
Question 1 actually surprised me. I thought it would be ambiguous, but I guess because there is a clear hierarchy to Double and Object (Double indirectly extends Object), there is no ambiguity. The most specific method is chosen.
Note that if you had method1(String) and method1(Double), Question 1 would be a compile error since it would be ambiguous (String is not an ancestor of Double, and vice versa, so there is no way to tell which you mean.) Whenever you pass null as an argument, you can cast it to be explicit:
c.method1((Object)null);And yes, in the future, please be more careful with which forum you choose to post in.

Similar Messages

  • Need help to draw a graph from the output I get with my program please

    Hi all,
    I please need help with this program, I need to display the amount of money over the years (which the user has to enter via the textfields supplied)
    on a graph, I'm not sure what to do further with my program, but I have created a test with a System.out.println() method just to see if I get the correct output and it looks fine.
    My question is, how do I get the input that was entered by the user (the initial deposit amount as well as the number of years) and using these to draw up the graph? (I used a button for the user to click after he/she has entered both the deposit and year values to draw the graph but I don't know how to get this to work?)
    Please help me.
    The output that I got looked liked this: (just for a test!) - basically this kind of output must be shown on the graph...
    The initial deposit made was: 200.0
    After year: 1        Amount is:  210.00
    After year: 2        Amount is:  220.50
    After year: 3        Amount is:  231.53
    After year: 4        Amount is:  243.10
    After year: 5        Amount is:  255.26
    After year: 6        Amount is:  268.02
    After year: 7        Amount is:  281.42
    After year: 8        Amount is:  295.49
    After year: 9        Amount is:  310.27
    After year: 10        Amount is:  325.78
    After year: 11        Amount is:  342.07
    After year: 12        Amount is:  359.17
    After year: 13        Amount is:  377.13
    After year: 14        Amount is:  395.99
    After year: 15        Amount is:  415.79
    After year: 16        Amount is:  436.57
    After year: 17        Amount is:  458.40And here is my code that Iv'e done so far:
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.Math;
    import java.text.DecimalFormat;
    public class CompoundInterestProgram extends JFrame implements ActionListener {
        JLabel amountLabel = new JLabel("Please enter the initial deposit amount:");
        JTextField amountText = new JTextField(5);
        JLabel yearsLabel = new JLabel("Please enter the numbers of years:");
        JTextField yearstext = new JTextField(5);
        JButton drawButton = new JButton("Draw Graph");
        public CompoundInterestProgram() {
            super("Compound Interest Program");
            setSize(500, 500);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            amountText.addActionListener(this);
            yearstext.addActionListener(this);
            JPanel panel = new JPanel();
            panel.setBackground(Color.white);
            panel.add(amountLabel);
            amountLabel.setToolTipText("Range of deposit must be 20 - 200!");
            panel.add(amountText);
            panel.add(yearsLabel);
            yearsLabel.setToolTipText("Range of years must be 1 - 25!");
            panel.add(yearstext);
            panel.add(drawButton);
            add(panel);
            setVisible(true);
            public static void main(String[] args) {
                 DecimalFormat dec2 = new DecimalFormat( "0.00" );
                CompoundInterestProgram cip1 = new CompoundInterestProgram();
                JFrame f = new JFrame();
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(new GraphPanel());
                f.setSize(500, 500);
                f.setLocation(200,200);
                f.setVisible(true);
                Account a = new Account(200);
                System.out.println("The initial deposit made was: " + a.getBalance() + "\n");
                for (int year = 1; year <= 17; year++) {
                      System.out.println("After year: " + year + "   \t" + "Amount is:  " + dec2.format(a.getBalance() + a.calcInterest(year)));
              @Override
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
    class Account {
        double balance = 0;
        double interest = 0.05;
        public Account() {
             balance = 0;
             interest = 0.05;
        public Account(int deposit) {
             balance = deposit;
             interest = 0.05;
        public double calcInterest(int year) {
               return  balance * Math.pow((1 + interest), year) - balance;
        public double getBalance() {
              return balance;
    class GraphPanel extends JPanel {
        public GraphPanel() {
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.red);
    }Your help would be much appreciated.
    Thanks in advance.

    watertownjordan wrote:
    http://www.jgraph.com/jgraph.html
    The above is also good.Sorry but you need to look a bit more closely at URLs that you cite. What the OP wants is a chart (as in X against Y) not a graph (as in links and nodes) . 'jgraph' deals with links and nodes.
    The best free charting library that I know of is JFreeChart from www.jfree.org.

  • Need help in Creating DB manually with OFA

    Hi,
    I want to create database in 10g manually and for this purpose
    I need help.
    since we can use OFA for storing Control files, and redolog file
    and datafile by describing them in Create database command but
    how to store any instance related file like spfile, pfile or network
    related file.
    once the oracle 10g database software is installed then if we want
    to create database then how can we separate the database file and
    all other instance files from software binaries because I've noted
    that creating database with DBCA create all instance files along with
    binary files of the software although DBCA give you option of creating
    database related file in some other location/directory.
    kindly help me in this I want to achieve above task in compliance with
    OFA
    Thanks and Regards,
    D.Abbasi

    Abbasi wrote:
    Hi,
    I want to create database in 10g manually and for this purpose
    I need help.
    since we can use OFA for storing Control files, and redolog file
    and datafile by describing them in Create database command but
    how to store any instance related file like spfile, pfile or network
    related file.
    once the oracle 10g database software is installed then if we want
    to create database then how can we separate the database file and
    all other instance files from software binaries because I've noted
    that creating database with DBCA create all instance files along with
    binary files of the software although DBCA give you option of creating
    database related file in some other location/directory.
    kindly help me in this I want to achieve above task in compliance with
    OFA
    Thanks and Regards,
    D.AbbasiTHe OFA spec (as best I recall) states that one of the levels of directory for all of your data files will be the db name. So if you name your database 'orcl', every file system in which you keep any files related to 'orcl' will be in a directory name 'orcl'.
    As for what happend when you created your db. Oracle will default to putting things in the Oracle home structure because that's the only thing he can guarantee will be there. But you had the option (indeed, the obligation) to override these defaults.
    BTW, when using dbca, if you chose any of the pre-canned database types, the database will be created by doing a restore from a pre-canned backup. If you chose 'custom' database, the database will be created by way of a CREATE DATABASE script. It would be instructive time well spent for you to go through dbca and select 'custom database', pay attention to all of the options as you work through, then at then end, deselect "create database" and select "generate scripts". Do the same for one of the pre-defined database types. Then study the scripts generated by each method.
    Edited by: EdStevens on Aug 16, 2009 8:46 PM

  • Need to manually override vbup-lfsta for fully invoiced order

    We have two sales orders in production that have been fully invoiced, but due to an old bug in our shipping point determination logic, the shipping point was accidentally cleared in the sales order, thereby showing it as incomplete (which is correct).    Because these documents have fully delivered and invoiced, we cannot update the shipping point but need a way to manually change VBUP-LFSTA from A to C (something similar to VL_complete, but for a sales order).      I am basically looking for the OPPOSITE of program SDVBUK00, which corrects incorrect VBUP and VBUK settings.     I need to manually override the settings since these are very old documents, cannot be reversed, rejected or changed and are not needed to show on the incomplete orders report because they were shipped and billed.
    Thank you in advance for your time!
    Regina
    Edited by: Regina DeMita on May 13, 2010 4:59 PM

    Hello Regina
    I have the following suggestions for you.
    1) The only way these docs may be bothering you is by showing up on the incomplete orders report. If you eliminate them in that report,  then you should be fine I guess. So my workaround is use Tcode V_ UC and create a variant excluding these 2 documents from the list (using the Sales Document field in the General doc data section and the option to exclude single values) and make this variant the default for all users.
    2) Use Z-code to change the status. See OSS notes 1177165 and 617501, the second one particularly because it has Document # in the selection criteria. They are meant to correct the Revenue Recognition status of sales documents and may be you can copy and adapt one of them to suit your situation. Or best ask SAP to provide one as they have done program from note 1177165 based on customer request.
    Hope this helps.

  • Need help in drawing inside the Oval and outside it

    I need help in something
    I have an array and I want the numbers to be around the oval and I have part of the array and I want to fill part of the oval
    and when I want to put a number I would like a line from the center to point at the number
    I know its hard to explain so I have picture maybe you will know hwo its work
    http://img265.imageshack.us/i/55788522.jpg/
    I have almost everything done the oval and all the code but I have no clue how to do what I explained

    import static java.lang.Math.*;
    import java.awt.*;
    import javax.swing.*;
    @SuppressWarnings("serial") public class Trefoil extends JComponent {
            setPreferredSize(new Dimension(400, 400));
        @Override protected void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D) g.create();
            int w = getWidth(), h = getHeight();
            g2.setColor(getBackground());
            g2.fillRect(0, 0, w, h);
            g2.setColor(getForeground());
            g2.translate(w/2, h/2);
            g2.setRenderingHint(
                RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
            int rays = 100;
            for(int i=0; i<rays; ++i) {
                double angle = i*(2 * PI)/rays;
                double flange = cos(1.5* angle - PI/4);
                int r = (int)(190 * flange * flange);
                int x = (int)(r* cos(angle));
                int y = (int)(r* sin(angle));
                g2.drawLine(0, 0, x, y);
            g2.dispose();
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    JFrame f = new JFrame("Trefoil");
                    f.add(new Trefoil());
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.pack();
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Need Help With D&D Program

    Hi, I'm not sure if I'm allowed to post questions on this forum but I can't find anywhere to talk to helpful people about programming.
    I'm making a dnd interface for JComponents. So far I've made a simple program that has a Component that can be lifted from a container and braught to the glass pane then later moved to anywhere on the screen and dropped into the container below it. Here's where my problems come:
    1) Rite now my 'Movable Component' is a JPanel which is just colored in. I want to either take a Graphic2d from a JComponent/Component and draw it on the JPanel or change the JPanel to the component I want to paint and disable the component.
    The problem with getting the Graphics2d is that if the component isn't on the screen it doesn't make a graphic object. I tried messing with the ui delicate and overriding parental methods for paintComponent, repaint, and that repaintChildren(forget name) but I haven't had luck getting a good graphics object. I was thinking of, at the beginning of running the program, putting 1 of each component onto the screen for a second then removing it but I'd rather not. I'd also like to change the graphics dynamicly if someone stretches the component there dropping and what not.
    The problem with disabling is that it changes some of the visual features of Components. I want to be able to update the Component myself to change how it looks and I don't want disabling to gray out components.
    I mainly just dont want the components to do any of there normal fuctions. This is for a page builder, by the way.
    Another problem I'm having is that mouseMotionListener is allowing me to select 2 components that are on top of one another when there edges are near each other. I don't know if theres a fix to this other than changing the Java Class.
    My next problem is a drop layout manager, but I'm doing pretty good with that rite now. It'll problem just move components out of the way of the falling component.
    One last thing I need help with is that I don't want the object that's being carried to go across the menu bar and certain areas. When I'm having the object being carried I have it braught up to the glass pane which allows it to move anywhere. Does anyone have any idea how I could prevent the component from being over the menu bars and other objects? I might have to make 1 panel is the movable area that can then be broken down into the 'component bank', 'building page' and whatever else I'm gonna need.
    This is all just test code to get together for when I make the real program but I need to make sure it'll be possible without a lot of hacking of code.
    Sorry for the length. Thanks for any help you can give.

    The trick to making viewable components that have no behaviour, is to render them onto an image of some sort (eg a BufferedImage). You can then display the Image on a JLabel that can be dragged around the desktop.
    Here is a piece of code that does the component rendering for you. This particular example uses a fixed component size, but you can modify that as you choose of course...public class JComponentImage
         private static GraphicsConfiguration gConfig;
         private static Dimension compSize = new Dimension(80, 22);
         private static Image image = null;
         public static Image getImage(Class objectClass)
              if (gConfig == null)
                   GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
                   GraphicsDevice gDevice = gEnv.getDefaultScreenDevice();
                   gConfig = gDevice.getDefaultConfiguration();
              image = gConfig.createCompatibleImage(compSize.width, compSize.height);
              JComponent jc = (JComponent) ObjectFactory.instantiate(objectClass);
              jc.setSize(compSize);
              Graphics g = image.getGraphics();
              g.setColor(Color.LIGHT_GRAY);
              g.fillRect(0, 0, compSize.width, compSize.height);
              g.setColor(Color.BLACK);
              jc.paint(g);
              return image;
    }And here is the class that makes the dragable JLabel using the class above...public class Dragable extends JLabel
         private static DragSource dragSource = DragSource.getDefaultDragSource();
         private static DragGestureListener dgl = new DragMoveGestureListener();
         private static TransferHandler th = new ObjectTransferHandler();
         private Class compClass;
         private Image image;
         Dragable(Class compClass)
              this.compClass = compClass;
              image = JComponentImage.getImage(compClass);
              setIcon(new ImageIcon(image));
              setTransferHandler(th);
              dragSource.createDefaultDragGestureRecognizer(this,
                                                          DnDConstants.ACTION_COPY,
                                                          dgl);
         public Class getCompClass()
              return compClass;
    }Oh and here is ObjectFactory which simply instantiates Objects of a given class and sets their text to their classname (very crudely)...public class ObjectFactory
         public static Object instantiate(Class objectClass)
              Object o = null;
              try
                   o = objectClass.newInstance();
              catch (Exception e)
                   System.out.println("ObjectFactory#instantiate: " + e);
              String name = objectClass.getName();
              int lastDot = name.lastIndexOf('.');
              name = name.substring(lastDot + 1);
              if (o instanceof JLabel)
                   ((JLabel)o).setText(name);
              if (o instanceof JButton)
                   ((JButton)o).setText(name);
              if (o instanceof JTextComponent)
                   ((JTextComponent)o).setText(name);
              return o;
    }Two more classes required by this codepublic class ObjectTransferHandler extends TransferHandler {
         private static DataFlavor df;
          * Constructor for ObjectTransferHandler.
         public ObjectTransferHandler() {
              super();
              try {
                   df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
              } catch (ClassNotFoundException e) {
                   Debug.trace(e.toString());
         public Transferable createTransferable(JComponent jC) {
              Transferable t = null;
              try {
                   t = new ObjectTransferable(((Dragable) jC).getCompClass());
              } catch (Exception e) {
                   Debug.trace(e.toString());
              return t;
         public int getSourceActions(JComponent c) {
              return DnDConstants.ACTION_MOVE;
         public boolean canImport(JComponent comp, DataFlavor[] flavors) {
              if (!(comp instanceof Dragable) && flavors[0].equals(df))
                   return true;
              return false;
         public boolean importData(JComponent comp, Transferable t) {
              JComponent c = null;
              try {
                   c = (JComponent) t.getTransferData(df);
              } catch (Exception e) {
                   Debug.trace(e.toString());
              comp.add(c);
              comp.validate();
              return true;
    public class ObjectTransferable implements Transferable {
         private static DataFlavor df = null;
         private Class objectClass;
         ObjectTransferable(Class objectClass) {
              try {
                   df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
              } catch (ClassNotFoundException e) {
                   System.out.println("ObjectTransferable: " + e);
              this.objectClass = objectClass;
          * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
         public DataFlavor[] getTransferDataFlavors() {
              return new DataFlavor[] { df };
          * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(DataFlavor)
         public boolean isDataFlavorSupported(DataFlavor testDF) {
              return testDF.equals(df);
          * @see java.awt.datatransfer.Transferable#getTransferData(DataFlavor)
         public Object getTransferData(DataFlavor arg0)
              throws UnsupportedFlavorException, IOException {
              return ObjectFactory.instantiate(objectClass);
    }And of course the test class:public class DragAndDropTest extends JFrame
         JPanel leftPanel = new JPanel();
         JPanel rightPanel = new JPanel();
         Container contentPane = getContentPane();
         Dragable dragableJLabel;
         Dragable dragableJButton;
         Dragable dragableJTextField;
         Dragable dragableJTextArea;
          * Constructor DragAndDropTest.
          * @param title
         public DragAndDropTest(String title)
              super(title);
              dragableJLabel = new Dragable(JLabel.class);
              dragableJButton = new Dragable(JButton.class);
              dragableJTextField = new Dragable(JTextField.class);
              dragableJTextArea = new Dragable(JTextArea.class);
              leftPanel.setBorder(new EtchedBorder());
              BoxLayout boxLay = new BoxLayout(leftPanel, BoxLayout.Y_AXIS);
              leftPanel.setLayout(boxLay);
              leftPanel.add(dragableJLabel);
              leftPanel.add(dragableJButton);
              leftPanel.add(dragableJTextField);
              leftPanel.add(dragableJTextArea);
              rightPanel.setPreferredSize(new Dimension(500,500));
              rightPanel.setBorder(new EtchedBorder());
              rightPanel.setTransferHandler(new ObjectTransferHandler());
              contentPane.setLayout(new BorderLayout());
              contentPane.add(leftPanel, "West");
              contentPane.add(rightPanel, "Center");
         public static void main(String[] args)
              JFrame frame = new DragAndDropTest("Drag and Drop Test");
              frame.pack();
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setVisible(true);
    }I wrote this code some time ago, so it won't be perfect but hopefully will give you some good ideas.
    Regards,
    Tim

  • Need help on Self Hosting Using channel Factory

    Hello,
         Need Help.
         I am trying to self host WCF service using cutom Channel Factory class. but I am getting exception.
     The scenario is something like below this  : -
    I want to create the endpoint connection to WCF service. I want to achieve this  using custom channel factory(not using default channel factory API provided in .Net Framework).
    I have written one class and it is derived from channel factory and we are reading the service endpoints, behaviors, bindings from external configuration file added in the project.
    I am able to connect to server side service hosted on different machine using following sample code successfully.
    In the case of “self-hosting”  I am receiving following error : --
         "There was an error reading from the pipe: The pipe has been ended. (109, 0x6d)."
    Below is the code which I have written for self hosting WCF service using custom channel factory.
    // Method where I am calling CustomChannel Factory constructor
    internal void ProxyCall(string msgEndpointConfigurationName, string url)
                string appConfigDirName, extConfigFilePath;
                FileInfo configFileInfo = new FileInfo(appConfigName);
                appConfigDirName = configFileInfo.DirectoryName;
                extConfigFilePath = appConfigDirName + "\\" + extConfigFileName;
                this.messageEndpointConfigurationName = msgEndpointConfigurationName;
                if (string.IsNullOrEmpty(url))
                    this.messageFactory = new CustomChannelFactory<IServerOperationsMessage>(extConfigFilePath, this.messageEndpointConfigurationName);
                else
                   //EndpointAddress e = new EndpointAddress(url + ClientToServerOperations.ServiceAddress);
                   //this.messageFactory = new ChannelFactory<IServerOperationsMessage>(this.messageEndpointConfigurationName, e);
                   this.messageFactory = new CustomSelfHostingChannelFactory<IServerOperationsMessage>(extConfigFilePath, this.messageEndpointConfigurationName, url + ClientToServerOperations.ServiceAddress);
                   //this.messageFactory = new CustomSelfHostingChannelFactory<IServerOperationsMessage>(extConfigFilePath, this.messageEndpointConfigurationName, e);
       ClientMessageFormatterBehavior formatterBehavior = new ClientMessageFormatterBehavior();
       foreach (OperationDescription operation in this.messageFactory.Endpoint.Contract.Operations)
        if (!operation.Behaviors.Contains(typeof(ClientMessageFormatterBehavior)))
         operation.Behaviors.Add(formatterBehavior);
       this.messageFactory.Endpoint.Behaviors.Add(new MessageStatisticsBehavior());
       this.messageFactory.Open();
    // Custom Channel Factory Class
    internal class CustomSelfHostingChannelFactory<T> : ChannelFactory<T>
            /// Custom client channel. Allows to specify a different configuration file
            /// <typeparam name="T"></typeparam>
            private string configurationPath, selectedMsgEndPoint, uriAddress;
            public PPCCustomSelfHostingChannelFactory(string configurationPath, string selectedEndPoint, string uriAddress)
                : base(typeof(T))
                this.configurationPath = configurationPath;
                this.selectedMsgEndPoint = selectedEndPoint;
                this.uriAddress = uriAddress;
                EndpointAddress e = new EndpointAddress(this.uriAddress);
                base.InitializeEndpoint(selectedEndPoint,e);
            //As you can see, a call to the method InitialiazeEndpoint of the base class is required.
            //That method will automatically call to our CreateDescription method to configure the service endpoint.
            ///Loads the serviceEndpoint description from the specified configuration file
            protected override ServiceEndpoint CreateDescription()
                ServiceEndpoint serviceEndpoint = base.CreateDescription();
                return serviceEndpoint;
            private EndpointIdentity GetIdentity(IdentityElement element)
                EndpointIdentity identity = null;
                PropertyInformationCollection properties = element.ElementInformation.Properties;
                if (properties["userPrincipalName"].ValueOrigin != PropertyValueOrigin.Default)
                    return EndpointIdentity.CreateUpnIdentity(element.UserPrincipalName.Value);
                if (properties["servicePrincipalName"].ValueOrigin != PropertyValueOrigin.Default)
                    return EndpointIdentity.CreateSpnIdentity(element.ServicePrincipalName.Value);
                if (properties["dns"].ValueOrigin != PropertyValueOrigin.Default)
                    return EndpointIdentity.CreateDnsIdentity(element.Dns.Value);
                if (properties["rsa"].ValueOrigin != PropertyValueOrigin.Default)
                    return EndpointIdentity.CreateRsaIdentity(element.Rsa.Value);
                return identity;
            private Binding GetBinding(IBindingConfigurationElement configurationElement)
                if (configurationElement is CustomBindingElement) return new CustomBinding();
                else if (configurationElement is BasicHttpBindingElement) return new BasicHttpBinding();
                else if (configurationElement is NetMsmqBindingElement) return new NetMsmqBinding();
                else if (configurationElement is NetNamedPipeBindingElement) return new NetNamedPipeBinding();
                else if (configurationElement is NetPeerTcpBindingElement) return new NetPeerTcpBinding();
                else if (configurationElement is NetTcpBindingElement) return new NetTcpBinding();
                else if (configurationElement is WSDualHttpBindingElement) return new WSDualHttpBinding();
                else if (configurationElement is WSHttpBindingElement) return new WSHttpBinding();
                else if (configurationElement is WSFederationHttpBindingElement) return new WSFederationHttpBinding();
                return null;
            private Binding CreateBinding(string bindingName, ServiceModelSectionGroup group)
                BindingCollectionElement bindingElementCollection = group.Bindings[bindingName];
                if (bindingElementCollection.ConfiguredBindings.Count > 0)
                    IBindingConfigurationElement be = bindingElementCollection.ConfiguredBindings[0];
                    Binding binding = GetBinding(be);
                    if (be != null)
                        be.ApplyConfiguration(binding);
                    return binding;
                return null;
            private void AddBehaviors(string behaviorConfiguration, ServiceEndpoint serviceEndpoint, ServiceModelSectionGroup group)
                EndpointBehaviorElement behaviorElement = group.Behaviors.EndpointBehaviors[behaviorConfiguration];
                for (int i = 0; i < behaviorElement.Count; i++)
                    BehaviorExtensionElement behaviorExtension = behaviorElement[i];
                    object extension = behaviorExtension.GetType().InvokeMember("CreateBehavior", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, null,
    behaviorExtension, null);
                    if (extension != null)
                        serviceEndpoint.Behaviors.Add((IEndpointBehavior)extension);
    Thanks in advance !! :-)

    Hi,
    There was an error reading from the pipe: Unrecognized error 109 (0x6d).
    One reason was inconsistent binding between client and server <netNamedPipeBinding> <security mode="None"></security>... (no
    communication)
    The other intermittent issue was time-out related.
    For more information, you could refer to:
    http://stackoverflow.com/questions/15836199/wcf-namedpipe-communicationexception-the-pipe-has-been-ended-109-0x6d
    http://stackoverflow.com/questions/22334514/wcf-named-pipe-error-the-pipe-has-been-ended-109-0x6d
    Regards

  • Question: Need help with overcoming the following message:  "Nothing was imported.

    Need help with overcoming the following message:  “Nothing was imported.  The file(s) or folder(s) selection to import did not contain any supported file types, or the files are already in this catalogue”.
    The photos being scanned are old film shots.  They have NOT been previously scanned.  I am using Photoshop Elements 9 software.
    QUESTION:  how do I override this STOP and or circumvent the photo comparison option????
    Thanks for the help. Bob K ---  [email protected]

      Are you scanning as jpeg, tiff or some other format?
    Are you using continuous numbering for files names as by definition scanned files have no exif data.
     

  • Need help bad, screen problem

    heres my problem. i setup arch on my desktop last night (64bit), i installed my nvidia drivers. i have a 21" crt sun monitor, not sure the model number. but i brought it to a friends this morning to update and install kdemod since they have highspeed. now i was hooked up to their monitor, they have a cheap 15" crt. so it worked fine there, now when i got it home, i get a black screen when it boots up on my monitor, i can get to a console however
    i deleted a couple lines in the monitor section in the xorg.conf............so now i get 640x480 res, but i cant use anything higher
    been searching around, and i found some stuff about running Xorg -configure, but i get something about a tmp file being locked..........and i dont know how to delete anything here from the console
    i need help here
    Last edited by ssl6 (2007-09-16 07:00:40)

    nvm, i just deleted the xorg.conf and rebooted, its fine now
    edit// nvm, its not using my nvidia driver.........i might still need help, im trying something right now, not sure what im doing though
    ok, i tried to run nvidia-xconfig, and when i rebooted, im back to square one with my monitor flashin an invalid scan frequency
    well, i deleted the xorg.conf again and got it booted up. but i generated a new one with nvidia-xconfig again, heres what i puts out, i just need to remember not to reboot any time soon. im using a 7900gs, the newest nvidia 100 series drive from the repo, and arch 64bit on this system by the way
    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 1.0 (buildmeister@builder26) Wed Jun 13 16:54:14 PDT 2007
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    EndSection
    Section "Files"
    RgbPath "/usr/lib/X11/rgb"
    EndSection
    Section "Module"
    Load "dbe"
    Load "extmod"
    Load "type1"
    Load "freetype"
    Load "glx"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 30.0 - 110.0
    VertRefresh 50.0 - 150.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
    EndSection
    here's that part of the xorg.conf from my other computer running 32bit arch with a geforce 3 connected to the same monitor via kvm switch. this machine is using a 96xx driver though
    Section "Monitor"
    # HorizSync is in kHz unless units are specified.
    # HorizSync may be a comma separated list of discrete values, or a
    # comma separated list of ranges of values.
    # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
    # USER MANUAL FOR THE CORRECT NUMBERS.
    # HorizSync 30-64 # multisync
    # HorizSync 31.5, 35.2 # multiple fixed sync frequencies
    # HorizSync 15-25, 30-50 # multiple ranges of sync frequencies
    # VertRefresh is in Hz unless units are specified.
    # VertRefresh may be a comma separated list of discrete values, or a
    # comma separated list of ranges of values.
    # NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
    # USER MANUAL FOR THE CORRECT NUMBERS.
    Identifier "sun"
    HorizSync 31.5 - 82.0
    VertRefresh 50.0 - 90.0
    EndSection
    Section "Device"
    # The chipset line is optional in most cases. It can be used to override
    # the driver's chipset detection, and should not normally be specified.
    # Chipset "generic"
    # The Driver line must be present. When using run-time loadable driver
    # modules, this line instructs the server to load the specified driver
    # module. Even when not using loadable driver modules, this line
    # indicates which driver should interpret the information in this section.
    # The BusID line is used to specify which of possibly multiple devices
    # this section is intended for. When this line isn't present, a device
    # section can only match up with the primary video device. For PCI
    # devices a line like the following could be used. This line should not
    # normally be included unless there is more than one video device
    # intalled.
    # BusID "PCI:0:10:0"
    # VideoRam 256
    # Clocks 25.2 28.3
    Identifier "Standard VGA"
    Driver "vga"
    VendorName "Unknown"
    BoardName "Unknown"
    EndSection
    Section "Device"
    #VideoRam 65536
    # Insert Clocks lines here if appropriate
    Identifier "geforce"
    Driver "nvidia"
    EndSection
    Section "Screen"
    Identifier "Screen 1"
    Device "geforce"
    Monitor "sun"
    DefaultDepth 24
    Option "AddARGBGLXVisuals" "True"
    SubSection "Display"
    Viewport 0 0
    Depth 8
    Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 16
    Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
    EndSection
    Section "Extensions"
    Option "Composite" "Enable"
    EndSection
    any ideas here?
    Last edited by ssl6 (2007-09-16 07:53:48)

  • Having a problem with family share... it's telling me I can not add my daughter for a year!!!??? this is bullcrap n I need help to be able to add her... does any one have any ideas?

    needing help with family share that isn't allowing me to add my daughter for a year!!!

    That happens because there is a restriction from changing family groups more than twice per year.  Unfortunately, a number of people have inadvertently triggered this in the process of setting up Family Sharing.  There isn't anything you can do about it on your own; all you can do is contact Apple support to see if they would override this at their end.

  • Need help in Custom component creation with cq

    Hi,
    I have created my own component in adobe cQ and able to drag an drop in any page. for each instance I am seeing the copy of
    component under node /content/mypage/commoncomp. If I edit the properties using design dialog  I can able to store values as
    expected.
    Need help in
    1) When I drag and drop the component it shows null for the property by deafult if I click save on edit dialog then the
    value is showing. The default value is not shown by default while drag and drop my component it requires atleast one time to
    click save from dialog using design mode
    2) I need to use the default properties of the orginal components which is root and use the duplicated properties if incase user edit the properties of duplicated component. This may be too messy.... to be more clear
    I want to use a common component in many pages but the properties of the components should be updated only when user edit it in design dialog utill then I need the page to use properties of root component.
    Thanks

    You just need to create your own version of PlumtreeTopBarView (original in com.plumtree.common.uiparts), and use CustomActivitySpace.xml to override that view with your own view. Your version would use some kidn fo logic to determine whether or not to display certain elements. TheUI Customization Guide should help quite a bit, and we have several quickstarts for overriding views you can start from.
    Is there some Help file in PT that I can reference that will enable me to find what namespace does GetRequestURL() belongs to?I would simply do a string compare. Tokenize the URL into the base address / control arguments, perhaps splitting on the "?" symbol; then tokenize the base address on the ".". You'll end up with three strings. For portal.plumtree.com, the three strings would portal, plumtree, and com. You can then use those string in the logig you add to PlumtreeTopBarView.
    David Phipps
    Plumtree Software

  • Need Help In "Custom" TopBar Class

    New to Plumtree and need help to get rolling. Req's is simple thus far: To supress render of "Login" link in TopBarView for Guests if certain URL is captured at Request.
    There were some topics here that suggests extending from the Class PlumtreeTopBarView.CS, I just need to identify which UI part that renders the "Login" html link to supress this. I got the function to use to capture the URL string -> GetRequestURL(), I am fishing info on where or what function in PlumtreeTopBarView I need to override to plugin a condition that if this URL string == <something> then suppress "Login" link, or the Search, or whatever elements in the TopBar I need to suppress if need be??
    Is there some Help file in PT that I can reference that will enable me to find what namespace does GetRequestURL() belongs to? Please bear with me I am very new to PT code infrastructure, still trying to find stuff with strict deadlines. Much Obliged in advance...

    You just need to create your own version of PlumtreeTopBarView (original in com.plumtree.common.uiparts), and use CustomActivitySpace.xml to override that view with your own view. Your version would use some kidn fo logic to determine whether or not to display certain elements. TheUI Customization Guide should help quite a bit, and we have several quickstarts for overriding views you can start from.
    Is there some Help file in PT that I can reference that will enable me to find what namespace does GetRequestURL() belongs to?I would simply do a string compare. Tokenize the URL into the base address / control arguments, perhaps splitting on the "?" symbol; then tokenize the base address on the ".". You'll end up with three strings. For portal.plumtree.com, the three strings would portal, plumtree, and com. You can then use those string in the logig you add to PlumtreeTopBarView.
    David Phipps
    Plumtree Software

  • Need help with applet servlet communication .. not able to get OutputStream

    i am facing problem with applet and servlet communication. i need to send few image files from my applet to the servlet to save those images in DB.
    i need help with sending image data to my servlet.
    below is my sample program which i am trying.
    java source code which i am using in my applet ..
    public class Test {
        public static void main(String argv[]) {
            try {
                    URL serverURL = new URL("http://localhost:8084/uploadApp/TestServlet");
                    URLConnection connection = serverURL.openConnection();
                    Intermediate value=new Intermediate();
                    value.setUserId("user123");
                    connection.setDoInput(true);
                    connection.setDoOutput(true);
                    connection.setUseCaches(false);
                    connection.setDefaultUseCaches(false);
                    // Specify the content type that we will send binary data
                    connection.setRequestProperty ("Content-Type", "application/octet-stream");
                    ObjectOutputStream outputStream = new ObjectOutputStream(connection.getOutputStream());
                    outputStream.writeObject(value);
                    outputStream.flush();
                    outputStream.close();
                } catch (MalformedURLException ex) {
                    System.out.println(ex.getMessage());
                }  catch (IOException ex) {
                        System.out.println(ex.getMessage());
    }servlet code here ..
    public class TestServlet extends HttpServlet {
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
             System.out.println(" in servlet -----------");
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            ObjectInputStream inputFromApplet = null;
            Intermediate aStudent = null;
            BufferedReader inTest = null;
            try {         
                // get an input stream from the applet
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                // read the serialized object data from applet
                data = (Intermediate) inputFromApplet.readObject();
                System.out.println("userid in servlet -----------"+ data.getUserId());
                inputFromApplet.close();
            } catch (Exception e) {
                e.printStackTrace();
                System.err.println("WARNING! filename.path JNDI not found");
            } finally {
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in foGet -----------");
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in doPost -----------");
            processRequest(request, response);
         * Returns a short description of the servlet.
         * @return a String containing servlet description
        @Override
        public String getServletInfo() {
            return "Short description";
        }// </editor-fold>
    }the Intermediate class ..
    import java.io.Serializable;
    public class Intermediate implements Serializable{
    String userId;
        public String getUserId() {
            return userId;
        public void setUserId(String userId) {
            this.userId = userId;
    }

    Hi,
    well i am not able to get any value from connection.getOutputStream() and i doubt my applet is not able to hit the servlet. could you review my code and tell me if it has some bug somewhere. and more over i want to know how to send multiple file data from applet to servlet . i want some sample or example if possible.
    do share if you have any experience of this sort..
    Thanks.

  • Need help to develop Pythagoras theorem-

    Hi i need help to develop proofs 2,3,4
    of pythagoras theorems in java as demonstrations
    These are applets can anyone help me with it or give me an idea of how to go about developing it -
    the site is the following
    http://www.uni-koeln.de/ew-fak/Mathe/Projekte/VisuPro/pythagoras/pythagoras.html
    then double click on the screen to make it start

    Pardon my ASCII art, but I've always liked the following, simple, geometric proof:
         a                   b
    ---------------------------------------+
    |       |                                |
    a|   I   |              II                |
    |       |                                |
    ---------------------------------------+
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    b|  IV   |              III               |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    ---------------------------------------+It almost goes without saying that I+II+III+IV == (a+b)^2, and II == IV == a*b,
    I == a*a and III == b*b, showing that (a+b)^2 == a^2+a*b+a*b+b^2.
    I hope the following sketch makes sense, stand back, ASCII art alert again:     a                   b
    ---------------------------------------+
    |               .             VI         |
    |     .                 .                |a
    | V                               .      |
    |                                        +
    |                                        |
    |   .                                    |
    b|                                     .  |
    |                                        |
    |                  IX                    |
    | .                                      |
    |                                    .   |b
    |                                        |
    +                                        |
    |      .                                 |
    a|               .                  . VII |
    |  VIII                   .              |
    ---------------------------------------+
                     a                    bThe total area equals (a+b)^2 again and equals the sum of the smaller areas:
    (a+b)^2 == V+VI+VII+VIII+IX. Let area IX be c^2 for whatever c may be.
    V+VII == VI+VIII == a*b, so a^2+b^2+2*ab= c^2+2*a*b; IOW a^2+b^2 == c^2
    Given this fundamental result, the others can easily be derived from this one,
    or did I answer a question you didn't ask?
    kind regards,
    Jos

  • I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    What file format did you export it to?

Maybe you are looking for