学习log
iWillook
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
iOS 获取设备相机所有可用分辨率 supportedMaxPhotoDimensions 并配置 maxPhotoDimensions
iOS 16 以上使用isHighResolutionPhotoEnabled 需要配置maxPhotoDimensions, 以下是根据设备 supportedMaxPhotoDimensions 获取最高拍摄分辨率的办法原创 2022-11-03 14:40:47 · 1309 阅读 · 0 评论 -
Xcode 怎样使用 iOS 16 文件(File)工具暴露你的 app 文件
开发基于文件夹的app原创 2022-10-29 11:56:14 · 871 阅读 · 0 评论 -
Swift 中的 Data Race (数据争用)
【代码】Swift 中的 Data Race (数据争用)转载 2022-10-20 18:03:21 · 369 阅读 · 0 评论 -
获取Xcode模拟器 Simulator 正在运行的 App Sandbox (沙盒) 文件路径的方法
App Sandbox (沙盒) 文件路径的方法原创 2022-10-11 12:10:15 · 1637 阅读 · 0 评论 -
在我学之前想看懂的Swift代码,懂了
/// - Note: Type Constraints in Action func findIndex(ofString valueToFind: String, in array: [String]) -> Int? { for (index, value) in array.enumerated() { if value == valueToFind { return index } } .原创 2022-02-15 17:22:16 · 201 阅读 · 0 评论 -
利用Swift语言特性,随手写个伪随机数生成器
利用Swift语言特性,随手写个伪随机数生成器原创 2022-02-13 23:57:55 · 1149 阅读 · 0 评论 -
Swift 位运算练习
// // main.swift // Ultimate // // Created by Mewlan Musajan on 5/7/21. // // Excerpt From: Apple Inc. “The Swift Programming Language (Swift 5.3).” Apple Books. https://books.apple.com/us/book/the-swift-programming-language-swift-5-4/id881256329 ext.原创 2021-05-07 14:33:39 · 257 阅读 · 0 评论 -
Swift 十进制二进制转换 (How to convert a decimal number to binary in Swift)
// // main.swift // Ultimate // // Created by Mewlan Musajan on 5/7/21. // // Excerpt From: SINKUK KANG “How to convert a decimal number to binary in Swift?” stackoverflow. https://www.xspdf.com/help/51882984.html extension BinaryInteger { var ...原创 2021-05-07 12:50:43 · 471 阅读 · 0 评论 -
定义一个列表存储n个整数,求列表的长度,最大值,最小值和平均值
# # main.py # List Handling # # Created by Mewlan Musajan on 4/29/21. # def listHandling(g): listLength = 0 all = 0 maximum = max(g) minimum = min(g) for b in g: listLength += 1 all += b average = all / listLength print(str("列表的长度{0},最大值{1}.原创 2021-04-29 19:27:29 · 1207 阅读 · 0 评论 -
Python的线性查找(作业)
线性查找指按一定的顺序检查数组中每一个元素,直到找到所要寻找的特定值为止。 定义Search(arr,n,x)函数实现在列表arr中查找x元素,如果存在输出元素在arr中的位置,否则输出-1.其中,n为arr的长度。 定义列表arr = [ 'A', 'B', 'C', 'D', 'E' ];来存储几个字母,提示用户输入一个字母,调用Search函数进行查找。 # # main.py # Linear Search # # Created by Mewlan Musajan on 4/2.原创 2021-04-29 19:16:07 · 663 阅读 · 0 评论 -
Python定义一个Calculator类表示计算器(作业)
定义一个Calculator类表示计算器,在该类中定义四个方法add(x, y)、subtract(x, y)、multiply(x, y)、divide(x, y)四个方法分别实现两个数的加法、减法、乘法和除法。 创建Claculator对象,提示用户输入两个操作数和运算符(+,-,*,/),调用对应的方法得到计算结果。请设计一个友好的信息交互方式。 # # main.py # Calculator # # Created by Mewlan Musajan on 4/29/21. # .原创 2021-04-29 18:26:42 · 7720 阅读 · 0 评论 -
Python 阿姆斯特朗数 Assignment
# # main.py # Armstrong Number Validation # # Created by Mewlan Musajan on 4/29/21. # g = int(input("BIR PÜTÜN SAN KIRGÜZÜNG: ")) b = 0 a = len(str(g)) s = g while s > 0: p = s % 10 b += p ** a s //= 10 if g == b: print(g, "BOLSA ARMSTRONG SA.原创 2021-04-29 17:00:03 · 593 阅读 · 0 评论 -
使用Python的随机数模块 random 实现猜数字游戏
随机生成1~10之间的一个整数,提示用户去猜,用户最多可以猜3次; 如果在3次内猜对答案,程序结束,显示如“答对了,您猜了2次!”的信息; 如果猜错,显示信息如“太大了”,“太小了”等提示。 # # main.py # Random Access Memory # # Created by Mewlan Musajan on 4/29/21. # import random g = random.randint(1, 10) b = int(input('1 DIN 10 GHICHE原创 2021-04-29 16:48:48 · 2610 阅读 · 0 评论 -
最好的捷径就是没有捷径
# # main.py # Some Python Program # # Created by Mewlan Musajan on 4/28/21. # triangleLength1 = 0 triangleLength2 = 0 triangleLength3 = 0 def lengthInput(): global triangleLength1 global triangleLength2 global triangleLength3 tri.原创 2021-04-28 23:09:00 · 180 阅读 · 0 评论 -
十分钟内学会 Python
# # main.py # Some Python Program # # Created by Mewlan Musajan on 4/27/21. # Excerpt From: Stochastic Technologies “Tutorial - Learn Python in 10 minutes.” Stavros Korokithakis. https://www.stavros.io/t.转载 2021-04-28 17:02:40 · 195 阅读 · 0 评论 -
功夫不负有心人,学就完事
# # main.py # Some Python Program # # Created by Mewlan Musajan on 4/27/21. # print(range(10)) rangeList = list(range(10)) print(rangeList) for number in range(10): if number in (3, 4, 7, 9): print("number is in it") break els.原创 2021-04-27 21:19:11 · 289 阅读 · 3 评论 -
alright alright alright
// // main.swift // Ultimate // // Created by Mewlan Musajan on 4/26/21. // //Excerpt From: Apple Inc. “The Swift Programming Language (Swift 5.3).” Apple Books. https://books.apple.com/us/book/the-swift-programming-language-swift-5-3/id881256329 fun.原创 2021-04-26 19:22:57 · 216 阅读 · 0 评论 -
It feels great to know you learned something, isn‘t it?
// // main.swift // Ultimate // // Created by Mewlan Musajan on 4/26/21. // //Excerpt From: Apple Inc. “The Swift Programming Language (Swift 5.3).” Apple Books. https://books.apple.com/us/book/the-swift-programming-language-swift-5-3/id881256329 func.原创 2021-04-26 17:41:45 · 219 阅读 · 0 评论 -
功夫不负有心人
// // main.swift // Ultimate // // Created by Mewlan Musajan on 4/23/21. // //Excerpt From: Apple Inc. “The Swift Programming Language (Swift 5.3).” Apple Books. https://books.apple.com/us/book/the-swift-programming-language-swift-5-3/id881256329 stru.原创 2021-04-23 21:25:08 · 254 阅读 · 0 评论 -
感觉学到点东西,会又忘掉吗?
extension Int { func repetitions(task: () -> Void) { for _ in 0..<self { task() } } mutating func square() { self = self * self } subscript(digitIndex: Int) -> Int { var decimal.转载 2021-03-23 19:10:52 · 171 阅读 · 0 评论 -
Swift Error Handling
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/20/21. // enum VendingMachineError: Error { case invalidSelection case insufficientFunds(coinsNeeded: Int) case outOfStock } struct Item { var price: Int var count:.原创 2021-03-23 15:10:10 · 175 阅读 · 0 评论 -
坚持学 Swift
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/6/21. // import Foundation @propertyWrapper struct TwelveOrLess { private var number: Int init() { self.number = 0 } var wrappedValue: Int { get { .原创 2021-03-06 02:03:19 · 149 阅读 · 0 评论 -
一个字符都懒得多写
let names = ["Apple", "Google", "Microsoft", "iWillook"] var reversedNames = names.sorted(by: > ) print(reversedNames)原创 2021-03-05 19:48:11 · 153 阅读 · 0 评论 -
Swift 返回类型是函数的函数
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/5/21. // import Foundation func stepForward(_ input: Int) -> Int { return input + 1 } func stepBackward(_ input: Int) -> Int { return input - 1 } func chooseStepFunctio.原创 2021-03-05 18:57:44 · 233 阅读 · 0 评论 -
和C指针函数相似的Swift语法
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/5/21. // import Foundation func swapTwoInt(_ a: inout Int, _ b: inout Int) { let temporaryA = a a = b b = temporaryA } var someInt = 256 var anotherInt = 512 print("someI.原创 2021-03-05 18:26:18 · 187 阅读 · 0 评论 -
重要的是过程
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/5/21. // import Foundation func arthmeticMean(_ numbers: Double...) -> Double { var total: Double = 0 for number in numbers { total += number } return total .原创 2021-03-05 18:14:30 · 163 阅读 · 0 评论 -
当我没学
// // main.swift // Ultimate // // Created by Mewlan Musajan on 3/2/21. // import Foundation func minMax(array: [Int]) -> (min: Int, max: Int) { var currentMin = array[0] var currentMax = array[0] for value in array[1..<array.c.原创 2021-03-05 15:44:43 · 166 阅读 · 0 评论 -
希望今年能看懂和写出这样的Swift代码
macOS 终端程序下载 func anyCommonElements<T: Sequence, U: Sequence>(_ lhs: T, _ rhs: U) -> Bool where T.Element: Equatable, T.Element == U.Element { for lhsItem in lhs { for rhsItem in rhs { if lhsItem == rhsItem { .原创 2021-03-02 19:17:45 · 181 阅读 · 0 评论
分享