Creating all binary strings with n 1's and n 0's

if i wanted to create all possible strings of n 1's and n 0's where there are never more 0's than 1's using 2 for loops and recursion how would i go about this? (the first for loop controlls how many 1's are in the string the second how many 0's up to the number of 1's) What would the recursive alogrithim have to look like inorder for me to create every possible string of n 1's and n 0's where there are never more 0's than 1's ?

{color:#ff0000}Cross posted{color}
{color:#000080}Including this post --{color}{color:#0000ff}
http://forum.java.sun.com/thread.jspa?threadID=5223773
http://forum.java.sun.com/thread.jspa?threadID=5223679
http://forum.java.sun.com/thread.jspa?threadID=5223774{color}{color:000080}
Cross posting is rude.
{color}

Similar Messages

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • I got my i phone4s few days back and i created an apple id with a credit card and when i go to the appstore to purchase apps,all have and message stating that "this app is no longer availabe"..how do i fix this issue?im from singapore by the way

    i got my i phone4s few days back and i created an apple id with a credit card and when i go to the appstore to purchase apps,all have and message stating that "this app is no longer available"..how do i fix this issue?im from singapore by the way

    If it is longer available then you can't get the app on your phone.

  • I would like to be able to create a few icons with photos on them and linked to a persons phone number.

    Hi, my father is in the middle stages of dementia and having trouble using his new iphone. I would like to be able to create a few icons with photos on them and linked to a persons phone number. This way he can select an icon and it will auto-dial that number. I did some research and an app called SBphotoDial did exactly what I need but it no longer seems to be available in the App Store. Any thoughts?

    See Here for iPhoto...
    iPhoto: How to move the Library to an EHD
    Make sure that the EXT Drive is formatted as Mac OS Extended (journaled).
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.

  • How do i create a little network with my i-mac and macbook

    how do i create a little network with my i-mac and macbook

    Hello:
    To give a sensible answer, a little more information is needed.
    I am guessing that you want to set up a wireless network as you have both a desktop and laptop.
    There are some pretty good tutorials/articles in the knowledge base articles.
    Barry

  • Problem in creating client side PDF with image using flex and AlivePD

    I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
    Thanks in advance
    Atishay

    I am having a similar and more serious problem. It takes a
    long time to execute, but even attaching a small image balloons the
    pdf to 6MB plus. After a few images it gets up to 20MB. These are
    100k jpeg files being attached. The resulting PDF is too large to
    email or process effectively. Does anyone know how to reduce
    size/processing?

  • The document could not be saved. The server said: "The operation failed because an unexpected error occurred. (Result code 0×80020005)" Please ensure you have completed all required properties with the correct information and try again.

    I am having problems  saving documents back to SharePoint when any of the document properties (metadata columns) are set to be "managed metadata". The check-in/save fails with error:
    The document could not be saved. The server said:
    “The operation failed because an unexpected error occurred. (Result code 0×80020005)”
    Please ensure you have completed all required properties with the correct information and try again.
    I have seen similar threads that suggest this is a known issue with this version of Acrobat but I would like conformation from Adobe that this is a known issue and whether it is fixed in a newer version?
    Adobe Acrobat version 10.1.13
    SharePoint 2010

    Hi quodd,,
    We are sorry for the issue being faced by you. I need some information from you so that I take further steps:
    1. Which Adobe product are you using Acrobat or Adobe reader- what is the complete version?
    2. How are you opening and saving the PDF, the exact workflow?
         Are you doing it from within Adobe Reader/Acrobat application or opening it from browser, doing changes and saving it using browser itself.
    3. Can you try to save a PDF to library with Custom template and managed metadata columns using browser directly.
    4. Please verify that columns name do not contain spaces or some other special characters.
       Can you try to save PDF to library with Custom template and just a single managed metadata column  with a simple name
    Thanks,
    Nikhil Gupta

  • Evaluating binary strings with "Don't care" conditions

    I frequently have to evaluate binary strings or register values for particular bits. Does anyone have a better way? And if not, perhaps this is a suggestion for NI.
    To this point I've used two methods:
    1. I turn the data into an actual string in my CVI code and inject X's in the necessary positions. I then perform a string evaluation for equivalence, the string now consisting of '1's '0's and 'x's.
    2. Bring the data into the teststep and applying an expression to the data source, masking the appropriate bits. Then evaluate as a numeric with a value that assumes the offended bits "zeroness" or "oneness" depending on how I've implemented.
    The first was one requires specialized code, but allows for a little more visibility (in the code at least) of which bits are designated as DCs. But translating a multiple byte and variable length of amount of information into a string is cumbersome. Sure the code is reusable, but I'm not convinced the translation is necessary or best.
    The second buries the mask in a window that is, seemingly, infrequently used. I've had colleagues work on a project behind me trying to figure out where the value was being manipulated because I've applied a mask via the source. My original explanation of "ninjas" wasn't well taken...
    It seems like it would be ideal for the limits window to allow the use of "X"s when defining a "binary" type comparison so that the mask is clearly defined in the limit itself, and the data as it's passed to and from teststand remains untouched. Also, if this were to be implemented I would hope the property loader would support it.
    Am I missing a much easier way to do this? Anyone have a better way?
    Thanks in advance!
    Colt.
    P.S. Why isn't "NI" and "CVI" built into the spell checker?

    So in that first case where I am using CVI to "insert" I am building a string type vector that contains ASCII '1's '0's and 'x's. Where the Xs are in the binary position for what I am considering as "don't care".
    So say for instance I was converting a piece of data that was 0xEB, with bit 0 being considered a DC for evaluation, I would build a string like "1110 101X" . This string is what I would pass back to teststand. In teststand I would then perform an equivalence test between the two strings.
    For the second question about an implementation for the limit, say I open the test step, click on "Edit Limits" then from the drop down in the bottom right I select "Binary". I could then compose a limit in a similar form as described above. Where the limit box could contain something like "0b1110101X". But as for the data I hand to teststand, it would still be just a scalar value, with no masks applied. In the code, or in teststand.
    Sorry if I'm not making any sense! I hardly ever do...
    Colt.

  • How to create all Integration Directory with Directory API

    How to create all Integration Directory
    elements (Receiver determination, Interface Mapping, Communication channel Etc ) using Directory API
    Can we upload multiple elements in ID from list in Excel sheet

    Take a look to this "How TO", can be really helpful for your requirements:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0336199-d3c7-2c10-c983-f8a945a4588c?QuickLink=index&overridelayout=true

  • Creating Blu-Ray DVD with Final Cut Pro and Adobe Encore

    Hi all,
    I am one of many with troubles creating a blu-ray DVD using Mac software. Sounds like the best way to do this is to do all of the editing in Final cut and create the DVD in Adobe Encore. Is there a way to export to Adobe Encore or should I just create a .mov file and import that to Encore. That way I think I lose the HD quality. I read that I could compress to Blu-ray format in Compressor, but I can only find HD DVD which is different. When I select create a Blu-Ray disc, Compressor won't simply create the file on my computer...it wants the disc to create.
    Maybe I am a little to new at this to fully understand, but why in the heck doesn't Apple get with the times and create a DVD authoring program that makes Blu-Ray?
    Thanks for any help you can offer.

    I have just completed my first blu-ray disc using FCP7 and Adobe encore. My workflow, once the timeline was complete, was to go to File>share>choose blu-ray as destination >export. The default encoding is H.264 along with an ac3 file for audio. It took 3 hours and 35 minutes to encode the 1hr 26 minute file.
    Opening encore, confirming you settings for HD, and choosing file>import>as asset each of the files (separately, of course). Encore imports them, then under Timeline>create new, then drag the files to the timeline. CLick on the build button and you are there. I did not mention that my original render was Prores422, but that should not matter here. No trouble with burning the Verbatim 25Gb disc.
    Encore will recognize that these files do not need re-encoding and burn the disc. It took 1 hour and 40 minutes to burn a 1 hour and 26 minute (17+ Gb) movie on an i7 iMac with an OWC 12x BD burner.
    Hope that helps

  • Creating a primary key with the parallel option and the tablespace option

    I know I can create a unique index with these options and then make the primary key with the "using index" clause. anyway to do this and skip the create unique index and just create the primary key ?

    SQL> ALTER TABLE t
      2  ADD CONSTRAINT pk_t
      3  PRIMARY KEY (testcol)
      4  USING INDEX
      5  TABLESPACE example
      6  PARALLEL (DEGREE 2);
    PARALLEL (DEGREE 2)
    ERROR at line 6:
    ORA-03001: unimplemented featureYou can name the tablespace but you must do an alter index thereafter.

  • Creating new VM ends with Error code 3430 and 3040 in Hyper-V log. Does anyone have any insight into what might cause this?

    The new VM is being created via a P2V process run from SCVVM. It reaches a completion of 60% and dies. I asked about this in another question detail of the VVM can be seen at this link:
    http://social.technet.microsoft.com/Forums/en-US/virtualmachinemgrp2vv2v/thread/71aae7dc-13b5-46f1-b794-cc1b8085541f
    Running Win2008 R2 w/ Hyper-V role enabled & SCVVM 2008R2
    In any event I checked the Hyper-V logs to see if they might shead any light on the problem and there were two error messages associated with the attempted conversion. The first Event ID 3430
    Log Name:      Microsoft-Windows-Hyper-V-Worker-Admin
    Source:        Microsoft-Windows-Hyper-V-Worker
    Date:          5/23/2011 4:51:25 PM
    Event ID:      3430
    Task Category: None
    Level:         Error
    Keywords:     
    User:          NETWORK SERVICE
    Computer:      Virtual-Mgt.amrinc-corp.local
    Description:
    'test1' failed to set/change partition property: The system cannot find message text for message number 0xtest1 in the message file for 18568CA2-82E9-4A9F-B462-701D8FB4C447. '0x8007013D'.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51DDFA29-D5C8-4803-BE4B-2ECB715570FE}" />
        <EventID>3430</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8000000000000000</Keywords>
        <TimeCreated SystemTime="2011-05-23T21:51:25.956775200Z" />
        <EventRecordID>1</EventRecordID>
        <Correlation />
        <Execution ProcessID="3316" ThreadID="2716" />
        <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel>
        <Computer>Virtual-Mgt.amrinc-corp.local</Computer>
        <Security UserID="S-1-5-20" />
      </System>
      <UserData>
        <VmlEventLog xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
          <VmName>test1</VmName>
          <VmId>18568CA2-82E9-4A9F-B462-701D8FB4C447</VmId>
          <ErrorCodeString>%%2147942717</ErrorCodeString>
          <ErrorCode>0x8007013D</ErrorCode>
        </VmlEventLog>
      </UserData>
    </Event>
    And the second Event ID 3040
    Log Name:      Microsoft-Windows-Hyper-V-Worker-Admin
    Source:        Microsoft-Windows-Hyper-V-Worker
    Date:          5/23/2011 4:51:25 PM
    Event ID:      3040
    Task Category: None
    Level:         Error
    Keywords:     
    User:          NETWORK SERVICE
    Computer:      Virtual-Mgt.amrinc-corp.local
    Description:
    'test1' could not initialize. (Virtual machine ID 18568CA2-82E9-4A9F-B462-701D8FB4C447)
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Hyper-V-Worker" Guid="{51DDFA29-D5C8-4803-BE4B-2ECB715570FE}" />
        <EventID>3040</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8000000000000000</Keywords>
        <TimeCreated SystemTime="2011-05-23T21:51:25.956775200Z" />
        <EventRecordID>2</EventRecordID>
        <Correlation />
        <Execution ProcessID="3316" ThreadID="2716" />
        <Channel>Microsoft-Windows-Hyper-V-Worker-Admin</Channel>
        <Computer>Virtual-Mgt.amrinc-corp.local</Computer>
        <Security UserID="S-1-5-20" />
      </System>
      <UserData>
        <VmInitialize xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://www.microsoft.com/Windows/Virtualization/Events">
          <VmName>test1</VmName>
          <VmId>18568CA2-82E9-4A9F-B462-701D8FB4C447</VmId>
        </VmInitialize>
      </UserData>
    </Event>
    I have blownout the server and reinstalled the operating system and SCVVM and applied all the current updates to no avail. I have the exact same issue again. The problem seem to be at least on the serface an authority problem because I have no problem creating
    new VM via the P2V process on an old Virtual Server running on Win2003R2.
    Oh yes I can create new virtual machines on the system in question and move them to the library as was suggested to verify in a Blog post so I am really wondering what the problem is?
    Configuration Analyzer Just gave me a warning about reporting not being setup on the VVM which it isn't so no suprise there?
    Any information that might help me figure this would be greatly appreciated

    I've looked at both threads, and there simply isn't enough information for me to tell you what is wrong.  Please collect a trace (instructions in General forum) and open a case with CSS.  CSS can provide more in depth analysis than what a forum
    post allows. 
    As a shot in the dark, I have seen the issue outlined in the following KB article cause this exact same error message and symptom,
    http://support.microsoft.com/kb/967902
    Best Regards, Mike Briggs [MSFT] -- posting provided "AS IS" with no warranties and confers no rights

  • Creating an AVCHD DVD with Nero Vision 5 and Premiere Pro

    This seems to work pretty well as a workflow (using AVCHD clips from a Panasonic SD5):-
    Get your AVCHD clips onto your hard drive using the camcorder's software.
    Run Nero 8 "StartSmart", choose "Author Edit and Capture Video"
    Choose "Make Movie"
    Using the "Browse For Media" button, navigate to where your AVCHD clips are and select.
    When they are in the media file list, drag them to the Nero Vision timeline.
    Click on the "Export" button and choose "Export Video to File"
    Choose format "MPEG-2" and profile "HDV HD2 (1080i)"
    Specify filename for output and click on "Export".
    Run Premiere Pro and choose "New Project" and "Adobe HDV"
    Choose HDV 1080i 25 (Sony 50i)
    Edit as normal. On my quad core (Q9300) PC it's easily possible to use 3 video tracks at once and preview full screen smoothly, or add effects etc - a much better experience that using AVCHD with the costly Mainconcept plugin IMHO.
    When done, choose File > Export > Adobe Media Encoder
    Choose format MPEG2, Range "Entire Sequence" and Preset "HDV 1080i 25"
    In the Video tab, Basic Video Settings area, you might care to up the quality to 5.0
    Click OK and supply output filename.
    Repeat the earlier stuff relating to Nero Vision but this time you want to select the file you've just output from PPro.
    When you click "Next" once your file is on the Nero Vision timeline, choose "Make DVD with Edited Movie" > "AVCHD"
    In the next screen choose "Create Chapters"
    Well, follow your nose from there to create the chapters, then choose the menu and customise it, and burn to normal DVD in AVCHD quality.
    What you end up with is an AVCHD DVD which will play on a Playstation 3 and probably on a Blu Ray player (I haven't got the latter to test). The finished quality is very close to the original quality - on the test material I've just been trying (playing back on a 42" full HD Bravia) I had to play repeatedly alternating original and edited footage to spot any differences - such that could be seen were pretty subtle.
    While there are cheaper conversion programs to get AVCHD into PPro, I don't think any of them take the finished edit and do the AVCHD DVD creation and layout part like Nero does.
    Hope that helps a new AVCHD user wanting to stick with PPro. If an experienced PPro user can see an obvious technical fault in what I'm doing I'd be glad to stand corrected.

    Mick,
    I got a simple project with a Play all and Scene select menu and then a scene menu. There was about 15 minutes of video, but it only seemed to cover about half the disk.
    Encore seems tempermental, so I had to be very careful not to change any of the assets, etc.
    I never could get Encore CS3 to recognize regular disks, and that's why I went to ImgBurn (burning either Bluray image or folder).
    I tried Nero at first, and it seemed like a long process to get it to burn a UDF 2.5 format, but IMGBurn does that automatically.
    This summarizes my experience, for what that's worth, with this.
    http://www.wrigleyvideo.com/forum/index.php?showtopic=29665
    Also, apparently,Sony will include this capability in DVD Architect Pro http://www.sonycreativesoftware.com/vegaspro/bluray.
    Finally, some work by others is being done to attempt to burn the BluRay project to a dual layer SD DVD which might double the capacity, but I haven't heard if that has been successful.
    Let me know what you think.
    JOhn

  • Creating a pdf document with both single pages and spreads

    Hi, i'm not sure if this is possible, but basically i'd like to set up a document which allows me view the first three pages as single sheets and the remainder of the document as a booklet. The reason for this is I'm sending a cover letter, CV and then a booklet via email to apply for a job, and the booklet i have created has graphics which run accross the spread. I was hoping to lay the document as such:
    1. cover letter
    2. CV
    3. Booklet front cover
    4-5. booklet spread
    6-7. booklet spread
    8-9. booklet spread
    I'm not too familiar with how to set this up (or if this is possible), could anyone point me in the right direction?

    @Dave Merchant - The pages are true spreads, I've had a go at attempting to define the page type by the master but i can't seem to get it to split the document so that the first three pages remain single. I had a go at trying to create an entire new document with the pages in in order, but not sure how to insert single pages and spreads combined within the document.
    @Test Screen Name - Do you know how i would be able to create such a document within indesign? i've had a look for some answers in the documentation but havent come accross anything yet (im on CS5). I had a go at combining the documents as the booklet and the single pages, but when i change the view options in acrobat to two page the first pages becomes a cover and the second and third are next to each other.

  • Search a string with in some file and get the name of file

    i want to search a string in some files that are in a given directory and return the name of file having searched string.I am doing this with grep command as given below
    import java.io.*;
    public class linux_java {
    public static void main(String[] args) {
    try {
    String command = "find . | xargs grep -l Resolv /data2/opt/jakarta-tomcat-4.1.24/webapps/Oa/BOG/*.txt";
    final Process process = Runtime.getRuntime().exec(command);
    OutputStream os= process.getOutputStream();
    System.out.println("out put stream= " +os);
    PrintStream stdIn = new PrintStream(new BufferedOutputStream(process.getOutputStream()), true);
    System.out.println("Return code = " + stdIn);
    } catch (Exception e) {
    e.printStackTrace();
    i dont know how to get the name of file that are return by the execution of command through process object. Please send the code for the same

    thanks for your suggestion....
    i change the code but now it is giving error as /usr/bin/find incomplete syntax....but i am giving the right syntax....
    please confirm whether the syntax is correct...
    import java.io.*;
    import java.util.*;
    public class linux_java {
    public static void main(String[] args) {
    try {
    //String command = "ls -alt";
    String command = "find /data2/opt/jakarta-tomcat-4.1.24/webapps/Oa/BOG -type f -exec grep -sl 'Aggarwal' {} \\; 2>/dev/null";
    ///grep -l System test/*java
    System.out.println(" the command is"+command);
    final Process process = Runtime.getRuntime().exec(command);
    InputStream is = process.getErrorStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line="";
    System.out.println(" the BufferedReader is"+br.readLine());
    while ((line = br.readLine()) != null) {
    System.out.println(" the files are"+line);
    } catch (Exception e) {
    e.printStackTrace();
    }

Maybe you are looking for