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 javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Arrays; | |
public class PasswordChecker { |
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
# `random` module is used to shuffle field, see: | |
# https://docs.python.org/3/library/random.html#random.shuffle | |
import random | |
# Empty tile, there's only one empty cell on a field: | |
EMPTY_MARK = 'x' | |
# Dictionary of possible moves if a form of: | |
# key -> delta to move the empty tile on a field. | |
MOVES = { |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int width = scanner.nextInt(); | |
int height = scanner.nextInt(); |
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 java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int n = scanner.nextInt(); | |
int[] array = new int[n]; | |
Map<Integer, Integer> map = new HashMap<>(); | |
for (int i = 0; i < n; ++i) { |
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
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int width = scanner.nextInt(); | |
int height = scanner.nextInt(); | |
int advertCount = scanner.nextInt(); | |
List<Advert> advertList = new ArrayList<>(advertCount); | |
for (int i = 0; i < advertCount; ++i) { |
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
object InsetsUtils { | |
fun View.doOnApplyWindowInsets(block: (View, WindowInsetsCompat, Rect) -> WindowInsetsCompat) { | |
val initialPadding = getCurrentPadding(this) | |
ViewCompat.setOnApplyWindowInsetsListener(this) { v, insets -> | |
block(v, insets, initialPadding) | |
} | |
requestApplyInsetsWhenAttached() |
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
<com.google.android.material.floatingactionbutton.FloatingActionButton | |
android:id="@+id/fab" | |
android:src="@drawable/ic_add_white_24dp" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="bottom|end" | |
android:layout_margin="16dp"/> |
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
#include <iostream> | |
#include <unordered_map> | |
using namespace std; | |
int main() { | |
int n; | |
cin >> n; | |
unordered_map<int, int> map; | |
for (int i = 0; i < n; ++i) { |
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
public void isAuthorised(Callback callback) { | |
if (mSettings.contains(APP_PREFERENCES_LOGIN) && mSettings.contains(APP_PREFERENCES_PASSWORD)) { | |
final String login = mSettings.getString(APP_PREFERENCES_LOGIN, ""); | |
final String passwd = mSettings.getString(APP_PREFERENCES_PASSWORD, ""); | |
NetworkService.getInstance().getApi().getUserWithCreds(login, passwd).enqueue(new Callback<User>() { | |
@Override | |
public void onResponse(Call<User> call, Response<User> response) { | |
User u = response.body(); |
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.rv150.bestbeforeserver.main; | |
import com.google.gson.Gson; | |
import com.rv150.bestbeforeserver.dao.BarcodeDAO; | |
import com.rv150.bestbeforeserver.dao.ProductDAO; | |
import com.rv150.bestbeforeserver.dao.RequestsDAO; | |
import com.rv150.bestbeforeserver.dao.UserDAO; | |
import com.rv150.bestbeforeserver.exception.AlreadyExistException; | |
import com.rv150.bestbeforeserver.model.*; | |
import org.slf4j.Logger; |
NewerOlder