Easy sequence question

Hi,
what is the easiest (and fastest) way to create sequence of Numbers of length 1000 filled up by 1
example:
[1,1,1,1,1,1,1,1...]
or
[2,2,2,2,2,2,2,2,2...]
or
[0,0,0,0,0,0,0,0,0...]
etc...
Thanks in advance
Oldrich

Thank you for your quick response ;)
Just a side note:
I have just done a small speed check as follows and my result is that arrayList is cca 3x faster than sequence. Do you know if sequences are going to be speed up in the future release?
import java.lang.System;
import java.util.ArrayList;
import java.util.List;
var length = 5e6;
function seq(){
  var start = System.currentTimeMillis();
  var seq = for(n in [1..length]) 1;
  var end = System.currentTimeMillis();
  println(end-start);
function array(){
  var start = System.currentTimeMillis();
  var array : List = ArrayList{};
  var i = 0;
  while(i < length){
    array.add(1);
    i++;
  var end = System.currentTimeMillis();
  println(end-start);
//seq();
array();

Similar Messages

  • Fill In The Blank / Sequence Questions

    Is it possible to have a fill in the blank question in captivate (4 or 5) that is scored according to how many options the user got correct?
    For example:
    If you use 4 grams of 'b' you will need _____ grams of 'x', _____ grams of 'y' and ____ grams of 'z' to complete the forumula.
    In this example if they answered all 3 blanks correctly they would get 3 points, 2 correct answers would give them 2 points and so on.
    Also, is it possible to  score sequence questions according to how many items were correctly sequenced?

    Hello,
    For the moment partial scoring (as I'm calling it) is not possible in Captivate, at least not in the included Question slides. If you want that feature, and you are certainly not alone, please fill in a Feature Request to get this feature on the priority list of the Adobe team.
    If you do not mind the work, it is possible to create question slides yourself using the available objects, user variables and advanced actions. I wrote several articles and blogged about those workarounds, one of them is about creating question slides with possibility for partial scoring (it is not a FIB-question but the principles are the same):
    Question slide with partial score
    Lilybiri

  • Havent a clue! Please help! Easy ABAP Question!

    Helly Gurus
    I am loading from a dso to a cube and doing a lookup on a second dso.
    eg
    'Name' is in the DSO1
    I lookup 'Address' from DSO2
    Then load to the cube.
    The problem is there may be more than one address so although I have coded the lookup to
    find all addresses, I do know how to get these into my results.
    Only the first address it finds is there.
    loop at DATA_PACKAGE.
        select * from DSO1 where
        NAME = DATA_PACKAGE-NAME.
        if sy-subrc = 0.
          move-corresponding DSO2 to itab1. collect itab1.
        endif.
        endselect.
      endloop.
    What do I need to do to get all of the results?
    I am in 3.5 so do not have the use of an End Routine.
    Thanks
    Tom Tom

    you need to do several treatments in fact you need to add records on the data_package (by the way it is not an easy ABAP question as you mentioned !)
    So
    Treatment 1: select all the records from ods2 table of adresses outside the loop
        select names adresses
        from ods2
        into table g_itab_ods2
          for all entries in data_package
          where name eq data_package-name.
    Treatment 2: delete double records of the internal table.
        delete adjacent duplicates from g_itab_ods2 comparing names adresses.
    Treatment 3: loop over the data_package. Within this loop read the internal ods2 table and loop over it to assign the corresponding adresses. Then append the results to the temporary data_package_tmp and move all the records to the initial data_package.
    loop at data_package assigning <data_fields>.
       read table g_itab_ods2 into l_g_itab_ods2
          with key name = <data_fields>-name.
          if sy-subrc eq 0.
            loop at g_itab_ods2 assigning <adresses>
            where name                = <data_fields>-name.
              <data_fields>-adresses= <adresses>-adresses.
              append <data_fields> to lt_data_package_tmp.
            endloop.
          endif.
        endloop.
        data_package[] = lt_data_package_tmp[].
    free lt_data_package_tmp.
    this should do what you want to do. hope this could help you out.

  • Sequence question drop-down list gets hung up on punctuation

    I'm making a sequence question. In drag-and-drop mode, it
    works fine. But in the drop-down list mode, it breaks. In other
    words, even if it is displaying correctly, it is "wrong" when the
    enduser tries to sequence the choices.
    I assume that this is because one of my items has punctuation
    in it.
    It's a person's name, so it looks like this:
    Lastname, FirstInitial.
    Or it could be even two people:
    Lastname, FirstInitial. & Lastname, FirstInitial.
    Is there a way to escape the commas and periods? (I'm willing
    to give up on ampersand!) Use ASCII, escape ActionScript or
    JavaScript? I'm not likely to solve the problem by experimenting,
    so I'm wondering if someone else has figured this out. THANKS.
    (I tried searching the forum, but searching does not seem to
    be working for me)

    I can't help you with this myself as I've not done it but there are quite a few tutorials kicking around the net.
    Simple ODBC Connections in Adobe LiveCycle:
    http://www.youtube.com/watch?v=C56_Cz-aE0c
    Connecting a form to a database:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    Database connected forms:
    http://acrobatusers.com/tutorials/database-connected-forms

  • Responses showing over feedback in sequence question - Captivate 5

    Hi all
    I have an issue with the sequence question type. If you have feedback, the draggable responses show over the top.  Please see grab.
    Is this a bug? I can't find any mention of it. It only seems to do it with certain responses. Makes it completely unusable.
    Suggestions?
    Mitch

    This tends to happen if you add answer options AFTER creating the question and adding the feedback captions.  The last thing added ends up on the upper layers of the quiz question slide, but since you cannot see these layers in the timeline, as you can for other slides, you cannot reorder the layers by normal means.
    The solution is to turn your feedback captions off and then on again so that they then end up on the higher layers again.
    Go to Quiz Properties for this slide and deselect/select the Correct and Incomplete captions to put them above the answer options.  Then set Failure level to NONE and back to whatever it was before to set the Failure caption above everything else.  This will erase any text you had in the captions, so if you've invested quite a lot of time adding text to these feedback captions, it's a good idea to copy that text somewhere else first, so that you can just paste it back in after recycling them.

  • Drop Down Options in Captivate 6 Sequence Question

    Hello!
    I'm working on a project using Captivate 6. There is a Sequence question using the drop down option for Answer Type. For this particular question there are 5 items that need to be placed in order. When a learner clicks the drop down to answer the question only 4 of the 5 options display forcing the learner to scroll to see the last option. Is there a way to make the drop down display larger so the learner doesn't have to scroll?
    Thanks in advance for your advice.
    Marie

    Thanks Lilybiri!
    This was helpful. My team decided to stick with the drop down format, but by making the font size smaller we were able to fit all 5 options into the window (taking away the need to scroll.
    Thanks again,
    Marie

  • Sequencing Question Review

    Hi all,
    Just a quick question regarding the sequencing question type
    - is there a way to format the review area to show the correct
    answer for a sequenciung question? In some of my courses, I have
    used the sequencing quetion type, but it leaves quite a bit to be
    disired when it comes to reviewing the correct answer once you've
    completed the quiz. It seems to cram all of the answers into a tiny
    little space, regardless of how big I make the Review Area when
    editing the screen.
    Any ideas?
    Thanks in advance!
    Cheers,
    Shawn

    I agree the space is very small for the review. It also helps
    to only have a sequence of four and that may be too small as well.
    The only other suggestion I can make is put the order of the
    correct answer into a Success Caption or the Failure Caption or
    even BOTH. You may not be able to put all of the answer in the
    captions but they can expand a lot. You can at least put the
    correct order of the letters.
    Jeff

  • Sequence Questions - Captivate 5

    I like using Sequence-type questions, but upon user review of the quiz, not all the answers appear.  Only the first two correct answers are shown.  If I have the user arrange five items in the correct order, only the first two correct responses are given in the quiz review.  I have carefully scrutinized all the setup parameters for this question type and don't appear to be doing anything wrong.
    Any suggestions would be appreciated?

    I've had a few issues with Sequence questions that were migrated from Cp4 to Cp5.  I usually found it best to just recreate the questions entirely in Cp5 to get everything working properly.

  • Sequence Questions Merging

    Hi
    I recently created an assessment on Captivate 3, which
    includes a number of sequence questions, the problem that I have is
    that the answers for the sequence questions are moving between
    questions and therefore people are answering it wrong as not all of
    the correct options are available.
    Any ideas on how to resolve this??
    Thanks

    Try separating the "Sequence" questions from one another with
    a different type of questions, i.e.
    1. sequence
    2. t/f
    3. sequence
    4. mult choice
    5. sequence
    This is definitely a bug, i've seen the same thing. --Bob

  • Can't edit multiple tracks - plus 2 easy audio questions

    I have a sequence with 1 video track and 6 stereo audio tracks. I set an in and an out point. The area on the clips in the timeline between the two edit points highlights, I hit delete. Normally, the tracks between the points should disappear as the two segments come together and form one great edit.
    But all the tracks do not highlight and edit. The video track and stereo audio tracks 3+4 and 5+6 highlight and LIFT off. But audio tracks 1+2 do not highlight or edit. And the whole sequence doesn't close together where the edit should be.
    Only way I have been able to overcome this is to use the razor blade tool, cut each track individually. Highlight them all, and then hit delete.
    This didn't use to be the way. FCP used to edit through one track, 3 tracks or all tracks, no problem.
    Two audio questions. How do you stop the waveforms from drawing onto the clips in the timeline, in order to speed up FCP?
    How do you get the audio in captured clips to be a Stereo Pair, from the outset?
    Thanks to all you who help!

    Is it usual for FCP to bog down on a 4 minute piece when audio wave forms are turned on??
    <
    No. Should run fine. You get up into 6-12 audio tracks, FCP gets all moody and pouty.
    But it depends on your system's capabilities and how well you have chosen your sequence settings.
    Audio waveforms n FCP are a cruel joke compared to many other NLEs. Often easier to leave them off in the timeline, use the waveform in the Viewer and set markers for hooks in the audio tracks.
    bogiesan

  • Sequence question

    I'm curious what others are doing with sequences in their AppEx applications. I know this isn't strictly an AppEx question - but I recently ran into serious problems because of my choice of how I'm using sequences.
    The problem goes something like this: I create a new table and while I'm doing so I go ahead and create a new sequence for that table. Seems innocent enough. Now, I just happen to use this new table as a lookup table for some foreign key values in one of my main data tables. Not a problem. Works like a charm.
    I start populating data into the main table and the lookup tables. Again, not a problem. The users want a little query mecanism for the report so I decide that I'm going to implement it in the UI with a checkbox based on an LOV that allows users to find records based on checking values and clicking a 'Find' button. OK, create a checkbox item, a named LOV, assign it to the checkbox item. Now amend the query for the report region to use the checkbox via an instr(:P1_MY_SEARCH_CHKBX, column_name)>0 kind of approach.
    Ooops! I'm not getting what I want. The changes to the query are clearly working for some cases but I'm seeing John Doe's projects (like I want) and Mary Jane's too (which I don't). Turns out John Doe's ID is '1' and Mary Jane's is '11' and '1' is definitely in '11', so things are working as they should based on my implementation, but I'm getting 'unexpected results' from the users point of view.
    Obviously, the root cause of this comes down to my choice to create that new sequence for each table and increasing the likelihood that this situation would occur. If I had used a single sequence value for the entire schema, that started with a large value (maybe a guid) and built all of my triggers off that one sequence then this little UI anomaly would likely not have occured.
    Sorry for the long, boring story - but I'm curious what others are doing and how many people have run into this same kind of problem?
    Earl

    Personally I would do it in this sort of way. It may add an extra page or two, but I think in the long run it becomes easier.
    Here is my sample app - click a couple, hit the search button, and it will show you your results.
    http://htmldb.oracle.com/pls/otn/f?p=20233:1:17770724214406136839::NO:::
    What I would do in your case is to do something similar - list out the project managers using htmldb_item.checkbox(1, manager_id). This will tie the exact id to that box. Create a before header process that creates a collection - this collection will hold your checked boxes. Add an after submit process to add items to that collection. On your next page, you would do something like this to restrict the rows:
    select pro.project_number, pro.description
      from project pro
    where exists (select 1
                   from htmldb_collections col
                   where pro.manager_id = col.c001 and
             col.collection_name = 'PROJECT_MANAGER')Personally I like collections a lot - that way someone can go back to that page, add a couple extra checks and it repopulates the collection. If you need to see the exact code, let me know and i'll post it on my application page.
    As far as your 2nd question, its a matter of preference. There is nothing wrong or right about creating one sequence - yes you're right - the user never sees it, so it really doesnt matter. But I guess I am a creature of habit, and dont see what creating one sequence really saves you. Its sometimes nice to be able to see the next sequence value and have an approximate guess that you are creating the 243rd new employee instead of the 125,335th new object in the entire database.
    To each their own!

  • Another 'Cannot mutate bound sequence' Question

    Hi Everyone,
    The below code throws a "Cannot mutate bound sequence" when the line (id:'a') is pressed first. However it runs fine when lines 'b' or 'c' are pressed first. But the output shows the correct line 'a' has been deleted when pressed first. Can anyone suggest a way around this or shed some light on what is happening?
    Im still new to javafx and have been reading up on 'bind'. It looks like there are a few known issues out there so hopefully this is one and there is a easy fix.
    package bindingerror;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.Group;
    import javafx.scene.shape.Line;
    class Wall extends Line{
         override var onMousePressed = function(e):Void {
                println(WallArray);
                delete e.node as Wall from WallArray;
                println(WallArray);
    var WallArray = [
                    Wall{id:'a' startX: 10 startY: 20 endX: 90 endY: 20 strokeWidth:10}
                    Wall{id:'b' startX: 10 startY: 50 endX: 90 endY: 50 strokeWidth:10}
                    Wall{id:'c' startX: 10 startY: 80 endX: 90 endY: 80 strokeWidth:10}
    var Group = Group{content: bind for(x in [0..(sizeof WallArray - 1)]) {WallArray[x]}};
    Stage {
            scene: Scene {
                       width:   100
                       height:  100
                       content: Group{content: bind Group
                                     }//Group
                          }//Scene
    }//Stage

    No wonder. Has you have seen yourself, binding is a delicate domain, particularly when used with a sequence and/or a function. That's why I won't answer your question but instead criticize your code... :-) No, seriously, I will try and answer (but the inconsistent behavior is still a bit puzzling), if I can, but since you say you are new to JavaFX, I think some remarks can be beneficial as well.
    Generic remark: I am not known to follow blindly the Sun Java coding rules (I have my own internal set of rules I apply across languages, when possible), but I still think using a capital initial for class names, and a lowercase initial for variable names is a useful convention. Particularly when you name a variable the same as a built in class name... The compiler sorts things out, but the reader is confused... :-)
    Other remark: I don't know if you come from the Java world. Knowing Java to do JavaFX isn't mandatory, but useful, since JavaFX routinely uses Java classes. I suppose most JavaFX coders have at least some Java background.
    That said, I am surprised to see so many newbies to JavaFX using the old Java way of iterating over a sequence, by index.
    Let's show a more idiomatic JavaFX. First, you can rewrite your loop as:
    for (x in [0 ..< sizeof WallArray]) WallArray[x];The ..< sequence notation is often overlooked/forgotten, I find it more readable than using -1.
    It can still be written:
    for (w in WallArray) w;But you create a new sequence, why not just use the original one?
    var Group = Group { content: bind WallArray };Ah, I magically dispelled the error message! But I modify WallArray, I don't know if that's the intended behavior. Ah, yes, since the mouse pressed function delete items from WallArray. The problem might lie there: I think the Group reference items in WallArray, and you delete items there, so its references hangs out in the void. Or something like that...
    Last remark: unless you are simulating something more complex, you don't need to put a group in a group.
    So, here is my version of your code:
    class Wall extends Line {
         override var onMousePressed = function (e: MouseEvent): Void {
            print(walls); print(" => ");
            delete e.node as Wall from walls;
            println(walls);
    var walls = [
        Wall { id:'a' startX: 10 startY: 20 endX: 90 endY: 20 strokeWidth: 10 }
        Wall { id:'b' startX: 10 startY: 50 endX: 90 endY: 50 strokeWidth: 10 }
        Wall { id:'c' startX: 10 startY: 80 endX: 90 endY: 80 strokeWidth: 10 }
    //~ var Group = Group { content: bind walls };
    Stage {
        scene: Scene {
            width:   100
            height:  100
            content: bind walls
        }//Scene
    }//Stage

  • VSL Sequencing question for gurus

    I've been making rehearsal tracks in Logic Express using the onboard patches of my old Yamaha EX-5 synth, but I need to move up in to actual sequencing for production. I've got some money and some time to learn, so here are my questions:
    I already have:
    -Logic Express 8
    -Controller kbd & midi interface
    -MacBook Pro with 4gb RAM and 500gb external FW/eSATA drive
    I'm planning on purchasing:
    -VSL Special Edition: Extended
    -Altiverb 6 (Regular)
    To do the actual orchestral sequencing, will I need to upgrade to Logic Pro? Is there any other software or hardware I'll need to buy to get started with VSL?
    Producing professional-grade orchestral mock-ups is my mid-term goal here. I've been composing symphonic works in Finale for 10 years, and want to make the leap from score to sound - so I'd appreciate any advice you'd be willing to offer.
    Advance thanks.

    there is no other special software or hardware other than a reasonably powerful computer and plenty of storage. VSL is a pretty detailed library so if you load very large libraries your macbook pro and 4 Gb could struggle, although that can be mitigated by a fast external drive. and you can optimise your library quite a bit.
    altiverb is fantastic but space designer is very good also - though look around for some other IRs other than the stock logic ones. i have the results of altiverbs stage postioning algorithm and i must say that sounds really fantastic and would help realism greatly for you.
    so i would suggest:
    - stage positioning from altiverb
    - space designer that comes with LP8 pro and put a little platinumverb after it.
    be prepared to do some optimisations with your current setup. but while you are about it...
    with logic pro, you can make your scores sound as they look. you do this by manipulating midi data in the environment. its very easy - easier than it sounds anyway.
    you can use program changes, or now with LP8, because certain meta data can be chased, you can actually use the dynamic markings and symbols to change the articualtions on an instrument.
    say you had a violin part. the first bar is tremelo, the second pizz, and the third stoccato. instead of having a different track for all these articualtions, you can set things up so that you could drag a tremelo marking onto the note and that would switch the VSL instrument to play tremelo. then you could type in pizz with the text tool, you would have to assign it a value in order to distinguish it from the other text-meta markings such as 'arco' or 'sordini' or whatever. but then IT would change the instrument to play pizz. in the third bar you can drag a stoccato note onto the page and the instrument would change to playout stocatto.
    and the thing is, while you could do that in previous versions of logic, they wouldn't chase. that means now if you stopped the sequencer in the third bar where the instrument had been switched to playing stoccato, and then started it in the second bar around half way through, logic would chase the last meta value - pizz - and so it would switch to pizz.
    so that means you can make your score look exactly right and have it sound exactly right with incredible detail. i don't think any other DAW allows this with such detail.
    i currently use EXS based instruments and program changes to make the switches. thats because i was doing this before 8 when meta values didn't chase. but i plan to make the conversion as soon as i get some down time and update my templates. it works extremely well, and with the EXS, you can have 128 articualtions for one instrument. i currently have 11 in my 1st violins which is about as much as i need.
    some people may advise you that your setup will choke as being not powerful enough - but i would take that with a pinch of salt. i was running very large mock-ups on my old G4 with less than 2GBs of RAM. the key is to optimise and not run vast quantities of things you don't need. i think you won't lose much by trying on your current rig first. but the EXS is much more CPU efficient than 3rd party soft instrument plugs such as VSL, so it could possibly push your machine a bit.

  • JMS XA/ Sequencing question

    Hi,
    Can i ask a question related to JMS.
    I have a project where one of the requirement is that a message when picked up from MQ > BEA JMS > and then persistet into Database needs to be guaranteed i.e either should be rolled back or commited.
    My questions were:
    1) is running the connection factory in XA is the only solution?
    [The reason being, we have had lot of  production problems while running some of our application in JMS XA mode and if possible, we wanted to use non-xa]
    2) is the requirement to have "sequencing" needs to have XA on BEA JMS Bridge (between BEA > MQ) OR we can accomplish "Sequencing" w/o been in XA Tx. ?
    Iam just trying to learn this JMS stuff and if iam asking some stupid question, please do not get offended and ignore my email.
    Your help is much appreciated.
    null

    Hi,
    Can i ask a question related to JMS.
    I have a project where one of the requirement is that
    a message when picked up from MQ > BEA JMS > and then
    persistet into Database needs to be guaranteed i.e
    either should be rolled back or commited.
    My questions were:
    1) is running the connection factory in XA is the
    only solution?
    [The reason being, we have had lot of  production
    problems while running some of our application in JMS
    XA mode and if possible, we wanted to use non-xa]XA drivers are required if you have more than one database involved in the transaction, but in this case there's only one. I have to admit that I haven't tried queue and database in the transaction with both non-XA and XA to see if it made a difference.
    2) is the requirement to have "sequencing" needs to
    have XA on BEA JMS Bridge (between BEA > MQ) OR we
    can accomplish "Sequencing" w/o been in XA Tx. ?The MQ-to-JMS bridge is another unknown to me. When you roll the database back, you expect to see the message put back on the MQ queue, right? Another unknown to me.
    Iam just trying to learn this JMS stuff and if iam
    asking some stupid question, please do not get
    offended and ignore my email.Not stupid at all. I would consider these to be rather advanced questions.
    %

  • Installing Version 11.1.1.3 Plan & Sequence: Questions

    I have to install Essbase, Planning & Financial Reporting Version 11.1.1.3. For now it's one development server with 3 client machines (all developers who will need admin rights). My plan is as follows, please check, I have a couple of questions along the way:
    Check for platform compatibility: Most likely going to be using Windows Server 2003 and default built in tomcat web server. Intend on using EPMA, so IIS 6.0 should be installed first (correct?)
    Download files:
    EPM Installer
    Foundations Services Parts 1 - 4
    Essbase Client
    Essbase Server
    Planning
    Unzip all these files in one folder in the development server. Also unzip the EPM installer and Foundation Services on all 3 client machines.
    For Server Install and Configuration:
    Run the EPM installer on the development server.
    Configure shared services on the development server. Then login to shared services and see if it works and is running. If so, then proceed. If not then come back to forums and SOS for help!
    Configure Essbase and Planning on the development server, using a separate Oracle (or SQL) Database for each. (*For this all I have to do is create a database in Oracle or SQL Server for each component is that correct*? Stupid question but how do you guys usually name those?)
    For client install and configuration
    Unzip EPM Installer, Foundation Services, Essbase & Planning
    Run EPM installer and under "Install By Tier" check mark ONLY the CLIENT products for Essbase and planning correct?
    While configuring shared services use "a previously configured shared services" (the one on the development server)
    How do I configure the database for the client components? Do I point to the one on the development server? Pls clarify this part for me.
    I believe the above are all the steps in sequence. Pls correct me if I'm wrong. Answers to my questions plus any additional tips from experts and experienced users appreciated.

    You are nearly there, the OS and server part seems fine.
    The client part you don't need to configure any database part, client elements are usually just an install and then you are ready to use them.
    It also depends on what client products you want to install.
    If it is the excel addin then there is a standalone install available on "My Oracle Support"
    If it is Smart view then there is a standalone install available.
    If you want to use the essbase runtime client then you would have to extract the files you have pointed out and run the installer and select essbase client.
    If you want the EAS client (though it can be accessed via the web) you would do the same thing with extracting the files.
    Examples of the files that are needed for essbase are available at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch02s02s02.html
    Not sure what other client products you plan on using.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for