728x90
๋ฐ˜์‘ํ˜•

Computer Science 102

[python] ํ…์ŠคํŠธ ํŒŒ์ผ ์ž๋ฅด๊ธฐ (text file crop)

#ํŒŒ์ด์ฌ ํ…์ŠคํŠธ ํŒŒ์ผ ๋‚ ๋ฆฌ๊ธฐ #python textfile crop #python textfile delete line ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ…์ŠคํŠธํŒŒ์ผ์ด ์žˆ๋‹ค๊ณ  ํ•˜์ž ์—ฌ๊ธฐ์„œ ํŠน์ • line ํ˜น์€ ์—ฌ๋Ÿฌ๊ฐœ์˜ line์„ ์ง€์šฐ๊ณ  ์‹ถ๋‹ค๋ฉด..?? ์ ˆ๋ฐ˜์„ ๋‚ ๋ ค๋ฒ„๋ฆฌ๊ณ  ์‹ถ๋‹ค๋ฉด?? line 1 of the text file line 2 of the text file line 3 of the text file line 4 of the text file line 5 of the text file # 1. ํ…์ŠคํŠธ ํŒŒ์ผ ์ฝ์–ด๋“ค์ด๊ธฐ # filename์— ํ…์ŠคํŠธํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ string์œผ๋กœ ๋„ฃ์–ด์ค€๋‹ค filename = './textfile.txt' text_file = opend(filename).readlines() # 2. ์ง€์šฐ๊ณ  ์‹ถ์€ li..

[Xcode] Compiling failed: extra tokens at the end of #sourceLocation directive ์—๋Ÿฌ ํ•ด๊ฒฐ โ€ผ๏ธ

xcode preview๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•˜๋ฉด ์ž๊พธ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค Compiling failed: extra tokens at the end of #sourceLocation directive ์ด์™€ ๊ฐ™์€ ์—๋Ÿฌ๋Š” xcode ๋ฒ„๊ทธ๋ผ๊ณ  ํ•œ๋‹ค. if ๋ฌธ์ด๋‚˜ ํด๋กœ์ €์™€ ๊ฐ™์ด '{' ๊ด„ํ˜ธ ์—ด๊ธฐ ๋ถ€๋ถ„์— ์ฃผ์„์ด ์žˆ์œผ๋ฉด ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜๋ผ๊ณ  ํ•œ๋‹ค. ์‹ค์ œ๋กœ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ์ง€์ ์œผ๋กœ ๊ฐ€๋ณด๋‹ˆ ๊ด„ํ˜ธ ์—ด๊ธฐ ๋ถ€๋ถ„์— ์ฃผ์„์ด ๋‹ฌ๋ ค์žˆ์—ˆ๋‹ค ์ € ์ฃผ์„์„ ์‚ญ์ œํ•ด์ฃผ๊ณ  ๋‹ค์‹œ ๋นŒ๋“œํ•˜์˜€๋”ฐ ! Build Success !!

[Xcode] Simulator Error ํ•ด๊ฒฐ๋ฐฉ๋ฒ• : ld: in /Users/../.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o), building for iOS Simulator, but linking in obj..

์ด๋ฒˆ์— ์•„์ด๋งฅ M1์„ ๊ตฌ๋งคํ•˜๊ณ  simulator๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋งˆ๋‹ค ์—๋Ÿฌ์™€ ๋งˆ์ฃผํ•˜์—ฌ,, ๊ต‰์žฅํžˆ ๋ถˆํŽธํ–ˆ๋‹ค,,ใ…Ž ๋‚ด๊ฐ€ ๋งˆ์ฃผํ•œ ์—๋Ÿฌ๋Š” ld: in /Users/../.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIR..

[swift] xcode build ์‹œ "Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window." ์˜ค๋ฅ˜ ํ•ด๊ฒฐ๋ฒ•โ€ผ๏ธ

