The best kittens, technology, and video games blog in the world.

Wednesday, April 03, 2019

6 Amazing Games

After a long day of gaming. by ocean.attic from flickr (CC-SA)

Now that Google+ got murdered by Google, I'll go back to reviewing stuff on this blog. I should probably start coming up with backup plan in case they murder Blogger too. Oh and maybe I'll dig through my Google+ posts and report reviews here as well.

So here's 6 video game recommendations of games I played relatively recently. These games are not merely good and enjoyable, they go far beyond that. If you like games and game design, it would be utter silliness not to try out every one of them.

Her Story

My memory is fairly poor when it comes to stories. Even if I enjoy a movie or a book, I would have a lot of trouble recalling much beyond general outline and a few highlights. Video game stories are usually even less important and less memorable, usually just providing some background on which the actual game takes place.

And yet, somehow I remember every minute of playing Her Story. It just burned into my memory like no other game ever.

It doesn't "tell a story". It invented a completely new genre, which lets you discover what might have happened, in a way that naturally leads to emergent plot twists, and apparently people end up strongly believing completely opposite conclusions on what the story was depending on which way their exploration went, even if they've seen the same content, just in different order, and with different mindset. This level of story engagement is unprecedented.

I very strongly recommend everyone to play it without any spoilers, as soon as possible. It's a one evening game.

I hope more games like that get made, but it was such a masterpiece of story construction and acting that maybe it's too difficult and it will remain a singular masterpiece forever.

Factorio

It's Steam's second highest game of all times, behind just Portal 2, so throwing another endorsement to million other endorsements might feel a bit redundant.

Factorio invented a new genre of automation games. You start on a new planet, manually extract some resources, and gradually setup more and more complex manufacturing chains so everything runs without your participation as much as possible. If everything in base game is too simple, you can ramp up complexity by another factor of 10x by getting some mods, which are conveniently available from in-game menu.

It's been such a great hit that new Factorio-style games like Satisfactory and Factory Town started coming out, but I don't think they're really there yet.

I don't love all their choices - color palette feels depressingly desaturated, and combat feels like a distraction from core gameplay (it can be turned off when starting a new game). It's still first and so far the best game in this new genre. It wouldn't surprise me if Factorio did to automation what Minecraft did to crafting, and it became regular feature in new games soon.

And it did it all while still in "early access". It's been far more ready for years than most games are on publication day.

Warning: The game can easily take hundreds of hours of your lifetime.

The Elder Scrolls V: Skyrim Special Edition

Everybody knows Skyrim by now, but special edition brought new life into the game. Games like Skyrim only truly come to life with mods, but setting up mods for them was always pain. I still remember wasting a weekend setting up modded Oblivion for it to only glitch itself into unplayability as soon as I left tutorial dungeon.

Special Edition wasn't just the usual remaster with some better graphics, it brought 64 bit support (which enables big mods), and built mod support into the game itself, so installing a hundred mods at once is fairly easy. It still doesn't have perfect detection of mod dependencies and conflicts, but you'll only face problems if you take things too far, and they'll probably be fairly minor.

You can use third party tools if you're setting up particularly complex mix of mods, but you don't have to, and it will probably going to be fine anyway. Amount of content provides by the mods is enormous, and many of them are of very high quality. And many are not. It's all good fun.

Special Edition even brought mods to console playing peasants! Much more limited, but still, give them a taste of what PC gaming is like.

Annoyingly you need a special mod to enable achievements on modded games, which is basically the point of Special Edition. And between game bugs and 100 mods at once, I ran into bug in main questline, and didn't figure it out right away to reload, so I couldn't actually win this time, but it was so much fun anyway.

It's not a game for everyone, especially because you need a lot of time to play it, but it's definitely best in its genre of vast open world games.

Doki Doki Literature Club!

This completely free game pretends to be a dating sim taking place in literature club of a Japanese high school, but it turns into... Well, I can't say without spoilers. There's a bit of gameplay, but it's mostly a really great mindfucky story.

As the trailer says "This game is not for children or those who are easily disturbed", so I can't recommend it for everyone, but other than that, do it, it's amazing. Play without any spoilers. It probably helps if you enjoy anime visuals, but it only really pretends to be a dating sim. It's a one evening game.

