website

The source code for https://bpaul.xyz
Log | Files | Refs

commit a47f284a4e2c96312420473daadaa8397f334c02
parent fc5e7636f4464abfe2177ce1b62ed6324e5794c4
Author: benjamin paul <bpaul@bpaul.xyz>
Date:   Sun,  5 Dec 2021 17:53:56 +1000

A lot of stuff! I want to add christmas decorations next

Diffstat:
Aaoc2021/1 | 16++++++++++++++++
Aaoc2021/2 | 12++++++++++++
Aaoc2021/3 | 11+++++++++++
Mchess-programming/1-intro.md | 8++++++++
Mchess-programming/2-bitboards.md | 8+++++++-
Acubing/monthly-progress/2021-12-goals | 42++++++++++++++++++++++++++++++++++++++++++
Aself-stuff/c-style | 3+++
Asoftware-review/wm/bspwm | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 197 insertions(+), 1 deletion(-)

diff --git a/aoc2021/1 b/aoc2021/1 @@ -0,0 +1,16 @@ +Day 1 of Advent of Code 2021!! + +https://adventofcode.com/2021/day/1 + +Problem 1 + +This problem wasn't very hard. + +Problem 2 + +I did something weird where i store 3 numbers in an array + +array[0], array[1], array[2] + +and when I would have a pointer saying which item in the array should be changed +next. diff --git a/aoc2021/2 b/aoc2021/2 @@ -0,0 +1,12 @@ +Day 2 of Advent of Code 2021!! + +This day was really easy wow + +Problem 3 + +You read the first character of the word in order to find which direction, then +skip to the space and read the number. Thats the most complicated part really. + +Problem 4 + +Copy problem 3 code but slightly modify it and you are done. diff --git a/aoc2021/3 b/aoc2021/3 @@ -0,0 +1,11 @@ +Day 3 :((( + +Problem 5 + +There wasn't much to this problem. The only noteworthy trick was that you could +bitwise not the first number to get the second number. + +Problem 6 + +This problem took me way too long but it shouldn't have been hard. You have to +track which numbers you have searched already which is annoying. diff --git a/chess-programming/1-intro.md b/chess-programming/1-intro.md @@ -147,6 +147,14 @@ new_strncmp(const char *s1, const char *s2, unsigned long n) { } ``` +Update 2: +Ok so I have found out that using instructions is bad because some instructions are faster than others. This means that something else has to be used like cycles. + +Using cycles shows that the new algorithm saves about 10000 cpu cycles which is pretty good (according to roughly looking at manual tests, so it isn't very formal)! Yay! + +Update 3: +It turns out that i forgot to decrement n in the last while loop of the new algorithm, so the program wouldn't work if n was not a multiple of 4. Fixing this shows that the algorithm is the same as the one implemented in glibc, so this was all a waste of time. Yay! + ## Links UCI protocol specification diff --git a/chess-programming/2-bitboards.md b/chess-programming/2-bitboards.md @@ -1,4 +1,4 @@ -# Bitboards +#Bitboards Nowadays, chess programs represent the board using bitboards. @@ -15,3 +15,9 @@ vectorize these somehow. Move make function: move a piece from a square to another square + + + + +NOTE: LZCNT is one clock cycle usually whereas TZCNT is TWO clock cycles usually on Zen 1,2,3 cpus!!!!!!!!!! strange right? +NOTE2: wow i forgot the fact that LZCNT counts how many 0s are at the end, not the position of the MSB, so TZCNT is still faster! diff --git a/cubing/monthly-progress/2021-12-goals b/cubing/monthly-progress/2021-12-goals @@ -0,0 +1,42 @@ +Fri Dec 3 01:01:30 PM AEST 2021 + +A two part competition was just announced that I will be able to go to in +January (January 7th - 8th): +https://www.worldcubeassociation.org/competitions/NorthsideDuologyPart12022 + +Events: + +3x3 +5x5 +6x6 +7x7 +3bld +oh +CLOCK!!! +mega +sq1 +multi + +One of my biggest goals is probably to get the oceanic record in 3bld single and +mean. I'm probably not there just yet but if I improve my turning it might be +possible by the comp. I also would like to finish learning full floating and +maybe learn ltct. + +I don't practice multi but maybe I will if I get bored. I have been asked to get +16/16. + +I may practice a bit for oh, and also finish oh cmll. + +Clock!! Apparently sub 10 is free so I guess I'll get that. Sub 10 ao5 is top 30 +in oceania! + +Sq1... :( I am pretty out of practice for sq1. If I want to get ok times I guess +I just need to learn eo and cp and spam solves. + +I have probably only solved a megaminx once using intuitive last layer, but it +doesn't seem like a bad event so maybe I'll practice it a bit. + +5,6,7 maybe maybe I will practice, but I dont have a method so. + +3x3 I am learning mehta right now so hopefully i get at least sub 20 by the +comp. If not I might just use the round as 3bld exec practice or something. diff --git a/self-stuff/c-style b/self-stuff/c-style @@ -0,0 +1,3 @@ +put all source files in the same directory so that grep can be run on them with `grep 'blahblah' *` +use tabs for indentation because some people like different indentation sizes. avoid writing code that depends on a certain indentation size +define return types of functions on a separate line to the functions so that the functions can be searched with `grep '^functionname' *` diff --git a/software-review/wm/bspwm b/software-review/wm/bspwm @@ -0,0 +1,98 @@ +BSPWM probably biased review + +TODO: Proofread + +I have used this wm for a long time, but there wasn't any particular reason for +doing so apart from hearing about people using it online. + +Binary size (If you care) + +BSPWM is small when compared to for example i3. On the arch linux repos it is +0.26 MiB, and SXHKD (The recommended keyboard daemon) is 0.14 MiB. + +What is it? + +BSPWM is a window manager that tiles and partitions windows as leaves of a +binary tree. It is a dynamic window manager (you can make floating windows) and +is managed with a socket client program, which makes interacting with the window +manager in shell scripts easy (although EWMH exists and is meant to do the same +thing). BSPWM has partial EWMH support. + +Default config + +There is no default configuration, though I think people usually copy the +example config's bspwmrc and sxhkdrc. There are gaps by default which im sure +would make a lot of people happy (for some reason ?? reddit posts!). It is setup +so that there are 10 tags for all monitors, not 10 tags for each monitor (This +is customizable). Some programs are given default desktops and states which may +confuse new users if they have not read over the config (Which they should have +done). Some of the default SXHKD bindings are similar to i3's which may be good +as I would imagine a lot of BSPWM users come from using i3. + +Configuration documentation + +The man page for bspc (the socket client) did not list the commands at the top +which is a little annoying. When you want to look for configuration options you +want to search "SETTINGS". I have actually never used this dispite using BSPWM +maybe for over a year now. + +One thing that I have found annoying with this wm is trying to move windows in a +certain way which i will discribe with an ascii picture + +Starting with: + +,____________, ,____________, +|a | |b | +| | | | +| | |____________| +| | ,____________, +| | |c | +| | | | +|____________| |____________| + +I want to move c so that it looks like this: + +,____________, ,____________, +|a | |b | +| | | | +|____________| | | +,____________, | | +|c | | | +| | | | +|____________| |____________| + +If i was to move c to the left it would look like this: + +,____________, ,____________, +|c | |b | +| | | | +| | |____________| +| | ,____________, +| | |a | +| | | | +|____________| |____________| + +This is probably something you cannot avoid due to the nature of the binary tree +partitioning, but maybe you can I wouldn't know. I wasn't able to figure it out +by looking at the settings section of the manual though. + +Potential capabilities with the wm + +I don't think there is anything that you can't do in this window manager in +terms of managing windows, though I can imagine that it may be a lot easier to +do some things in other window managers. That doesn't mean there are things that +this window manager can't do well, because there certainly are things that it +can do well (binary space partitioning! i.e. the name of the window manager) + +Overall thoughts + +BSPWM is definitely a usable window manager (I used it for a while and lots of +people online use it as well) although I feel like it should be pointed out that +this window manager is specifically called binary space partitioning window +manager. I think a lot of people choose this window manager simply because they +see lots of online posts with people using the window manager without actually +understanding that it is a BSP wm. I am absolutely absolutely sure that there +are people who want a binary space partitioning window manager (I would imagine +the creater of the wm would have wanted one, else why would they have made it in +the first place?), it's just that not everyone would enjoy binary tree tiling. +Know what you are running before you run it!