Skip to content

Instantly share code, notes, and snippets.

class Solution {
private int[] parse(String log) {
int n = log.length();
int i = 0;
int[] res = new int[3];
char ch = log.charAt(i);
int curr = 0;
while (ch != ':') {
curr = curr * 10 + (ch-'0');
i++;
@igavrysh
igavrysh / tasks-20240303.md
Last active March 11, 2024 19:45
Завдання на 3/3/24
@igavrysh
igavrysh / gist:79a7c04c0025fd23c29f39de4d192510
Created September 10, 2023 03:50
ibm trackpoint keyboard rt3200 - setup for ubuntu (kde neon)
# instructions are taken from https://chrisirwin.ca/posts/ps2-trackpoint-scrolling-wayland/
# usb adapter and producer info
lsusb | grep 13ba
# finding device ids
sudo libinput list-devices | grep Device
# create udev rule
$ sudo tee /etc/udev/rules.d/70-ps2-pointingstick.rules <<EOF
{
"user_id": "gene34"
}
package main
import (
"fmt"
"log"
"math/rand"
"sync"
"time"
)
package main
import "sync"
type BinaryTreeData interface {
Less(element BinaryTreeData) bool
}
type BinaryTreeNode struct {
Data BinaryTreeData
@igavrysh
igavrysh / insert_to_slice_perf_test.go
Last active July 14, 2021 23:10
insert_to_slice_perf_test.go
package main
import (
"fmt"
"math/rand"
"time"
"github.com/sajari/regression"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
package main
import (
"fmt"
"math/rand"
"time"
"github.com/sajari/regression"
"gonum.org/v1/plot"
"gonum.org/v1/plot/vg"
"gonum.org/v1/plot/plotter"
@igavrysh
igavrysh / ubuntu-install-ruby-1.8.7.sh
Created January 22, 2021 09:28 — forked from murphyslaw/ubuntu-install-ruby-1.8.7.sh
Install Ruby 1.8.7 with rbenv on Ubuntu
# Install system libraries.
sudo apt-get install zlib1g-dev openssl libssl-dev libreadline-dev git-core
# Install rbenv.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Setup bash.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@igavrysh
igavrysh / set_cursor_size
Created March 4, 2020 03:50
Set cursor size in cinnamon
go to
/etc/X11/Xresources/x11-common
add line
Xcursor.size: 22
Xcursor.theme: DMZ-White