How to create a program that will accept a series of strings of 0 and 1 onl

how to create a program that will accept a series of strings of 0 and 1 only then displays 0 as 48 and displays 1 as 49.

Isn't one thread enough for your homework?
http://forum.java.sun.com/thread.jspa?threadID=5253850&messageID=10051155#10051155

Similar Messages

  • How to create a program that accepts 5 digits from the user between 0 and 9

    how to create a program that accepts 5 digits from the user between 0 and 9 then put them in ascending order using link-list method..

    You can use a scanner to get user input from the command line.
    import java.util.*;
    public class Test {
        private List<Integer> list;
        private Scanner in;
        public static void main (String... args) {
            new Test ();
        public Test () {
            list = new LinkedList<Integer> ();
            in = new Scanner (System.in);
            for (int i = 0; i < 5; i ++) {
                System.out.format ("Please enter a number (%d more): ", (5 - i));
                list.add (in.nextInt ());
            Collections.sort(list, new Comparator<Integer> () {
                public int compare (Integer i1, Integer i2) {
                    return i2 - i1;
            System.out.println (list);
    }

  • Create a Procedure that will accept a variable

    Hi,
    I'm new to pl/sql and I'm trying to create a procedure that will accept a variable. I want to use this sql to create restore points that can store the name of each batch job as it runs.
    The code works fine on it's own, but if I try to create the procedure it asks me for a value for 1, how do I stop it doing that?
    CREATE OR REPLACE PROCEDURE create_restore_point AS
    DECLARE
    pointno number(5);
    pointname varchar2(128) := upper('&1');
    dbname v$database.name%TYPE;
    scn_time date;
    scn number;
    BEGIN
    SELECT restore_point_seq.nextval into pointno from dual;
    SELECT name into dbname from v$database;
    SELECT sysdate into scn_time from dual;
    SELECT dbms_flashback.get_system_change_number into scn from dual;
    INSERT into restore_point
    values
    (pointno,pointname,dbname,scn_time,scn);
    commit;
    END create_restore_point;
    Many thanks in advance,
    Tom.

    It asks for value of 1 because you have &1 in your code. If you want to pass the value for pointname, then you can change your procedure like below.
    CREATE OR REPLACE PROCEDURE create_restore_point (svar varchar2)AS
    DECLARE
    pointno number(5);
    pointname varchar2(128) := upper(svar);
    dbname v$database.name%TYPE;
    scn_time date;
    scn number;
    BEGIN
    SELECT restore_point_seq.nextval into pointno from dual;
    SELECT name into dbname from v$database;
    SELECT sysdate into scn_time from dual;
    SELECT dbms_flashback.get_system_change_number into scn from dual;
    INSERT into restore_point
    values
    (pointno,pointname,dbname,scn_time,scn);
    commit;
    END create_restore_point;

  • How to create a form that will allow the applicant to upload their photo

    I have Adobe Acrobat 9 Pro Extended and I know how to create forms that require text input.
    How to create a form that will allow the applicant to upload their photo? I alo wish to know how to upload a photograph so that I can test the form I created.
    Thank you
    Adrian Watts

    test@ORA10G> with x as (
      2    select '234-1111' as customer, to_date('2-Jan-2008','dd-Mon-yyyy') as call_date, 'Order product' as reason from dual union all
      3    select '234-1132', to_date('3-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
      4    select '231-1154', to_date('4-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
      5    select '234-1111', to_date('2-Nov-2007','dd-Mon-yyyy'), 'Order product' from dual union all
      6    select '234-1132', to_date('9-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
      7    select '231-1154', to_date('9-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
      8    select '234-1111', to_date('5-Dec-2007','dd-Mon-yyyy'), 'Order product' from dual union all
      9    select '234-1131', to_date('7-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    10    select '231-1154', to_date('1-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    11    select '234-1111', to_date('8-Jan-2008','dd-Mon-yyyy'), 'Order product' from dual union all
    12    select '234-1131', to_date('3-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    13    select '231-1154', to_date('4-Nov-2007','dd-Mon-yyyy'), 'Forward to Sales' from dual)
    14  --
    15  select customer,max(call_date), reason
    16  from x
    17  where reason = 'Request info'
    18  group by customer, reason;
    CUSTOMER MAX(CALL_ REASON
    231-1154 09-SEP-07 Request info
    234-1131 07-DEC-07 Request info
    234-1132 09-JAN-08 Request info
    test@ORA10G>
    test@ORA10G>pratz

  • How to create an action that will crop two sections from one scanned image?

    I'm trying to create an action that will automate the process of cropping the left and right pages from a series of two-page book scans.
    I tried to create a 2 step action which first crops the left half of a scan (by setting the left margin to 0in and the right margin to 6in) and then the right half of the scan (by setting the left margin to 6in and the right margin to. 12in), however when executing, only the left half appears to be cropped.
    I imagine this is due to the fact that once one side of the initial scan is cropped, the other side disappears.
    Is there any way around this?

    Basically i need to create a new document out of a folder full of images.
    You may have to look into Scripting to achieve something like this.
    You could ask in the Scriptimg Forum
    Photoshop Scripting
    But maybe it would suffice to insert the Menu Item
    File – Scripts – Load Files into Stack
    into the Action and then iterate through the Layers with [ or ] and reset the opacities and Blend Modes – but as Actions would not be able to change the number of repetitions of the operation conditionally a custom Script would still seem preferable. 

  • How to make a program that will ask for a name the first time the program is used and if is not the first time will not ask the name?

    I want to make a program that will ask for the ID of the testing machine the first time the program is running, then will never ask for it. I'm using Labview 6.0

    Hi
    There are a Couple of methods you can use for this.
    Method 1 -
    You can create an ini file and save a boolean Key "First Instance" as True. Now In your Program you read this Key, If it is True then you can show your ID Dialog VI.If False do not run the VI. At the Conclusion of Id Dialog you can update this registry enrty to False. So In effect you have created One time Event. In fact you can save ID as another Config entry.
    The Drawback and advantage is that such an INI file can be edited by someone moderately knowledgeable about the Program
    Method 2
    Use Unitialized Shift Register in A while Loop. Please see LV2 style Globals entry under this forum. You can read and write to this Variable and it retains the Value it last had within it.
    You can read
    this Global the Very first time and say if it true you display your ID Vi. If False you dont. When you display your ID Vi you can Update your Global Like Before.
    If you need Example Let me Know.
    Good Luck
    Mache!!
    Good Luck!
    Mache

  • I need instructions on how to create a button that will email a pdf form to someone else on a websit

    I NEED ASSISTANCE CREATING A BUTTON THAT WILL EMAIL A PDF FORM FROM A WEBSITE TO WHOEVER THE VIEWER WANTS TO

    Just a bit more info. E-mail can be used, but has potential problems -- often related to the client machine that you have no control over. Use the data submissions (either FDF or XML) rather than the full PDF so you do not have to deal with Reader Rights and the related license issues. The FDF and XML data files are easily imported into the original form so that you see what the client sees. With those aspects in mind, just go ahead and try one. Be aware that you can add form fields using the form tools in the Advanced Editing tools, OR use the forms menu that will take you to Designer. You might want to try both to see the pros and cons. Be sure to keep such a test simple so you are not wasting time on your final form just for testing. I typically create a 1 page form that has all of the possible fields for such a test.

  • Searching for how to create a page that will recreate it self and image uploader!

    Greetings,
    Does any one knows how I could create client side page that would always recreate it self when a new clients to signs up and become a member to my blog site, so they could manage and add friends to their page and upload image to their album? The idea is to have pages added like it is on Facebook, when a member signs up.
    If I server side software is need in order to achieve this goal; what type of server side software do I need for this design? Please contact me if you have any idea.
    I also would like to receive any information on where to find script that will help visitors upload images to my site.
    I have done with other parts of my web design adding this idea is all I need to finish. Your help is immensely appreciated.
    Joplateau.

    You may want to ask in a more generalized forum such as http://forums.adobe.com/community/design_development/webdesign. This one is specifically for Adobe Contribute (which won't do what you want) and is seldom visited. Good luck.

  • How to create an easteregg that will reveal an image

    I created a flash movie which resembles a control panel. I created a image of the group of people that worked on the project and I want the image to be hidden until the user types a key combination that would trigger the image to appear and dissapear when clicked. This url is something like what I was looking for,  (www.virtualmarketingblog.com/how-to-create-alert-boxes-in-flash/) but I want an image to appear instead, can this be customized?  The only problem is, I'm not really good at actionscript. Is there any tutorials out there that may show an easy way to do this. The attached file is a sample of my interface.
    Thanks

    here's code for multikey as2 detection:
    http://www.kirupa.com/forum/showthread.php?t=211149

  • How to create dynamic stamp that will prompt for Cause number and exhibit number?

    I have a need to have a three line custom stamp that will look like the following but will allow a user to input the Cause number then the exhibit number, then successively number exhibits that the stamp is applied to:
    EXHIBIT
    12:74130
    001
    Exhibit will always be the same, but the cause number would need to be modifiable per batch possibly and I would like to be able to update the exhibit number to have a unique number on each page of exhibits....or just each exhibit.
    Can that be done?
    thanks!

    It sounds like you are trying to use a retail serial as an enterprise serial and would like to bypass it's restrictions by deactivating it . . . I assume that's not possible, but perhaps I don't understand your issue.
    I doubt you'll get a good answer on the forum. Try support, your sales rep, or a help link on the licensing web site (if there is one).
    Ben

  • I'm trying to create a program that will allow me to collect data from a Luxtron thermometr​y system. How can I do this?

    I'm a little confused as to how to write to the machine and how to retrieve data from the machine. I'm unsure of requested byte size and string to write specifically. This machine also has 4 probes, so it can record 4 temperatures simultaneously. How can I reflect this in the waveform chart?

    There are example VI's in LV on Instrument Connectivity. If you go to the Help menu >> Examples.. >> I/O, you will see a couple; and Examples.. >> Fundamentals for File and String manipulation. I would suggest tweaking them to suit your application. Also the specific command that your instrument responds to can be found from it's manual.
    You could find a driver for this instrument at http://www.ni.com/devzone/idnet/default.htm . If it's not listed there, it leaves you with one of a couple options. First, I would like you to submit a request for this driver at: http://zone.ni.com/idnet97.nsf/instrumentdriverreq​uest/
    We develop drivers based on demand and popularity so the more requests we have for it, the greater the possibility that we will develop one.
    If y
    ou would like to try developing your own instrument driver (or modify the existing one), we have documentation, model instrument drivers, and driver templates to help at :
    http://www.ni.com/devzone/idnet/development.htm
    We also have a syndicate of third party vendors that specialize in National Instruments' products and services. Some of the vendors specialize in driver development. I would suggest contacting one of the Alliance members at:
    http://www.ni.com/alliance
    Some useful resources for your application are
    ni.com > NI Developer Zone > Development Library > Instrument Connectivity
    http://search.ni.com/?col=alldocs&layout=TechResou​rces&ql=a , to search examples and knowledge bases
    Hope this helps.

  • HELP!How to create HD disc that will play back in HD DVD or Blu-Ray player?

    Footage comes from Panasonic HVX200 as DVCPRO HD 1080i60, all appropriate settings made in FCP5 to edit. Have already made SD DVD, whoopie.
    Now client is interested in real HD version that they can play back on HD DVD or Blu-Ray set top unit. Of all my research, I've discovered little about how to make a "real" HD video disc. OSX doesn't support Blu-Ray burning, OK. What about HD DVD burning support? And what drive to purchase for this application?
    I understand DVD Studio will allow me to author a disc with HD content...that I can burn onto DVD5. Useless to the client. Need to burn on either Blu-Ray or HD DVD media.
    Aside from encoding in Compressor, what do I do when I need to make this HD disc happen? Compressor step seems easy enough to figure out. Just very unclear on how to burn out appropriate video disc.
    Thanks for your help.

    For Blu-Ray creation:
    I'm curious if DVDit! works in parallels too, though it will certainly work in BootCamp. The question is what format should FCP/Compressor output to in order for DVDIt, etc. on BC or Parallels need in order to create the disc?
    MPEG-2 and H.264 should work, but who knows?
    In the meantime, I have HDV source footage that I edit. I print the final edit back to HDV for archiving, and burn a HD-DVD on a DL DVD+R red laser disc to show on my Toshiba HD-DVD player using DVDSP. It works, and I can get about 40 minutes of MPEG-2/HDV on there without transcoding at 1080i and it looks fantastic.
    In the future, I hope to be able to dump the HDV final edit onto a Blu-Ray disc. I'm guessing Adobe Encore will be needed on the Mac for that.
    The point here is there certainly are options that work. I do wish Apple added Blu-Ray burning capability.
    There's still room for that, however... FCS 1 (and even now 2, with AVCHD support, albeit non-native) have histories of adding new support for codecs, etc. in free updates.

  • How to create a dimension that will reference another dimension

    Im creating a new cube without having a schema or DSV in place yet.  Starting from scratch.  In my OLTP database I have a table 'Orders' which contains various FK references to other tables, which in turn might reference two other tables.
    For example.  Orders has a FK to a table called MarketAuthority.  This is a table that contains references to two other tables Market and Authority.  
    How can setup my dimension(s) to capture this, if Im starting with no DSV or schema for a data warehouse.
    Correct me if Im wrong, but I think I just setup a new dimension called MarketAuthority and use it from the Measuregroup for the Orders.  However, how will I reference the Authority.  I assume it will be a dimension as well, but how do I relate
    MarketAuthority and Authority?
    In other words, say you had these types of tables in your OLTP system
    Orders (salesperson, account, department ...)
    OrderDetails (references order, many to 1)
    Goals (references many of the same attributes eg. salesperson as order)
    Im thinking I need 3 separate measure groups?
    Im looking over the Adventureworks 2008 SSAS example project for how its setup.

    I think im looking at this all wrong.
    Again, with the example tables above, I can still create 3 different measure groups, but they all will need to reference some of the same dimensions.  This will result in 3 different fact tables when the schema is realized I believe?
    What I think i was missing was that something like an OrderDetail table, that refers back to an Order will need references also to the same attributes as the order, at least as regard to the fact table(s).
    In other words, if Orders has a SalesPerson key, account key etc, then OrderDetails will as well, IN ADDITION TO the order id as a measure.  
    Or ... does this sound like the case for a Fact type dimension?
    https://msdn.microsoft.com/en-us/library/ms167409(v=sql.105).aspx
    Hi Shiftbit,
    As you said, it related to Degenerate dimensions which also called fact dimensions, are standard dimensions that are constructed from attribute columns in fact tables instead of from attribute columns in dimension tables.
    http://www.jamesserra.com/archive/2011/11/degenerate-dimensions/
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to create a program that enable peer-to-peer connection

    I'm currently doing a college project which is a instant messenging system. The system will have the client-server network and peer-to-peer network. The client-server network part has been finished but i still facing the problem to write the code to enable two pc communicate with each other by using a server that use in the client-server part .
    I very hope someone can help me.
    thank you!

    Hi,
    I think that i can help u in this respect.
    Let me see what you are suggesting.
    You have two or more servers which need to be aware of on another.
    you have clients which can be connecting on any of the servers.
    you need these clients to be aware of each other.
    well....to do this you need to take a lot of factors into account.
    1. you can use a central server and redirect accordingly.
    2. use distributed servers.
    this is the more difficult part as you need to keep track of the server timezone.
    you need to keep track of the up and downtime of your servers.
    when servers are up or down you need to distribute clients accordingly.
    The second approach is more robust and known better as load balancing.
    Regards,
    myraid

  • How to create a Column that will "carry over" values

    I have the first 5 colums of the following table and I would like to create the last column (Carryover). The calculation for carryover (current row) is PRIOR_DAYS_OF_SUPPLY(current row)-DAYS_BTW_REFILL(current row)-carryover (prior row)
    This is tricky since the value is dependent on the prior row value of the SAME column. I have tried the window functions but still cannot get it to work.
    P_ID     RX_DATE     DAYS_OF_SUPPLY     PRIOR_DAYS_OF_SUPPLY     DAYS_BTW_REFILL     CARRYOVER
    100     10/20/2005     30               0
    100     11/28/2005     30     30     39     0
    100     12/21/2005     30     30     23     7
    100     1/13/2006     60     30     23     14
    100     3/3/2006     30     60     49     25
    100     4/14/2006     30     30     42     13
    100     6/9/2006     30     30     56     0
    100     7/7/2006     30     30     28     2
    100     7/31/2006     30     30     24     8
    200     10/20/2005     30               0
    200     11/28/2005     30     30     30     0
    200     12/21/2005     30     30     35     0
    200     1/13/2006     60     30     25     5
    200     3/3/2006     30     60     70     0
    200     4/14/2006     45     30     32     0
    200     6/9/2006     30     45     41     4
    200     7/7/2006     30     30     30     4
    200     7/31/2006     30     30     32     2
    Any help would be greatly appreciated,
    Sam

    I may not be explaining my issue well enough. I believe that 10g has new funciontality that can solve this. Since I am in 9i, I would like to have something that does the same thing as the following 10g SQL:
    create table foo (P_ID number(3) ,R_DT date , DOS number(3) ,
    PDOS number(3), DBTWR number(3), CO number(3));
    insert into foo values (100,to_date('10/20/2005','mm/dd/yyyy'),'30',0,null,null );
    insert into foo values (100,to_date('11/28/2005','mm/dd/yyyy'),'30','30','39',0);
    insert into foo values (100,to_date('12/21/2005','mm/dd/yyyy'),'30','30','23',7);
    insert into foo values (100,to_date('01/13/2006','mm/dd/yyyy'),'60','30','23',14);
    insert into foo values (100,to_date('03/3/2006','mm/dd/yyyy'),'30','60','49',25);
    insert into foo values (100,to_date('04/14/2006','mm/dd/yyyy'),'30','30','42',13);
    insert into foo values (100,to_date('06/9/2006','mm/dd/yyyy'),'30','30','56',0);
    insert into foo values (100,to_date('07/7/2006','mm/dd/yyyy'),'30','30','28',2);
    insert into foo values (100,to_date('07/31/2006','mm/dd/yyyy'),'30','30','24',8);
    insert into foo values (200,to_date('10/20/2005','mm/dd/yyyy'),'30',0,null,null);
    insert into foo values (200,to_date('11/28/2005','mm/dd/yyyy'),'30','30','30',0);
    insert into foo values (200,to_date('12/21/2005','mm/dd/yyyy'),'30','30','35',0);
    insert into foo values (200,to_date('01/13/2006','mm/dd/yyyy'),'60','30','25',5);
    insert into foo values (200,to_date('03/3/2006','mm/dd/yyyy'),'30','60','70',0);
    insert into foo values (200,to_date('04/14/2006','mm/dd/yyyy'),'45','30','32',0);
    insert into foo values (200,to_date('06/9/2006','mm/dd/yyyy'),'30','45','41',4);
    insert into foo values (200,to_date('07/7/2006','mm/dd/yyyy'),'30','30','30',4);
    insert into foo values (200,to_date('07/31/2006','mm/dd/yyyy'),'30','30','32',2);
    ================
    Quote:
    select p_id,r_dt,dos,pdos,dbtwr,cry
    from foo
    model return all rows
    main grr
    partition by ( p_id)
    dimension by (row_number() over
    (partition by p_id order by r_dt ) as rn )
    measures (r_dt,dos,pdos,dbtwr,co, 0 as cry )
    ignore nav rules sequential order
    cry[any]= case when (pdos[cv()]-dbtwr[cv()] +cry[cv()-1])
    < 1 then 0
    else pdos[cv()]-dbtwr[cv()]+cry[cv()-1]
    end
    )

Maybe you are looking for

  • Backed up my old phone to my computer.  trying to sync new phone and retrieve old info.  It is asking for a password.  I never gave it one.  How do I get to my stuff????

    backed up my old i-phone 3 to my computer.  tried to sync new i-phone 4S to computer to restore info.  It is asking for a password.  I never assigned one.  How do I get to my info????

  • TOC doesn't show in View Primary Layout

    OK, this has got to be some minor little thing I'm not doing. I created a project by importing a PDF and creating topics based on a given style. In the Project Manager pod (?), under Project Files, I have 6 files. Each of the 6 files appears to be on

  • BE on MCS v7 migrate to BE6000 on UCS

    I have a client who has a 100 single MCS server based Business edition running version 7. Currently they are covered under UCCS/ESW nearing the end of this 3 year agreement. What is the correct migration path to take them from V7 to BE6k on UCS.  Loo

  • Unicode and CR/LF

    Hi, In preparation for Unicode upgrade, all of our HR programs have been upgraded and 'Unicode Checks Active' attribute turned on.  In doing so, we made the following code change for "carriage return/line-feed" functionality in several programs. FROM

  • Reports in MS Excel Application

    Hi, All, We are using Oracle 10g database and forms. We have installed Jinitiator version 1.3.1.22. We are generating some of the reports in MS Excel Application from the Oracle forms. To generate the report in excel format we are using Client_OLE2 c