Skip to content

Instantly share code, notes, and snippets.

View Manjago's full-sized avatar

Kirill Temnenkov Manjago

View GitHub Profile

Keybase proof

I hereby claim:

  • I am manjago on github.
  • I am manjago (https://keybase.io/manjago) on keybase.
  • I have a public key whose fingerprint is C552 9998 5198 0D6A 6429 5CA6 AA77 C378 EC58 D954

To claim this, I am signing this object:

@Manjago
Manjago / keybase.md
Created May 9, 2024 13:37
keybase.md

Skip to content All gists Back to GitHub @Manjago Manjago/gist:dd80feb723d5346c5391fbd9373a6029 Secret Created May 9, 2024 16:36

Code Revisions 1

import java.util.ArrayList;
import java.util.List;
// 2023008-02 46. Permutations https://leetcode.com/problems/permutations/ by ChatGPT
public class LeetCode00046_1 {
public List<List<Integer>> permute(int[] nums) {
List<List<Integer>> result = new ArrayList<>();
permuteHelper(nums, new boolean[nums.length], new ArrayList<>(), result);
return result;
}
import java.util.ArrayList;
import java.util.List;
// 2023008-02 46. Permutations https://leetcode.com/problems/permutations/
public class LeetCode00046 {
/*
{1 2 3 }
1 {2 3}
1 2 3
1 3 2
@Manjago
Manjago / SumFct.4th
Last active July 17, 2023 14:02
Perimeter of squares in a rectangle
: fibosum ( sum, second, first -- sum, second, first)
\ 1, 1, 2, 3, 5, 8 ... - calculate sum of Nth fibonacci sequance members
\ first - "first" member of fibonacci sequence
\ second - "second" member of fibonacci sequence
\ sum - current sum
OVER \ sum, second, first -- sum, second, first, second
+ \ sum, second, first, second -- sum, second, next(first+second)
ROT \ sum, second, next(first+second) -- second, next(first+second), sum
OVER \ second, next(first+second), sum -- second, next(first+second), sum, next(first+second)
+ \ second, next(first+second), sum, next(first+second) -- second, next(first+second), updatedSum
@Manjago
Manjago / MemoryAppender.kt
Created July 9, 2021 11:59
Kotlin Asserting Log Messages With JUnit
package ru.mts.ftb.ftbotpservice.utils
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core.read.ListAppender
//inspired by https://www.baeldung.com/junit-asserting-logs
class MemoryAppender : ListAppender<ILoggingEvent?>() {
fun reset() = list.clear()
@Manjago
Manjago / gist:9b518f8ddfb77524ad45
Created March 26, 2015 12:07
анонимный статический класс
public class Toster {
static class Zhopa{
void display(){
}
}
public static void main(String[] args) {
@Manjago
Manjago / gist:4e8b3d039c439977b7c8
Created December 25, 2014 07:52
читаем проперти в utf8
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.Properties;
public class Toster {
public static void main(String[] args) throws IOException {
Properties p = new Properties();
p.load(new InputStreamReader(new FileInputStream("D:\\tmp\\test.properties"), Charset.forName("UTF8")));
package com.sts.voms.ui.client.common;
public interface Lambda2<T, T1, R> {
R execute(T arg0, T1 arg1);
}
package com.sts.voms.ui.client.common;
public interface Lambda<T, R> {
R execute(T arg);
}