Sniper Elite 4

Having played Sniper Elite 3 previously, I was expecting a decent stealth shooter, but I got a lot more.

The levels are huge, and allow a lot of approaches. Very few games ever tried that - Far Cry 1 and its sequels Crysis 1 and Crysis Warhead did it and then the whole concept died out, probably because console hardware had too little memory, and PC exclusives don't sell quite as well. It's those console peasants' fault as usual.

The second great thing is what happens when you break stealth. In basically all other games every enemy within some distance would magically know where you are, and now you'd have to run away or face a shootout against overwhelming odds. That's fine, and even Sniper Elite 3 did basically that. Sniper Elite 4 has a better idea. Enemies lack this magic, and only guess you might be based on when you've been last seen or where shots have been heard from. They'll try to suppress and flank your suspected location, throw grenades, and even artillery strikes to get you, but you can use it to your advantage.

This change makes breaking stealth a tool, not a fail mode. You can shoot to reveal yourself to lure enemies in direction you want, straight into some mines you just put, while you take advantage of them moving away from their posts to sneak past. Blow something up to make them take cover facing completely wrong direction, while you backstab them staring at the blazing inferno. Huge maps give plenty of options for creativity. Oh and as is tradition of the series, you get to kill Hitler in a DLC, in many unique ways. You can even shoot him in his one ball.

A big downside is third person perspective, which offers less control and immersion than first person would. But it's still an amazing shooter taking the genre in a new direction. If you enjoy shooters, it would be silly not to give this one a try.

The game doesn't actually explain all that well that you can take this dynamic approach, and I guess many people will play it as a traditional stealth game, which also definitely works. But if you do, you won't see why it's so special.

Silicon Zeroes

So it looks like a puzzle game inspired by TTL era chip design. Except they didn't just take vague inspiration, by the end of it, you will actually be designing superscalar pipelined processors with bypass logic. A lot of details of real hardware are simplified, but problems you'll be solving are completely genuine. It's a total opposite of games like Shenzhen I/O where everything is as fake as fake gets.

It feels to me like the most successful educational game I've ever seen, and I'm not even sure if that's what they were aiming for, or just accidentally hit.

There's also some story in it, but it's totally lame (half of negative reviews it has are about the story). At least it's not much of a distraction, you can basically ignore it and just enjoy the game.

The game starts very easy, but final designs are sort of Microprocessor Design 101 finals level, and only 1.5% of people have achievement for completing all challenges.

Oh and there's a free downloadable demo with first levels. Just give it a try.

Good gaming!

Enjoy the games. For summary of key points:

  • Her Story - one evening game, avoid spoilers at all cost
  • Factorio - long and very replayable, little to spoil, it's more fun if you try your own designs first few times; then it's OK to see how others did it, but if you want to start by watching some let's plays it's all fine too
  • Skyrim Special Edition - very long, and mods make it a lot longer, spoilers are mostly fine, 
  • Doki Doki Literature Club! - one evening game, avoid spoilers at all cost
  • Sniper Elite 4 - medium length, little to spoil
  • Silicon Zeroes - medium length, mostly avoid spoilers as it's a puzzle game

I plan to posting a lot more on this blog now.

Saturday, March 30, 2019

stringify-any

a185975 jewel-2 by The.Rohit from flickr (CC-NC)

So here's my second interesting Javascript npm package - stringify-any.

Javascript is a basically very low quality language where everything only kinda sorta mostly works. In this case I ran into problems of inspecting objects.

Problem this package is targeting

If you want to inspect obj in a browser, you'd usually just do:

console.log(obj)

And the browser will generate appropriate interactive widget you can click around to look around.

That's of course not possible outside the browser. So what if you want to print the object?

console.log(`${obj}`)

The most obvious way will fail with [object Object].

JSON sort of helps, and we can do this:

console.log(JSON.stringify(obj))

It's hard to read due to bad indentation, but copy and pasting JSON into pretty printer is a basic web development skill, so it's kinda tolerable.

And then you try some modern Javascript, and somewhere in that obj there's a nested new Set([1, 2, 3]), which quietly turns into {}, making you want to drop Javascript and just code Ruby in browser or Clojurescript or something.

What you can do now

Just get the package, import stringify function, and call it:

import "stringify-any" as stringify
console.log(stringify(obj))

It will do the right thing.

It handles all cases I could think of, like undefined, -0, infinities, NaN, Date, Map, Set.

It also sort of handles WeakMap, WeakSet, Function - we can't show what's inside, but we can at least show the type.

Because Javascript is Javascript I'm sure I missed something. Please report, github issues are the best place.

I couldn't find any other package that does this correctly (found a lot which tried but failed), but then it's totally possible something like this already exists.

Friday, March 15, 2019

How democratic are countries really

BOY was that EXHAUSTING!! by Lisa Zins from flickr (CC-BY)

I mentioned many times how "democratic" countries are actually not all that democratic. It's time to quantify that.

I have no time to data mine all the Tanzanias and Liechtensteins of the world, so I limited this analysis to OECD member countries plus 3 extra not-yet-OECD EU members. Also excluded is Switzerland, as it has a completely unique system of government.

Limitations

This ranking only covers how representative elections are, and only for Lower House, Upper House, Head of State, and Head of Government, as most countries either have those four roles, or a single entity covers two of those roles in a way that's easy to score.

This excludes all other elections, such as regional elections, super-national elections, possibly judicial elections, and such.

This also excludes any issues such as term limits, mandatory retirement age, campaigning, party financing, relative division of power between those branches, any rule of law issues and such. There's a lot to cover beyond this list, but it's very country-specific and difficult to score objectively.

It's all about how will of the voters is translated into results. If votes are thrown away (by non-proportional system), or voters are forced to vote for their non-preferred candidates (by FPTP and such), it gets lower scores.

If a very insignificant number of seats are reserved (like current VP, former presidents, ethnic minority groups), I'm not counting that either way.

I compiled the information from Wikipedia, and it's possible that I made a few mistakes.

Scoring

Power is divided differently between branches of government in different countries, but for some reasonable baseline the following mix is used:
  • Lower House - 40%
  • Upper House - 15%
  • Head of Government - 30%
  • Head of State - 15%
If there's no Upper House, Lower House is counted for both roles.

If elected Head of State is also Head of Government, they're counted for both roles. 

If parliament elects Head of Government and/or Head of State, Lower House is counted for both roles. This also includes all cases where technically Head of State nominates Head of Government, but they need some kind of parliamentary confirmation, as that's in practice the same as direct election by the parliament.

Scoring for parliamentary elections

  • Proportional representation (with threshold less 4%) - 100%
  • Proportional representation (with threshold 4% or higher) - 80%
  • Single Transferable Vote - 80%
  • Mixed Member Representation - 60% - there's a lot of variety here, so it's a non-committal scoring
  • Proportional representation (with threshold 7% or higher) - 60%
  • FPTP with runoff - 60%
  • Proportional representation (with threshold 10% or higher) - 40%
  • Proportional representation with majority bonus - 40%
  • FPTP - 40%
  • FPTP with vastly disproportional sized districts (like US states) - 20%
  • Unelected - 0%
Proportional representation always has some threshold. For example a no-threshold elections with single national list for 100-member parliament basically forces de facto 1% threshold. And any kind of regional lists de facto results in low thresholds, even without any distortionary intend.

Medium-threshold systems are distortionary in practice. For example in Poland's electoral threshold alone was responsible for overturning results of 1993 and 2015 elections.

High threshold systems and bonus for largest party are intentional distortions targeted against minor parties.

FPTP is extreme distortionary in theory and practice, and it only somewhat works if districting just so happen to be random and not too biased. In practice every single FPTP system in the world has severe bias against certain demographies and parties.

FPTP with vastly disproportional sized districts is borderline if it should count as elections at all.

Unelected Upper House obviously gets no points.

STV and Mixed Member Representation systems cover various systems which are generally less representative than pure proportional representation would be, but it's difficult to score them properly.

Scoring for presidential elections

  • Single Transferable Vote - 100%
  • Majority with runoff - 80%
  • Plurality without runoff - 60%
  • Electoral College - 40%
  • Monarch - 0%
This should be fairly obvious. There's no way to elect a single position proportionally, so whichever system most reasonably approximates Condorcet winner is best.

None of the countries currently hold Prime Minister elections (Israel had them for a while), so either Lower House score or Head of State score counts.

