From: acevest Date: Mon, 30 Oct 2017 11:42:27 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/man.named.html?a=commitdiff_plain;h=5fbca2735bb7279cf31b44b4b2385f1b01292ce6;p=acecode.git ... --- diff --git a/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate index b35f291..8cf4b10 100644 Binary files a/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate and b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/learn/AppleSwift/AppleSwift.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate b/learn/AppleSwift/AppleSwift.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate index f58186f..5ac116a 100644 Binary files a/learn/AppleSwift/AppleSwift.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate and b/learn/AppleSwift/AppleSwift.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/learn/AppleSwift/AppleSwift.xcodeproj/xcuserdata/Ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/learn/AppleSwift/AppleSwift.xcodeproj/xcuserdata/Ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 7a7ffc6..58e1053 100644 --- a/learn/AppleSwift/AppleSwift.xcodeproj/xcuserdata/Ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/learn/AppleSwift/AppleSwift.xcodeproj/xcuserdata/Ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -14,7 +14,9 @@ startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "40" - endingLineNumber = "40"> + endingLineNumber = "40" + landmarkName = "unknown" + landmarkType = "0"> diff --git a/learn/go/clock.go b/learn/go/clock.go index c7ce67a..015b132 100644 --- a/learn/go/clock.go +++ b/learn/go/clock.go @@ -15,6 +15,8 @@ import ( "net" "log" "time" + "math/rand" + "strconv" ) func main() { @@ -46,7 +48,12 @@ func handleConn(c net.Conn) { return } - //time.Sleep(1 * time.Second) + _, err = io.WriteString(c, strconv.Itoa(rand.Int())+"\n") + if err != nil { + return + } + + time.Sleep(1 * time.Second) time.Sleep(100 * time.Millisecond); } } diff --git a/tools/AceBox/AceBox.xcodeproj/project.pbxproj b/tools/AceBox/AceBox.xcodeproj/project.pbxproj index e373c87..617ae79 100644 --- a/tools/AceBox/AceBox.xcodeproj/project.pbxproj +++ b/tools/AceBox/AceBox.xcodeproj/project.pbxproj @@ -13,19 +13,8 @@ 50A4F2821AF2154100DB7E36 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A4F2801AF2154100DB7E36 /* Main.storyboard */; }; 50A4F2841AF2154100DB7E36 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 50A4F2831AF2154100DB7E36 /* Images.xcassets */; }; 50A4F2871AF2154100DB7E36 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50A4F2851AF2154100DB7E36 /* LaunchScreen.xib */; }; - 50A4F2931AF2154100DB7E36 /* AceBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A4F2921AF2154100DB7E36 /* AceBoxTests.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 50A4F28D1AF2154100DB7E36 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 50A4F26D1AF2154100DB7E36 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 50A4F2741AF2154100DB7E36; - remoteInfo = AceBox; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 50A4F2751AF2154100DB7E36 /* Ace.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ace.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50A4F2791AF2154100DB7E36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -35,7 +24,6 @@ 50A4F2811AF2154100DB7E36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50A4F2831AF2154100DB7E36 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 50A4F2861AF2154100DB7E36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 50A4F28C1AF2154100DB7E36 /* AceBoxTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AceBoxTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50A4F2911AF2154100DB7E36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50A4F2921AF2154100DB7E36 /* AceBoxTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AceBoxTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -48,13 +36,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50A4F2891AF2154100DB7E36 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -71,7 +52,6 @@ isa = PBXGroup; children = ( 50A4F2751AF2154100DB7E36 /* Ace.app */, - 50A4F28C1AF2154100DB7E36 /* AceBoxTests.xctest */, ); name = Products; sourceTree = ""; @@ -135,24 +115,6 @@ productReference = 50A4F2751AF2154100DB7E36 /* Ace.app */; productType = "com.apple.product-type.application"; }; - 50A4F28B1AF2154100DB7E36 /* AceBoxTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50A4F2991AF2154100DB7E36 /* Build configuration list for PBXNativeTarget "AceBoxTests" */; - buildPhases = ( - 50A4F2881AF2154100DB7E36 /* Sources */, - 50A4F2891AF2154100DB7E36 /* Frameworks */, - 50A4F28A1AF2154100DB7E36 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 50A4F28E1AF2154100DB7E36 /* PBXTargetDependency */, - ); - name = AceBoxTests; - productName = AceBoxTests; - productReference = 50A4F28C1AF2154100DB7E36 /* AceBoxTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -165,10 +127,7 @@ TargetAttributes = { 50A4F2741AF2154100DB7E36 = { CreatedOnToolsVersion = 6.3.1; - }; - 50A4F28B1AF2154100DB7E36 = { - CreatedOnToolsVersion = 6.3.1; - TestTargetID = 50A4F2741AF2154100DB7E36; + DevelopmentTeam = VR7L9Q5L2E; }; }; }; @@ -186,7 +145,6 @@ projectRoot = ""; targets = ( 50A4F2741AF2154100DB7E36 /* AceBox */, - 50A4F28B1AF2154100DB7E36 /* AceBoxTests */, ); }; /* End PBXProject section */ @@ -202,13 +160,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50A4F28A1AF2154100DB7E36 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -222,24 +173,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50A4F2881AF2154100DB7E36 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 50A4F2931AF2154100DB7E36 /* AceBoxTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 50A4F28E1AF2154100DB7E36 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 50A4F2741AF2154100DB7E36 /* AceBox */; - targetProxy = 50A4F28D1AF2154100DB7E36 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 50A4F2801AF2154100DB7E36 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -302,6 +237,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -339,6 +275,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -348,10 +285,11 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = VR7L9Q5L2E; INFOPLIST_FILE = AceBox/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tencent.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.tencent.voip.ace; PRODUCT_NAME = Ace; }; name = Debug; @@ -360,50 +298,15 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = VR7L9Q5L2E; INFOPLIST_FILE = AceBox/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tencent.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.tencent.voip.ace; PRODUCT_NAME = Ace; }; name = Release; }; - 50A4F29A1AF2154100DB7E36 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = AceBoxTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tencent.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AceBox.app/AceBox"; - }; - name = Debug; - }; - 50A4F29B1AF2154100DB7E36 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = AceBoxTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.tencent.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AceBox.app/AceBox"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -425,15 +328,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 50A4F2991AF2154100DB7E36 /* Build configuration list for PBXNativeTarget "AceBoxTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50A4F29A1AF2154100DB7E36 /* Debug */, - 50A4F29B1AF2154100DB7E36 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 50A4F26D1AF2154100DB7E36 /* Project object */; diff --git a/tools/AceBox/AceBox.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate b/tools/AceBox/AceBox.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate index e0be8c7..edc0110 100644 Binary files a/tools/AceBox/AceBox.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate and b/tools/AceBox/AceBox.xcodeproj/project.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/tools/AceBox/AceBox/Base.lproj/Main.storyboard b/tools/AceBox/AceBox/Base.lproj/Main.storyboard index b4035b0..cc32045 100644 --- a/tools/AceBox/AceBox/Base.lproj/Main.storyboard +++ b/tools/AceBox/AceBox/Base.lproj/Main.storyboard @@ -1,9 +1,18 @@ - - + + + + + - + + + + + Helvetica + + @@ -14,24 +23,24 @@ - + - - + @@ -54,24 +63,24 @@ - + - + @@ -94,12 +103,12 @@ - + - + - + @@ -109,7 +118,7 @@ - + @@ -130,12 +139,12 @@ - - - + + + - + @@ -156,5 +165,5 @@ - + diff --git a/tools/AceBox/AceBox/Images.xcassets/AppIcon.appiconset/Contents.json b/tools/AceBox/AceBox/Images.xcassets/AppIcon.appiconset/Contents.json index 0052e14..d80ff66 100644 --- a/tools/AceBox/AceBox/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/tools/AceBox/AceBox/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -32,6 +42,16 @@ "filename" : "AceBoxIcon@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -68,6 +88,11 @@ "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/tools/AceBox/AceBoxTests/AceBoxTests.swift b/tools/AceBox/AceBoxTests/AceBoxTests.swift index 058e114..60c1008 100644 --- a/tools/AceBox/AceBoxTests/AceBoxTests.swift +++ b/tools/AceBox/AceBoxTests/AceBoxTests.swift @@ -28,7 +28,7 @@ class AceBoxTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock() { + self.measure() { // Put the code you want to measure the time of here. } } diff --git a/tools/game/ksp_planet_transfer_calculator.go b/tools/game/ksp_planet_transfer_calculator.go index dbc3ebb..a65cc0b 100644 --- a/tools/game/ksp_planet_transfer_calculator.go +++ b/tools/game/ksp_planet_transfer_calculator.go @@ -19,7 +19,7 @@ type AstronomicalObject struct { sma float64 // Semi-major axis 轨道半长轴 inclination float64 // 轨道倾角 eccentricity float64 // 轨道偏心率,没有使用 - u float64 // 标准重力参数 + u float64 // 标准重力参数 u = GM, F=(G*M*m)/(r^2) soi float64 // Sphere of influence 势国作用范围 } @@ -34,6 +34,17 @@ var objects = map[string]AstronomicalObject { 1.1723328e18, math.MaxFloat64, // 应该是infinity }, + "Eve" : + { + "Eve", + "Kerbol", + 700000, + 9832684544, + 2.1, + 0.01, + 8.1717302E12, + 85109365, + }, "Duna" : { "Duna", @@ -68,7 +79,7 @@ func main() { // 轨道周期的计算公式为 T=2*Pi*sqrt(sma^3/u) // 设源和目标轨道半轴长分别为Rs, Rd - // 则转移轨道周期为 Tt = 2*Pi*sqlrt(((Rs+Rd)/2)^3/u) + // 则转移轨道周期为 Tt = 2*Pi*sqrt(((Rs+Rd)/2)^3/u) // 则源,目标和平均转移角速度分别为 Ws = 1/Ts, Wd = 1/Td, Wt = 1/Tt // 设转移时间为t // 则有 t*Wt = Pi ===> t = Tt*Pi @@ -77,7 +88,7 @@ func main() { // ===> PhaseAngle = Pi - Tt*Pi/Td aos := objects["Kerbin"] - aod := objects["Duna"] + aod := objects["Eve"] if aos.parent != aod.parent || aos.parent == "" || aod.parent == "" { fmt.Println("invalid astronomical object"); return