Observable and Observer

I am trying to use Java Observable and Observer to notify the change in one object to other.
So i have to extend Observable class on the object which i want to montior on and
my observer class implements the observer to listen toupdate.
I have achieved the basic Observable and observer running.
Where I am having problem is, I couldn't figure out how to monitor, lets say 100 instance of the same object, with one object? I am not even
sure whether it is possible or not, if yes, can somebody tell me how
this can be achieved.
what i want to do in code
//The Observable class
public class Foo extends Observable {
    public void setFoo(String abc){
         //blah blah
         setChanged();
          notifyObservers();
//Observer class
public class observeFoo implements Observer{
    public void update(Observable o, Object oo){
        //blah blah
}Lets say i have 100 threads running each holding one instance of Foo
class. Is it possible to observe all those Foo instance running on each
thread by one observeFoo class? If yes how?
any help will be appreciated.
thanx in advance.

Just add the single Observer as an observer to all the observable objects. NotifyObservers() will do the rest.

Similar Messages

  • My observations ( for people that have indexing and connection issues )

    Since cisco takes an awful lot of time doing anything about these problems i decided to investigate the box myself today.
    I followed advice from various threads and did some digging aroudn with network traffic snoopers and some other tools.
    First ( and this is buried somewhere deep in the documentation ) you can NOT have ANY file or folder name that is longer than 32 characters. This is a limitation of the stupid linux they are running on ! If you have a file with longer name or foldername it may screw up the indexing.
    Second : file and path names can only have alphanumerical characters and numbers and spaces in them. DO NOT USE ANY other character. it messes up the indexing  I had folders named -= folder 1 =-. they never got indexed. as soon as i removed teh  -= and =- the indexing kicked in .... This is again a twonkyvision / loonix problem
    The box has tremendous problems with ghost devices on the network. I have on my network at home : 4 pc's running XP ( some pro some home edition )  2 laptops with Vista. One box with Win7. One Windows home Server. One linksys Skype phone , One Roku soundbridge, one Dlink DNS323 , one ADS network drive , one Simpletech Simplestor , A HP color laserjet , a Hp 6250 , 7650 and some other HP network printer. Thru the wireless link my PDA ( iPaq) and iPhone connect once in a while too. My blu ray player is also hooked up (netflix streaming). And then there are various experimental systems ( i am an electronics engineer and i have built some gadgets that are network connected that allow me to remotely turn on lights monitor temperature etc. )
    Now , the NMH does not detect correctly most of the devices. It keeps on trying to feed information to the printers ... it also tries feeding information to other NAS devices as well as to the Windows Homeserver ... It falsely identifies one of the printers as a dlink ethernet connected dvd player ...
    It also has problems with devices that use static ip addresses on the network ( i set up the printers and other NAS devices with hardcoded ip addresses. so no dhcp )
    So here is what i did : go to twonky configuration ( port 9000 see tony's article )
    Step 1 : Yank out the ethernet cable to ANY OTHER DEVICE except the pc you are working on , your router and the NMH <- this is important
    step 2 : Hit the button to erase all the devices it discovered.  (reset list)
    Step 3 : hit the SAVE button
    step 4: UNCHECK the box next to the 'reset list' button
    step 5: hit the SAVE button
    Now , on the left hand side click on Maintenance
    Click on ALL checkboxes under Log level. they should ALL be checked
    Hit the Clear Logs button
    Hit Save changes
    Hit RESTART server. you wil get a file not foound error page. you will see in your browsers titlebar that the url changes to an ip address with some text behind it. remove all that text and key in :9000 and hit return. it will take you back to tonky. ( i don't know how important this step is , but i did not go in throught the device name , i used the ip address from this point on. normally it should not matter but you never know ( i have a suspicion i will explain later )
    Write down this IP address. it is usefull to know.
    Now since we are back in wonkyvision ( stupid half baked program ) Go back to the maintenance screen.
    now hit the rebuild databse button.
    You should hear disk activity now.
    Hit the Show log  button once. the log files should open.
    you can refresh this screen by hitting the reload button in your browser.
    you should see messages fly by like
    21:14:40:317 LOG_SYSTEM:fsmon_add_watch inotify_add_watch (12, /share/media/photos/Moorea May 1998) returns 2045
    21:14:40:317 LOG_DB:watch wd=2045 added on /share/media/photos/Moorea May 1998
    21:14:40:379 LOG_DB:upnp_folder_watch_add_dir /share/media/photos/Moorea May 1998/New Folder
    thnis means it is probin the entire directory structure and adding files and paths.
    Let it run for a while. hitting refresh on your browser once in a while. it took a couple of hours on mine ( 76000+ pictures ... ) and a couple of hundred songs + some videos.
    once disc activity ceases : go back to twonky port 9000 , go in to maintenance and hit Clear Logs button.
    HitSave button
    Hit restart server. you will again get an error page. get rid of the rubbish behind the ip address.and key in :9000
    go to the clients and security page.
    Make sure Automatic discovery is still turned OFF ( if it is on you will see in the logbooks that it attempts several times a second to connecto to anything it can find. Since the detection process is flawed it bombs out. this may overload the poor cpu in the NMH... )
    Hit the reset list once more
    hit save
    Now turn automatic discovery on and hit Save.
    go back to maintenacne and hit restart server. again on the error page : erase the garbage after the ip address and go back to port 9000.
    if you now go back to client/sharing page you should see 2 possibly 3 device. one is your router , one is the pc you are working on, and the last one is the same ip address as you see in the browser. ( the ipaddress you are using to talk to the nmh )
    make sure all the checkboxes before these devices are checked. and hit the save button once more.
    at this point i unchecekd the automatic discovery and hit save once more. i go back to maintenance and hit restart server for the last time.
    At this point the nmh restarted twonky and immediately there was a ton of disc activity. i opened the normal nmh user interface and lo and behold : the green spinning arrow started to move and progress was going forward. it increased 1% roughly ever 10 seconds or so. when it finally hit 100% everything was there. as it should be.
    Now. speculation on my part
    - this thing has trouble with long file names and non alphanumerical characters.
    - this thing has trouble with device it incorrectly identiefies or cannot identify. this screws up wonkymedia.
    - the communication between the process on the NMH (that serves the flash user interface running on your browser ) and winkymedia is going through a network port itself. There are problems. thye do not do inter process communication but go via network messages... ( this is kind of dumb as it loads the network... )
    proof :
    21:01:03:625 filescanner thread started
    21:01:03:628 LOG_SSDPSDP_notify_packet ### SSDP sending:
    NOTIFY * HTTP/1.1
    HOST: 239.255.255.250:1900
    CACHE-CONTROL: max-age=99999
    LOCATION: http://192.168.1.66:9000/DeviceDescription.xml
    NT: urn:schemas-upnp-org:service:ContentDirectory:1
    NTS: ssdp:alive
    SERVER: Linux/2.x.x, UPnP/1.0, pvConnect UPnP SDK/1.0
    the filescanner sends messages through network port 1900 to the NMH. Since the filescanner is running on the NMH ... i also have no clue what 239:255:255:250 at 190 is ...
    i also see sometimes the following messages fly by
    21:01:03:894 [Error] - LOG_HTTP:HTTP_get_header Cannot receive header, clientSocket=13, nBytesReceived=0
    21:01:03:894 LOG_HTTP:HTTP_send_receive received no header in HTTP_send_receive, propably client closed socket, URL=http://192.168.1.66:9000/
    my suspicion is that , since the various processes running on the NMH ( the indexer , the UI server and all the twonky processes) all intercommunicate through the network port , this is a problem. if the network settings get corrupted ( because false identification , notwork overload or whatever ) the thing jams up.
    by cleaning out all the false identieis , letting it identify itself ( important for its own process communication ) and a pc , and then turning off the detection .this solves that problem.
    limiting the filesstem to 'clean 32 char max' names solves another problem.
    I also see a lot of keep-alive message fly by on the netowrk ( several a second. )
    i eventually plugged in my other computers and the roku , let it autodetect for a while and turned this feature back off. Then i plugged in all other devices the NMH has no business with.
    So far it still works fine.
    I still do see a ton of messages fly by where the NMH is probing the network on existing devices. tey come back with 'device already validated
    21:01:04:140 LOG_CLIENT_DB:The entry found in known clients list is already validated (ip=192.168.1.76)
    21:01:04:140 LOG_CLIENT_DB:checking http header for entry ip=192.168.1.76, mac=
    21:01:04:140 LOG_CLIENT_DB:Checking http header to find a matching client.db entry (ip=192.168.1.76)
    21:01:04:141 LOG_CLIENT_DB:Ignoring client with fixed flag = TRUE (ip=192.168.1.76)
    ( .76 is the pc i am working on right now. )
    i don't know why they keep probing. i am not streaming anything and auto detect is turned off ..
    anyway i will keep you guys posted on how this evolves.
    One thing is for sure. this is another half baked ' broken source' based system.

    further observations :
    22:24:31:868 LOG_CLIENT_DB:checking http header for entry ip=192.168.1.66, mac=
    22:24:31:868 LOG_CLIENT_DB:Checking http header to find a matching client.db entry (ip=192.168.1.66)
    22:24:31:869 LOG_CLIENT_DB:HHetting client adaptation to 49 (ip=192.168.1.66)
    22:24:36:878 LOG_CLIENT_DB:The entry found in known clients list is already validated (ip=192.168.1.66)
    22:24:36:878 LOG_CLIENT_DB:checking http header for entry ip=192.168.1.66, mac=
    22:24:36:878 LOG_CLIENT_DB:Checking http header to find a matching client.db entry (ip=192.168.1.66)
    22:24:36:879 LOG_CLIENT_DB:HHetting client adaptation to 49 (ip=192.168.1.66)
    22:24:37:926 LOG_CLIENT_DB:The entry found in known clients list is already validated (ip=192.168.1.76)
    22:24:37:926 LOG_CLIENT_DB:checking http header for entry ip=192.168.1.76, mac=
    22:24:37:926 LOG_CLIENT_DB:Checking http header to find a matching client.db entry (ip=192.168.1.76)
    22:24:37:927 LOG_CLIENT_DB:Ignoring client with fixed flag = TRUE (ip=192.168.1.76)
    22:2
    thisnthing keeps on probing itself ... i wonder why. (.66 is the NMH  .76 is my pc ... ) it is also strange it cannot retrieve its own mac address....
    Oh , you can turn off the logging features again when done. it only takes time and diskspace on the NMH
    And before i get flamed : the comments i make about 'broken source' : i have no gripe with linux. I have a problem with companies that grab a bunch of stuff that is free ,slap it together, sell it for a lot of money and give no support to the people that bought it. They want all the money for no effort .. they turn open source into broken source ...

  • I cannot seem to find out if I have one or two accounts by mistake?with the Guardian, my  subscription seems to have doubled. I stopped it now I cant find out  which one I had. I wanted the Guardiain and the Observer combined but on  the ipad and mac.

    Looking at my apple or itunes account it read two different dates for collecting my Guardian and Observer subscription. Being wowrrried I was paying for it twice I cancelled it. Now  how do i find out if I was over impetius or should just start again?Also can one get this double subscription to be on both the Mac and on the ipad?

    Looking at my apple or itunes account it read two different dates for collecting my Guardian and Observer subscription. Being wowrrried I was paying for it twice I cancelled it. Now  how do i find out if I was over impetius or should just start again?Also can one get this double subscription to be on both the Mac and on the ipad?

  • Suggestions, Observations and problem with Time Capsule shares

    *Some Observations*
    The Time Capsule can take a long time to become active. This is especially true if using an extended or WDS network. I would suspect this is due to the negotiation between devices that it needs to do. I have on occasion believed it to be hung, only to find that after walking away for a bit it comes up. This also impacts devices showing up in the Airport utility.
    Using a time capsule with one Airport Express B/G will work, but adding a second creates problems.
    Extending a network with an Airport Express N seems to work well.
    Best bet is to set up separate B/G and N networks and run your N network as N only at 5Ghz.
    WEP provides no real security, so think of it as you would an open network.
    *My Issue*
    I am having an issue where the time capsule shares become unavailable. It is an intermittent issue, and I have been unable to identify a test case. This happens for devices connected over ethernet as well as wireless. The Time Capsule shows in the Finder list, but the volumes are not available. Connecting to them fails.
    The device also appears in the Airport Utility list, but when clicking on Manual Setup, or guided set up, it causes a hang.
    This results in Time Machine hanging when trying to initiate a backup.
    I have also noticed that when this happens, the signal does start to get a bit flaky with "Roam (Beacons Lost)" messages. Wireless connectivity still seems to be very useable though. I can connect to other network shares through the Time Machine, but not to the shares on the Time Machine. The only way to recover from this is to power cycle the Time Capsule.
    One thing I want to investigate more tonight is whether there are any issues with my keychain and old passwords in case there are multiple failed attempts in the mix that are doing something. Although I know of no lockout feature on the device.
    Any suggestions would be appreciated. This is the second Time Machine, so I have seen this on two different devices. I am also seeing this issue across 4 different computers simultaneously, some via ethernet and some wirelessly. Time Capsule is 7.3.2

    Hi,
    I have pretty much the same problem, 1TB Time Capsule that works fine most of the time as a wireless router. Up till recently Time Machine backups just worked (as one would expect them to) wired and wireless. I went away for a week came back and now every time Time Machine invokes a back up process all of a sudden my wireless network goes down, Time Machine can no longer see the Time Capsule and all other devices (iphone / apple TV other non apple devices) no longer have connections (they see wireless but no pass through to the internet or each other).
    I have tried resetting all sorts of stuff, re-deployed my network, changed IP / LAN settings to make it less complex, Yasu'd my mac, connected only via wires, cleaned out my keychain etc etc and still get the same problems and as per Chris's point airport utility also hangs and the only solution is rebooting the time capsule.
    I am fairly frustrated with this! any suggestions / help would be gratefully accepted.
    thanks
    alex

  • Pages to ePub observations and hints

    I've been experimenting with exporting ePubs. Here are some things I have have found that may help others.
    These observations are based on Pages v4.1 and iBooks v2.0.1
    These truths might be invalidated when new versions of Pages and/or iBooks appear.
    There may be subtle distinctions and/or situations where these observations don't work as described. Or maybe for some of them, I have gotten close to the truth but not fully realized it completely yet. Experiment with them at your will.
    1. Pages does not and will not insert any "page breaks" (or css causing that effect) in an ePub file per se. When exporting to ePub, Pages ignores any and all page breaks or section breaks you insert into a Pages document. Instead, it splits what it considers to be chapters each into separate xhtml files within the created ePub container. It seems that iBooks is hardcoded to automatically display each xhtml file beginning on a new "page."
    2. According to Apple's "ePub Best Practices" document, Pages considers chapters to be delimited by instances of text of the style "Chapter Name". I have found that changing the name of that style does not effect the resulting ePub. Therefore, it is not the style's name that informs pages to use it as the chapter delimiter. Instead, I have found that Pages will look at all the styles you have marked as to be included in the TOC (hereafter called "TOC-included-styles"). Whichever one of these happens to be used first in the document, will be the style that Pages will use to parse chapters, unless the first TOC-included-style used is named "Chapter Number". In this case, that instance of "Chapter Number" is skipped over when considering the style to use as chapter delimiter, and the next TOC-included-style found will be used.
    3. Unlike "Chapter Name", the style named "Chapter Number" is required be to named "Chapter Number". This style further affects the splitting of the xhtml files, and therefore, iBook's rendering of "page breaks". An exported ePub will normally be split into xhtml files at the first character of all instances of "Chapter Name". A document that also includes any "Chapter Number" instances will be split at the first character of those instances. The rule, in plain english, would be: split into xhtml files at instances of 'Chapter Name', but if any particular 'Chapter Name' instance has a 'Chapter Number' instance before it, back up and make the split immediately before that 'Chapter Number'. If a "Chapter Name" instance has more than one instance of "Chapter Number" before it, the split will happen at the earliest instance of "Chapter Number" until a previous "Chapter Name" is found. If the last "Chapter Name" instance in a document has any "Chapter Number" instances after it, there will be no split at those "Chapter Number" instances. Any other styles in between any of these instances are preserved, so you could have a new page in iBooks with a chapter number, followed by some text, then the chapter's name.  If you rename the  "Chapter Number" style to something else, it is then considered like any other style and has no affect on resulting ePub structure.
    4. If you insert a TOC into your Pages document, it is ignored for ePub export. The TOC created in an ePub will include whatever styles are checked in the Document->TOC inspector. The ePub TOCs as generated by Pages seem to have only two levels of indentation. The high level is the chapter level, as described above, whatever TOC-included-style appears first in the document will be the chapter delimiter and be the least indented level of the TOC. All other TOC-included-styles, no matter what they are named or how they are configured in Pages, will be placed at indent level two in the resulting ePub's TOC. So, a style does not need to be named "Heading" to be included in the ePub TOC, it just needs to be a TOC-included-style.
    5. You can add however many images you want to a chapter, but if the combined file size of the images in that chapter add to more than 1Mb, then the resulting ePub will not display any of the images which cause the size of that chapter to surpass 1Mb.
    6. There is talk that a "magic" resolution for images is 600x860 in order to have them occupy a full "page" in the resulting ePub. I have found that any image whose pixel resolution fills the iBooks page viewport will do that, if the image is also set to cause wrap-with-clear-space on the left and/or right. The iBooks viewport seems to be 368x569 pixels when the iPad is held in landscape orientation. So in other words, no matter how large your image is, when viewing on the iPad in landscape mode, it will be at the most 368x569 physical iPad pixels. Therefore it seems to me, if you only wanted to view a book in landscape mode, you could make all your images exactly 368x569, and not larger, making the resultant ePub file as small as possible. But you'd probably want to design the book for portrait mode as well. In portrait mode, the viewport seems to be 547x???. Where I have not taken the time to deduce the exact vertical viewport dimension, but I know it is close to 780px, either way, the image can be smaller than 600x860. iBooks will shrink any image larger than the viewport at hand (portrait or landscape) to fit the viewport. If the aspect ratio of the image differs greatly from the viewport, the image will appear "letterboxed" because the aspect ratio of the image is maintained as it is shrunk to fit the page's viewport.
    7. The margins of your Pages document, whether they be document-wide margins, or margins within a section, don't seem to affect the resulting ePub. The document-wide-margins and the layout-margins (in a section) can be set to zero. The on-the-ruler margins can be at the edges of the "paper." Extranious tabs on the rulers can affect things. I find it is best to drag all tab stops off the rulers.
    8. Tables are problematic. They are not good constructs to put in ePubs. Pages will dimension tables/columns width based on percentages. So if the overall width of your table drawn in Pages happens to be 50% the width of the "paper", then in iBooks on the iPad, the table will be 50% of the width of iPad's page viewport. An 8.5x11 "sheet" of paper shown in Pages is typically defined as 612 pixels wide* (change your Pages ruler units preferences to Points to verify, the Document inspector will show the page size in pixels). So if you draw your table half the width of that sheet, you get a table 306px wide in Pages. That's pretty good, you can fit a bit of text in a table that wide. But now you export to ePub, and since the iPad's (landscape) viewport is only 368 pixels wide, your resulting table is 50% of that, or 184px wide. Since the size of the text hasn't changed much, now everything is wrapping and going crazy. Column widths are also generated as percentages of the table's width, so a column that fits its content nicely in Pages is now too narrow in the ePub. Confusion ensues. Incidentally, the above assumes your document left and right margins are set to zero, if not, the percentage of width is calculated between the margins, not the edges of the page. What you can do is make the table 100% of the width of the page, in that case the resulting table in the ePub will always be 100% of the width of the page viewport on the iPad. For a bit of left and right margin, you can throw in an empty column to the left and an empty column to the right of your table's content, then shut off the border lines for those side columns so they aren't seen. This won't solve your problems, but might take some of the pain away. If a user cranks the font size up as high as it will go on the iPad, no table remains standing.
    * if you do any measuring with on-screen rulers, make sure you set Page's zoom to 100% first, as it defaults to 125%!
    9. If you want to get a clue as to how your book will flow on the iPad (in landscape mode for example), you can temporarily set your document's Page Size to be 368x569 pixels (will all margins set to zero). You set Page Size and Margins in pixels (in inspector) by first changing the ruler units to Points in Page's settings. Be careful though, it's an approximate result, not exact WYSIWYG, the words won't end up exactly where you see them.
    10. If you have read thus far, you probably already know that the first (on-screen) page of a Pages document can be used to automatically create the ePub's cover image upon export. As mentioned elsewhere on the 'net, floating images can be used on this first page (if they are used elsewhere they are ignored). I have found that shapes, specifically floating shapes can be used on the first page as well. You can even use background shapes! This unlocks the door to creating some truly nice covers with a minimum of work. I have here attached an image of a cover I created in just a couple of minutes without using Photoshop or any other image editor, just Pages. I will describe below how it is done
    All the objects on the first page (shown above) is set to floating or background, therefore, you need to move the inline text to the next page. You can do this by inserting a section break. You can see it in the upper left corner. That forces all the text to be shuttled off to next page, out of the way.
    First I created the swirly pattern background. To do so, create a box shape on the page and immediately set its Placement properties to "in background". Keep "background objects selectable" and resize it to cover the entire page. Remove any border or shadow from it. Then set its Fill to any seamless pattern you like. Keep the pattern pixel dimensions small so as not to create a large ePub. This particular swirly pattern I created very quickly for free at patterncooler dot com. Set the fill properties to "Tile" so that your pattern is tiled throughout the whole box shape. Now you can uncheck "background objects selectable" so that you can work on top of it without disturbing it.
    The size of the pattern repeat itself is important to consider. The book cover will be seen in two places: on iBook's bookshelf (small), and opposite the table of contents in the book itself if the iPad is held in landscape mode. If the size of the repeat is too small, then you cant really make out the pattern in the bookshelf icon because the whole cover has been shrunk down, if the repeat is too large, it might look nice on the bookshelf but funny opposite the TOC. You'll have to experiment, but the repeat used in this example is a good compromise.
    Next the brown spine down the left hand side is another box shape. This one's placement is set to "floating". Stretch it to the edges of the page. I filled this one with a subtle gradient to give it a slightly 3 dimensional look. Remember that iBooks will overlay shade an indentation along the left edge to appear as a crease. So dont make it too dark. Remove any border from this box, but give it a shadow on the right, just enought to make it appear affixed on the book. I used shadow settings of Offset 1pt, Blur 6pt, Opacity 75% at an angle of 323. Too much offset or blur ruins the effect. You want it to appear as a very thin layer adhesed to the "book". As for colors, use the eyedropper on the color inspector to pick colors from the background pattern, this will make it "work together" if you are color challenged.
    The stitching on the right edge of the spine shape is a simple line shape 2 pts wide. Properties are: dotted, with a very slight shadow (2,4,85%,315). You can use the "bring forward" or "send backward" commands if the stack order gets mixed up.
    Next add the Title and Author boxes. They are simple floating box shapes with color fill, and simple black border of 3px. Page's pop-up alignment guides will help you center them in the page. There is no shadow for these boxes as they (here) are supposed to mimic a printed and not a physical adhesion. Instead of a line border, you can also apply Page's "picture frame borders. I went crazy with those, but ultimately came back to the simple line border.
    If you want to make these "adhesions" there are lots of nice paper textures on the 'net you can use as fill.
    Finally you see there is a slight highlight on the top edge of the book and slight shadow along the right and bottom edge. These make the cover seem to have rounded edges, they give it a 3D appearance. To create the right hand "round over" draw a line-shape the height of the page. Make it 5px wide, and give it shadow properties of 5,4,50%,142. Next you have to move it so that it is slightly off the paper and thus not seen, but close enough that it's shadow is still seen. To move it, you can use a combination of the mouse, the arrow buttons on the keyboard, and/or the position inspector pane. In my example, the page is 600px wide, and the line sits at the 601px location. Be careful about moving shapes off the page, as you can "lose" them. Oddly enough, there is no way to see and/or find shapes that are "off page" (that I know of anyway). If you lose a shape off the page, you have to draw selection boxes blindly, until you stumble upon the shape again. It seems a way to hide content if one so desired.
    For the bottom edge of the book, do the same thing with a horizontal line. Shadow angle in my example is the same 142 degrees.
    For the top edge, do the same except make the shadow color white. (5,5,50%,270). This shape is hard to select once you have it offscreen. If you want to select it, you might have to move the background and right edge shadow out of the way first. Then draw a small box at the top right corner of the page until you hit it.
    And one last detail, you might notice my page size is 600x860px (8.333in x 11.944in). This is because I think this aspect ratio is shaped more like a novel than than 8.5x11in (612x792px). The latter is squarer, and more the shape of a text book.
    I hope this stuff has been useful to you.
    Dave

    Thank you for sharing such an informative post! I'd like to offer one small correction.
    My company publishes children's picture storybooks in print. These are edge to edge full color pages for those who may not be familiar with this format. Our early ePub's were always disappointing in that we could not duplicate the print format without showing considerable white margins on an e-reader. We have since solved that problem in order to achieve the maximum image size. There will always be some amount of white margin in ePub format, but our image output now nearly fills the screen of any e-reader.
    The 600X860 resolution is correct in order to achieve a wall to wall ePub image. The image must be created at that resolution for insertion into the document, and the page setup must also be set at the same dimension, which in inches is 8.333X11.944. You cannot, for example, use a smaller size image and drag it with constrained proportions to fill the viewport at the 600X860 resolution. The exported ePub file recognizes the portion of the image that is beyond the margins of the viewport and it will show up in an e-reader with a large white bottom margin.
    Dragging a smaller image than the 600X860 resolution to fill the viewport with unconstrained proportions will work, but of course distorts the image. So, create your images at 600X860, insert them into your doc, export to ePub and you will be happy, happy, happy!

  • Help please on Observer / Observable and Serial Communications!

    Help!
    I have a project where I need a java application to talk to some test equipment via the serial port. I have studied the java comm api and played around with the SerialDemo example which I used to model my code.
    I have a SeialConnection class which is very similar to the example except I made it to extend Observable and I have it notify observers when data is detected on the serial port.
    I created a second class which extends Obserable which communicates with the SerialConnection and implemented the observer interface. This class process the incomming and outgoing data and provides some higher level methods, like getSerialNumber(), for my application to use. The application frame is an Observer of this class so the GUI can show the status as well.
    An example method from this class:
    private String Get590AROMString() {
    SendString("EZR-V"); //Send a command to the s.p.
    serialConnection.pause(750); //Basically a sleep(750)
    return ROMVersion; //Return the data from update()
    Excerpt from update method:
    // If return from serialConnection starts with VER: parse the RV and SN.
    if(T.startsWith("VER:")) {
    ROMVersion = new String(T.substring(0,T.indexOf('~')));
    SpeciesName = new String(T.substring(T.indexOf('~')+2));
    return;
    This works great when the test equipment sends a message or when the user selects a command from the program interface. My problem is when I try to send a command to the serial port from within the update method of the observer. There are instances where a result from the serial port needs to initiate another request for information.
    Here is a fragment from the update method of the application frame:
    public void update(Observable obs, Object obj) {
    DensTalkStatus DTS;
    if( obs==DT ) {
    DTS = (DensTalkStatus)obj;
    else if(DTS.GetStatus()==DensTalkStatus.NOTIFY_ZEROOK) {
    if(FIRSTCONNECT590A) {
    GDD.GetDensimeterInfo(); // *** This is the Request
    GDD.SetDensID(EDM);
    FIRSTCONNECT590A = false;
    When I make a request for additional information from the serial port within the update method I get nothing returned and the requested data arrives later after the update method has completed.
    I do not know the fine details of how the javax.comm or observer/obserable works but it appears to me that my strategy can only process one command at a time.
    Can anyone think of a way to allow the application's frame update method to request information and wait for the data to be ready?
    Does anybody have an example of how to do this type of communications?
    I am sorry for the length of this question... Thank you for your time.
    Doug

    I have not received any suggestions yet on an alternate method for this problem, but I have come up with a solution I think will work. I am posting it here so others who have the same problem can at least see what path I followed...
    The basic problem seems to be that I am trying to have my observer ask for information that requires the same observer / observable thread to respond.. duh! :) To requst additional information from the serial port I need to move the requests out of the update() method to a different thread.
    I implemented the SerialWorker class to make the request so the observer update() method could return normally without waiting for the result of the new request.
    Doug

  • Can you force ARD to ask permission before control/observing *AND* still be able to push updates/patches?

    Is there a way to force ARD to ask permission before observing/controling a computer AND still be able to push updates/patches to the computer?
    I know we can't be the only ones who have this dilemma so I'm hoping someone has a solution.
    ARD version 3.
    OS 10.6.8 (ARD machine) and 10.6-10.7 client Macs
    Each remotely monitored computer has an admin account that ARD uses to inventory and update the machines. Let's call it ADMIN. Of course each computer also has a local (non-admin) account let's call USER.
    When USER is logged in, we'd like ARD to always ask permission before observing and/or controlling the computer. We found we can replicate this by removing the ADMIN login and password from the info tab of the computer in question as well as turning on the 'Any guest may request permission' setting. Unfortunately we found this also removes the ability of ARD to start a chat session with the computer - even with the chat option checked on in ARD settings (system preferences). To push updates/patches we have to put the ADMIN account information back into computer info tab.
    Basically it boils down to giving the end user the privacy they would like (not being viewed without warning) while they're logged in vs. allowing the IT department to update the computers when necessary.
    With the ADMIN login and password entered into the computer's info tab we're able to observe/control without warning. We changed the client settings for that computer via ARD to always request permission but this didn't work while the ADMIN login and password were still entered in the info tab. Once we removed the information we were prompted to ask permission but that's because we were essentially an unknown guest.
    It appears to be an either/or situation right now. Either you give the user privacy and always ask permission or you give the IT department the rights to observe a machine and push updates. Because once we put the ADMIN information back into the info tab, we can observe without permission again.
    When USER is logged in, always ask permission to control/observe. But still be able to push updates. If ADMIN is logged in or no one is logged in, don't ask to control/observe.
    Has anyone found a workable solution for this question?

    You can take a look at this website and it will give you the command to run that will control the Observe and Control options for the access mode.
    http://support.apple.com/kb/HT2370
    The command is:
    $
    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users "THIS IS WHERE YOU PUT THE USERS YOU WANT TO HAVE ACCESS" -access -on -privs -ControlObserve -ObserveOnly -TextMessages

  • Hi, when I click on SAFARI and APP STORE on my iphone5 64 gb, it skips, no other problem(s) have been observed.

    Hi, when I click on SAFARI and APP STORE on my iphone5 64 gb, it skips, no other problem(s) have been observed.

    define "it skips"

  • Quick advice needed on Observer and Observable...

    Ok at the moment i have about 10 sorting algorithms in 10 classes. They all extend another class which includes methods like print, randomise, user input etc etc which all sorting classes use. So basically my sorting classes only sort and nothing more is done in those classes.
    Now what i want to do is have some statistics on a GUI. This will include copy coperations, compare operations and total operations. I will obviously need to input where these operations occur for each sorting class. I want the GUI to be updated each time an operation happens. All my sorts run in a thread, i did this so i can choose the speed of the sort with a JSlider.
    My question is, will i need to be using the Observer and Observable interface? If so, can i have some advice into how i would structure this. If not, then how else can i do a statistics class. I tried a way without this approach, but it didn't seem too OO friendly. Any help is appreciated.
    Thanks in advance.

    I'm not a GUI guy and this is definitely not the best way to do it - but you could probably call an update method after each calculation or whatever. Make a static method that has a reference to your GUI form.
    This is definitely not an elegant solution - but I think it's explicit and readable, and that can be more valuable than elegance.

  • ARD showing users offline, but I'm able to control and observe.

    Strange thing/bug happening.
    I updated a user's computer with a static IP address to new hardware, using the same static IP as before. Old machine was taken out of service, but the brand new Thunderbolt iMac is showing up as offline in ARD.
    Observer and Control buttons connect me to the new machine, but ARD has the old machine's info populating the info fields, including MacOS version and ARD version.
    Deleting and adding the machine back in did nothing to fix the problem — only after changing the new Mac to DHCP the updated info showed up in the scanner window.

    Hello I have ran into this issue as well and this is my solution.
    on the left side i have groups by dept, teachers, etc and found that the link from the left side loses connection from the source like you have on your scanner for bonjour or network range, etc.
    So what i do is in my left pane i would select the specific computers - then press delete key on the mac to remove them.  Then i go to that scanner via ip or bonjour how ever it is searched on the network.
    Find those specific computers again and re-add them to the left folder, smart list, group, etc and now the computer is bold in blue and not offline anymore.
    it some how loses its connection but when i perform my process above they are online and working with no issue able to interact or chat where when it was offline i can remote in but not deploy, chat, interact, etc.  but by removing them and adding again it reconnects or clearing it out is like removing the old cache and everything starts working.
    I have been performed this process for 2 years, and i even took my macbook to apple retail store, and stated there is no reason why it should not work, but they wanted me to delete the app and all settings and do it again - i said no not happening.
    Then i called Apple Edu Support and they jumped in and they stated the process i performed seems to work properly and this is why i continue it.  Until i see a fix in an update.
    Thanks
    Dan Fernandez
    Apple.iOSGenius on youtube
    iOSG3nius on twitter

  • Observable and ActionListener.. help

    Is there anyway to pause update method and continue after I click the �Add Student� button?
    The update method is called automatically when my observable object is changed, so I can�t display previous observable information via the button�s ActionListener.
    Anyway to do that?
    Thanks
    import java.util.Observable;
    import java.util.Observer;
    import java.awt.event.*; //package for event handeler
    import java.awt.*;
    import javax.swing.*;
    public class Lab5Frame extends JFrame implements Observer {     
         private JLabel label;
         private String name;     
         public TestFrame(Observable observable) {
              System.out.println("Windows created.");
              observable.addObserver(this);
         public Lab5Frame(String title) throws HeadlessException {
              super(title);          
              Container c = getContentPane();
              JPanel panel = new JPanel();
              label = new JLabel(name);
              panel.add(this.label);
              JButton button = new JButton("Add Studnet");
              button.addActionListener(new ListName());           
              c.add(button, BorderLayout.NORTH);
              c.add(panel, BorderLayout.CENTER);
              //*** window adapter
              addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent we){
                        System.exit(0);
         private class ListName implements ActionListener{
              public void actionPerformed(ActionEvent event){                    
                   //what should I write here to performe the updated information
    vai the update method?
         //oberver update     
         public void update(Observable arg0, Object arg1) {     
              System.out.println("LogConsole: " + arg1);
         }

    Is there anyway to pause update method and continue after I click the �Add Student� button?
    The update method is called automatically when my observable object is changed, so I can�t display previous observable information via the button�s ActionListener.
    Anyway to do that?
    Thanks
    import java.util.Observable;
    import java.util.Observer;
    import java.awt.event.*; //package for event handeler
    import java.awt.*;
    import javax.swing.*;
    public class Lab5Frame extends JFrame implements Observer {     
         private JLabel label;
         private String name;     
         public TestFrame(Observable observable) {
              System.out.println("Windows created.");
              observable.addObserver(this);
         public Lab5Frame(String title) throws HeadlessException {
              super(title);          
              Container c = getContentPane();
              JPanel panel = new JPanel();
              label = new JLabel(name);
              panel.add(this.label);
              JButton button = new JButton("Add Studnet");
              button.addActionListener(new ListName());           
              c.add(button, BorderLayout.NORTH);
              c.add(panel, BorderLayout.CENTER);
              //*** window adapter
              addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent we){
                        System.exit(0);
         private class ListName implements ActionListener{
              public void actionPerformed(ActionEvent event){                    
                   //what should I write here to performe the updated information
    vai the update method?
         //oberver update     
         public void update(Observable arg0, Object arg1) {     
              System.out.println("LogConsole: " + arg1);
         }

  • Collection of Tips and Observations

    Being quite new to DPS and having just completed a 100 page brochure I wanted to share some observations and hopefully get some back.
    Some of these may not be true as there may be better ways of working that we haven't discovered yet, and some may be blatently obvious but this is what we have found.
    If you have lots of pages that make use of the same interactivity, setting this up on a master page saves a lot of time, but as you make each new page make sure you release from the master straight away otherwise elements like buttons and actions will not be linked to the right element on the page and will cause In Design to crash when uploading the article
    Using layers for different interative elements can really help organise the interacivity, but make sure all layers are active before you upload the article if you have buttons that link to an inactive layer then In Design will probably crash again
    Labelling buttons and MSO clearly saves a lot of time if you need to trouble shoot why something isnt behaving as you expect later on, In Design makes a good job of renaming duplicate buttons by adding a sequencial number, but if you have several duplicated elements on the same page naming them by their position on the page can help you when linking button actions, e.g. Image Slide Left, Image Slide Right. Having buttons with identical names can also cause crashes when uploading articles, but not always.
    Buttons inside MSO can only control elements inside the same MSO, a bit of lateral thinking (and forum help) can probably achieve the intended results
    If Video content is placed inside a frame that hides (crops) part of the video, the whole video is still shown when published (might be doing this wrong)
    Edge animations that rely on custom javascript need to be added as HTML not OAM (unless there is a way to embed the javascript into oam files?)
    anyway those are just my initial observations based on builing a publication that has a lot of identical layout product pages.

    If Video content is placed inside a frame that hides (crops) part of the video, the whole video is still shown when published (might be doing this wrong)
    You can crop the video as long as the mask is set to be an overlay object.

  • Warnings and observations- need some explications and opinions

    Hallo,
    I'm new to Java and using Eclipse for coding. I copied the following code from a book, but Eclipse gives me some yellow flagged warnings (not critical). There are few I can't understand. This would help me a lot in understanding Java better, as I couldn't find answers. Thank you.
    warnings I get:
    1) The serializable class Window does not declare a static final serialVersionUID field of type long     demo.java     teste/src     line 10     Java Problem
    2) The static field BorderLayout.CENTER should be accessed in a static way     demo.java     teste/src     line 29     Java Problem
    interesting observations:
    3) If I delete setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); and setContentPane(ca);, the program works as before. Are they necessary?
    4) Which Layout do you use? Border layout looks for me very unuseful if you can only add 5 buttons, you can' arrange tham ore leave spaces between. Do you use Gridbag Layout in application ore what other, so that I know which is the best
    5) I also get the warning : The local variable win is never read     demo.java     teste/src     line 6     Java Problem. Is there any problem IF I have warnings in my code? I don't need to do anything else with the win variable? Should I add some parameters to the variable or leave the warning message.
    Thank you very much
    import java.awt.*;
    import javax.swing.*;
    public class demo {
         public static void main (String [] args){
              Window win=new Window();
    class Window extends JFrame {
         public Window(){
              super ("Title Bar");
              setSize(400,100);
              //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setVisible(true);
              Container ca = getContentPane();
              ca.setBackground(Color.lightGray);
              BorderLayout blm = new BorderLayout();
              ca.setLayout(blm);
              JButton bt1=new JButton ("Start test 1");
              ca.add(bt1,blm.WEST);
              JButton bt2=new JButton("Start test 2");
              ca.add(bt2,blm.EAST);
              JButton bt3=new JButton("Start test 3");
              ca.add(bt3,blm.NORTH);
              JButton bt4=new JButton("Start test 4");
              ca.add(bt4,blm.SOUTH);
              JButton bt5=new JButton("Start test 5");
              ca.add(bt5,blm.CENTER);
              //JButton bt6=new JButton("Start test 6");
              //ca.add(bt6,blm.CENTER);
              //setContentPane(ca);
    }

    1. You simply haven't defined the static long serialVersionId variable (not really necessary).
    2. blm.CENTER should be BorderLayout.CENTER (No biggie but should definately be changed).
    3.
    part a. The default action is dispose on close, but since your program does nothing other than this simple GUI it will also exit at that point. So, in this case, it doesn't matter, but is better to set it, if that is what you want to have happen.
    part b. since ca is defined with getContentPane(), using setContentPane() is not needed.
    Judging by the stuff shown, if this is a true copy of the example from the book you used, and not edited by yourself, then I would say to find a new book. These things may only be warnings, and no real big thing, but in a book they are signs of disaster. As it will either cause bad habits in the person using them, or even cause real problems in other areas. If they are this sloppy in such a simple example, I would hate to see anything more complicated from them.

  • Is 1.3 Bios really better than 1.52B?? Neo2 Board and Some Observations!

    Hi All... I read this post on the forums and it got me thinking and i did some fiddling and made some observations..
    This is whith regard to the 1.3Bios being better than the 1.52B Bios.. because it would let you run in turbo mode...
    Ok i've spent the last 60mins testing and i came up with the following..
    1.3BIOS
    With the 1.3Bios.. no matter what memory timings u set... it does'nt show in CPU-Z and it does'nt make a difference in the memory bandwith scores...
    For example my ram was rated at 2.5-3-3-8 .. i changed it to 2.5-2-3-8 .. it did'nt change and my scores remained the same..
    Going from Slow to Fast to Turbo.. did'nt incrase my scores.. actually.. donno how.. but i got a decrease in scores..
    The only thing that was noticable was that MSI core-center overclocks the CPU a lil more than what is set in BIOS..
    1.52B BIOS
    With the 1.52B Bios... u can change the memory timings and it does show in CPU-Z and it makes a massive difference with Sisoft sandra.. 250mbps more..
    What u set in the bios .. u get with the 1.52B.. Corecenter does'nt mess around and overclock it more..
    Going from Slow to Turbo did give me an increase in scores.. slightly..
    Im now running Ultra-Turbo.. and i get a sisoft bandwith score of 5250Mbps at 3.21G..
    CONCLUSION
    So infact i think the 1.52B is better than the 1.3 . I don't have a Radeon so i donno how these bios's work with the cards cause i've read about some problems... I'm getting one soon so 'ill post some info about that in a fortnight..
    I personally think this board is great.. atleast the one i have.. never had a problem.. had it for 3 months.. i have a revision 1.. no DOT sticker.. and just the Neo2-S version... I've used Spectec 333 on this board too (dual) had no problems..
    Wish i had some DDR-500 so i could test whether this board can do 1:1 above 250...whether it has a 1:1 limitation above 285 like some other boards.. that is my only doubt.. anywayz.. i hope atleast some of u are sailing as smoothly with this board as i have..
    Get some nice ram .. this Twinmos Dual channel kit DDR400 with the Twinmos chips are really great.. and i recommend it..

    Quote
    Originally posted by DeReD
    1.3BIOS
    With the 1.3Bios.. no matter what memory timings u set... it does'nt show in CPU-Z and it does'nt make a difference in the memory bandwith scores...
    For example my ram was rated at 2.5-3-3-8 .. i changed it to 2.5-2-3-8 .. it did'nt change and my scores remained the same..
    Going from Slow to Fast to Turbo.. did'nt incrase my scores.. actually.. donno how.. but i got a decrease in scores..
    That´s wrong. RAM-Settings are displayed fine. Turbo does make a BIG difference in scores. About 15% more performance. In Games and in benchmarks like 3dmark and sandra, too.

  • Hello I'm with you old client I've got some observations When you request from your Website demand is refused I would like to inquire why the request is rejected Please refer my account and make sure rejected previous applications Thank you very much

    Hello
    I'm with you old client I've got some observations
    When you request from your Website demand is refused I would like to inquire why the request is rejected
    Please refer my account and make sure rejected previous applications
    Thank you very much

    Check the Ethernet connection to the AirPort Express. Make sure that the Ethernet connection from the Comcast modem is connected to the WAN port on the back of the AirPort Express. The WAN port is the one with the circle of dots shown over the port.
    It sounds like you are connected to the Ethernet LAN port.

Maybe you are looking for

  • Error occurred while trying to access desktop

    Dear friends, <br><br> I'm working with Composition Environment 7.1 trial version.<br><br> I read some other related posts, but they don't apply to our situation.<br><br> The problem is: while trying to login into the Portal (with any user) the follo

  • Small problems after system update

    I have a couple of problems which appeared after a recent pacman update. A lot of stuff was updated, including the kernel and xorg. 1) Shutdown stalls at "Save system clock". 2) Ctl-Alt-F(1-6) doesn't get me out of X11. Actually, this works sometimes

  • IPhoto doesn't show thumbnails anymore

    I actually figured this out- I am posting this as a solution, not a problem. It frustrated me but I figured it out. THE PROBLEM: You click on an "event" and it brings up a picture from that event, however you can only see one picture. Clicking left-r

  • Multi-threading problem

    Hello everybody, I am having a problem using OCCI and threads. First I have Oracle RAC, I launched 5 threads from my application to do some query each thread has its own parameters to the same query but all are accessing the same table which is creat

  • PCR to read the variable-Urgent help required

    Dear Experts, I'm trying to read a variable in a pcr and tried many ways however NOT been successful so far hence seeking your help I have a WT( 5115) in infotype 15 and I would like the amount to transferred to a varibale and read it in the further