Array methods for a total noob-

Well, not exactly a total noob, I’ve got an old project
in lingo/shockwave (where I have over 10 years experience) that I
need to convert to Flash/AS3 (where I have about a week’s
experience). I’ve got the basic navigation and interface
elements working but I’m getting stuck trying to extract data
out of my primary data structure, a two dimensional array. An
example of the first few lines of the array are attached.
My first task is to write a function that can return a new
one dimensional array, brandList, that contains a unique list of
manufacturers (second element of the sub-array, or tireData[j][2])
keeping in mind that tireData is not sorted and will contain
duplicate entries for manufacturers. It seems the filter method
will be part of my solution but so far I haven’t gotten
anything to work. Anyone know of a good tutorial on the subject?

If you want the second element of the array, it is index 1,
not 2. If you want to sort the results, you can use the
Array.sort() method. If you want some code that does the
extraction, study the following, it's one possible approach:

Similar Messages

  • Best method for plotting data array?

    I am reading data from a Delta Motion controller and writing that data to an array in my vb.NET program.  The data is not time stamped but I know what the sampling interval is (0.001s).  I want to take that data and plot it on my Waveform Graph.  What is the best method for doing this?  I'm sure this is simple, but I'm new to MS and LV.
    Private Sub btnRampUpA_Click(sender As Object, e As EventArgs) Handles btnRampUpA.Click
    Dim Axis0ActualPrsData() As Single = New Single(4096) {} 'Create array for data from the RMC controller to be read into
    Dim Axis0Actual() As AnalogWaveform(Of Single)
    If RMC.IsConnected(PingType.Ping) = True Then 'Check to make sure comms to RMC is good before trying to read data from it
    Try
    RMC.ReadFFile(FileNumber150.fn150Plot0StaticUA0, 112, Axis0ActualPrsData, 0, 4095) 'read the plot data where sample period = 0.001
    Catch ex As ReadWriteFailedException
    MessageBox.Show("Unable to read plot data from the RMC. " & ex.Message)
    End Try
    End If
    End Sub
    Thank you

    PlotYAppend appears to be the answer according to the white page, although I don't have it working as of yet.  Can someone confirm?

  • Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    9 hours??!
    Twice the length of a cinema epic?
    How are you expecting to distribute it?
    iDVD encoding settings:
    http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    That was for single-layer DVDs. Double these numbers for dual-layer DVDs.
    Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned abo
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • When bouncing- what's best method for smallest file size/highest quality?

    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality? And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's. I basically need them to be about 3 mb each. Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    If anyone can help I would really appreciate it. Please be detailed in your response, because I am new to logic and I really need the step by step.
    Thank you...

    MUYconfundido wrote:
    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality?
    The highest bitrate that falls within your limits. You'll have to calculate how big your MP3's can be, then choose the bitrate that keeps the size within your limit. The formula is simple: bitrate is the number of kilobits per second, so a 46 second stereo file at 96 kbps would be 96 x 46 = 4416 kbits / 8* = 552 kBytes or 0.552 MB. (*8 bits = 1 Byte)
    So if you know the length of your tracks you can calculate what bitrate you need to keep it within 10 MB total.
    I consider 128 kbps the lowest bearable bitrate for popsongs and other modern drumkit based music. Deterioration of sound quality is often directly related to the quality of the initial mix and the type of instruments used in it. Piano(-like) tones tend to sound watery pretty quickly at lower bitrates, as do crash and ride cymbals. But don't take my word for it, try it out.
    And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    You can only ZIP the whole thing after that, but that is just for transport. You'll have to unzip it again to use it. And no, you cannot compress an MP3 any further and still play it.
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's.
    That is silly, you could have done that in Logic, which has one of the best MP3 encoders built in. And how good encoders are will especially come out at bitrates around or below 128, which you might be looking at.
    I basically need them to be about 3 mb each.
    So, one more scrap of info we need here: how long are those three pieces, exactly? I'll calculate the bitrate for you - but please bounce 'm directly out of Logic as MP3's. They will very probably sound better than your WAV-conversions made with Switch.
    !http://farm5.static.flickr.com/4084/4996323899_071398b89a.jpg!
    Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    Length of the piece? And does the .Wav bounce you have sound OK?

  • Queue access method for In-memory databases

    Hi,
    I am trying to use the Queue access method for an in-memory database
    with no backing file. Here is the how I've created the environment and
    the database.
    int env_flags_create = DB_CREATE | DB_INIT_LOG | DB_INIT_LOCK |
    DB_INIT_MPOOL |DB_INIT_TXN |
    DB_SYSTEM_MEM | DB_RECOVER | DB_THREAD ;
    ret = env->set_shm_key(env, 17);
    ret = env->open(env, R_"in-mem-env", env_flags, 0644);
    int db_flags = DB_CREATE | DB_THREAD | DB_AUTO_COMMIT;
    DB_MPOOLFILE *mpf = subs_db->get_mpf(subs_db);
    mpf->set_flags(mpf, DB_MPOOL_NOFILE, 1);
    ret = queue_db->set_re_len(queue_db, 512);
    ret = queue_db->open(queue_db, NULL, NULL, "queue", DB_QUEUE,
    db_flags, 0644);
    My application has one reader threads and one writer thread. The
    writer write to the queue with the "DB_APPEND" flag and the reader
    consumes the queue using the "DB_CONSUME_WAIT" flag.
    After inserting a few thousand messages the database fails to insert
    any new records and starts returning the following error.
    "unable to allocate space from the buffer cache"
    From the db_stat -e output (attached below) I can see that none of
    the buffer cache pages are ever being freed up.
    149907 Requested pages found in the cache (99%)
    3 Requested pages not found in the cache
    2004 Pages created in the cache
    0 Pages read into the cache
    0 Pages written from the cache to the backing file
    0 Clean pages forced from the cache
    0 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    2004 Current total page count
    0 Current clean page count
    2004 Current dirty page count
    4099 Number of hash buckets used for page location
    153851 Total number of times hash chains searched for a page
    BDB reference manual (http://www.oracle.com/technology/documentation/
    berkeley-db/db/api_c/frame.html) says that the pages associated with a
    queue can only be reclaimed by setting a queue extent by using the
    "set_q_extentsize" method. When I try to use this method on my in-
    memory database I get the following error.
    " Extent size may not be specified for in-memory queue database"
    Does this mean that I can never use the queue access method for in-
    memory database? Because no matter how big of a shared memory pool I
    allocate to the in-memory database it will eventually get used up by
    the queue (if I'm inserting and consuming records) and there is no way
    to free up the pages associated with the deleted records.
    thx
    nina

    As far as I know you can choose any method as long as print setting are set to "send to spool"
    Regards
    Juan

  • Is there a method for counting words?

    Hi!
    Is there a method for counting words?
    How do I read specific data ( row, column ) out of an array?
    Thx
    Lebite

    There's could be a better way, but this is how I would do it:
            String[][] myArray = { {"Blah Blah Blah"},
                                   {"Blah Blah Blah"},
                                   {"Blah Blah Blah"} };
            int tokens = 0;
            for(int i = 0; i < myArray.length; i++)
                for(int j = 0; j < myArray.length; j++)
    StringTokenizer st = new StringTokenizer(myArray[i][j]);
    tokens += st.countTokens();
    System.out.println(tokens);

  • Suggested methods for full backup of XServe RAID data

    I know this is only peripherally related to the discussion topic, but since every other suggestion posted here is followed by the disclaimer that you should make a full backup of your data before proceeding with any major operations on your RAID arrays, I'd like to know what more experienced admins do in order to create a full backup for reasonably fast recovery in case of substantial data loss during maintenance/repair.
    Our current "backup" availability is incremental optical disc archival (our data is mostly "write-once"), but this isn't entirely practical for recovery since it's over a terabyte of data. Since the connected server has a free hot-swappable SCSI drive bay as well as an interface for external SCSI devices, not to mention the fiber channel and ethernet interfaces, the options that I'd consider in order would be:
    1. A handful of 150-500 Gb SCSI hard drives, rotated out of the hot-swappable bay
    2. An external tape drive attached to the SCI interface (with appropriate tape size, maybe the LTO-2 with 200Gb native capacity?)
    3. Some other external SCSI storage device
    4. Larger optical disc archival (I hear there are technologies arriving in the near future)
    5. Network-based option; remote seems impractical due to sheer size, but perhaps local?
    The idea is to make a full backup (long-term solutions are superior of course) of 1-2 Tb of data on the XServe RAID before attempting major surgery. Suggestions for common, accepted, tested, efficient methods for accomplishing this would be greatly appreciated. I apologize if this thread isn't on-topic enough for some of you.
    -Brian

    Brian,
    Tape IMO is kinda yucky (to steal a term from your average 3 year old). It's fairly slow to back up to, it's very slow to restore, and it's actually not that reliable by itself (I worked with a large enterprise customer who said their backups were successful about 70% of the time (!!!)).
    That said, tape has the advantage that you can offsite it and archive it very cheaply, and the media are fairly cheap, so you can make lots of backups, so if one fails, you probably can restore the data from another tape.
    Disks are more expensive initially, but end up being pretty reliable, and you get a lot more flexibility (plus, they're fast).
    An emerging "best of both worlds" backup strategy is what's called disk to disk to tape, where you typically back up to another large "disk," for example a second Xserve RAID. Data is then backed up from the second disk to tape, which is taken offsite... thus tape is used for what it's best at (offsite archival). Restore can be from disk in most cases, which is 10-20x faster than restoring from tape. People use software packages like Netvault's Bakbone or Atempo's Time Navigator, which can handle the whole process, and it works quite well. The backup disks (e.g. the RAID) can be onsite, or can be at a backup site a couple KM away, attached via optical (this is preferable, for DR reasons).
    For cases where a second Xserve RAID is prohibitively expensive, cheaper (and slower) RAID 5 enclosures like Wiebetech's RAIDtech can provide a large (say, 1.6 TB) RAID 5 volume, accessible over FW800 or SATA (not sure if they have a SATA-based one yet).

  • Total noob Q: Can I run virtual machines on a MacBook Pro ?

    My apologies for entering totally green, folks. My last Apple was the first Mac I bought in university, sold quickly, and preceded by a bunch of ]['s. Sadly, I have been living under a rock for 20 years, and just this year spent $200k at IBM for servers etc in a pro capacity ...
    My problem is that I am not gonna buy one more piece of lame Lenovo garbage ever again, and I need a new notebook.
    The time has come where I am considering the change. I'd enjoy it really, to crawl out of this shell.
    Because I am a total noob, the answer to my question is probably so easy for you folks ...
    I need to keep Windows for now. I need to run Linux. I need to VM a few Novell 6.5 servers as I transition them to SUSE, and I have precisely zero MacOS apps at the moment.
    With this said, does it make sense to consider a fully optioned MacBook Pro to take the place of a highest-end Thinkpad, to do the above (and more), using a Virtual Machine technology ?
    My first months with a Mac would probably be spent in virtual machines as I get with the program, but I really do want to get out of this situation that nobody makes a good PC anymore and the best Wintel box seems to a Mac.
    I want to believe. Please help me.

    check
    http://www.kju-app.org/kju/
    Q is a free virtual machine, and can run windows and linux. You can also install win and linux and have triple boot. For information:
    http://wiki.onmac.net/index.php/TripleBoot_viaBootCamp
    MacBook Pro 2.16,ibook g4 1.33   Mac OS X (10.4.8)   wireless mighty mouse and 1/2 ipod nano black

  • Can any one suggest me how to use drawPixels method for 40 series devices

    Hello!
    I am using drawPixels method of DirectGraphics class the code I have written is :-
    Image offscreen=DirectUtils.createImage(width,height,0x00000000);// width and heights are integer value
    public final int MODEL=DirectGraphics.TYPE_INT_8888_ARGB ;
    Graphics offgra = offscreen.getGraphics();
    DirectGraphics directgraphics = DirectUtils.getDirectGraphics(offgra);
    directgraphics.drawPixels(imgData,false,0,width,0,0,width,height,0,MODEL); // imgData is a int array(int imgData[]) which contains required pixels of image.
    The above code is working fine with NOKIA 60 series device but when i use it with NOKIA 40 series device it gives java.lang.IllegalArgumentException.
    same time if i use :-
    directgraphics.drawPixels(imgData,false,0,width,0,0,width,height,0,DirectGraphics .TYPE_USHORT_4444_ARGB ) ;
    // imgData is a short array(short imgData[]) which contains required pixels of image. i have used different formet here.
    it works fine with 40 series device,
    can any one suggest me how to use drawPixels method for 40 series devices with format
    DirectGraphics .TYPE_INT_8888_ARGB .

    If Remote wipe is activated it can't be undone. And Once the Wipe is done, the device can nö longer be tracked.
    Sorry.

  • Alternate method for LSMW

    Hi friends, kindly let me know alternate solution for my problem.
    Q. For transacton code MB11 iam posting the data through LSMW using standard program RM07MMBL(Batch input program). This program is having structure called BMSEG it will accept only one record per transaction.
    In my flat file iam having total 20000 records, due to this iam getting performance issue.
    Could you please tell me alternate method for the same?
    Regards,
    Sreenivasa Babu,
    9866123064.

    Hi srinivas..
    In this Case it will be better to Call BAPI than using LSMW.
    We have the BAPI_GOODSMVT_CREATE which is used to Create Goods movement.
    It will be faster since the Data will not be processed in Screens when we Call BAPI.
    Sample code to Call this BAPI:
    data : gm_header type bapi2017_gm_head_01,
            gm_code type bapi2017_gm_code value '01',
            gm_headret like  bapi2017_gm_head_ret,
            matdocument type    bapi2017_gm_head_ret-mat_doc,
            t_gmitem type table of  bapi2017_gm_item_create,
            wa_gmitem type   bapi2017_gm_item_create,
            t_gmsernumber type table of bapi2017_gm_serialnumber,
            wa_gmsernumber type  bapi2017_gm_serialnumber,
            ret type table of bapiret2.
    gm_header-pstng_date = '20051201'.
    gm_header-doc_date = sy-datum.
    gm_code = '01'.
    wa_gmitem-material = 'SAMPLE'.
    wa_gmitem-plant = '0001'.
    wa_gmitem-stge_loc = '0001'.
    wa_gmitem-move_type = '501'.
    wa_gmitem-entry_qnt = 10.
    append wa_gmitem to t_gmitem.
    wa_gmsernumber-matdoc_itm = 10.
    wa_gmsernumber-serialno = 1.
    append wa_gmsernumber to t_gmsernumber.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gm_header
        goodsmvt_code               = gm_code
      TESTRUN                     = ' '
    importing
      GOODSMVT_HEADRET            =
       materialdocument            = matdocument
      MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = t_gmitem
       goodsmvt_serialnumber       = t_gmsernumber
        return                      = ret
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT  = 'X'.
      write:/ matdocument.
    <b>reward if helpful</b>

  • Arrays.asList for primitives

    Ok, this may sound like a stupid question, but I've checked the java API and searched this forum and cant find an answer, so here goes:
    Is there any equivilent for Arrays.asList for arrays of primitives? I need to get an array of ints in to a list.
    Is my hangover just causing me to miss something really stupid?

    In case anyone in Sun is listening...
    Please provide a class/method for creating human-readable Strings from the following...
    int[]
    byte[]
    float[]
    and any other primitive arrays.

  • Total Noob - Need Advice

    Hey there, I'm a total noob about Macs and I would like to know information on certain iMacs. I'm interested in getting one.
    http://www.argos.co.uk/static/Product/partNumber/5082834/Trail/searchtext%3EIMAC .htm
    Was looking at that, Is it a good version? And will it run high end games no problem.
    Also any other information about macs, ie the Operating Software and what to expect is also welcome, always used windows, and once I get my paycheck on the 26th I'll be getting it
    Thanks for ANY help.
    ~Jack

    If you want to save few £. Visit Comet website
    http://www.comet.co.uk/shopcomet/product/602450/APPLE-iMac-MB950BA?cm_mmc
    On the checkout enter discount code " 6OFF " to safe extra 6%. And u can get this model for £845.06.
    Remember that if you are in Uni. Or anyone u know is a student u can safe 15% on macs.
    http://store.apple.com/uk/browse/home/education_routing?mco=OTY2ODQzMg
    Also visit
    http://www.apple.com/uk/why-mac/

  • Help with a method for battleships

    Hi, I am doing a battleships applet, so far things are going well, except for the fact that I am using two methods of input for my ships, the first one is manual input, the user types in the textfields to place the ship, the second one is by using random number generators to place the ship and define if they are to be place horizontally and vertically. Here is my method for the PC placement. My question is how to write a method, which doesn`t allow the ships to overlap in any way?
    {int a = (int) (Math.random()*2);
                   rowindex[0] = 1 + (int) (Math.random() * 11);
                   colindex[0] = 1 + (int) (Math.random() * 11);
                   showship[1] = true;
                   if(a==1){
                   orientation[1] = true;
                   for(int i = 0;i<bsholder.length;i++){
                   bsholder[i] = (colindex[0]+i);
                   System.out.println(bsholder);
                   System.out.println();
                   else {
                   orientation[1] = false;
                   for (int i=0; i<bsholder.length;i++){
                   bsholder[i] = (rowindex[0]+i);
                   System.out.println(bsholder[i]);
              System.out.println();
                   int b = (int) (Math.random()*2);
                   rowindex[1] = 1 + (int) (Math.random() * 12);
                   colindex[1] = 1 + (int) (Math.random() * 12);
                   showship[2] = true;
                   if (b==1){
                   orientation[2] = false;
                   for (int i=0; i<cruisholder.length;i++){
                   cruisholder[i] = (rowindex[1]+i);
                   System.out.println(cruisholder[i]);
                   System.out.println();
                   else {
                   orientation[2] = true;
                   for (int i=0; i<cruisholder.length;i++){
                   cruisholder[i] = (colindex[1]+i);
                   System.out.println(cruisholder[i]);
                   System.out.println();
                   int c = (int) (Math.random()*2);
                   rowindex[2] = 1 + (int) (Math.random() * 13);
                   colindex[2] = 1 + (int) (Math.random() * 13);
                   showship[3] = true;
                   if (c==1)orientation[3] = true;
                   else orientation[3] = false;
                   rowindex[3] = 1 + (int) (Math.random() * 14);
                   colindex[3] = 1 + (int) (Math.random() * 14);
                   showship[4] = true;
    rowindex and colindex are the arrays I use for the graphical representation of the ships on the board. orientation is a boolean array used to define the horizontal or vertical placement. bsholder and cruisholder are arrays to store the coordinates of the ships. I am currently not using one for 2square ship and 1square ship because this is just a test programm.I am using the System.out.println is not going to be included in the end version. Please help me, I ve been stuck on it for days. I have tried all sorts of for loops includen the "enchanced for" loop but still no luck. Many thanks in advance.

    mpenoushliev wrote:
    Wow, thanks a lot I will try it out, only one last question, should the holder for the ship (the array that has the location of the ship be a 2D array or could I use a standard array and combine that with either the row or col to track the ship. (That is what I am doing now). Once again thank you very much for the help.I wrote a battleship game a few weeks ago for fun, and I created a Board class that has a 2D array of Cells. The Cell class holds a reference to 1 ShipElement, which is a single piece of a whole Ship. The Ship class has a List of ShipElements, and is used to keep track of when whole ships are sunk, etc. The Board class is responsible for placing ships, and it iterates over the Cells. The Cell class has methods that tell you if it has a ShipElement or just Water, and you can use the size of the Board to check you haven't gone over the edge. Hope it helps!

  • Error in Pre- Export methods for a request

    Hi All,
    I am getting an error while releasing a request, its giving
    "Error in Pre- Export methods for a request DM0k.....". Could you please tell me why and how can I rectify that?
    Thanks.
    NA

    Please go through as per the link
    [SAP Transport Request |http://www.sap-basis-abap.com/sapbs008.htm]
    thanks
    G. Lakshmipathi

  • How to find a badi and how to find the method/methods for a transaction?

    Hi all,
    i need to give a text either while creating customer (vd01) or changing customer(vd02)...thsi is via extras->texts.....then I have to double clik the text and go to change editor...and then i have to clik on insert line and then choose text element radiobutton on screen and then give it a name and then save it..this should be done for all customers....my problem is i am unable to find a badi and the appropriate method for thsi..i have placed break point in method read_add_on_data in the badi customer_add_data....i tested both by transactions va01 and va02 but of no use..also there are so many methods..can u tell me how do i find the appropriate method of the appropriate badi.....

    Hi,
       For XD01/XD02/XD03 The following BADI's are useful
    business Add-In CUSTOMER_ADD_DATA  and  business Add-In CUSTOMER_ADD_DATA_CS .
    *<b>Reward points</b>
    Regards

Maybe you are looking for