๊ฐ€๋” xcode์—์„œ ๋””๋ฐ”์ด์Šค ๋ฐ”๊ฟ”์„œ ๋นŒ๋“œํ•˜๋ ค๊ณ  ํ•˜๋‹ค๋ณด๋ฉด ๋งˆ์ฃผํ•˜๊ฒŒ ๋˜๋Š” ์—๋Ÿฌ๋ฉ”์„ธ์ง€... Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window. ์ด์— ๋Œ€ํ•œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์€ ์•„์ฃผ ๊ฐ„๋‹จํ•˜๋‹ค!!!!! ๊ป๋‹ค ํ‚ค๋ฉด ๋ผ์š” โ˜บ๏ธ

[swift] uikit์™€ swiftui ํ˜ผ์šฉํ•˜๊ธฐ (uikit์—์„œ swiftui์‚ฌ์šฉ, swiftui์—์„œ uikit์‚ฌ์šฉ)

1. UIKit → SwiftUI : UIKit์˜ UIView๋ฅผ SwiftUI์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• ์˜์–ด๋กœ๋Š” wrapping์„ ํ•œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. wrap UIView to use in SwiftUI 1-a. SwiftUI์—์„œ UIView ์‚ฌ์šฉ UIViewRepresentable protocol๋ฅผ ์ค€์ˆ˜ํ•˜๋Š” ๊ตฌ์กฐ์ฒด(struct) ์ƒ์„ฑํ•˜์—ฌ SwiftUI์—์„œ ์‚ฌ์šฉ UIViewRepresentable protocol : UIViewRespresentable protocol์„ ์ค€์ˆ˜ํ•˜๊ธฐ ์œ„ํ•ด ๋ฐ˜๋“œ์‹œ ๊ตฌํ˜„๋˜์–ด์•ผ ํ•˜๋Š” 2๊ฐ€์ง€ ๋ฉ”์†Œ๋“œ func makeUIView(context: Context) → UIKit์˜ UI ElementType(ex. UILabel) SwiftUI์—์„œ ๋ณด์—ฌ์ค„ view๋ฅผ ๋ฐ˜ํ™˜ func updateUIVi..

[swift] swift์˜ ์ „์ฒด์ ์ธ ๊ตฌ์กฐ ๋ฐ UIView ๊ฐœ๋…

reference : https://crisco.tistory.com/entry/UIView-๊ฐœ๋…์•Œ๊ธฐ UIView ๊ฐœ๋…์•Œ๊ธฐ UIView๋Š” UI๋ฅผ ์ด๋ฃจ๋Š” ๊ตฌ์„ฑ์š”์†Œ์ด๋ฉฐ ํ™”๋ฉด์— ๋‚˜ํƒ€๋‚˜๋Š” ์‹œ๊ฐ์  ์š”์†Œ๋ฅผ ์ œ๊ณตํ•œ๋‹ค. ์œˆ๋„์šฐ๋Š” ์ปจํ…Œ์ด๋„ˆ ์—ญํ™œ์„ ํ•˜๋ฉฐ, ํ™”๋ฉด์— ํ‘œ์‹œํ•  ๊ตฌ์„ฑ ์š”์†Œ์—์„œ ์ตœ์ƒ์œ„์— ์œ„์น˜ํ•˜๊ณ  UIImageView, UITextView ๋“ฑ ๊ฐ ์šฉ๋„์— crisco.tistory.com

[swift] hit test

reference : https://baked-corn.tistory.com/128?category=718235 [ios] Hit Testing in iOS [ios] Hit Testing in iOS ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ iOS์—์„œ Event Handling์— ๋Œ€ํ•ด ๊ณต๋ถ€ํ•˜๋ฉด์„œ ์•Œ๊ฒŒ ๋œ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•ด๋ณด๋ ค ํ•ฉ๋‹ˆ๋‹ค. ์ด์ „ ํฌ์ŠคํŒ…์—์„œ๋Š” UIControl์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ Hit Testing์— ๋Œ€ํ•ด ๊ธฐ. baked-corn.tistory.com

[swift] Rxswift ๋กœ timer

