Skip to content

Instantly share code, notes, and snippets.

View ktprezes's full-sized avatar

Tadeusz Kurpiel ktprezes

View GitHub Profile
@ktprezes
ktprezes / TestClass.java
Created January 12, 2023 20:21 — forked from asicfr/TestClass.java
Properties and ResourceBundle from Xml file
package test;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;
public class TestClass {
@ktprezes
ktprezes / CartesianProduct.kt
Created November 6, 2021 23:32 — forked from kiwiandroiddev/CartesianProduct.kt
Kotlin function to return the cartesian product of two collections
/**
* E.g.
* cartesianProduct(listOf(1, 2, 3), listOf(true, false)) returns
* [(1, true), (1, false), (2, true), (2, false), (3, true), (3, false)]
*/
fun <T, U> cartesianProduct(c1: Collection<T>, c2: Collection<U>): List<Pair<T, U>> {
return c1.flatMap { lhsElem -> c2.map { rhsElem -> lhsElem to rhsElem } }
}
;;; Paper: https://arxiv.org/pdf/2001.02491.pdf
;;; Code: https://github.com/cvlab-epfl/n-queens-benchmark
;;; Lisp Code: https://github.com/cvlab-epfl/n-queens-benchmark/blob/master/code/queens.lisp
;;; Changes/extensions to the original Common Lisp code: Rainer Joswig, joswig@lisp.de, 2020
;; * using bitvectors is faster than 'boolean' arrays (which typically aren't supported in CL)
;;; In Common Lisp
;;; * use Quicklisp
;;; * compile and load this file
@ktprezes
ktprezes / awesome-java-sorted-2019-05-01.md
Created December 31, 2019 01:28 — forked from kvnxiao/awesome-java-sorted-2019-05-01.md
awesome-java-sorted-2019-05-01.md
@ktprezes
ktprezes / spring-boot-cheatsheet.java
Created December 31, 2019 01:20 — forked from jahe/spring-boot-cheatsheet.java
Spring Boot Cheatsheet
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@ktprezes
ktprezes / build_your_own_lisp.md
Created November 22, 2019 09:49 — forked from john-science/build_your_own_lisp.md
Build Your Own LISP

Build Your Own LISP

I had fun building my own LISP (Slow Loris). The project was extremely easy to get off the ground, because there a ton of resources to do just this. I thought it might be handy to have a little links round-up, based on my research.

In Python

There are already several good projects out there on writing your own LISP in Python.

Peter Norvig's LisPy

@ktprezes
ktprezes / exif_date.py
Created September 7, 2019 22:37 — forked from ikoblik/exif_date.py
Python script to update image creation and modification dates to the EXIF date.
#!/usr/bin/env python
"""A simple utility to restore file creation and modification
dates back to their original values from EXIF.
This script requires exif module to be installed or the exif
command line utility to be in the path.
To function correctly under windows this script needs win32file and
win32con modules. Otherwise it will not be able to restore the creation
@ktprezes
ktprezes / Windows_Functions_in_Malware.md
Created August 21, 2019 17:31 — forked from 404NetworkError/Windows_Functions_in_Malware.md
Concise Windows Functions in Malware Analysis List
<!DOCTYPE html>
<html>
<head>
<script>
document.onmousedown=disableclick;
var status="Right Click Disabled";
function disableclick(event)
{
if(event.button==2)
{
@ktprezes
ktprezes / what-forces-layout.md
Created April 14, 2019 14:13 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()