Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

Weekly 2022-31


Weekly 2022-30

user_comment = get_object_or_404(
    self.user.comments,
    pk=self.kwargs["comment_pk"],
)

Weekly 2022-29


Schneller Veganer Gnocchi Brokkoli Auflauf

Servings: 4 , Prep Time:

Ingredients

  • 800g Gnocchi
  • 1 Brokkoli
  • 1 Dose Tomatenstück
  • 1 Becher veganes Creme Fraiche
  • 1 Zwiebel
  • 1-2 Knoblauchzehen
  • Veganer Reibekäs
  • Olivenö
  • Oregano
  • Thymian
  • Salz und Pfeffer
  • Optional: Paniermehl und Leinensamen

Instructions

Schneller Veganer Gnocchi Brokkoli Auflauf.

Ein schneller veganer Auflauf mit Gnocchi und Brokkoli. Kann eingefroren oder backfertig im Kühlschrank gelagert werden, für Tage wenn man keine Lust hat zu kochen.

  • Wasser in Topf zum Kochen bringen und Gnocchi nach Packung kochen
  • Brokkoli in mundgerechte Stücke schneiden
  • Zwiebel und Knoblauch hacken
  • Zwiebel in Öl anbraten bis sie anfangen Farbe zu bekommen
  • Brokkoli und Knoblauch hinzufügen und kurz mit anbraten
  • Mit Tomaten ablöschen und Dose mit etwas Wasser ausspülen und mit hinzugeben
  • Für ein paar Minuten aufkochen, dann Creme Fraiche hinzufügen
  • Nach Geschmack würzen
  • Fertige Gnocchis in die Pfanne geben und alles gut vermischen
  • In Auflaufform geben und mit Käse bedecken
  • Optional etwas Paniermehl und Leinensamen über den Käse sträuen, für einer knusprigere Kruste
  • für ca. 20 Minuten bei 200°C backen

How to install an AppImage

In general AppImages can just started by double clicking or executing them from the terminal (./MyApp.AppImage). If you want to have them accessible from the start menu, you have to do a little bit more work.

First, move your AppImage to a suitable location. One option is to create a new directory for all your apps (e.g. an "Applications" directory in your home folder). I prefer to store them in .local/bin, as this folder is added to the $PATH variable. This allows you to use the app anywhere by calling it in a terminal. For GUI apps you most likely want to start them from the start menu of your desktop environment. For most apps, this can be achieved by following these steps.

  1. Open the App
  2. In a terminal call mount and look for the application name. You can use grep to filter the output. (mount | grep MyApp)
  3. Open the location in your file manager. In the directory you should find:
    • an icon. This can be a PNG in the main folder. In my case (Obsidian) the icons where stored in usr/share/icons/hicolor
    • a "desktop configuration file". It's content should look similar to this:
    [Desktop Entry]
    Name=Obsidian
    Exec=AppRun --no-sandbox %U
    Terminal=false
    Type=Application
    Icon=obsidian
    StartupWMClass=obsidian
    X-AppImage-Version=0.13.19
    Comment=Obsidian
    MimeType=x-scheme-handler/obsidian;
    Categories=Office;
    
  4. Copy the icon into .local/share/icons. If you find a hicolor folder in the app directory, copy the entire folder over. (use Ctrl+H to show hidden files)
  5. Copy the desktop configuration file into the .local/share/applications/ directory in your home folder.
  6. Edit the copied desktop file.
    • Replace the app name in the Exec= (and TryExec=) statement with the full path to the AppImage. In the example file above: Exec=~/.local/bin/MyApp


Fun Facts Game

I've create a small game: fun-facts.rerere.org

How To Play:

  • Meet up with friends, co-workers or people you would like to know better in a video call (or in person once the pandemic ends).
  • Create a new game and share the link with all players.
  • At the top of the Page you can enter new fun facts about you, for example: “As a child I owned 10 chickens”.
  • Wait until some facts are in the pool. The number of facts is shown in the sidebar.
  • With “Next Facts” you can show change the fact shown to all players. Discuss in the group from whom the fact might be.
  • You can set your choice in the sidebar by clicking on a name.
  • Once everybody has set their choice, the submitter (or game creator) can reveal the author of the fact.
  • Talk about the fun fact.
  • Repeat until no more facts are available.

