A Challenge - Re-Arranging an ArrayCollection

I am displaying data from an ArrayCollection (dynamically generated) into an Advanced DataGrid. The ArrayCollection (of objects) which looks something like this:
{ date:"2009-11-08", visitors:"252678", name:"Sitename1"},  // On this day, Sitename1 got 252678 visitors
{ date:"2009-11-09", visitors:"655378", name:"Sitename1"},
{ date:"2009-11-10", visitors:"452648", name:"Sitename1"},
{ date:"2009-11-11", visitors:"282678", name:"Sitename1"},
{ date:"2009-11-12", visitors:"315267", name:"Sitename1"},
{ date:"2009-11-13", visitors:"695135", name:"Sitename1"},
{ date:"2009-11-14", visitors:"659862", name:"Sitename1"},
{ date:"2009-11-08", visitors:"598754", name:"Sitename2"}, // On this day, Sitename2 got 598754 visitors
{ date:"2009-11-09", visitors:"255378", name:"Sitename2"},
{ date:"2009-11-10", visitors:"268554", name:"Sitename2"},
{ date:"2009-11-11", visitors:"282678", name:"Sitename2"},
{ date:"2009-11-12", visitors:"568754", name:"Sitename2"},
{ date:"2009-11-13", visitors:"695135", name:"Sitename2"},
{ date:"2009-11-14", visitors:"365874", name:"Sitename2"},
{ date:"2009-11-08", visitors:"552678", name:"Sitename3"}, // On this day, Sitename3 got 552678 visitors
{ date:"2009-11-09", visitors:"265875", name:"Sitename3"},
{ date:"2009-11-10", visitors:"452648", name:"Sitename3"},
{ date:"2009-11-11", visitors:"965875", name:"Sitename3"},
{ date:"2009-11-12", visitors:"695135", name:"Sitename3"},
{ date:"2009-11-14", visitors:"365898", name:"Sitename3"},
So I need to re-arrange (dynamically) [not sorting] the above ArrayCollection into:
{ date:"2009-11-08", Sitename1:252678, Sitename2:598754, Sitename3:552678},
{ date:"2009-11-09", Sitename1:655378, Sitename2:255378, Sitename3:265875},
{ date:"2009-11-10", Sitename1:452648, Sitename2:268554, Sitename3:452648},
This Data will be the dataProvider of an AreaChart, so the fastest way is generally the best way to go
Thanks all

