Skip to content

Instantly share code, notes, and snippets.

@mbakhoff
mbakhoff / core.properties
Created December 21, 2023 08:21
solr uuid bug repro
# server/solr/logs/core.properties
# file is empty
@mbakhoff
mbakhoff / crash1.log
Created September 22, 2022 12:20
wlfreerdp 2.8.0 crashes
Thread 38 "wlfreerdp" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdb7fe640 (LWP 510165)]
__memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:413
413 VMOVU %VEC(0), (%rdi)
(gdb) backtrace
#0 __memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:413
#1 0x0000555555559410 in wlf_copy_image (src=0x7fffe1940030, srcStride=7680, srcWidth=1920, srcHeight=1019, dst=0x7fffd910e000, dstStride=7680, dstWidth=1920, dstHeight=1019, area=0x7fffdb7fd8d0, scale=0)
at /usr/src/debug/net-misc/freerdp-2.8.0/freerdp-2.8.0/client/Wayland/wlfreerdp.c:710
#2 0x0000555555557ca7 in wl_update_buffer (context_w=0x5555555783d0, ix=288, iy=976, iw=64, ih=43) at /usr/src/debug/net-misc/freerdp-2.8.0/freerdp-2.8.0/client/Wayland/wlfreerdp.c:108
#3 0x0000555555557e85 in wl_end_paint (context=0x5555555783d0) at /usr/src/debug/net-misc/freerdp-2.8.0/freerdp-2.8.0/client/Wayland/wlfreerdp.c:151
How does a hashmap work?
A map contains key-value pairs.
Pairs can be added and values can be looked up by the key.
Adding a key-value pair when the key already exists in the map will replace the existing value.
A naive map holds a list of key-value pairs: List<Pair<KeyType, ValueType>>.
To look up a value, each key-value pair in the list must be inspected.
When the number of pairs gets large, then the lookups will get slow.
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
class ClientHandler implements Runnable {
private final Socket s;
public ClientHandler(Socket s) {
@mbakhoff
mbakhoff / Scratch.java
Created February 15, 2016 12:05
oop 3. praks 2016-02-16
import java.util.Scanner;
class Scratch {
public static void main(String[] args) {
Node n1 = new Node(1);
n1.add(2);
n1.add(3);
n1.add(4);
package ee.ut.derpcode;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
package ee.ut.derpcode;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Properties;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;