Are Crypto Currencies to Blame for High GPU Prices?

Lately I'm paying more attention to the crypto currency and "DeFi" spaces, again. One discussion that comes up regularly: are miners to blame for the high GPU prices? To add some facts to this discussion, I’ve done a small analysis of GPU and crypto currency prices to determine if they are related.

Data Sources

GPU Prices

For GPU prices I used the german website https://geizhals.de. The website shows the prices of items over a time frame of six months. The data of the plots is delivered as JSON and can be easily scraped. I scraped the pricing data for the four current-gen NVIDIA graphics cards (RTX 3060 - 3090). As multiple manufacturers sell the same graphics card chips, I averaged the prices per chip.

Plot with prices of graphics cards over time.

Crypto Currency Prices

I used Yahoo! Finance as my source for the crypto currency prices. You can download the historic data as CSV.

Evaluation

For a first impression, I’ve added the bitcoin price to the plot of GPU prices. To normalize the prices, I divided each time series value by the first price observed. Squinting at this plot, you can already see that the overall trend in prices roughly line up.

Plot with prices of graphics cards and bitcoin over time.

For a more accurate analysis, I looked at the correlation factors and created corresponding scatter plots. Each dot in the plots represents one day. The Y-axis shows the price of the GPU at that day and the X-axis the price of the crypto currency. If prices correlated perfectly, all dots would lie on a diagonal line.

For the RTX 3060, there is only a weak correlation between prices. The correlation between RTX 3060 and ETH prices is not significant and has to be discarded. Keep in mind that the 3060 was just released on 26 of February, so we have less pricing data compared to the other GPUs. For the other cards, we see higher correlation factors. Whenever the price of one rose, the other rose too. The effect is strongest for the RTX 3090 and is visible in Bitcoin and Ethereum.

Scatter plots showing the relationship between crypto currency prices and GPU prices.

This analysis still has a flaw, as it does not correct for the overall trend in the price development. Prices change over time because of factors affecting all products. For example, inflation will rise all prices over longer observations. This creates a false correlation if you compare prices over a long time frame. To correct for this, the overall trend has to be removed from the data. I used a linear regression to remove the trend.

Plot with prices of graphics cards and bitcoin over time. The trend is removed.

With the trend removed, the measured correlation between the prices is weaker, as expected, as we removed a linear factor from the data. The data still shows a correlation between crypto currency and GPU prices. The correlation is stronger for Bitcoin than for Ethereum.

Scatter plots showing the relationship between crypto currency prices and GPU prices. The trend is removed.

To test the validity of these correlations, I did the same analysis for CPU from AMD and Intel. I used the prices of the generations; Ryzen 5000 and i-11000. The AMD prices show no correlation with the crypto currency prices (p-value below 0.05). For Intel chips, we can observe a slight correlation. This gives me more confidence that the correlation is real for GPUs.

Scatter plots showing the relationship between crypto currency prices and CPU prices. The trend is removed.

Conclusion

We can see a correlation between GPU prices and the value of crypto currencies, but correlation does not mean causation. A causation is plausible in this case. Miners earn a lot of money with their businesses and can predict how much they will earn on average with each graphics card. As long as their earnings are high enough, it is profitable for miners to buy cards at higher prices. Bitcoin miners rarely use GPUs anymore, but ASICs. The production of ASICs may add more price pressure on silicon and chip production. I don't have any data on the amount of production capacity being used by ASICs, so I don't know how much pressure they produce.

Why is this a problem? There is nothing inherent to blockchains that demands such a high dependence on computing hardware. The resources spent by miners only serves as a mechanism to increase the cost of changing data in the blockchain. This cost serves as a mechanism to secure blockchain. Other mechanism for securing blockchains exist and successfully used (see Proof of Stake). Proof of Work creates external costs (environmental impact, higher electricity prices, GPU scarcity) to benefit a small group of miners.

