Detecting intersections between rectangles and circles

Hello,
I'm experimenting with collision detection for a game I plan to make. I'm looking into the Rectangle class because it has an intersects() method that would be great for detecting collisions. But now I'm wondering a couple things:
1) Searching through the swing and awt APIs, I have not found an equivalent class for circles. Is there one or something like it?
2) The intersects() method for the Rectangle class seems to require another Rectangle (or rectangular coordinates and dimensions). There isn't anything equivalent to testing for intersection with a circle is there?

Note: This thread was originally posted in the Abstract Window Toolkit (AWT) forum, but moved to this forum for closer topic alignment.Thanks for moving it. I was torn between this forum and the AWT one. Now I know that questions about the Rectangle, Ellipse2D, Shape, etc. classes belong here.
Check out java.awt.geom.Areadb>
Anything that derives from the Shape interface will likely work, including Ellipse2D, the class you're likely looking for.Interface Shape
Class Ellipse2D
Class Ellipse2D.Double
>
These are great classes to know about. Thanks.
So I can created a bounding "box" for a circular entity using Ellipse2D and it has the method intersects(double x, double y, double w, double h) which tells me whether the specified rectangle intersects this ellipse.
However, I'm not finding a counterpart for this for Rectangles (i.e. something like Rectangle.intersects(Ellipse)).
On the other hand, I'm wondering if this will work instead (and if it does, it should work for detecting intersections of any shape with any shape):
1) Create two Area objects from my Rectangle and my Ellipse2D.
2) call Area1.intersect(Area2)
Area1 will now be the intersection between it's previous state and that of Area2. Therefore, if they did indeed intersect, the new area should be non-zero; otherwise, zero. Therefore...
3) call Area1.isEmpty();
If original Areas did intersect, this should return false; true otherwsie.
The only thing I'm not sure about is whether this is in fact what Area.isEmpty() computes. The description in the API doc is not all that clear:
Tests whether this Area object encloses any area.which sounds like it returns true is the enclosed area is zero, which would be the case if the original Areas didn't intersect.
Am I on the right track?
Edited by: gib65 on Jul 5, 2010 9:01 AM

