Skip to content

Instantly share code, notes, and snippets.

View matdziu's full-sized avatar

Mateusz Dziubek matdziu

View GitHub Profile
import random
import time
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
class Level:
def start(self):
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/defaultRippleColor">
<item
android:id="@android:id/mask"
android:drawable="@android:color/white" />
</ripple>
<style name="Style.Button.TextButton" parent="Widget.AppCompat.Button.Borderless.Colored">
<item name="android:padding">16dp</item>
<item name="android:theme">@style/ThemeOverlay.Button.TextButton</item>
</style>
<style name="ThemeOverlay.Button.TextButton" parent="ThemeOverlay.AppCompat">
<item name="colorControlHighlight">@color/rippleColor</item>
</style>
package com
import com.TimeSpanType.FURTHER_THAN_NEXT_DAY
import com.TimeSpanType.NEXT_DAY
import com.TimeSpanType.SAME_DAY
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import java.text.SimpleDateFormat
import java.util.Locale
package com
import com.TimeSpanType.FURTHER_THAN_NEXT_DAY
import com.TimeSpanType.NEXT_DAY
import com.TimeSpanType.SAME_DAY
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import java.text.SimpleDateFormat
import java.util.Locale
typealias Frequency = Int
// O(n^2)
fun performTask(a: List<Int>, b: List<Int>, p: Int): List<Int> {
if (isPrime(p)) {
val frequencyMap: HashMap<Int, Frequency> = hashMapOf()
for (currentElem in b) {
if (frequencyMap[currentElem] == null) {
var currentElemFrequency: Frequency = 0
for (elem in b) {
extension GamesCollectionViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return gamesList.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let collectionGameCell = tableView.dequeueReusableCell(withIdentifier: COLLECTION_GAME_CELL_ID, for: indexPath) as! CollectionGameCell
let collectionGame = gamesList[indexPath.row]
collectionGameCell.selectionStyle = UITableViewCell.SelectionStyle.none
import UIKit
class CollectionGameCell: UITableViewCell {
@IBOutlet weak var gameNameLabel: UILabel!
@IBOutlet weak var yearPublishedLabel: UILabel!
@IBOutlet weak var gameImageView: UIImageView!
override func prepareForReuse() {
super.prepareForReuse()
import Foundation
import UIKit
import Kingfisher
extension UIImageView {
func downloaded(from url: URL, placeHolder: UIImage?) {
self.kf.setImage(with: url,
placeholder: placeHolder,
options: [KingfisherOptionsInfoItem.cacheOriginalImage])
override fun onStart() {
super.onStart()
buttonClickSubject = PublishSubject.create<Boolean>()
mainViewModel.bind(this)
}