https://fomaios.tistory.com/entry/RxSwift-Disposable๊ณผ-DisposeBag [RxSwift] Disposable๊ณผ DisposeBag ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ RxSwift์—์„œ ๊ฐ€์žฅ ๊ธฐ์ดˆ๊ฐ€๋˜๋Š” Disposable๊ณผ DisposeBag์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ Disposable ๋จผ์ € dispose์˜ ์‚ฌ์ „์  ์˜๋ฏธ๋Š” ๋ญ˜๊นŒ์š”? ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์˜๋ฏธ๊ฐ€ ์žˆ์ง€๋งŒ fomaios.tistory.com

[swift] xcode์‹คํ–‰์„ command line์œผ๋กœ ํ•  ์ˆœ ์—†์„๊นŒ..

https://ericasadun.com/2020/07/15/executing-command-line-directly-from-xcode/ Executing command-line directly from Xcode I got pulled into one of those conversations where I end up saying, “Fine, I’ll put up a post about it” and this is the post. Yes, you can test and run command-line apps directly … ericasadun.com

[swift] AVPlayer, AVFoundation

reference : https://stackoverflow.com/questions/38437935/how-do-i-get-current-playing-time-cmtime-in-milliseconds-in-avplayer/56608415 How do I get current playing time, CMTime in milliseconds in AVPlayer? I am getting current playing value in seconds but i need in milliseconds. I tried to currentTime.value/currentTime.scale. But it didn't get exact value. CMTime currentTime = vPlayer.currentIte..

[swift] ios calendar ๊ด€๋ จ (๋‚ด๊ฐ€ ๋ณด๋ ค๊ณ  ๋งŒ๋“ )

calendar ์จ๋“œํŒŒํ‹ฐ๋ฅผ ์ฐพ๊ณ  ์žˆ๋‹ค ์•„๋ž˜ ๋งํฌ ์—ฌ๋Ÿฌ๊ฐœ๋ฅผ ์ฐธ๊ณ ํ•  ์˜ˆ์ •์ด๋‹ค search keyword : - swiftui calendar week schedule - how to use calendarkit reference : https://iosexample.com/a-fully-customizable-calendar-library-written-in-swift/ A fully customizable calendar library written in Swift Calendar for iOS and iPadOS in Swift. iosexample.com https://github.com/richardtop/CalendarKit GitHub - richardtop/CalendarKit: ๐Ÿ“… Calend..

[git] Merge and Pull Request (feat. PR ๋‚ ๋ ค์ฃผ์„ธ์š”~)

reference : https://wayhome25.github.io/git/2017/07/08/git-first-pull-request-story/ git ์ดˆ๋ณด๋ฅผ ์œ„ํ•œ ํ’€๋ฆฌํ€˜์ŠคํŠธ(pull request) ๋ฐฉ๋ฒ• · ์ดˆ๋ณด๋ชฝํ‚ค์˜ ๊ฐœ๋ฐœ๊ณต๋ถ€๋กœ๊ทธ ๊ฐœ๋ฐœ์„ ํ•˜๋‹ค ๋ณด๋ฉด ์ฝ”๋“œ๋ฅผ ์—ฌ๋Ÿฌ ๊ฐœ๋กœ ๋ณต์‚ฌํ•ด์•ผ ํ•˜๋Š” ์ผ์ด ์ž์ฃผ ์ƒ๊ธด๋‹ค. ์ฝ”๋“œ๋ฅผ ํ†ต์งธ๋กœ ๋ณต์‚ฌํ•˜๊ณ  ๋‚˜์„œ ์›๋ž˜ ์ฝ”๋“œ์™€๋Š” ์ƒ๊ด€์—†์ด ๋…๋ฆฝ์ ์œผ๋กœ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ์ด๋ ‡๊ฒŒ ๋…๋ฆฝ์ ์œผ๋กœ ๊ฐœ๋ฐœํ•˜๋Š” wayhome25.github.io

Computer Science 2021.07.31
728x90
๋ฐ˜์‘ํ˜•