Similar Messages

  • Drawing lines, rectangles and circles as objects onto a JPanel.

    Hi. I have to complete a task in school. The work is to create some simple 2D graphical editor. I'm new to java and I have some problems with this job, so I'm looking for help where it is possible...
    I created a JFrame and using it as a window. Into this JFrame I've added a toolbox (JToolBox) and "drawpad" - a JPanel. The toolbox wasn't any problem, but I aim to use the JPanel for drawing 2D objects. I tought about creating some container of objects, where I could put lines, rectangles or circles, each one with its properties (color, [x; y] coordinates on the scene, filling and drawing width) and then, draw this scene onto the JPanel.
    It should be something like windows Paintbrush. Can be simplier, but including the possibility to move and change properties of drawn objects.

    Well, there are two approaches to this that come to mind:
    1. Create an image. If this program is supposed to be like Windows Paint, the tools you are describing are only there for the sake of modifying a two dimensional image. In that case, I would recommend using a BufferedImage.
    The JPanel can contain a single JLabel. The JLabel is constructed in the following fashion:
    JLabel image_label = new JLabel(new ImageIcon(bufferedImage));...where bufferedImage is the image on which you will be storing the data. You can use bufferedImage.getGraphics() to get an object which will quite happily draw geometric shapes for you. Then, after each draw, you tell the panel to repaint itself.
    2. Store the shapes and create a component to draw them for you. You'd create a new JComponent class that would accept objects representing geometric shapes. You then override the paintComponent method on this new class to have it render itself according to the contents of the geometry objects. It would also probably be advisable to have all of these classes implement a common interface (which you would also create) so the rendering component could treat them identically.

  • PDFExport fonts. How they are detected, difference between bold and italic.

    Hi,
    i am experiencing issues with PDFExport mainly because i don't understand how the engine detects fonts in the original document.
    First i will explain my issue:
    PDFExport is used on linux machine environment.
    Copyright reasons prevents me from using windows fonts for PDFExport. I downloaded some open source fonts, most of time they are working fine. the issues that i have are with the variations the fonts. italicized and bold.
    Lets take an example of a .doc file. the file contains Hebrew characters some of them are bolded some italicized and some are regular. the font that .doc used is a windows font called David.
    When i use PDFExport with the original David fonts everything works fine and converted correctly to PDF. Since i cannot use windows fonts i resorted to using the Open Source fonts, they too have similar in style to David. they have bold version, italicized version and regular version.
    When i use the open source fonts the detection of the font is incorrect. the entire document becomes italic. when i remove the italic version of the font everything is bold. and when i remove the bold version everything becomes regular. -- i am missing the bold and italic styles when they are used in the document.
    (note that the original document can use any font it wants not restricted to the Copyright issue)
    if i understood how the detection worked, i could modified the open source fonts that i have so that it will detect correctly all the different style (bold and italicized ) correctly.
    my first question:
    How can i use the Open source fonts and also not lose the bold and italicized styles?
    my second question:
    2. Is there a way to recieve via the API which fonts the engine looked for and didn't find? it can help me to better understand which fonts i need. and may be look for them and bring them manually.
    sometimes even when i used the entire windows fonts folder still the fonts where missing or incorrect. (in the resulted converted PDF 'squares' instead of characters). an API like this may help me look for the missing fonts.
    my third question:
    is there a general guide or Standard which fonts to use. i wish to use the minimum number of fonts which will get the job done. i.e characters will be visible and not squares, styles (bold and italicized) should not be lost.
    my forth question:
    How do the engine choose which font to use?

    These are very deep technical questions and I assume it will be difficult to find anyone who knows answers on this forum.
    You will need to speak with Outside In people (you could also try other conversion component such as OpenOfficeConversion - see http://docs.oracle.com/cd/E23943_01/doc.1111/e10800/c03_pdfi_all.htm#IBRAG238). Contacts to OIT are available at Oracle Outside In Technology, or try to create a SR via Metalink.

  • JFileChooser detecting switch between "List" and "Details" views

    I'm customizing a JFileChooser and would like to provide users a longer version of the file names when in Details mode (Unix showing links).
    This might be accomplished using the getDescription method of FileView, I don't know. My FileView getTypeDescription and getDescription methods are never called but getIcon is. I added @Override annotations to all method, so I think I really am overriding them.
    Thanks!

    Here's a solution. I still think there should be a more official way of doing this.
    public MyFileView(JFileChooser chooser)
              for ( Component c : chooser.getComponents())
                   if (c.getClass() == FilePane.class)
                        filePane = (FilePane) c;
         @Override
         public String getName(File f)
              if (filePane.getViewType() == FilePane.VIEWTYPE_DETAILS){
                   return "Long";
              return null;
         }

  • X3500 No Connection between LAN and WLAN

    Hello,
    I've purchased and installed an x3500 modem, and can connect to internet using both wired and wireless but my problem is, i can not ping or see/detect devices between LAN and WLAN.How can i fix this problem?
    Mac filtering is disabled on wireless
    both gets ip from dhcp

    Hi hakanbayar. Can you ping your Linksys device? If yes and you're using a computer, you may need to disable the computer firewall or security so it will allow you to ping other computers. 

  • Difference between jsp and servlets

    Can any body tell me the difference b/w jsp and servlets.
    As i know one difference is to seperate the java code from html. Is there any other difference. please...

    Servlets are a way to run java on a server. They don't necessarily need to be about HTML or even HTTP. You can write servlets that generate images rather than HTML, for example.
    JSP is a way to create servlets that generate HTML. They get translated into servlets (special-purpose servlets). This is sort of glossing over the details -- the power of JSP is that, by being an intersection between HTML and executed Java code, they can provide a way to clearly differentiate between the two.
    That's a way of looking at it anyway.

  • Intersection point of rectangle and line

    So I have a point somewhere on the scene and from that point a line is drawn to the center of the rectangle. Is there a way I can find the point of intersection between the rectangle and the line? Thanks!

    PhiLho wrote:
    abedi_ali wrote:
    For that model I would need to know if the point is on top line of the rectangle, left line ,right, or bottom.Yes. Makes sense.
    However it would be much simpler if there is a way to find that intersection point.The way is the one you just described. Unless you mean a way built-in in JavaFX? The Shape classes have intersects() methods, but they just return a boolean...Yes thats what I figured. I guess my only option is to section it off. Thanks!

  • I have an itouch 4G...problem is while on landscape mode whenever i press down left of the screen edge..ripples are seen ...similarly while we press LCD tv screen in between...and circles are seen around our fingre...what to do??

    I have an itouch 4G...problem is while on landscape mode whenever i press down left of the screen edge..ripples are seen ...similarly while we press LCD tv screen in between...and circles are seen around our fingre...what to do??

    - You can make an appointment at the Genius Bar of an Apple store and see what they say or call AppleCare
    - Just do not press hard.  The iPod screen includes an LCD screen

  • My phone is stuck between off and on.  It has a white, slash circle going around and around.  The button on top doesn't seem to do any good.  The phone is only 31 days old. Please write back, I can't use it to even call in an emergency.  Thank you

    My phone is stuck between off and on.  It has a white, slash circle going around and around.  The button on top doesn't seem to do any good.  The phone is only 31 days old. Please write back, I can't use it to even call in an emergency.  Thank you

    I had major issues with the iPhone 4s battery, however it’s resolved.
    The tech who set the phone up at the Apple store did so with little training.
    if you have a mobile me account. First go and move all your data to the cloud by going on your computer and logging in at me.com/move. The cloud has replaced mobile me, so there is no need for those two accounts
    Also make sure that for any of your email accounts you set them up to fetch, not push. My tech person set them all to have the email servers push data to the phone. The new iphone4s antenna is extremely strong so it will continually try to access stuff that is pushed–***** a lot of battery life doing this. It makes it worse if you have exchange 2010 accounts. Something about changes made to exchange really suck battery life from devices that access such accounts.
    turning of locator and the push notifications from facebook--they have a lot!

  • T420: Button in between "volume" and "ThinkVant​age" -what does this do?

    I can't figure out what the button in between "volume" and "ThinkVantage" on my T420 does.  I've never seen the symbol before, it looks like a diagonal rectangle with a circle at the top.  It has to be important if it got its own key, but nothing happens when you press it as far as I can tell.  I feel like I'm asking Mr. Obvious from Bob and Tom...
    This is what the key looks like.
    Moderator Note: Edited subject to match content.
    Solved!
    Go to Solution.

    It's the microphone mute button.

  • The difference between WLSE and WLSM

    Dear All,
    In my understandings
    WLSM can support layer 3 roaming
    1. For rogue AP detection, is WLSE or WLSM be the choice?
    2. Between AP and WLSM, it is FSRT, is it encryped? by Cisco proprietary?
    Thanks a lot in advance.
    Regards,
    mak

    WLSE is a Management/Monitoring application that uses the radio information from WLSM to show Radio data including Rogue AP Detection. WLSE itself/alone cannot do Rogue AP Detection

  • Choosing between 720p and 1080p on Mini connected to Sony HDTV (1920x1080)

    I have a late 2009 Mac Mini and a SONY HDTV and had no difficulties at all in hooking them up. I just connected the Mini Display Port to DVI connector which ships with the MAC Mini to a Belkin DVI to HDMI cable (also available from Apple Store) and connected the HDMI to my TV. I switched on the TV, selected the correct HDMI input, then switched on the Mac Mini and could see the picture immediately. I was missing the menu bar at the top so went to SYSTEM PREFERENCES and then DISPLAYS and the OPTIONS tab, and unselected OVERSCAN, and that gave me a perfect picture (slightly smaller than full screen but perfectly adequate as far as I'm concerned).
    By default my resoluton was set at 1080p (presumably the Mac detected that the native resolution of my TV is 1080p). The DISPLAYS box shows a number of resolution with a little TV screen icon beside them, as if suggesting those resolutions for use with the Sony. It shows 480i, 480p, 720p, 1080i and 1080p. There are also lots of others without TV icons beside them.
    The only problem I found is that 1080p made it quite difficult to read text on my screen, even though it's not very far away from the sofa. My eyesight is very good but I couldn't read the screen comfortably when surfing the net or even when changing settings etc. I swiiched, therefore, to 720p and this produces a very comfortable size of text for using the MAC.
    My question is whether it really makes such a big difference whether one chooses 720p or 1080p, as I really can't see much difference for playback of video from Hulu or other streaming websites. Even when I played a DVD movie from the Mac Mini superdrive, the difference in quality was hard to detect. I guess if I tried viewing Full 1080p HD material, there would be some difference, but how much of such material is available on the net anyway? I take it that switching between 720p and 1080p wouldn't cause any harm, if I chose to do so occasionally for watching any Full HD movies that I rip?
    Look forward to hearing views!

    Hi- I also picked up a mini a week ago, and have it hooked up to my Sony HDTV via HDMI, just as you. The same thing happened the first time I connected the mini to my tv- with overscan on, the top and bottom of the screen were cut off.
    The solution is to pick up your Sony remote, go to the onscreen menus, and make sure that 'full pixels' option is selected. When you do, the screen will be absolutely perfectly aligned.
    I mention this because while in overscan mode, I find that the Sony makes an absolutely beautiful screen, and text is quite easy to read, albeit a bit small.

  • Need help with ASA 5512 and SQL port between DMZ and inside

    Hello everyone,
    Inside is on gigabitEthernet0/1 ip 192.9.200.254
    I have a dmz on gigabitEthernet2 ip 192.168.100.254
    I need to pass port 443 from outside to dmz ip 192.168.100.80 and open port 1433 from 192.168.100.80 to the inside network. 
    I believe this will work for port 443:
    object network dmz
    subnet 192.168.100.0 255.255.255.0
    object network webserver
    host 192.168.100.80
    object network webserver
    nat (dmz,outside) static interface service tcp 443 443
    access-list Outside_access_in extended permit tcp any object webserver eq 443
    access-group Outside_access_in in interface Outside
    However...How would I open only port 1433 from dmz to inside?
    At the bottom of this message is my config if it helps.
    Thanks,
    John Clausen
    Config:
    : Saved
    ASA Version 9.1(2) 
    hostname ciscoasa-gcs
    domain-name router.local
    enable password f4yhsdf.4sadf977 encrypted
    passwd f4yhsdf.4sadf977 encrypted
    names
    ip local pool vpnpool 192.168.201.10-192.168.201.50
    interface GigabitEthernet0/0
     nameif outside
     security-level 0
     ip address 123.222.222.212 255.255.255.224 
    interface GigabitEthernet0/1
     nameif inside
     security-level 100
     ip address 192.9.200.254 255.255.255.0 
    interface GigabitEthernet0/2
     nameif dmz
     security-level 100
     ip address 192.168.100.254 255.255.255.0 
    interface GigabitEthernet0/3
     shutdown
     no nameif
     no security-level
     no ip address
    interface GigabitEthernet0/4
     shutdown
     no nameif
     no security-level
     no ip address
    interface GigabitEthernet0/5
     shutdown
     no nameif
     no security-level
     no ip address
    interface Management0/0
     management-only
     nameif management
     security-level 100
     ip address 192.168.1.1 255.255.255.0 
    ftp mode passive
    dns server-group DefaultDNS
     domain-name router.local
    object network inside-subnet
     subnet 192.9.200.0 255.255.255.0
    object network netmotion
     host 192.9.200.6
    object network inside-network
     subnet 192.9.200.0 255.255.255.0
    object network vpnpool
     subnet 192.168.201.0 255.255.255.192
    object network NETWORK_OBJ_192.168.201.0_26
     subnet 192.168.201.0 255.255.255.192
    object network NETWORK_OBJ_192.9.200.0_24
     subnet 192.9.200.0 255.255.255.0
    access-list outside_access_in extended permit icmp any4 any4 log disable 
    access-list Outside_access_in extended permit udp any object netmotion eq 5020 
    access-list split standard permit 192.9.200.0 255.255.255.0 
    access-list VPNT_splitTunnelAcl standard permit 192.9.200.0 255.255.255.0 
    pager lines 24
    logging asdm informational
    mtu outside 1500
    mtu inside 1500
    mtu management 1500
    mtu dmz 1500
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    no arp permit-nonconnected
    nat (inside,outside) source static inside-network inside-network destination static vpnpool vpnpool
    nat (inside,outside) source static NETWORK_OBJ_192.9.200.0_24 NETWORK_OBJ_192.9.200.0_24 destination static NETWORK_OBJ_192.168.201.0_26 NETWORK_OBJ_192.168.201.0_26 no-proxy-arp route-lookup
    object network netmotion
     nat (inside,outside) static interface service udp 5020 5020 
    nat (inside,outside) after-auto source dynamic any interface
    access-group Outside_access_in in interface outside
    route outside 0.0.0.0 0.0.0.0 123.222.222.1 1
    timeout xlate 3:00:00
    timeout pat-xlate 0:00:30
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    timeout tcp-proxy-reassembly 0:01:00
    timeout floating-conn 0:00:00
    dynamic-access-policy-record DfltAccessPolicy
    user-identity default-domain LOCAL
    http server enable
    http 192.168.1.0 255.255.255.0 management
    http 192.9.200.0 255.255.255.0 inside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
    crypto ipsec ikev1 transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac 
    crypto ipsec ikev1 transform-set ESP-DES-MD5 esp-des esp-md5-hmac 
    crypto ipsec ikev1 transform-set ESP-3DES-SHA esp-3des esp-sha-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-192-MD5 esp-aes-192 esp-md5-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac 
    crypto ipsec ikev1 transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac 
    crypto ipsec ikev1 transform-set ESP-DES-SHA esp-des esp-sha-hmac 
    crypto ipsec security-association pmtu-aging infinite
    crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 set pfs group5
    crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 set ikev1 transform-set ESP-AES-128-SHA ESP-AES-128-MD5 ESP-AES-192-SHA ESP-AES-192-MD5 ESP-AES-256-SHA ESP-AES-256-MD5 ESP-3DES-SHA ESP-3DES-MD5 ESP-DES-SHA ESP-DES-MD5
    crypto map outside_map 65535 ipsec-isakmp dynamic SYSTEM_DEFAULT_CRYPTO_MAP
    crypto map outside_map interface outside
    crypto ca trustpool policy
    crypto ikev1 enable outside
    crypto ikev1 policy 10
     authentication crack
     encryption aes-256
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 20
     authentication rsa-sig
     encryption aes-256
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 30
     authentication pre-share
     encryption aes-256
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 40
     authentication crack
     encryption aes-192
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 50
     authentication rsa-sig
     encryption aes-192
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 60
     authentication pre-share
     encryption aes-192
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 70
     authentication crack
     encryption aes
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 80
     authentication rsa-sig
     encryption aes
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 90
     authentication pre-share
     encryption aes
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 100
     authentication crack
     encryption 3des
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 110
     authentication rsa-sig
     encryption 3des
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 120
     authentication pre-share
     encryption 3des
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 130
     authentication crack
     encryption des
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 140
     authentication rsa-sig
     encryption des
     hash sha
     group 2
     lifetime 86400
    crypto ikev1 policy 150
     authentication pre-share
     encryption des
     hash sha
     group 2
     lifetime 86400
    telnet 192.9.200.0 255.255.255.0 inside
    telnet timeout 5
    ssh timeout 5
    ssh key-exchange group dh-group1-sha1
    console timeout 0
    dhcpd address 192.168.1.2-192.168.1.254 management
    dhcpd enable management
    threat-detection basic-threat
    threat-detection statistics access-list
    no threat-detection statistics tcp-intercept
    ssl encryption aes128-sha1 3des-sha1
    webvpn
     enable outside
     anyconnect image disk0:/anyconnect-win-2.5.2014-k9.pkg 2 regex "Windows NT"
     anyconnect image disk0:/anyconnect-macosx-i386-2.5.2014-k9.pkg 3 regex "Intel Mac OS X"
     anyconnect enable
     tunnel-group-list enable
    group-policy SSLVPN internal
    group-policy SSLVPN attributes
     dns-server value 192.9.200.13
     vpn-tunnel-protocol ssl-client 
     split-tunnel-policy tunnelspecified
     split-tunnel-network-list value split
     default-domain value router.local
    group-policy VPNT internal
    group-policy VPNT attributes
     dns-server value 192.9.200.13
     vpn-tunnel-protocol ikev1 l2tp-ipsec 
     split-tunnel-policy tunnelspecified
    split-tunnel-network-list value VPNT_splitTunnelAcl
     default-domain value router.local
    username grimesvpn password 7.wersfhyt encrypted
    username grimesvpn attributes
     service-type remote-access
    tunnel-group SSLVPN type remote-access
    tunnel-group SSLVPN general-attributes
     address-pool vpnpool
     default-group-policy SSLVPN
    tunnel-group SSLVPN webvpn-attributes
     group-alias SSLVPN enable
    tunnel-group VPNT type remote-access
    tunnel-group VPNT general-attributes
     address-pool vpnpool
     default-group-policy VPNT
    tunnel-group VPNT ipsec-attributes
     ikev1 pre-shared-key *****
    class-map inspection_default
     match default-inspection-traffic
    policy-map type inspect dns preset_dns_map
     parameters
      message-length maximum client auto
      message-length maximum 512
    policy-map global_policy
     class inspection_default
      inspect dns preset_dns_map 
      inspect ftp 
      inspect h323 h225 
      inspect h323 ras 
      inspect rsh 
      inspect rtsp 
      inspect esmtp 
      inspect sqlnet 
      inspect skinny  
      inspect sunrpc 
      inspect xdmcp 
      inspect sip  
      inspect netbios 
      inspect tftp 
      inspect ip-options 
      inspect icmp 
    service-policy global_policy global
    prompt hostname context 
    no call-home reporting anonymous
    Cryptochecksum:36271b5a1b9382621e14c3aa635e2fbb
    : end

    Hi Vibor. Apologies if my comment was misunderstood.  What I meant to say was that the security level of the dmz interface should probably be less than 100. 
    And therefore traffic could be controlled between DMZ and inside networks. 
    As per thr security level on the DMZ interface. ....... that command is correct. :-)

  • Remote site redundancy IPSEC VPN between 2911 and ASA

    We already have IPSEC VPN connectivity established between sites but would like to introduce some resilience/redundancy at a remote site.
    Site A has an ASA with one internet circuit.
    Site B has a Cisco 2911 with one internet circuit and we have established site-to-site IPSEC VPN connectivity between the 2911 and the ASA.
    Prior to getting the new internet circuit, Site B had a Cisco 877 with an ADSL line which are still available but aren’t currently in use.
    The internet circuit at Site B has dropped a few times recently so we would like to make use of the ADSL circuit (and potentially the 877 router too) as a backup.
    What is the best way of achieving this?
    We thought about running HSRP between the 877 and 2911 routers at Site B and, in the event of a failure of the router or internet circuit, traffic would failover to the 877 and ADSL.
    However, how would Site A detect the failure? Can we simply rely on Dead Peer Detection and list the public IP address of the internet circuit at Site B first with the public IP address used on the ADSL line second in the list on the ASA? What would happen in a failover scenario and, just as important, when service was restored – I’m not sure DPD would handle that aspect correctly?
    I’ve read briefly elsewhere that GRE might be best to use in this scenario – but I can’t use GRE on the ASA. I have an L3 switch behind the ASA which I may be able to make use of? But I don’t want to disrupt the existing IPSEC VPN connectivity already established between the ASA and the 2911.   Can I keep IPSEC between the ASA and 2911 but then run GRE between the L3 switch and the 2911? If so, how would this best be achieved?  And how could I also introduce the 877 and ADSL line into things to achieve the neccessary redundancy?
    Any help/advice would be appreciated!

    Hello,
    I don't think GRE tunnel that you could set up on the switch  behind ASA would be really helpfull. Still site-2-site tunnel you want  to establish between ASA and some routers, but still it is ASA which needs to make decision about which peer to connect to.
    Possible solution would be to do HSRP between both routers on LAN side and with two independent tunnels/crypto maps (one on each of them). On ASA you would need to set up two hosts in set peer. Problem of this solution is that if one router at side B is going to go down and second ADSL line will take over ASA will not do preempt after you main Internet connection is up again. This would happen after ADSL Internet connection will be down.
    Solution to that would be to assign two different public IP addressess on two different interfaces of ASA. Then you attach two crypto maps to both interfaces and by using sla monitor (let's say icmp to main router, if it does not respond then you change routing for remote LAN to second interface) you are selecting which crypto map (with one peer this time) should be used.
    I hope what I wrote makes some sense.

  • Errors when saving contacts locally and syncing them between MacBook and iCloud

    Last night I detected that the synchronisation of contacts between my MacBookPro (Yosemite, 13" Retina, late 2013) and iCloud is no longer working. Sync between iCloud and iOS devices (with iOS 8.1) works fine.
    The problem effects the exchange of information from MBP to iCloud as well as the other way around. However, the issues are slightly different.
    No matter what changes (changing existing contacts, creating new ones or creating/changing groups) I do directly in iCloud (which I usually don't do – I was just testing), none of them get synced to my MBP (though they do sync to all iOS devices).
    If I do work on my MBP the situation is a bit different:
    If I change any existing contact, those changes are not synced.
    If I create a new contact in the "all contacts" group, it syncs to iCloud. If I make changes to that newly created contact, they are again not synced.
    If I create a new contact in any other group, the contact does not sync.
    If I create a new group, that group is displayed in iCloud as "new group", i.e. the name I gave it is lost on the way... If I add contacts to this group (again on the MPB), they do not sync.
    If I create a new group using the option "create group from selected contacts" those contacts are synced to iCloud but the name of the group is again only "new group". Contacts added later to that group also don't sync.
    Worst of all, everything that does not sync to iCloud, is lost once I close the Contacts app, meaning this information is not even stored on my MPB. OS X does not display any error messages. However, looking into the console, I found this message repeatedly whenever I was making changes to contacts etc (not only upon closing the app):
    21.10.14 17:12:46,786 Contacts[532]: Error saving address book: Error Domain=NSCocoaErrorDomain Code=1560 "Bei der Überprüfung sind mehrere Fehler aufgetreten." [TRANSLATION: "Multiple errors occurred during verification"] UserInfo=0x600002e75500 {NSDetailedErrors=(
        "Error Domain=NSCocoaErrorDomain Code=1570 \"originalLine ist ein erforderlicher Wert.\" [TRANSLATION: "originalLine is a required value"] UserInfo=0x600003072180 {NSValidationErrorKey=originalLine, NSLocalizedDescription=originalLine ist ein erforderlicher Wert., [TRANSLATION: NSLocalizedDescription=originalLine is a required value.] NSValidationErrorObject=<NSManagedObject: 0x600000ab6ec0> (entity: ABCDUnknownProperty; id: 0x60000102b9e0 <x-coredata:///ABCDUnknownProperty/tFFBA3874-332E-45E1-AD9D-C743B61BD9148226> ; data: {\n    originalLine = nil;\n    owner = \"0x56b4002ab <x-coredata://606A6059-A9DE-42A2-91C2-BBCDADB20C77/ABCDContact/p5549>\";\n    propertyName = \"X-MS-OL-DESIGN\";\n})}",
        "Error Domain=NSCocoaErrorDomain Code=1570 \"originalLine ist ein erforderlicher Wert.\" [TRANSLATION: "originalLine is a required value"] UserInfo=0x600003462f40 {NSValidationErrorKey=originalLine, NSLocalizedDescription=originalLine ist ein erforderlicher Wert., [TRANSLATION: NSLocalizedDescription=originalLine is a required value.] NSValidationErrorObject=<NSManagedObject: 0x6000006bede0> (entity: ABCDUnknownProperty; id: 0x600000c3d300 <x-coredata:///ABCDUnknownProperty/tFFBA3874-332E-45E1-AD9D-C743B61BD9148152> ; data: {\n    originalLine = nil;\n    owner = \"0x56a0002ab <x-coredata://606A6059-A9DE-42A2-91C2-BBCDADB20C77/ABCDContact/p5544>\";\n    propertyName = \"X-MS-OL-DESIGN\";\n})}"
    21.10.14 17:12:46,788 Contacts[532]: -[ABAddressBook save] failed. (<ABAddressBook: 0x6080020c4130>)
    21.10.14 17:12:46,788 Contacts[532]: [CardDAVPlugin-ERROR] -doSyncWithServer: [syncAddressBook(<ABAddressBook: 0x6080020c4130>) save] FAILED
    Does anyone have an idea how to fix this?
    I am not sure about the relevance of these error messages but I found them as well in the console:
    21.10.14 17:46:36,619 uxipm_ui[745]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.0 instead of 10.10.0. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
    Call location:
    21.10.14 17:46:36,619 uxipm_ui[745]: 0   CarbonCore                          0x00007fff934f2dc3 ___Gestalt_SystemVersion_block_invoke + 113
    21.10.14 17:46:36,620 uxipm_ui[745]: 1   libdispatch.dylib                   0x00007fff92302c13 _dispatch_client_callout + 8
    21.10.14 17:46:36,620 uxipm_ui[745]: 2   libdispatch.dylib                   0x00007fff92302b26 dispatch_once_f + 117
    21.10.14 17:46:36,620 uxipm_ui[745]: 3   CarbonCore                          0x00007fff9349b4da _Gestalt_SystemVersion + 987
    21.10.14 17:46:36,620 uxipm_ui[745]: 4   CarbonCore                          0x00007fff9349b0c7 Gestalt + 144
    21.10.14 17:46:36,620 uxipm_ui[745]: 5   QtCore                              0x000000010c089496 _ZN9QInternal16registerCallbackENS_8CallbackEPFbPPvE + 194
    21.10.14 17:46:36,620 uxipm_ui[745]: 6   ???                                 0x00007fff64845ceb 0x0 + 140734879784171
    And also this one:
    21.10.14 17:46:35,098 CoreServicesUIAgent[322]: unexpected message <OS_xpc_error: <error: 0x7fff79579c60> { count = 1, contents =
      "XPCErrorDescription" => <string: 0x7fff79579f70> { length = 18, contents = "Connection invalid" }
    }>
    And this one:
    21.10.14 17:42:42,115 com.apple.iCloudHelper[737]: objc[737]: Class FALogging is implemented in both /System/Library/PrivateFrameworks/FamilyCircle.framework/Versions/A/FamilyCircl e and /System/Library/PrivateFrameworks/FamilyNotification.framework/Versions/A/Famil yNotification. One of the two will be used. Which one is undefined.
    21.10.14 17:42:42,121 com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    I have tried the troubleshooting listed here: Get help using iCloud Contacts (i.e. disabled and reenabled the sycn through iCloud in Preferences > iCloud and checked the login information etc)
    And I also do not exceed any of the limits for contacts listed here: iCloud: Limits for Contacts, Calendars, Reminders, and Bookmarks
    Any help is greatly appreciated!

    I don't know if this is applicable for you, but this solved it for me.
    My initial situation was the following, Ipad, Iphone and iMac where syncing well. But not my Macbook Pro. So I did this Get help using iCloud Contacts - Apple Support and this Sync Services: Advanced troubleshooting for contact and calendar syncing - Apple Support . As result all my contacts, even the view I had where gone on my macbook. I tried rebooting and restartting but nothing helped.
    Then I did the following. I backuped all the cards from contacts on my imac (by moving them into a folder) and backuped them by export as archive.
    Afterwards I disconnected from icloud on my imac, then reconected and deleted all contacts from the addressbook. I double checked if they where gone on icloud.com too. Afterwards I just moved them back from the folder to the address book. again double checked on icloud.com and the my macbook started syncing properly.
    Which of the things I finally solved it, I don't know for sure. But I assume it was the one with deleting and restoring everything on another machine.

Maybe you are looking for