- 博客(47)
- 资源 (19)
- 收藏
- 关注
原创 iOS 获取设备相机所有可用分辨率 supportedMaxPhotoDimensions 并配置 maxPhotoDimensions
iOS 16 以上使用isHighResolutionPhotoEnabled 需要配置maxPhotoDimensions, 以下是根据设备 supportedMaxPhotoDimensions 获取最高拍摄分辨率的办法
2022-11-03 14:40:47
1001
原创 获取Xcode模拟器 Simulator 正在运行的 App Sandbox (沙盒) 文件路径的方法
App Sandbox (沙盒) 文件路径的方法
2022-10-11 12:10:15
1410
原创 在我学之前想看懂的Swift代码,懂了
/// - Note: Type Constraints in Actionfunc 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
146
原创 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/id881256329ext.
2021-05-07 14:33:39
199
原创 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.htmlextension BinaryInteger { var ...
2021-05-07 12:50:43
387
原创 定义一个列表存储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
1143
原创 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
608
原创 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
7491
原创 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 = 0a = len(str(g))s = gwhile s > 0: p = s % 10 b += p ** a s //= 10if g == b: print(g, "BOLSA ARMSTRONG SA.
2021-04-29 17:00:03
517
原创 使用Python的随机数模块 random 实现猜数字游戏
随机生成1~10之间的一个整数,提示用户去猜,用户最多可以猜3次;如果在3次内猜对答案,程序结束,显示如“答对了,您猜了2次!”的信息;如果猜错,显示信息如“太大了”,“太小了”等提示。## main.py# Random Access Memory## Created by Mewlan Musajan on 4/29/21.#import randomg = random.randint(1, 10)b = int(input('1 DIN 10 GHICHE
2021-04-29 16:48:48
2494
原创 通过用户输入三角形三边长度,并计算三角形的面积,其中长度为实数
## main.py# Some Python Program## Created by Mewlan Musajan on 4/29/21.#g = int(input('UZUNLUQ 1: '))b = int(input('UZUNLUQ 2: '))a = int(input('UZUNLUQ 3: '))def isLengthValid(): global g global b global a while g+b<a o.
2021-04-29 15:55:54
836
原创 最好的捷径就是没有捷径
## main.py# Some Python Program## Created by Mewlan Musajan on 4/28/21.#triangleLength1 = 0triangleLength2 = 0triangleLength3 = 0def lengthInput(): global triangleLength1 global triangleLength2 global triangleLength3 tri.
2021-04-28 23:09:00
149
转载 十分钟内学会 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
145
原创 功夫不负有心人,学就完事
## 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
216
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/id881256329fun.
2021-04-26 19:22:57
163
原创 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/id881256329func.
2021-04-26 17:41:45
162
原创 功夫不负有心人
//// 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/id881256329stru.
2021-04-23 21:25:08
201
转载 感觉学到点东西,会又忘掉吗?
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
115
原创 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
113
原创 坚持学 Swift
//// main.swift// Ultimate//// Created by Mewlan Musajan on 3/6/21.//import Foundation@propertyWrapperstruct TwelveOrLess { private var number: Int init() { self.number = 0 } var wrappedValue: Int { get { .
2021-03-06 02:03:19
99
原创 一个字符都懒得多写
let names = ["Apple", "Google", "Microsoft", "iWillook"]var reversedNames = names.sorted(by: > )print(reversedNames)
2021-03-05 19:48:11
113
原创 Swift 返回类型是函数的函数
//// main.swift// Ultimate//// Created by Mewlan Musajan on 3/5/21.//import Foundationfunc stepForward(_ input: Int) -> Int { return input + 1}func stepBackward(_ input: Int) -> Int { return input - 1}func chooseStepFunctio.
2021-03-05 18:57:44
172
原创 和C指针函数相似的Swift语法
//// main.swift// Ultimate//// Created by Mewlan Musajan on 3/5/21.//import Foundationfunc swapTwoInt(_ a: inout Int, _ b: inout Int){ let temporaryA = a a = b b = temporaryA}var someInt = 256var anotherInt = 512print("someI.
2021-03-05 18:26:18
137
原创 重要的是过程
//// main.swift// Ultimate//// Created by Mewlan Musajan on 3/5/21.//import Foundationfunc arthmeticMean(_ numbers: Double...) -> Double{ var total: Double = 0 for number in numbers { total += number } return total .
2021-03-05 18:14:30
118
原创 当我没学
//// main.swift// Ultimate//// Created by Mewlan Musajan on 3/2/21.//import Foundationfunc 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
120
原创 希望今年能看懂和写出这样的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
132
原创 Swift Playgrounds Learn to Code 2 final project Pyramid
Swift Playgrounds 基于笛卡尔坐标的立体金字塔The most difficult thing in life is know yourself.- Thalesvar coords: [Int] = []var increse = 9for i in 1 ... 4 { for j in i ... i + increse { coords.append(j) } let insideSquare = world.coordina.
2021-03-01 13:23:37
177
转载 #pragma 预处理指令详解
在所有的预处理指令中,#pragma 指令可能是最复杂的了,它的作用是设定编译器的状态或者是指示编译器完成一些特定的动作。#pragma指令对每个编译器给出了一个方法,在保持与C和C++语言完全兼容的情况下,给出主机或操作系统专有的特征。依据定义,编译指示是机器或操作系统专有的,且对于每个编译器都是不同的。 其格式一般为: #pragma para 其中par
2017-11-09 19:06:32
247
转载 C语言头文件深入理解
C语言程序中,源文件通常分为两种:一种用于保存程序的声明(declaration),称为头文件;另一种用于保存程序的实现(implementation),称为定义(definition)文件。 C程序的头文件以“.h”为后缀,C 程序的定义文件以“.c”为后缀。可以将 .h 文件的内容写在 .c 文件中,也可以将 .c 文件的内容写在 .h 中,但这是很不好的习惯。许多初学者用了头文件
2017-11-02 00:47:13
2282
转载 visual studio 调试时提示 已加载“C:\Windows\SysWOW64\ntdll.dll”。无法查找或打开 PDB 文件。
问题描述“Win32Project3.exe”(Win32): 已加载“D:\software\VS2013\VS2013 文档\Win32Project3\Debug\Win32Project3.exe”。已加载符号。“Win32Project3.exe”(Win32): 已加载“C:\Windows\SysWOW64\ntdll.dll”。无法查找或打开 PDB 文件。“Win32
2017-11-01 22:53:59
2245
转载 error: a label can only be part of a statement and a declaration is not a statement
GCC:error: a label can only be part of a statement and a declaration is not a statement switch(a){ swtch(a){case 1: case 1:.................... {..........
2017-10-31 01:12:38
371
转载 Segmentation fault到底是何方妖孽
那么对于任何没有经过MMU映射过的虚拟空间的地址,不管进程是执行写操作还是读操作,操作系统都会捕捉到这个错误的非法访问,然后输出一个“Segmetation Fault”的错误提示信息并强行终止进程。程序之所以会时不时的出现“Segmetation Fault”的根本原因是进程访问到了没有访问权限的地方,诸如内核区域或者其0x08048000之前的地方,或者由于要访问的内存没有经M
2017-10-20 21:16:06
519
原创 难点—在引用数组元素时指针的运算
如果指针变量p1和p2都指向同一数组,如执行 p2 - p1,结果是 p2 - p1 的值(两个地址之差)除以数组元素的长度。假设,p2 指向实型数组元素 a[5],p2 的值为2020;p1指向a[3],其值为2012,则 p2 - p1 的结果是(2020 - 2012)/ 4 = 2。这个结果是有意义的,表示 p2 所指的元素与 p1 所指的元素之间2个元素。这样,人们就不需要具体的知道 p
2017-10-19 23:38:16
725
ALKATIP Aqqigi Yaman Tom.ttf.zip
2021-05-11
简易计算器 (C语言)作业
2017-11-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人