var timeKeyed:Object = {}
for each (var datum:Object in arrayCollection) {
    if (!(datum.date in timeKeyed)) {
        timeKeyed[datum.date] = { date : datum.date };
        timeKeyed[datum.date][datum.name] = datum.visitors;
var newCollection:ArrayCollection = new ArrayCollection();
for each (var datum:Object in timeKeyed) {
    newCollection.addItem(datum);
You may need to sort newCollection when you're done. That's left as an exercise to the reader.

Similar Messages

  • Can anyone solve this simple MVC problem with ArrayCollection

    I have very simple application trying to understand how to apply MVC without any framework. There are quite a few exemples on the net but most do not deal with complex data.
    here is my application with 4 files: MVCtest.mxml, MyController.as, MyModel.as and MyComponent.as
    first the Model MyModel.as
    package model
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import mx.collections.ArrayCollection;
    [Event(name="ArrayColChanged", type="flash.events.Event")]
    [Bindable]
    public class MyModel extends EventDispatcher
      private static var instance:MyModel;
      public static const ARRAYCOL_CHANGED:String = "ArrayColChanged";
      private var _myArrayCol:ArrayCollection;
      public function MyModel(target:IEventDispatcher=null)
       super(target);
       instance = this;
      public static function getInstance():MyModel
       if(instance == null)
        instance = new MyModel();
       return instance;
      public function get myArrayCol():ArrayCollection
       return _myArrayCol;
      public function set myArrayCol(value:ArrayCollection):void
       _myArrayCol = new ArrayCollection(value.source);
       dispatchEvent(new Event(ARRAYCOL_CHANGED));
    then the controller: MyController.as
    package controller
    import components.MyComponent;
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import model.MyModel;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.remoting.RemoteObject;
    public class MyController extends EventDispatcher
      [Bindable]
      public var view:MVCtest;
      [Bindable]
      public var componentView:MyComponent;
      private var _model:MyModel = MyModel.getInstance();
      public function MyController(target:IEventDispatcher=null)
       super(target);
       _model.addEventListener("ArrayColChanged", onArrayColChange);
      public function initialise(event:Event):void
       getData();
      public function getData():void
       var dataRO:RemoteObject = new RemoteObject;
       dataRO.endpoint = "gateway.php";
       dataRO.source = "MytestdbService";
       dataRO.destination = "MytestdbService";
       dataRO.addEventListener(ResultEvent.RESULT, dataROResultHandler);
       dataRO.addEventListener(FaultEvent.FAULT, dataROFaultHandler);
       dataRO.getAllMytestdb();   
      public function dataROResultHandler(event:ResultEvent):void
       _model.myArrayCol = new ArrayCollection((event.result).source);
      public function dataROFaultHandler(event:FaultEvent):void
       Alert.show(event.fault.toString());
      public function onArrayColChange(event:Event):void
       componentView.myDataGrid.dataProvider = _model.myArrayCol;
    This is the main application: MVCtest.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:controller="controller.*"
          xmlns:components="components.*"
          width="600" height="600"
          creationComplete="control.initialise(event)">
    <fx:Declarations>
      <controller:MyController id="control" view = "{this}"/>
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import model.MyModel;
       import valueObjects.MyVOorDTO;
       [Bindable]
       private var _model:MyModel = MyModel.getInstance();
      ]]>
    </fx:Script>
    <s:VGroup paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <s:Label fontSize="20" fontWeight="bold" text="MVC Test with components"
         verticalAlign="middle"/>
      <components:MyComponent/>
    </s:VGroup>
    </s:Application>
    And this is the component: MyComponent.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
    <s:layout>
      <s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
    </s:layout>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label fontSize="16" fontWeight="bold" text="My Component " verticalAlign="bottom"/>
    <s:DataGrid id="myDataGrid" width="100%" height="100%" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="mystring" headerText="String"></s:GridColumn>
        <s:GridColumn dataField="myinteger" headerText="Integer"></s:GridColumn>
        <s:GridColumn dataField="myreal" headerText="Real"></s:GridColumn>
        <s:GridColumn dataField="mydate" headerText="Date"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
    </s:DataGrid>
    </s:Group>
    Here is the code to generate the database:
    CREATE DATABASE mytest;
    CREATE TABLE myTestDB
          myid INT UNSIGNED NOT NULL AUTO_INCREMENT,
          mystring CHAR(15) NOT NULL,
          myinteger INT NOT NULL,
          myreal DECIMAL(6,2) NOT NULL,
          mydate DATE NOT NULL,
          PRIMARY KEY(myid)
    ) ENGINE = InnoDB;
    INSERT INTO myTestDB (mystring, myinteger, myreal, mydate) VALUES ('Test', 123, 45.67, '2012-01-01'), ('Practice', 890, 12.34, '2012-02-01'), ('Assay', 567, 78.90, '2011-10-01'), ('Trial', 111, 22.22, '2009-09-09'), ('Experiment', 333, 44.44, '1999-04-15'), ('Challenge', 555, 66.66, '2012-12-21');
    And finally here is the PHP script.
    <?php
    class myVOorDTO
      var $_explicitType = "valueObjects.myVOorDTO";
      public $myid;
      public $mystring;
      public $myinteger;
      public $myreal;
      public $mydate;
      public function __construct()
        $this->myid = 0;
        $this->mystring = "";
        $this->myinteger = 0;
        $this->myreal = 0.0;
        $this->mydate = date("c");
    class MytestdbService
      var $username = "yourusername";
      var $password = "yourpassword";
      var $server = "yourserver";
      var $port = "yourport";
      var $databasename = "mytest";
      var $tablename = "mytestdb";
      var $connection;
      public function __construct()
        $this->connection = mysqli_connect(
        $this->server, $this->username, $this->password, $this->databasename, $this->port);
    * Returns all the rows from the table.
    * @return myVOorDTO
      public function getAllMytestdb()
        $query = "SELECT * from $this->tablename";
        $result = mysqli_query($this->connection, $query);
        $results = array();
        while ($obj = mysqli_fetch_assoc($result))
          $row = new myVOorDTO();
          $row->myid = $obj['myid'] + 0;
          $row->mystring = $obj['mystring'];
          $row->myinteger = $obj['myinteger'] + 0;
          $row->myreal = $obj['myreal'] + 0.0;
          $row->mydate = new Datetime($obj['mydate']);
          array_push($results, $row);
        return $results;
    ?>
    My understanding as to what is going on is: (1) on creation complete the application launch the initialise() function of the controller (2) this function starts the remoteObject which get the data (3) once the results arrive the resultHandler store the data into the ArrayCollection of the model ***this does not work*** (4) even if part 3 did not work, the setter of the ArrayCollection in the model send an event that it has been changed (5) the controller receive this event and assigns the ArrayCollection of the model as the dataprovider for the datagrid in the compoent.
    Of course, since the ArrayCollection is null, the application gives an error as the dataProvider for the datagrid is null.
    What is missing in this application to make it work properly? I believe this is an example that could help a lot of people.
    Even if I change the setter in the model to _myArrayCol = ObjectUtil.copy(value) as ArrayCollection; it still does not work.
    Also, it seems that the remoteObject does not return a typed object (i.e. myVOorDTO) but rather generic objects. I am usually able to make this works but in this particular application I have not managed to do it. Again what's missing?
    Thanks for any help with this!

    Calendar c = GregorianCalendar.getInstance();
    c.set(Calendar.YEAR,2000);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));
    c.set(Calendar.YEAR,2001);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));But it says that 2000 has 53 weeks and 2001 has 52.

  • Need help with Albums style page, having trouble arranging the way I need

    Hello,
    I am creating a my albums styled page for an automotive club website I am working on. I love the way the albums functionality is built into iWeb with the slide shows and automatic linking and everything, its perfect. The trouble I am having is:
    on my Photos page (using my albums-styled) I want to have the albums organized into different categories. like this
    MEETS:
    grid of photo albums from car meets
    PHOTO SHOOTS:
    grid of photo albums from photo shoots
    TRACK DAYS:
    grid of photo albums from track days
    CHALLENGES:
    grid of photo albums from challenges
    and thats it, something so simple is giving me so much trouble, I have not been able to find a way to duplicate the original photo album grid thats inserted by iWeb when you select a my albums styled page. and I haven't been able to find a way for me to space them freely either so that I could at least have the text in-between to separate them into the categories that I want.
    I want to do the exact same setup for my VIDEOS page too with video albums.
    if anyone could explain to me how I could do this it would greatly appreciated thanks

    One possible method would be the following:
    1 - create individual album pages for your Meets, Photo Shoots, Track Days and Challenges.
    2 - do not include them in the navbar.
    3 - create a blank page and add thumbnail images representing each of those album pages. If you want to add frames to them you might want to follow the suggestions in this tutorial: #7 - Converting Photos w/Frames, Drop Shadows and/or Reflections into a Single JPG Image.
    4 - make each thumbnail a hyperlink to the album page it represents. This way you can arrange the thumbnail in whatever layout you'd like and even have some text description below each.
    5 - on each album page turn off the navbar.
    6 - put a hyperlink at the top of each album page and subsequent photo page sending the visitor back to the page created in step 1.
    OT

  • External screen arrangement has stopped 'sticking' after logout on one account.

    I've been using an external screen with my 2006 MacBook 2.1 since forever, but recently the screen arrangement I've set up doesn't stick when I reboot or relogin. It reverts to a previous arrangement, and I have to redo the arrangement in System Preferences each time.
    Is there a way round this short of a new user account?
    thanks

    Reply much appreciated. Although I do not claim to have much knowledge of this type of hardware and software problems but they do give me a challenge. I have been trying various things. while I was doing this, switching the pc on and off, at one point the display on LCD came back.
    When I checked the status in Device manager the error message,'WINDOWS HAS STOPPED THIS DEVICE AS WINDOWS HAS REPORTED PROBLEM (CODE 43) had disappeared and it said.' The device is working properly'!
    I notice that the CPU temp rises upto about 51 deg C, the fan goes crazy (fast and slow)and the temp falls down and fluctuates between 27 and 48.
    The screen goes blank again and come on some time and most times not!
    To me it looks like that the chipset gives up when too hot. 
    I intend to open up the laptop and see if the GPU chip is seated, has good contact with its heatsink etc.
    If anyone has any further suggestions, will be appreciated.

  • I had all my jpeg pictures arranged by mumber. I had to restart my computer and now the pictures are rearranged?

    I had all my jpg pics arranged by #. I had to restart my mac because of mail. Now the jpg icon are out of order. I need the pics in order for someone to make a slide show. I am using a flash drive. How do I get the pics back in order? I have # them 0001, 0002...
    Message was edited by: 1SSS

    Contact support be web chat and have them generate a working temporary serial/ challenge code for the install.
    Mylenium

  • How do you arrange your checkboxes acording to their visibility?

    Hi All,
    I mean in our configuration forms we have many check-boxes and these check-boxes' visibility is changing according to application parameters, licenses etc. So I usually want to display the visible check-boxes by re-arranging their locations to keep the good looking in the screen.
    I wonder how you handle these things ? Do you have some common libraries to these things ? Do you have a procedure that you only pass the data-block and some size restrictions and have it handle all the arrangements for you?
    What is best way to follow for these things ?
    Thanks for suggestions
    Muhammed Soyer

    Yes, it can be a pain if you have a lot of checkboxes. You may consider using a different (stacked?) canvas for the various possible layouts--if there aren't too many possibilities. Then just show/hide the canvas.
    Since you can't have the same checkbox appear on differnt canvases, you'd have to create duplicate checkboxes (with different names and/or blocks). Then your code will have to interact with the checkboxes on the canvas that is current showing. Not sure if that will be any easier though...
    Another possibility is to create non-database checkboxes and rename the prompts as the application requires. Then before doing a commit, copy the non-database checkboxes to respective database checkboxes. Hide the ones not being used (the ones showing will always be in order). The challenge here is keeping track of which nondatabase item corresponds with the database item.

  • Quota Arrangement || Allocated Quantity

    Hi All,
    I am currently dealing with two issues related to Quota Arrangement which are as follows:
    I have a product in APO on which inbound quota arrangement is set. The product is procured from a vendor and purchase requisitions are created on it. The validity of the quota is from 01.01.2000 to 31.12.2014. Now as per the business requirement we need to extend the validity till 31.12.2015. In APO we can't extend the validity of the quota. The other option is to delete this quota and create the new quota arrangement  of desired validity. But the challenge is 32,654 quantity is already allocated to it( in Allocated quantity field, which is as per my understanding the sum quantity of purchase requisitions and purchase orders). If I delete the quota what will be the affects of it ???. How should I proceed with this issue ???
    I have integrated a new product in APO and I am trying to arrange a quota for the same. I created it successfully. There are purchase requisitions and purchase orders created on it. However, I can see 0 in the allocated quantity field. Can anyone help me in understanding the reason behind 0 Allocated Quantity ???
    Thanks,
    Swapnil

    Dear Sethuraman,
    P - Type of procurement (Internal manufacturing, External Procurement).
    S - Special procurement type. For example consignment / sub-contracting.
    Vendor - Number of Vendor Master
    PPI - Your internal plant from which you will be manufacturing the material.
    Ver. - Production version.
    Quota - The quota percentage in which the required quantity is to be splitt.
    Allocated Qty - Total quantity from all purchase requisitions, purchase orders, release orders, and scheduling agreement schedules allocated to a given source of supply. (The quantities of quota-allocated planned orders are also taken into account.)
    Maximum Quantity - Max qty which is to be assigned to this vendor.
    Quota Base quantity - If you get a new vendor in the quota arrangement, the quota base quantity is to be entered here to avoid all requirements being assigned to the new vendor.
    Max & Min Lot Size - The lot size related to this vendor.
    Rounding Profile -
    1X - Mark tick here of the vendor is to be assigned only one lot during a MRP run. (may be due to capacity restriction).
    Maximum Release quantity - Max qty the vendor should be assigned per MRP period.
    No. - Number of periods for which the Max release qty relates.
    P - Period to which this qty relates.
    Pr - Priority determination sequence
    Determining the Quota Base Quantity
    The quota base quantity is used only when you include a new source in an existing quota arrangement.
    Read SAP Help for more details Determining the Source Under a Quota Arrangement - Purchasing (MM-PUR) - SAP Library
    Split Quota issue
    Thanks & Regards,
    Ramagiri

  • Catalog pricing challenge (idml, xml, javascript solution?)

    Greetings,
    I have a very large challenge that i desperately need help with.
    I am working on a 1000+ page catalog with over 30,000 products in it. The pages come to our studio from a master database much like the example image I have inserted below ---> and inline list of product names, images, Specs and Tables. We then apply formatting and arrange the items into a paginated layout. Basic InDesign stuff.
    The problem comes at the end (After pagination of 1000+ pages). These files do not come in with final pricing and we then need to update it to reflect the current pricing for the items. We have been using a plugin that interfaces with our database to flow in pricing and it has worked O.K.(we have had many bugs along the way). We recently updated our database software and the ID plugin that goes with it and have lost the functionality to update pricing (UGGGGHHHH, they are "working on it") which renders this very expensive product useless.      : (    sad face
    We have researched a large number of 3rd party solutions (plugins, software, etc.) to change/enhance our workflow but unfortunately all of them have trouble interfacing with our database software and cannot be implemented without a very large, pricey and time consuming conversion. (trust me, I have done over 15 demos of all the major plugins and services, small to large)
    My solution/workaround for this problem of updated pricing for 30,000+ products perhaps could be a simple solution that goes like this:
    1. Receive ID CS6 files.
    2. Complete pagination of IDCS6 files.
    3. Export .idml for paginated files.
    4. Export a mirrored IDCS6 file from the database with all the same data, images, tables, etc. with updated pricing.
    5. Export .idml from mirrored file.
    6. Convert both .idml files to .zip files and replace the .xml containing the Story Data (Located at Catalog_Paginated.zip\XML\Stories) with the exported Story data from the mirrored files .zip package
    (Located again at Catalog_Mirrored.zip\XML\Stories).
    7. Convert paginated files .zip back to .idml and open in IDCS6 which should now have the new Story data and in turn updated pricing.
    I have tried this and in short I get a file that is hung up and will not open. Keep in mind that i do not do all 30,000 products in one ID file. They are exported in chunks of 20 to 30 products. This works perfectly on a small scale document such as in my attached example pic, but has trouble with a large file with more complex product data and tables.
    This is where i need help. Am I barking up the wrong tree? Am I simply replacing the wrong .xml data in the .idml/.zip file? Is there a JavaScript solution to update/replace the .xml data?
    I feel strongly that the robust data offered in the .idml format (perhaps in conjunction with a scripting solution) can offer an ideal solution in this problem as oppose to pursuing a costly and time consuming transfer to a new plugin/software solution.
    I have some help from a very talented (and very busy) team of developers working on a JavaScript solution but I am pursuing this .idml solution myself and REALLLLLLY NEED HELP as we are falling behind in production as we speak.
    In short, this should be simple. What am i doing wrong?

    lazycarpenter
    I oversee the catalog production for a major autoparts distributor here in the midwestern United States. Our catalog is 886 pages including an index. If you are looking for price updating for InDesign go look at this product called AutoPrice:
    http://www.meadowsps.com/site/details/autoprice_detail.htm
    What you might find unique with this product is the batch processing feature and reporting..In certain cases the reports this software generates has proven invaluable for for my team. If you say your catalog is 1000 pages you could easily update this in or around an hours time (via the batch processing feature). We've used AutoPrice since the dark days when Quark dominated the industry..probably around 15 years. This is also available for CS6 as you mention above. If you do look at this program it would be interesting to know how it turned out for your dilema. Good Luck!
    Doug Fehr

  • Techno Home Design Challenge

    Ok Here's a creative techno design challenge. I live in a three story house with two Mac laptops, three hard drives, two printers, a Trendnet wirelessG router, AirPort Express and Airport Extreme n. My office is on the second floor where the printer/scanner is now, the cable enters on the main floor beside the HD tv and a cabinet that can house a printer and hard drives. What is the optimum arrangement to have the freest access to the internet, hard drives & printers?
    I would greatly appreciate suggestions on this.

    Unfortunately building materials can wreak havoc with any wireless signal and therefore it is extremely difficult to predict a configuration which will be guaranteed to work for you. Take a look at KB 58543, AirPort: Potential sources of interference.
    Ignoring RF interference...
    Either your AirPort Extreme base station (AEBS) or AirPort Express (AX) will need to be connected via Ethernet to the Trendnet router. Depending on how you want to run the Ethernet cable, it could be on a different floor than the Trendnet router.
    The other Apple device can be placed on the other floor. The 2 Apple devices can be connected wirelessly using WDS.
    If the printer/scanner uses a USB connection, it could be connected to either Apple device. Be aware that the scanning function will not be available if it is connected to the AX or AEBS via USB.
    What do you mean by "...the freest access..."?

  • Arranger

    Hello.
    I own a M-audio USB-Midi keyboard and a MacBookPro. Is there any software that allows me to use my keyboard as a professional arranger-keyboard instead of having just tones like Garage-band?
    What I need is something which split the keyboard into 2 parts. The lower part is used to play chords. When I play a chord, the software should play all drums and harmony according to the chord I'm playing.
    Any suggestion?

    Data Stream Studio wrote:
    It sounds like you are seeking auto accompaniment. Logic does not do this.
    Actually Logic can do something in the Environment which was a great challenge personally for me to think about
    Honestly to create such a complex Environment tool is not easy and requires deep researches to solve some major problems to simulate the hardware Workstation Arrange Intelligent Synths. Here are some of the things you need.
    1. Splitting the Keyboard range in "Upper" and "Lower" parts before the sequencer in Click & Ports ( it is not hard using a transformer object ).
    2. Creation of so called "Chord Translator" gear. It is the heart of the system. This gear must recognize the chord (in any position in any octave like the NI Kontakt Akkord Guitar script for example) and translate it to a single note to be able to use the Logic "Touch Tracks" object musically - i.e playing chords not one finger way. The idea is to use the "Touch Tracks" midi sequences as "Style Motifs" like you create "User Styles" in the hardware Style Arrange Synth. I.e you play a chord on the "Lower" keyboard part and it is translated to a mapped "Touch Tracks" sequence note.
    3. Later you need a "Chord buffer transposition range utility" which will transpose the "Touch Tracks" motifs ( which are created in C normally ) according the buffer range settings.
    4. A hold "Midi Latch" tool must care for the "Lower" part layering etc. I have developed one complex "Midi latch" which is also possible in Logic environment. I did not included in the Demo Video below but it works fine with layering patches like strings, organs, choirs, pads etc.
    5. Some "Touch Tracks" midi data block must care for changing the styles i.e Intro, Main A,Main B Fill AB, Fill BA etc.
    6. Logic must run cause of the "Touch Tracks" style motifs.
    As I said it is a great challenge, so I spend some years ago to make some researches and experiments. Finally I could create a working prototype with slight issues I must think about in the future.
    I just exported a short non-voice video of that and a snapshot ( see below ) where I created a frameless window of the virtual keyboard of the Click&Ports so you can watch what chords I input in my external controller. The other non-visible thing is that the "Style Arranger" buttons inc Itro, Main A, Main B etc respond to external CC# so you can control the "Style Arranger" externally - in the video I use my mouse clicking them just for the show.
    *Logic Environment Tool "Style Arranger"* - [DEMO VIDEO|http://audiogrocery.com/video/style_arr.zip]
    !http://img267.imageshack.us/img267/8380/stylearr.gif!
    !http://img59.imageshack.us/img59/4967/aglogo45.gif!

  • Programming challenge!

    This question isn�t a specific Javaprogramming question, instead it�s a more general programming problem/challenge.
    I�m trying to create a football league generator in java. It should be possible to generate leagues with 4 to 24 teams (only even leagues, 4, 6, 8, 10� teams). Every team should meet each other twice (homeTeam vs. awayTeam and awayTeam vs. homeTaem).
    An example:
    A league with 4 teams, A, B, C and D.
    Round 1.1
    A vs. B
    C vs. D
    Round 1.2
    B vs. C
    D vs. A
    Round 1.3
    A vs. C
    D vs. B
    Round 2.1
    B vs. A
    D vs. C
    Round 2.2
    C vs. B
    A vs. D
    Round 2.3
    C vs. A
    B vs. D
    Because there are 4 teams it is easy to calculate the following:
    1: It is necessary to have 2 matches per round.
    2: Total of 12 matches for the whole league
    3: It is necessary to have 6 rounds (12/2) in the league.
    It is also easy to generate all the matches that are going to be played in the league:
    A vs. B B vs. C C vs. D D vs. A
    A vs. C B vs. D C vs. A D vs. B
    A vs. D B vs. A C vs. B D vs. C
    The difficult part is to put the matches in rounds so that every team plays once and only once per round. This is the part that is challenging! Any suggestions how this could be solved?

    Unfortunately, the maths magazine I used to have which has a solution is at my parents' house. I think it's something like this:
    You have n teams.
    1. Arrange the teams in a circle. (So addition is done mod n).
    2. i = 1
    3. Go round the circle, pairing each unmatched team j with the team (i+j). If there's a team left over, they don't play that round.
    4. if (! some sensible termination condition) {i++; goto 2}

  • Challenge #193 (October)

    Grant asked for this to be posted here. Sorry about the confusion.
    I'm now back in Nova Scotia and oh my what a Wild world I am living! Yes we
    *are* seriously looking for a place to relocate to. Looking for a houses is
    very stressful, I am now very tired ... but so far feeling good.
    The down side of all this is that the Challenge is being run from internet
    cafes and airports. This means that I have all my great candidates for the
    challenge are on my home computer and .... well i just drove past a local
    artist's home and this was how she decorated one of her window. PLease have
    fun with this image while you are keeping your fingers crossed in hope I
    will get a good house ...so far they all have high speed internet hook-up
    http://www.cavesofice.org/~grant/Challanges.html
    Present and Past Challenges will remain Until tomorrow at 7:00 pm the then
    the Present will be Past and new images will be posted as Present.
    * Important notice to all the new people in this forum. This is not a
    close shop you are all invited to submit an image. If you don't think you
    are good enough this is your first mistake, I think most have found that
    working on the Challenge has improved their personal level. So young and
    old, hot shots and cool dudes now is you time to post.
    Grant
    Home Pages http://home.cogeco.ca/~grant.dixon
    Challenge Pages: http://www.cavesofice.org/~grant/Challenge
    Photo of the Day http://www.cavesofice.org/~grant/POD

    A colorful starter image from our Challenge host, Grant. Let's see what everyone did with it this week.
    Alex: An interesting trio. I like the way you substituted the vase/shade from last week (thanks for the credit) and #3 is the "cat's meow". Isn't that the castle from the Gnome challenge from several weeks ago?
    Anne: A nice framing job in #1. How was that done? Love the flying bits and pieces in #2. I think the flying shingle in the middle is a nice detail.
    Ben: Great canvas look to your entry. Is that the texturizer filter?
    Bill: Is that a storm shelter door? I like the way you have enlarged the area and reshingled the rest of the house.
    Bob: By and by, Lord in your #1. I was reminded of crop circles when I first saw it. Is that you in #2-I see a camera in hand. I love the faded image and the golden tint of the shingles.
    Cathy: Great effect with the quilt keeping the texture and repeating the patterns in #1. I like the re-arrangement of the elements in your second window in #2.
    Celia: Like the stained glass look of #1, but I really like the flowing patterns of #2. How was that done?
    Charles:The red really catches the eye; I like the framing of the canyon scene with the window frame.
    Jack: A nice three-dimensional house, very well done. Nice way to work the challenge colors into the details of the model.
    John: Effective way to replace panes of the original with the pictures in #1. How did you create the circular part of your #2. Very good job on getting the sides square and the "floor" flat. I always have trouble with my perspective drawings.
    Malcolm: Nice way to blend the Mondrian style with the challenge elements.
    Marilyn: The lamp chimney and flame adds an old-fashioned, country look to your entry. I'm sure the flowers are as fragrant as they are beautiful.
    Nancy: I like the frame and the way you've added the texture to the image-how was this done?
    Pat: Nice use of the umbrellas to add a different dimension to the challenge entry. Love the floor idea in #2 and the replacement scene of the window.
    Red Sky: Great effect in your #1 depot shot-please tell us how this was done. I laughed out loud with your rest stop in #2 and #3.
    Rita: Wow, what a burst of color behind your globe-would you mind sharing your technique? Any signifigance to the wrench or is that a spanner outside the US?
    Steve: What a creative idea to turn the wood pieces into book titles. Must have taken a lot of time to type and align the various titles. I think "Bermuda Triangle" is my favorite.
    Susan: I like the "building block" in your #1, but the topiary couple in #2 "leaves" me speechless. What a great interpretation.
    Tab: Your usual great work. I love the framing technique with the shingles.
    Tracy: An exhibit worthy of any museum. Is that you behind the camera?
    Tricia: What a creative idea to turn the challenge into a flag. Love the wiggly, wavy addition. Likely a voter's favorite if we took a "pole".
    Wendy: Like mother, like daughter. A nice family portrait of the Frames' family in #1. Great box in your #2; I remember saying you had a new tutorial on box making. I am guessing this is from that tutorial.

  • Challenge 216

    Late again! This relocation is causing me all sorts of scheduling
    problems! Seems the move has a mind of it's own. We are getting to the
    point to of OMG this is really happening.
    The Challenge is presented by Byron Gale. Byron's Challenges are
    always great and this one is no exception. Please have fun.
    http://www.cavesofice.org/~grant/Challenge/Challenges.html
    Present and Past Challenges will remain Until tomorrow at 7:00 pm the then
    the Present will be Past and new images will be posted as Present.
    * Important notice to all the new people in this forum. This is not a
    close shop you are all invited to submit an image. If you don't think you
    are good enough this is your first mistake, I think most have found that
    working on the Challenge has improved their personal level. So young and
    old, hot shots and cool dudes now is you time to post.
    Grant
    Home Pages: http://www.cavesofice.org/~grant/Challenge/index.html
    Challenge Pages: http://www.cavesofice.org/~grant/Challenge/Challenges.html
    Creativity is so delicate a flower that praise tends to make it bloom, while
    discouragement often nips it in the bud. Any of us will put out more and
    better ideas if our efforts are appreciated.
    Alexander Osborn (1888 - 1966)

    I know that Bob has done a round-up review, but I feel compelled to post my
    own, since I was fortunate enough to have my image selected for the
    challenge.
    Alex Barna - Both guitars look perfectly natural in the image. That second
    one is missing its strings, though. Great idea with the fingering chart,
    too.
    Ben Mills - Giving the background a "whitewash" really makes your nice
    coloration stand out.
    Bill Zingraf - I don't really know how to describe what you did, but I like
    it... almost like a painting that got wet. I'm having a premonition about
    those on-lookers, too.
    Bob Warren - The mixed, sketchy style looks great, and the see-through
    hombre is too cool!
    Celia Bircumshaw - I'm sure my mom would have liked to have a building in
    the yard she could have sent me to, when I was playing with my guitar in Jr.
    High School! He looks relaxed.
    Charles Young III - The disembodied hands and guitars make me think of the
    Haunted Mansion at Disneyland, for some reason.
    Chuck Fry - Those colors look really nice on him. I see he's wearing his
    best sombrero to the ring!!
    Dave Dahlberg - Looks like all three of them got their moustaches from the
    same place! Nice job fitting the perspective of the canvas to the wall. I
    guess gnomes can sleep through anything?!?
    Donald McLean - That golden tone was an attractive choice to go with the
    leafy background... like he's strumming while the sun goes down.
    Ellen Heinemann - FINALLY, a diet I can stick to... He's so svelt!!
    Jancy - What a nice sketch!! The way you brought the light in from the four
    edges is a fantastic touch.
    Jodi Frye - It looks more real than the photo... the subtle coloring
    blending with the backdrop and haze... que suave!
    John Earl - Sittin' in on a couple of sessions... Looks like he does
    everything from "salsa" to "hard rock"!! Out of this world... Freedom Rock!!
    Juergen Dirrigl - You sure gave him a cool new "ax" to play!! Hmmm... seems
    familiar. Hope he's got a "permit" from the policia to be playing on the
    street!
    Malcolm Denton - You really brought out the texture with that close-up.
    Pat Coggin - A south-of-the-border version of "Duelling Banjos"?
    Red Sky - Steven - Ay-ay-ay!!! I almost missed the 6th element. Looks like
    Curly has been spending too much time with (on) the chiflado. That bushman
    will have to figure out what's brewing if he wants to be Amazed... Thanks
    for putting so much into this!!
    Rita Gremmel - The turquoise and bronze colors go together so well, and you
    came up with a very nice design.
    Rusty - No longer will I pick the shoe... from now on, my token will be the
    "Mariachi gordito"!
    TAB Allen - Your borders are always a signature element, and this one is a
    fine example. He looks surprised!!
    Ward Grant - What a stack... twin towers!!! And a great colorization, too.
    The "divided light" rendition would make a great wall arrangement.
    Wendy Williams - Twins? Triplets? Neopolitan? ¿Dónde están los sombreros?
    All of them are finely done!
    Thanks, again, to Grant Dixon for hosting the party!!!
    Byron

  • When creating new track in stereo... track opens in mono in arrange window

    Since upgrading to 8.0.2...weird things are happening to previously saved projects. Stereo tracks are opening up mono and affecting following track. When creating new tracks in stereo.... tracks open mono. I don't know if this is due to 8.0.2 but all these freaky things have happening since. Also, when previewing Apple Loops, I can only hear it on one side, but Loops sounds fine once dragged to arrange window. Is this common or is my computer haunted ? Should I call Ghost Busters ? HELP !!! lol

    Hi there,
    I'm having the same problem as well: creating new tracks results in a mono software instrument, not the usual stereo software instrument. BUT... "Universal Track Mode" is already checked in my Audio prefs. I unchecked & rechecked it, but to no avail... I'm still only getting mono software instruments.
    Any other ideas? No changes have been made to my system, and I'm running the latest version of Logic Pro.
    Kirby

  • I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder

    Add new photo to existing calendar folder in iPhoto
    I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder, but the picture does not show up on the scrolling menu of pictures at the left of the calendar-making page. This happened last year and in frustration I started all over again. But surely there is a way to add a new picture to a calendar that is already laid out.

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

Maybe you are looking for