Results

  • 100 Israel
  • 97 Finland
  • 97 Portugal
  • 94 Iceland
  • 91 Romania
  • 85 Denmark
  • 85 Luxembourg
  • 80 Bulgaria
  • 80 Croatia
  • 80 Estonia
  • 80 Latvia
  • 80 Slovakia
  • 80 Slovenia
  • 79 Chile
  • 76 Spain
  • 74 Czech Republic
  • 74 Poland
  • 71 Ireland
  • 70 Netherlands
  • 68 Australia
  • 68 Austria
  • 68 Norway
  • 68 Sweden
  • 63 France
  • 63 Lithuania
  • 60 Hungary
  • 60 Italy
  • 60 Mexico
  • 60 South Korea
  • 58 Turkey
  • 56 Belgium
  • 51 Germany
  • 51 Japan
  • 51 New Zealand
  • 40 Greece
  • 37 United States
  • 28 Canada
  • 28 United Kingdom

Raw data


CountryLower HouseUpper HouseHead of GovernmentHead of State
AustraliaSTVSTVParliamentMonarch
Austria4%UnelectedParliamentRunoff
Belgium5%UnelectedParliamentMonarch
Bulgaria4%noneParliamentRunoff
CanadaFPTPUnelectedParliamentMonarch
Chile0%2 per statePresidentRunoff
Croatia5%noneParliamentRunoff
Czech Republic5%FPTPParliamentRunoff
Denmark2%noneParliamentMonarch
Estonia5%noneParliamentParliament
Finland0%noneParliamentRunoff
FranceRunoff FPTPMixedParliamentRunoff
GermanyMixedUnelectedParliamentParliament
Greece3%+bonusnoneParliamentParliament
HungaryMixednoneParliamentParliament
Iceland0%noneParliamentPlurality
IrelandSTVUnelectedParliamentSTV
Israel3.25%noneParliamentParliament
ItalyMixedMixedParliamentParliament
JapanMixedMixedParliamentMonarch
Latvia5%noneParliamentParliament
LithuaniaMixednoneParliamentRunoff
Luxembourg0%noneParliamentMonarch
MexicoMixedMixedPresidentPlurality
Netherlands0%UnelectedParliamentMonarch
New ZealandMixednoneParliamentMonarch
Norway4%noneParliamentMonarch
Poland5%FPTPParliamentRunoff
Portugal0%noneParliamentRunoff
Romania0%MixedParliamentRunoff
Slovakia5%noneParliamentRunoff
Slovenia4%noneParliamentRunoff
South KoreaMixednonePresidentPlurality
Spain3%FPTPParliamentMonarch
Sweden4%noneParliamentMonarch
Turkey10%nonePresidentRunoff
United KingdomFPTPUnelectedParliamentMonarch
United StatesFPTP2 per statePresidentElectoral College

Commentary

There's a lot of "democratic" countries with very questionable scores. It's usually not quite as bad, as the general pattern is that more representative branches of government have more power than less representative branches.

So monarchs tend to have a lot less power than presidents, unelected Upper Houses tend to have a lot less power than elected Upper Houses and so on. Notably Emperor of Japan (sort of Head of State) has no role whatsoever, and British House of Lords (Upper House) is basically meaningless.

If this list was weighted by actual power, it would look a bit better.

The main exception to this pattern is US, which has it exactly backwards, and the (relatively speaking, none of them are actually good) most representative House of Representatives (Lower House) is least powerful, while the even less representative Senate (Upper House) and Presidency have almost all power between them.

Consequences

It all might have seemed like a purely theoretical issue a decade ago, but right now of the bottom 4 countries, 3 are in a major unending political crisis, and Canada's luck might run out just as it did for UK and US.

Of 13 countries scored 60% or lower, only Canada, Mexico, and New Zealand avoided major political crises recently, unless there were some that I missed. On top of the list, such situations are fairly rare.

One thing that's not directly connected with electoral systems, but would greatly improve quality of democracy, is implementing strict term limits, especially for top positions like presidents and prime ministers. Eternal prime ministers cause all sorts of problems, which could be easily avoided if their party just picked someone else for the role.

Emojiful ls in your terminal

lsd is a really sweet looking ls replacement, unfortunately it's awkward to install, so here are the steps for OSX:

Install lsd and font with emoji


brew tap caskroom/fonts
brew cask install font-hack-nerd-font
brew install lsd

Change font in your terminal

For iTerm2, it's: Preferences > Profiles > Text.
Then for both Font and Non-ASCII Font, choose "Hack Regular Nerd Font Complete".
It's a bit smaller than default font so I increased point size from 12pt to 14pt, but it's up to you.


For builtin Terminal app, it's Preferences > Profiles > Font.


Because this setting is per-profile, if you use multiple profiles, or some non-default profile, you might need to set it in multiple places.

Make it default

Depending on your setup, add this to your ~/.bashrc or ~/.profile or ~/.bash_profile:

alias ls="lsd"

Or depending If you use another shell, edit ~/.zshrc or such file.

Tuesday, March 12, 2019

Map mode for Hearts of Iron 4 resistance and suppression system for 1.6


I previously published this data for HoI4 1.0-1.5, and simply updated that post each release, as there were minimal differences.

1.6 changes thing a lot, so it's best to just publish new maps.

For some theory behind this map, check out this post as nothing really changed. It's still a horrible system that forces endless tedious and boring micromanagement on the player, and which completely cripples the AI.

If Paradox wants to do resistance, it should be possible to just put units anywhere in some big region like "France", and they'd apply to all its states, not this nonsense of individually placing every damn 1cav brigade by alt-tabbing out of the game and hoping you clicked things right. Or just remove it completely, the game already applies flat static penalty to occupied lands.

EU4 figured that out, why can't HoI4? Also contrary to romantic visions of La Résistance, all that resistance was historically close to irrelevant minor hassle, except maybe in Yugoslavia.

Anyway, here are the maps. Click for full resolution version.

Gentlest:


Gentle:

Harsh:

Harshest:

Friday, March 01, 2019

Challenges for February 2019 SecTalks London

Snow Leopard Cub Looking Curious by Eric Kilby from flickr (CC-SA)

I ran another round of London SecTalks CTF.

There were 12 regular challenges, and 1 super-hard bonus challenge. Only 10/13 got at least one solve during the event, so maybe difficulty or number of challenges were a bit too high.

Challenge files and code used to generate them available on github.

There are no answers below, but some serious hints which might make it too easy.

For previous rounds, see posts about September 2017, November 2017, May 2018, July 2018, and October 2018 CTFs.

from_future_import_flag (5 points)

It was a simple program which could tell you the flag if you run it in year 2020.

Censored SVG (10 points)

A simple HTML file with SVG image on it. The image contains flag covered with some censoring square. SVG image is base64 encoded for one small layer.

Hello RISC-V (15 points)

A simple binary which will give you the flag if you run it. It only runs on RISC-V, so you'll need to figure out a way to do so.

Crystal (20 points)

Password validator binary compiled from Crystal. Binary contains a lot of extra stuff, but validating function shouldn't look all that strange.

Powerpoint (25 points)

PowerPoint PPTX file encrypted with XOR. Flag is on the slides.

RISC-V Verify (30 points)

RISC-V binary validating password. It might be easier to run static analysis, but you should still understand basics of RISC-V assembly. Or you could run gdb on RISC-V emulator.

OCaml (35 points)

Password validator binary compiled from OCaml. OCaml uses unusual integer representation, so it's extra layer of confusion.

It had zero solves during the event.

LOLHEX (40 points)

English text encoded by hex encoding, but which of 16 digits is which is scrambled. Simple statistical analysis should do here.

Imba (45 points)

Password validator written in Imba. It will tell you if you get your flag right. It can be solved by static analysis (data driving logic is easy to see), or in-browser, possibly by by attaching DOM breakpoints.

It had zero solves during the event.

Catzip (50 points)

For mandatory meme challenge. It's a zip format made by gzipping something, then turning it into a PNG containing cat emojis. There's two cat emojis, 8 per row, so you can probably guess where it's going.

FPGA (55 points)

A slight variant of challenge from previous time. It's a small circuit, and you need to find inputs which give positive result. This time circuit has NAND, AND, NOR, OR, and XOR gates.

It's highly advisable to use Z3 or similar for it.

Monoalphabetische Chiffrierung (60 points)

