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
package com.codility.tasks; | |
/* | |
Negate a negative based binary (base -2) using Two's Complement Annotation. | |
Given a base -2 number splitted into a primitive array of ints (int[]), return it's negation. | |
EXAMPLES: | |
INPUT: [0,1,0,0,1,1,1] // Decimal 39. | |
OUTPUT: [1,0,1,1,0,0,1] // Decimal -39. | |
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
#!/bin/bash | |
echo "Removing unavailable simulators..." | |
xcrun simctl delete unavailable | |
echo "Brew cleanup..." | |
brew cleanup | |
echo "Removing Xcode Caches..." | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode |
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 SwiftUI | |
import PlaygroundSupport | |
struct Desktop: View { | |
var body: some View { | |
ZStack { | |
// Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG")) | |
Color(UIColor.systemBlue) | |
macOS() | |
} |
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
extension Data { | |
init?(hexString: String) { | |
let count = hexString.count / 2 | |
var data = Data(capacity: count) | |
var i = hexString.startIndex | |
for _ in 0 ..< count { | |
let j = hexString.index(after: i) | |
if var byte = UInt8(hexString[i ... j], radix: 16) { | |
data.append(&byte, count: 1) | |
} else { |