Download the raw data and notebook.

#cryptocurrency #gpu #analysis


NFTs in Games Are Bad! Here Is an Alternative.

NFTs in gaming are just a bad idea. They create artificial scarcity in order to create a pure manifestation of capitalism in the gaming world. This is not fun! Games should allow you to escape from reality, not bring the problems of real life into virtual life.

Do gamers want this? Ask any gamer about pay-to-win, or in-game purchases, and you got your answer.

Alternative Financing

What are the alternatives? Let’s imagine the manifestation of another ideology: Communism.

Everybody pays as much as they can spare to game developers. The game developers use this money to pay artists and developers, which create the content of the former NFTs. Every player can use these new skins and items, no matter how much they paid. There is no special treatment for paying more. Your sole motivation for paying is liking the games and wanting to see it grow.

This is certainly better than NFTs, but still does not enhance the game. A game where you cannot progress or achieve anything is boring. So let’s mix in meritocracy.

We still finance the content as above, however it’s not given to the players directly. Instead, the items/skins are tied to achievements in the game in a deterministic way. Want that new sword skin? Win 100 fights in the Arena of Doom. This gives players a goal and rewards skill in the game.

I think these two principles create a system which most gamers will like. You don’t have to pay for new skins/items, but you can still brag about your new skin because everyone knows how hard it is to obtain. This would also be an improvement over the current system of micro transactions and in-game purchases.

Now you may ask: “But what about sharing items between games? That’s the whole reason for using blockchain and NFT.”

Decentralization and Ownership

Blockchain will not solve the problem of sharing items between games.

Tracking ownership is the smallest of problems. The more hard questions are: How do you translate item stats from one game to the other? How do you exchange assets in a unified way? How do you convince large publishers to open up their ecosystems?

So here is my solution: Federation.

First, we need to find a common way to connect game account with each other. An established method is OAuth2. This would allow players to connect accounts of different games. Once connected, your game can retrieve the list of items a player unlocked in the other game.

Another possibility, and a more decentralized method, is the Solid Project, where your data is stored in a place you control. This would have the added benefit that your game assets still exist when the publisher of the stops maintaining the game.

Additionally to authentication, we need an API to exchange information about the in-game assets between games. The API needs to present items in a standardized way, which is still flexible enough to cover “all” items in games. One possibility would be to use RDF and define a standard vocabulary for game items. RDF uses three-part structure to describe properties of subjects. With in-game items, this would be equivalent to: “sword is green”, “sword has +3 strength”. By defining a standard vocabulary (e.g. how to represent colors), games could easily translate from the common description to in-game attributes.

You might also want to include assets in the API. Again, we need heavy standardized representation (e.g. glTF or obj for 3D assets, PNG for images, ...). These assets would mostly only serve as references for designers to create their own assets. Games are art pieces, and it is almost impossible to share assets between them in an automated way.

Once our authentication flows and APIs are defined, we can integrate them into games. This still requires work from artists and programmers. The game developers decide which game they want to support for exchanging items with. Connecting two shooters is easier than connecting a fantasy RPG to a sci-fi strategy game. Using the assets API the designers change or recreate the assets to be used in their game and adjust the stats to be balanced. When the players connect their game accounts, the information about ownership is exchanged, and the modified items awarded to the player.

Most games will probably only support game connections with similar settings where the translation is straightforward. But over time, more and more games will build connections between varying genres. At this point the true power of a federated system starts.

The connections of games build a graph. This allows you to support many game connections without explicitly connecting them. A player earns an item in Game A. This item is translated to another item in Game B. If your game supports a connection to Game B, it can automatically supports all items which are also supported by Game B. This way, your game will automatically accept more and more items from different games without more work for the designers.

Conclusion

I think this creates a system that is beneficial to all participants. New games will use connection to popular, similar games to attract players to their game. Players that get a bit tired of a game can swap to new games and take (some) of their assets over. Large publishers might use this system to cross promote their games.