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
// Before | |
.target { | |
transform: translateX(50%) rotate(30deg) scale(1.2); | |
} | |
// Now you can use individual properties: | |
.target { | |
translate: 50% 0; | |
rotate: 30deg; | |
scale: 1.2; |
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
// Before: | |
@media (min-width: 400px) and (max-width: 600px) { | |
/* Styles for viewports between 400px and 600px. */ | |
} | |
// Now you can use: | |
@media (400px <= width <= 600px) { | |
/* Styles for viewports between 400px and 600px. */ | |
} |
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
val individual1 = turnaj() | |
val individual2 = turnaj() | |
val child = krizenie(individual1, individual2) | |
mutacia(child) |
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
val najlepsi_jedinci = (0 until pocet_najlepsich).map { populacia[it] } |
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
var populacia = (0 until populationSize).map { nahodnyChromozom() } | |
fun nahodnyChromozom() = (0 until chromosomeSize).map { nahodnyGen() } |
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
struct DraggingComponent: View { | |
let maxWidth: CGFloat | |
private let minWidth = CGFloat(50) | |
@State private var width = CGFloat(50) | |
var body: some View { | |
RoundedRectangle(cornerRadius: 16) | |
.fill(Color.blueDark) |
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
struct UnlockButton: View { | |
@State private var isLocked = true | |
@State private var isLoading = false | |
var body: some View { | |
GeometryReader { geometry in | |
ZStack(alignment: .leading) { | |
BackgroundComponent() | |
DraggingComponent(isLocked: $isLocked, isLoading: isLoading, maxWidth: geometry.size.width) |
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
struct DraggingComponent: View { | |
let maxWidth: CGFloat | |
private let minWidth = CGFloat(50) | |
@State private var width = CGFloat(50) | |
var body: some View { | |
RoundedRectangle(cornerRadius: 16) | |
.fill(Color.blueDark) |
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
fun accept(actual: Solution, neighbor: Solution, temp: Double) : Boolean { | |
val diff = neighbor.cost - actual.cost | |
if (diff < 0) { return true } | |
return random.nextDouble() < exp(-diff / temp) | |
} |
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
if (accept(riesenie, susedne_riesenie, teplota)) { | |
riesenie = susedne_riesenie | |
} |
NewerOlder