German text encoded with monoalphabetic cipher, and then turned into Unicode Fraktur.

It's actually very easy, as punctuation, capitalization, digits etc. were not really scrambled.

LOL64 (100 points)

For super hard bonus challenge, it's English text encoded by Base64 variant, but which of 64 digits is which is scrambled.

Understandably, it had zero solves during the event.

It's definitely solvable in principle, but I'm not really sure how to write such solver. It can be seen as breaking a key of 64 6-bit parts, so 512 bits total. Knowing that it's all ASCII and simple statistical methods get a lot of those bits, but from that point on it would take some creative statistical analysis. Big difficulty is just size of the key, and how a single error in decoding can mess up all following statistical analysis, and cost a lot of time.

I'm sure there are also some ways to circumvent this whole process, and find exact encoded text from some simple statistical properties, but I didn't try it this way as it's less fun.

Sunday, February 24, 2019

Parable of the Sharks

Art show for sharks at Spoke Art by Steve Rhodes from flickr (CC-NC-ND)

Alice believes sharks are the biggest problem facing humanity.

If you ask her, she'll tell you about all documented cases of shark attack. She'll tell you how it's definitely undercounted - random disappearances will be counted as drownings even if they were shark attacks. Or someone could actually drown but only because they were running away from sharks.

She'll tell you that population increases every year, mostly in warmer and so presumably more shark-infested areas, that most people live in coastal areas, so we can expect more shark attacks in the future.

She'll tell you that as people get wealthier, tourism increases, and more tourists means more possibility of shark attacks.

She'll tell you that even living far away from the coast doesn't guarantee safety, as some sharks live in rivers. And what stops sharks from swimming into canals and sewer systems really?

She'll tell you that direct sharks attacks are just start of the problem. Sharks will eat fish, causing famines or mass unemployment in fishing dependent regions. Panics caused by shark attacks might cause mass migration, and all that together increases likelihood of armed conflicts. The more you talk to her, the most every problem turns out to be related to sharks.

She'll tell you how we need global solution to shark problem. Armed guards on every beach. Shark radars. Maybe even security bars in every toilet so shark won't swim up to bite you in your most vulnerable moment. The more you talk to her, the more elaborate her solutions become.

And of course she'll happily provide links with evidence for all those claims.

Bob doesn't believe sharks are even real.

Which of them is less wrong?

Sunday, January 27, 2019

finder-sort

Cat (OOF!) by Long Road Photography (formerly Aff) from flickr (CC-NC-ND)

I was playing a bit with Electron, building a small image viewer, as Xee is weirdly crashy nowadays. A small aspect of any image viewer is sorting images to show them in order. As far as I know there's no programming language with any special support for sorting file names, and default ASCII sort is just atrocious - going cat1.jpg,  cat10.jpg,  cat2.jpg etc.

It's not uncommon to find file manager or image viewer which uses this completely unsuitable sort order.

OSX Finder is notable for very much not doing so, and using human-friendly ordering. Exact details are unfortunately not properly documented.

I created something which works more or less the same, and published it as npm package finder-sort.

There could be some differences, especially for non-ASCII locales. In the end, it's trying to solve the same problem, not necessarily match OSX Finder exactly.

The source code is on github.

About the only interesting thing about it from code point of view is that I used ava testing package this time. Javascript has over 9000 different testing packages, and it's not uncommon for a single program to duct tape together 10+ of them. I'm surprised there's no clear winner yet. Some of the new ones like ava and cypress seem mostly decent.

Sunday, January 13, 2019

What I learned from Awair Air Quality Monitor

Unimpressed kitten by Magnus Bråth from flickr (CC-BY)

After watching DHH's video about air quality I decided to get myself AWAIR 2nd Edition air quality monitor.

Here's what I found.

Setup

Awair setup was fairly awkward. It couldn't connect with my WiFi until I changed my router to some compatibility mode, there were weird error messages about firmware update and so on. I finally got it running, but it wasn't smooth. At least there were no further issues after that.

Air circulation inside the flat is poor

I originally assumed that air in the flat would rapidly be fully mixed up, as it's a fairly small London flat, but that's not what I found. If I open all windows, fresh air gets to the sensor real quick, but as soon as I close them, the stale air is back just as fast from parts of the flat not on air flow path between open windows. I guess it's all the awkwardly placed walls and doors. Keeping windows open much longer eventually works, at least for a while.

