How to share an array?

I want to share a list of visitors of chat room with SharedObject. I was going to put and array into shared object's field. Is it possible? And also I was realized that it is impossible to synchronize shared array correctly. If two visitors will add themselves to the list simultaneously, then one can be lost.
Is it possible to synchronize access to shared object somehow or the only way is to write server side function to control the array?

Hi,
In the following document go through the section conflict resolution.
http://help.adobe.com/en_US/FlashMediaServer/3.5_CS_ASD/WS5b3ccc516d4fbf351e63e3d11a070f7d df-7ec4.html
I hope this will help you.

Similar Messages

  • How to share an array among members of a package

    I need to share the value of h among members of a package. The values for Byte h are generated by button events in the other program in the package [ sample below ]. That is transformed into ASCII code, h, which ideally should go through SerialWriter and out the serial port.
    private void menuButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
            Charset asciiCharset = Charset.forName("US-ASCII");
         CharsetDecoder decoder = asciiCharset.newDecoder();
         byte h[] = {33, 48, 48, 66, 77, 69, 78, 85, 13}; //brings menu up
         ByteBuffer asciiBytes = ByteBuffer.wrap(h);
         CharBuffer hChars = null;
         try {
              hChars = decoder.decode(asciiBytes);
         } catch (CharacterCodingException e) {
              System.err.println("Error decoding");
              System.exit(-1);
              System.out.println(hChars);
        }                                          Predictably, when trying to run the main member of the package -- listed below -- h is not transferred, hence not instantiated, and I get a Null Pointer Exception. How can I transfer the value of h so that is seen by the "connect" method below? thanks
    package desktopapplication1;
    import org.jdesktop.application.Application;
    import org.jdesktop.application.SingleFrameApplication;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.ByteBuffer.*;
    import java.nio.charset.*;
    import java.lang.String.*;
    import java.io.*;
    import java.util.*;
    import gnu.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.ByteBuffer.*;
    import java.nio.charset.*;
    import gnu.io.CommPort;
    import gnu.io.CommPortIdentifier;
    import gnu.io.SerialPort;
    * The main class of the application.
    public class DesktopApplication1 extends SingleFrameApplication {
            String defaultPort = "/dev/ttyS0";
         * At startup create and show the main frame of the application.
        @Override protected void startup() {
            show(new DesktopApplication1View(this));
         * This method is to initialize the specified window by injecting resources.
         * Windows shown in our application come fully initialized from the GUI
         * builder, so this additional configuration is not needed.
        @Override protected void configureWindow(java.awt.Window root) {
         * A convenient static getter for the application instance.
         * @return the instance of DesktopApplication1
        public static DesktopApplication1 getApplication() {
            return Application.getInstance(DesktopApplication1.class);
        public void connect ( String portName ) throws Exception {
         String defaultPort = "/dev/ttyS0";
            Byte h;
            CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);
            if ( portIdentifier.isCurrentlyOwned() )
                System.out.println("Error: Port is currently in use");
            else
                CommPort commPort = portIdentifier.open(this.getClass().getName(),200);
                if ( commPort instanceof SerialPort )
                    SerialPort serialPort = (SerialPort) commPort;
                    serialPort.setSerialPortParams(4800,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                    InputStream in = serialPort.getInputStream();
                    OutputStream out = serialPort.getOutputStream();
                    (new Thread(new SerialReader(in))).start();
                    (new Thread(new SerialWriter(out))).start();
              out.write(h);
              out.flush();
                else
                    System.out.println("Error: Only serial ports are addressable by this application.");
         public static class SerialReader implements Runnable
            InputStream in;
            public SerialReader ( InputStream in )
                this.in = in;
            public void run ()
                byte[] buffer = new byte[1024];
                int len = -1;
                try
                    while ( ( len = this.in.read(buffer)) > -1 )
                        System.out.print(new String(buffer,0,len));
                catch ( IOException e )
                    e.printStackTrace();
        public static class SerialWriter implements Runnable {
            OutputStream out;
            SerialPort     serialPort;
            public SerialWriter ( OutputStream out )
                this.out = out;
            public void run ()
                try
                    int c = 0;
                    while ( ( c = System.in.read()) > -1 )
                        this.out.write(c);
                catch ( IOException e )
                    e.printStackTrace();
             try {
                     Thread.sleep(2000);  // Be sure data is xferred before closing
                  } catch (Exception e) {}
                  serialPort.close();
                  System.exit(1);
         * Main method launching the application.
        public static void main(String[] args) {
            launch(DesktopApplication1.class, args);
          try
                (new DesktopApplication1()).connect("/dev/ttyS0");
            catch ( Exception e )
                e.printStackTrace();
    }

    Make h global, and make an getH method in that class. And then make an instance of the class containing the getH() method, and call it from the connect() method.
    private byte h[] = {33, 48, 48, 66, 77, 69, 78, 85, 13};
    public byte[] getH() {
         return h;
    private void menuButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
            Charset asciiCharset = Charset.forName("US-ASCII");
         CharsetDecoder decoder = asciiCharset.newDecoder();
          //brings menu up
         ByteBuffer asciiBytes = ByteBuffer.wrap(h);
         CharBuffer hChars = null;
         try {
              hChars = decoder.decode(asciiBytes);
         } catch (CharacterCodingException e) {
              System.err.println("Error decoding");
              System.exit(-1);
              System.out.println(hChars);
        }

  • How to share more than one Time Machine folder

    Hi,
    With Snow Leo Server I found how to find how to share more than one Time Machine Folder but I can't see how to do the same with Lion Server, could you help me with that ?
    The goal of that is to offer one TM folder per user which is located on a dedicated partition in order to limit the size of TM backups per user (150Gig).
    In Lion, in can only share one TM folder for everybody and I didn'tfind if I can set a limit size per user...
    Thank you in advance,

    I have figured out a way to enable multiple backup targets.
    However, it's one of these things I wouldn't want to describe to anyone except true programmer types, because everyone else has a 90%+ chance of messing up their system if they do something wrong.
    It involves turning off file sharing, and then editing the plist files in /private/var/db/dslocal/nodes/Default/sharepoints/
    The gist of it is this:
    a) first create all the share points you later want to use for TimeMachine, and set them up for afp-only file sharing, also create one TM target, which you can either use later, or have there so the system has one entry it knows how to handle. I just made a bogus one that I'm not actively using.
    b) turn off file sharing in Server.app
    c) turn off TimeMachine in Server.app
    d) now you can edit the files, the easiest is with Xcode, so you may want to install that first
    e) for each sharpoint you made in a) there will be a corresponding .plist file in the location indicated, these are the files that need to be edited.
    f) for each of these files
         1) the item0 string property in the timeMachineBackup array must be switched from 0 to 1
         2) a new key of type array with the name timeMachineBackupUUID must be created
         3) in the newly created array an item of type string must be placed with the value of a UUID, which can be created with the shell command uuidgen
    g) make sure all the edited plist files are saved
    h) turn on TimeMachine in the Server.app again
    If all went well, you now should be able to go to one of your networked client computers and see all the time machine share points just created as options for being a time machine target.
    Anyway, if you go that route: be careful, don't blame me if you muck things up...

  • Example on how to set an array as a Global Variable (LV2?).

    Hi,
    I am new to Labview and recently I have been given the task to evaluate labview as our new data acquisition software.
    Let me briefly describe what we currently have set-up and what I need to accomplish.
    We have developed several dll's (created in C) to access the shared memory where the data is located and I have imported these dll's in labview and read them in as one big 1-d array. (There are several 1-d array's that I import but I will try to keep things simple by starting out with one)
    Now I want to share this array to several sub-vi�s, which will I am planning to call from the run-time menu. How can I assign this array globally so that I can access it from any sub-vi?
    For example, lets say
    that my array name that I imported is called ARRAY1 (name created using the local variable option). ARRAY1 is a 1-d array with 10000 elements.
    I would like to access only a few elements of this array on another sub-vi by its name and index number i.e. ARRAY1[10], ARRAY1[20].
    Please let me know if you need any more information.
    I would really appreciate it if someone can help me out.
    Thanks
    Nish
    My E-mail: [email protected]

    Attached is the VIs in LV 6i format...The advantage of those VIs is that they allow you to read and write subsets of the array, not just one element at a time.
    MTO
    Attachments:
    Example.vi ‏27 KB
    ArrayGlobal.vi ‏27 KB

  • How to share an iTunes library

    I have an iTunes library that is probably 90% music I added from CDs I own and the other 10% purchased from the iTunes Store.  Is there a way to copy (or share) this library to my wife's mac on the same network?  Or do I need to add an external drive and move my iTunes media library there for access by both computers.  Also, can all the music be shared on her computer, or only the 90% that I didn't purchase from the iTunes Store? 

    Hi Larry,
    If you are looking to share your music to another computer on the same local network, you may find the following article helpful:
    iTunes: How to share music and video
    http://support.apple.com/kb/ht2688
    Regards,
    - Brenden

  • How to share account with multiple devices?

    3 kids with 3 devices - an iPod Touch and two iPads Mini - family shares one account with Apple/iTunes and one library on our family PC.  They use FACETIME and MESSAGES with their friends, and they all see each others messages and conversations.  How do I fix this?  Is there a setting or a way to create sub-accounts off the family account so they can still share the main library for music and video OR do I have to create separate Apple/iTunes accounts for each kid?  Is there a setting on their devices that can help?  Any help is greatly appreciated.  I'm not even sure the right question to ask...

    How to use multiple iPods, iPads, or iPhones with one computer
    http://support.apple.com/kb/HT1495
    How to Share a Family iPad
    http://www.macworld.com/article/1163347/how_to_share_a_family_ipad.html
    Using iPhone, iPad, or iPod with multiple computers
    http://support.apple.com/kb/ht1202
    iOS & iCloud Tips: Sharing an Apple ID With Your Family
    http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/
    How To Best Use and Share Apple IDs across iPhones, iPads and iPods
    http://www.nerdsonsite.com/blog/2012/06/07/help-im-appleid-confused/
     Cheers, Tom

  • HT1203 iTunes: How to share music between different accounts on a single computer - I tried to use the instructions to configure 2 different windows users sharing the same iTunes library.  I could not get this to work per the instructions.

    I tried to configure 2 windows users accounts using a single library per the instructions in HT1203.  My iTunes library is on an external drive.  I cannot get this to work.  Any suggestions?

    To give other users read-only access to your iTunes library, use the Sharing features of iTunes. Sharing works over the local network as well as on the same computer. See the built-in help for details.
    If you want to give full read/write access to more than one user, see the support article linked below.
    iTunes: How to share music between different accounts on a single computer
    There is a way to share the library without moving it to a secondary volume. If you really need to do that, ask for instructions.

  • Adobe Creative Cloud - How To Share Files With Clients and Colleagues | Creative Suite Podcast: Designers | Adobe TV

    In this episode of the Adobe Creative Suite Podcast, Terry White shows how to share Photoshop, Illustrator and InDesign Files with clients and colleagues and all they'll need is a browser to comment and see your Photoshop Layers.
    http://adobe.ly/10ZjpE4

    Terry,
    I guess I miss something. How can I share a folder of photos? When I return from a shoot, I select 20 of the pictures and need to share them with my client to pick up the favorites. Am I supposed to copy and past an URL for each image separately?
    Sometimes I also work with a colleague, I need to share my favorites with him. Same issue.
    We have tried Adobe Cloud, and then went for Dropbox. There we can share a folder and he can put even his pictures in it as well. That's what I call collaboration. And it is free (unlike Adobe Cloud). If you have some word in Adobe, please tell them to either drop it and make a deal with services like Dropbox, or make it properly.
    Thanks.
    Vaclav

  • How to share documents which are NOT photos?

    I only see how to create a family for IPhoto sharing.  What about documents in folders I create? How to share non-photo items with friends, without giving someone my username&password, which then gives FULL access to everything?  Not Cool; or so user-friendly!

    You could try to send the large audio attachment using Mail Drop.
    See this help page:   Mail (Yosemite): Add attachments
    Send large attachments using Mail Drop
    You can use Mail Drop to send files that exceed the maximum size allowed by the provider of your email account. Mail Drop uploads the large attachments to iCloud, where they’re encrypted and stored for up to 30 days.
    If you have an iCloud account and you’re signed in to iCloud when you click Send, Mail automatically sends the attachments using Mail Drop. Mail Drop attachments don’t count against your iCloud storage.
    If you don’t have an iCloud account, or if you’re not signed in, Mail asks you whether to use Mail Drop (select “Don’t ask again for this account” to always use Mail Drop).
    If a recipient uses Mail in OS X Yosemite, the attachments are automatically downloaded and included in your message just like any other attachment. For other recipients, your message includes links for downloading the attachments and their expiration date.
    You can turn Mail Drop on or off for an account. Choose Mail > Preferences, click Accounts, select your account, click Advanced, then select or deselect “Send large attachments with Mail Drop.”
    It seems not yet to work always reliably, but perhaps you are lucky.

  • I have 2 profiles on one computer. How to share music between the profiles in itunes?, I have 2 profiles on one computer. How to share music between the profiles in itunes?

    I have 2 profiles on one computer. How to share music between the 2 separate profiles in iTunes?

    iTunes: How to share music between different accounts on a single computer
    This might help. info provided by 'b noir'
    iMoz

  • How to share music between different accounts on a single computer

    I am trying to share music on my Mac between two different iTunes accounts.  Can this be done?

    iTunes: How to share music between different accounts on a single computer - http://support.apple.com/kb/HT1203 - relocating iTunes' media folder to a shared area but leaving separate library files - extra tip at https://discussions.apple.com/message/17331189

  • How to share administrator iPhoto library with other users on same iMac?

    How to share administrator iPhoto library with other users on same iMac?

    This is the part I'm referring to:
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    The library stays in the Pictures folder for this.

  • How to share my iTunes Music Library

    My wife and I each have our own iPod and we want to share one Music Library on our desktop computer. I follwed the instructions in iTunes:" How to share music between different accounts on a single computer". This entailed moving the iTunes Music Folder to a publicly accessible location:
    c:\Shared Documents\Shared Music\iTunes Music
    I can access my library, but my wife cannot. I used EDIT, Preferences, Advanced to change the location in her account to the above path, but still no luck.
    The path actually displays as:
    c:\Documents and Settings\All Users\Documents\My Music\iTunes Music
    What to do?
    Tom

    We share a library by using separate playlists for each iPod.
    I'll try to explain.
    If your iPod is connected to your computer And iTunes is up and running , you should see it listed along the left hand side of iTunes. If you single click on its name, you can also change its name.
    1) Create a playlist that you would like associated with that iPod. Give the Playlist a name that is useful to you - perhaps similar to the name you gave the iPod. eg. "Person 1's iPod" and "Person 1's Playlist."
    Go to the EDIT Menu at the top of iTunes and select PREFERENCES
    Click on IPOD tab.
    Click on MUSIC tab
    select AUTOMATICALLY UPDATE SELECTED PLAYLISTS ONLY
    select the Playlist or playlists that you want on that particular iPOd (eg. ""Person 1's)
    That's how We've been doing it.
    If up until now , you've been doing it manually, be aware of what the difference is. (between manual and automatic update)
    If you have nothing in Person 1's playlist, then the result will be nothing in Person 1's iPod.
    You should be able to go back to your old way just by de -selecting those options in the same Preferences area if you don't like this system.
     I hope this helps. Good luck.

  • How to share your itunes library with another person

    how can two people have all the same stuff on their ipods/iphones? we have both bought different things but dont know how to share them

    Hey jimyam,
    Thanks for the question. If you wish to access your music library from multiple devices, anywhere, It sounds like iTunes Match may be the right service for you:
    Apple - iTunes - Match
    http://www.apple.com/itunes/itunes-match/
    With iTunes Match, all your music can be stored in iCloud — even songs you’ve imported from CDs. You can access your music from all your devices and listen to your entire library wherever you are. And you'll also be able to listen to iTunes Radio without ads.
    iTunes Store: Subscribing to iTunes Match
    http://support.apple.com/kb/HT4914
    Thanks,
    Matt M.

  • HT1727 how to share my itunes with my android phone for free?

    How to share my itunes with my android htc and samsung gallaxy phones.At one time paid for but will not sync anymore song.

    Read the directions for your phones to learn how to put music on them.

Maybe you are looking for