Skip to content

Instantly share code, notes, and snippets.

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 {
# `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 = {
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();
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) {
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) {
object InsetsUtils {
fun View.doOnApplyWindowInsets(block: (View, WindowInsetsCompat, Rect) -> WindowInsetsCompat) {
val initialPadding = getCurrentPadding(this)
ViewCompat.setOnApplyWindowInsetsListener(this) { v, insets ->
block(v, insets, initialPadding)
}
requestApplyInsetsWhenAttached()
<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"/>
#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) {
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();
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;