How much CO2 per day do I need to get rid of?

One person burns about 2000 kcal a day, so let's say that's 500g carbohydrates getting burned. That's 200g carbon, or 730g CO2 per day, or 17 moles. 17 moles of CO2 takes volume of a bit over 400 liters. Plus a bit more for the cat, and for gas cooker.

Let's say the flat is 50 square meters, at height of 250 cm, so 125 cubic meters. Atmospheric CO2 is 400ppm, and let's say I want to keep it under 1000ppm, so 600ppm difference. 600ppm of 125 cubic meters is just 75 litres.

These are all heavily rounded calculations, but unless I forgot all the high school chemistry already, I need to somehow fully replace air at home 5-6 times a day to keep it in the happy range. Either by opening windows until fully replaced, or by having some small continuous air "leaks".

This number doubles with a second person, to 11 times a day.

That's a far higher number than I expected.

This number also changes depending on carb vs fat based diet, actual caloric expenditure, and so on, but in any case, it's very high.

Cooking anything generates massive PM2.5 spike

The sensor is placed in the computer room, about as far from the kitchen as it gets. And it looks like cooking anything whatsoever without windows open generates a massive PM2.5 spike for a fairly long time. This can fortunately be easily fixed by only cooking with windows open.

It's difficult to keep Awair happy

Awair never had any serious problems with chemicals, and PM2.5 spikes were only caused by cooking.

The problem were the other three readings. If windows are closed, CO2 levels creep up. If windows are open, CO2 levels go down, but temperature and somehow humidity go into unhappy zone. Pretty much no matter what I do, Awair will be unhappy. Only briefly after closing the windows when temperature goes back up but CO2 is still low Awair becomes briefly satisfied.

Perhaps I should move it farther away from airflow to make it more stable, then again it's fairly close to my computer chair, so it should be more representative of air I breathe this way.

What should I do?

I've been definitely opening windows more now, especially when cooking, but that's not too great - I like my place real warm (24-26C), and the outside is quite cold, especially in the winter.

I don't want to keep windows open too long not just because of higher heating bills, but also because of all the sound coming from outside. I'd have serious trouble falling asleep with bedroom windows open, as I'm extremely sensitive to light and sound when falling asleep. And it's distracting when I'm trying to focus on coding or gaming or just about anything.

I could open some other windows, not those in the bedroom, but honestly I don't think air would circulate much - bedroom door is always just slightly ajar for cat's sake, to keep bedroom as dark and quiet as possible. Closing them fully would generate cat scratching on door sound, which also negatively affects sleep.

Plants?

So an obvious idea is to get some houseplants. It's a bit of a hassle, and the cat would probably damage them a bit. But mostly I have no idea how much CO2 would they really remove. I suspect the numbers would be really low for any realistic amount of plants, making it not worth it. Especially at night, when the light is understandably off.

Or is there any other trick I'm missing?

Sunday, November 11, 2018

Webpack boilerplate package for Imba and SCSS

Fluffball by Rum Bucolic Ape from flickr (CC-ND)

Imba looks extremely interesting - seriously, just check out the code examples on their website.

I wanted to give it a go, there was just one tiny problem - in Javascript world you can't just gem install a few things and run them like that. Nope, painless setup is just a crazy ruby idea that never got much traction anywhere else. In Javascript universe everything always requires painfully complicated setup.

I found some boilerplate example for Imba, but it was broken on so many levels, I had to start pretty much from scratch.

So here's a working webpack boilerplate for Imba with SCSS support. Feel free to fork it into your project.

What's in it:
  • Latest Webpack
  • Imba
  • SCSS (as plain old compile to CSS, intentionally no CSS-in-JS shenanigans)
  • CSS normalize to avoid cross browser pain
  • standard npm commands for development and production builds.
Everything uses sane 2 space indentation, and tries to avoid doing anything weird.

What's obviously missing is some kind of testing framework, so PRs wanted.

I haven't used it for anything more complicated than just another TODO app yet, so I don't know if there are any issues. Just report them on github.

Thanks to all the brave souls who answered webpack questions on Stack Overflow - somehow I managed to duct tape working boilerplate out of all that.