func nsurlForApplicationDirectory()->NSURL?{
let manager=NSFileManager.defaultManager()
let possibleURLs=manager.URLsForDirectory(NSSearchPathDirectory.AllLibrariesDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask) //look for the location of app support dir in user dormain
if let directoryURL=possibleURLs.first as? NSURL{ //pick the first one
directoryURL.URLByAppendingPathComponent(NSBundle.mainBundle().bundleIdentifier!) //This is this app application support directory
return directoryURL
}
return nil
}
- If you assign out of range value to signed type, the result is undefined
- The code below will never terminate because --0 for unsigned int wraps around to become positive
for (unsigned u = 10; u >= 0; --u)
std::cout << u << std::endl;
- If combine unsigned and signed in a expression,everything get converted to unsigned. For example,
unsigned int a=1;
- You can only use public swift classes or those marked with @objc in objective file.
- The public properties & method will be available to you
- The internal properties & method will only be available if objective--c bridging file is present.
- only private marked with @objc,@IBAction or @IBOutlet will be accessible
- If you mark a class public(unlike private and internal), it members will have a default access of internal.
- Tuple type assume access of its most restrictive type.
- Function assume access of its most restrictive parameter type or return type.
- access type of associate type in an enum must be at least that of the whole enum. The example below is an error because associated type has overall access of private while the enum has default internal access. Since private is less than internal, its an error. The associated type must either be public or internal
enum ENUMERATION{
class FileManager:NSObject,NSFilePresenter { //You need to inherit for NSObject
var fileUrl:NSURL?
let operationQueue=NSOperationQueue()
var contentToWrite=String() //This holds content
var deleted=false //indicate if the file has been deleted
var presentedItemURL: NSURL? {
return fileUrl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.openqa.selenium.JavascriptExecutor; | |
import org.openqa.selenium.NoSuchElementException; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.support.ui.Select; | |
import java.util.concurrent.TimeUnit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.openqa.selenium.NoSuchElementException; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import java.util.List; | |
import java.util.concurrent.TimeUnit; | |
public class TestClass { |
{
"Rules":[
{
"ID":"Moving my special dir",
"Prefix":"dir/",
"Status":"Enabled",
"Transitions":[
{
"Days":90,
OlderNewer