Hacker Newsnew | past | comments | ask | show | jobs | submit | _jsn's commentslogin

You can create a Smart Folder that is based on one or more Tags (or any other combination of metadata, but Tags are useful in that you can manipulate them directly).


That facility sort of exists for sandboxed Mac apps, since all incidental files related to the app are under a single container that iirc is deleted if the corresponding app is removed.


Ah then "uninstallation" isn't needed at all, unless it pumps a lot of stuff into ~/Library/Application Support or somewhere, kind of like what Xcode does (I think it forgets about outdated and huge documentation downloads sometimes.)


This is very similar to work done by J. Alex Halderman et al. in 2008 [1]. If you find this interesting, check out their paper. They give an example of a bitmap image in memory and its degradation over a number of seconds without power. It's a fantastic visual aid and you might be surprised by how well the data survives; if you're fast (5 seconds) it's nearly lossless.

[1] https://citp.princeton.edu/research/memory/


They were injecting code in to the Finder too. No doubt this is why Finder Sync Extensions[1] were created, because it's a support nightmare. (Well, and also because that code injection vector was eliminated in El Capitan.)

[1] https://developer.apple.com/library/ios/documentation/Genera...


Wouldn't it be fabulous if they live streamed someone writing the code for an account deletion feature?


WebKit supports ARIA attributes. If you aren't using them in your web code already, VoiceOver can probably navigate your page just fine, but it's subpar compared to a document that has been marked up with rich accessibility information.


Yes. It's double precision on 64-bit platforms and single precision on 32-bit.

  #if defined(__LP64__) && __LP64__
  # define CGFLOAT_TYPE double
  # define CGFLOAT_IS_DOUBLE 1
  # define CGFLOAT_MIN DBL_MIN
  # define CGFLOAT_MAX DBL_MAX
  #else
  # define CGFLOAT_TYPE float
  # define CGFLOAT_IS_DOUBLE 0
  # define CGFLOAT_MIN FLT_MIN
  # define CGFLOAT_MAX FLT_MAX
  #endif


Exactly, this is also pointed out in the struct definition in CoreGraphics for CGFloat.

/// The native type used to store the CGFloat, which is Float on 32-bit architectures and Double on 64-bit architectures.


Right. The OS X image now has to contain a /usr/local directory so that it exists unrestricted after you install the OS (otherwise you would be unable to create it yourself, because /usr is restricted). It has to ship with some permissions, so it rightly ships owned by root. The installer will apply these permissions each time it runs.

Aside: I really wish Homebrew didn't encourage having a single user own /usr/local. If they're going to insist on never needing sudo to install things, it should just default to installing in your home directory.


It's funny, but that's just how it is in the Motor City. I'm originally from there, and when my aunt visited me here in the SF Bay, she was amazed at how many people were moving from place to place not in cars. (And for reasons other than "they had multiple DUIs")


Protocol extensions seem like a good way to get what you'd frequently want out of abstract classes. What's missing?


What I want (Scala land):

  trait Robot
    var serialCode = generateSerialCode()
  
    def gas
    
    def engine = Engine(gas)
    def body = Body(engine)

  class SunnyRobot extends Robot
    def gas = sun

  class OilyRobot extends Robot
    def gas = oil
Protocol extensions don't hold state. They are meant to provide default implementations for a type, not as a 1:1 relationship with the class it's implementing functionality for. Following what you're saying, I would be doing something like this:

* `extension Robot where Self = SunnyRobot { def gas() = ... }`

* `extension Robot where Self = OilyRobot { def gas() = ... }`

That looks all good and well, right? Ok, well now my sunny robot wants to find the sun and my oily robot wants to go find oil. How to provide functionality unique to each of them? Maybe I'm just not getting something, but I'm pretty sure protocol extensions are not the answer to the problem I'm trying to describe.

When you're working in front-end land, you can do your best to stay functional and be cool and all that jazz, but it's just a waste of time usually. You're going to use a lot of state and you just have to learn how to manage that effectively (IMO). What this boils down to for me is that I might build a cell that does 3 things great and will be on every cell, but then business designs call for 2 slightly different cells still based upon that main cell. Oh and when those different cells are tapped, different things should happen.

So again, I just go about doing it with the simple base class gonna throw you an exception unless you override the "abstract" method. This way, I get to keep state going down and classes can actually fill up naturally rather than playing the protocol game.


Wouldn't you define gas() and whatever class-specific methods in the class itself, instead of in extensions on the protocol?

    class SunnyRobot : Robot {
      func gas() { ... }
      func findSun() { ... }
    }


By defining `gas()` in the children, you can't take advantage of it in base class. For example, the base robot might know how to move and all that, but the sunny robot just needs to know where it's going.

Protocol extensions just don't cut it, I'm sorry. They're great for defining some default behavior and doing kinda-abstract-classes, but it's a different playing field in Swift/Obj-C than Java/Scala/C#/etc..


I think this[1] does what you want, unless I'm not understanding your problem description. AFAIK you are correct about protocol extensions not holding state. So I don't think you can implement the `var serialCode = generateSerialCode()` with just a protocol. But you could do it with a protocol + base class.

[1]: https://gist.github.com/jayrhynas/49945331e41314fc3ede

Edit: I just realized that with this method, the protocol extension is useless, you could just define `move` on Robot. So protocol extensions can give you a mix of abstract & default methods but if you need to inherit state you need to use a base class.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: