This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
old="$(gsettings get org.gnome.desktop.interface text-scaling-factor)" | |
if (( $(echo "$old > 1.0" |bc -l) )) | |
then | |
gsettings set org.gnome.desktop.interface text-scaling-factor 1 | |
else | |
gsettings set org.gnome.desktop.interface text-scaling-factor 2.2 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On neogaf off-topic forums I encountered a fun programming challenge. Like all good riddles, the question was simple but the answer was difficult to come up with. I got two thirds of the way to the solution and then gave up and read the answer. I'm going to try and explain what I see as each version of the answer. But first, the question: | |
"Give a data structure that behaves like a fixed size array of size n (that is to say, O(1) to read and write any index) but additionally allows resetting all of the data to arbitrary value k in O(1)." | |
You can stop reading here and think about it or just skip ahead to the answer. | |
============================== | |
SPOILER WALL! DO NOT LOOK OVER | |
============================== |