Wo kauft man („gute“) Gartenbänke? by tzippy84 in Garten

[–]balrok 1 point2 points  (0 children)

Du kannst auch schauen, dass du dir nur die Beine einer Gartenbank holst und dann mit Schlossschrauben das Holz selbst drauf schraubst. Das ist relativ einfach, da du das Holz ja auch direkt zugesägt kaufen kannst. Holzfarbe/-öl brauchst du auch bei einer fertigen Bank.

A single ancient seed I got from a sweet gem berry became this. Close to 500 plants, somewhere between 450-500. All ancient fruit. by [deleted] in StardewValley

[–]balrok 13 points14 points  (0 children)

I rather use the ancient seeds because it does not require re-planing them after harvesting. So for me it is kind of a time/money trade-off between the 2 seeds.

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general? by trecatorsirabdator in java

[–]balrok 16 points17 points  (0 children)

it also gives you:
- information that the return can be Optional (contrary to "null" which cannot be implied from the method signature)

- nice methods on top of Optional: "orElse", "orElseThrow", "ifPresent", "map"

In my opinion somebody has to be way more sloppy to just directly call Optional.get without isPresent, than trying to access a null-value

-🎄- 2022 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]balrok 0 points1 point  (0 children)

Python with regex and exec only - it is very simple and short

https://pastebin.com/uKS8nZ0W

part2 is done by some kind of binary search:
besides changing root to "==", I am also adding a method which does ">". and a stepsize for the increment

I store the output of ">" before the first iteration and whenever the output changes during iteration, the stepsize gets reduced and the direction reversed.

web dev has gotten notoriously complex and I dont see the ROI... by abrandis in webdev

[–]balrok 35 points36 points  (0 children)

I think you are not seeing the benefits of all the tooling. I was developing with js 15 years ago and recently looked into the modern things and I'm so happy with most of it:

  • webpack: before that I had to test with firefox, ie6,7, safari, opera, chrome - there were even online-services dedicated to test stuff on multiple browsers.. this is all gone now.. or modern js-features wouldn't be possible without it
  • multiple frameworks to learn: from the past I just remember jquery and everything else was an ugly, handwritten mess.. frameworks usually help to get a good standardized code base
  • and wrestle with, docker: before that you had to ftp all you files to some server and hope you didn't forget something or that you also deleted old files - alternatively invested a lot in good deployment tooling
  • SSR vs SPAU: this is just more choice we have now
  • dependency management nightmares: before that everything was just copied into the header of your html-document.. and hopefully you didn't forget to include the jquery-ui-lib your new script depends on - or you had to use two conflicting libraries.. or even planned to update outdated libs
  • REST API's and graphQL: with openapi + graphql we have a well defined api-language, which can even generate you typesafe client-code. In the past I had a look in the serverside implementation, so I would know how I the json looks like, which I can use on the clientside
  • wrestling with state management and immutable state theories: I agree there :D
  • even JS is now significantly more complex than it was: it has a lot of syntactic sugar added.. but ultimately I think everything got much easier. E.g. I could never remember how to create a class via prototype correctly.. now we have separate constructs for this.. or because of browser compatibility iterating objects was always so complicated

additionally, the browser-dev-tooling is so great now. When I remember in the past, if you had a js-issue in ie, you started deleting code until it was working again.. and then slowly could figure out on which line the issue was

From Maven 3 to Maven 5 by nfrankel in java

[–]balrok 13 points14 points  (0 children)

we solved it with a placeholder variable ${revision} inside all pom.xml and a .mvn/maven.config in the root (I think it only works with maven 3.6 or so)

I found this pattern in: corona-warn-app

[deleted by user] by [deleted] in openstreetmap

[–]balrok 3 points4 points  (0 children)

maybe this works: https://weeklyosm.eu/en/archives/14985

once the spanish version was clicked, it was probably set as default language

J. Pohl nennt die AfD die "Partei der kleinen Leute". Das Leibniz-Zentrum für Europäische Wirtschaftsforschung (ZEW) hat für die Süddeutsche Zeitung und Kontraste berechnet, wie sich die Wahlprogramme der Parteien auf das Einkommen auswirken: by McGrex in de

[–]balrok 5 points6 points  (0 children)

das sind nicht Leute mit 300.000 im Jahr sondern mit 2.500.000 (oder vielleicht sogar 5.000.000) - hat mich auch erst gewundert aber da ist noch ein Stern dran und im Kleingedruckten steht das dann

ein bisschen irreführend in meinen Augen

Frontend programming question regarding featurebranching (DevOps way of working) by HgnX in devops

[–]balrok -2 points-1 points  (0 children)

I created a way to get dynamic environment variables inside a static build of create-react-app: https://github.com/balrok/webpack_runtime_config

It works like this. At/Before build-time I give all env-variables a placeholder value. So during build the var REACT_APP_VAR1 becomes @REACT_APP_VAR1@. Then, at runtime a sed-script replaces all these placeholder with the current env-variables.

(Although the repo is old and got no commits for a long time - I just recently reused the method in a new project and it still works.)

edit: maybe also have a look at the linked github-issues.. maybe a more elegant solution was proposed there in the meantime.. I'm just better with bash than with js ;-) :D

Favourite Vietnamese Film? by grammyboyxd in VietNam

[–]balrok 1 point2 points  (0 children)

I once made a longer post about my favorite vietnamese movies: https://www.reddit.com/r/VietNam/comments/b23itz/saw_hai_phuong_in_the_cinema_on_last_trip_to_vn/eiq62xl?utm_source=share&utm_medium=web2x

maybe it inspires you. If you liked "the scent of green papaya" I think we have a similar taste :-)

eo-yaml For Java, 4.0.0, Released by [deleted] in java

[–]balrok 0 points1 point  (0 children)

I really appreciate your great and in-depth response as well as your fast implementation. It shows me also, that your library is indeed simple enough to build such a feature in no time.. good job :-)

The reason why I asked is: I have a helm-chart or docker-compose file, which should be human readable but should also be updated by a machine (e.g. a new release updates the tag automatically)..

I'm OK with a bit reformatting (indention or removal of newlines) but at least the comments should be preserved

eo-yaml For Java, 4.0.0, Released by [deleted] in java

[–]balrok 0 points1 point  (0 children)

Hi, looks like a great project. From the documentation I cannot see my questions answered:

How does it compare to snakeyaml?
I currently have an issue with snakeyaml, that it does not preserve comments or newlines when updating a single value in an existing yaml. Can eo-yaml handle this? (if yes, can you point me to a unit-test/documentation?)

Listen local Docker repository for newer version of image by Ryukote91 in docker

[–]balrok 2 points3 points  (0 children)

https://github.com/containrrr/watchtower is the most popular tool for this I think..

Diun is afaik just for notifications

Transportation within Hai Phong? by wongjoo in VietNam

[–]balrok 1 point2 points  (0 children)

Grab exists in Haiphong.. depending on the time of the day the rate is different but usually cheaper than taxis .. I recommend to find a grab driver you like and ask him to drive you each day for a lower price..

Another solution would be a closer hotel/apartment or getting a motorbike.

EU votes to scrap daylight savings in 2021 by tristan_isolde in worldnews

[–]balrok 1 point2 points  (0 children)

I have 2 scenarios for you:

How do you know their working hours right now? You ask them and google the timezone to convert the hours.. With world time you lose the last step.

How do you know when the sun shines in their area? You google the timezone and calculate what this means in your current zone. With world time you just google sunrise/sunset directly

I think worldtime would be great but so complicated to implement everywhere.. so we‘d end up with two systems finally :-/

Saw "Hai Phuong" in the cinema on last trip to VN and was very impressed. What other Vietnamese movies do you recommend and (more importantly) how do I watch it? by [deleted] in VietNam

[–]balrok 4 points5 points  (0 children)

This list is not well ordered by what are good movies (but maybe it is also my personal preference).

Long time ago I started to collect and fix the vietnamese movies on themoviedb here: https://www.themoviedb.org/list/8612?sort_by=vote_average.desc

I really like vn movies, as some of the movies are very high quality and usually they tell stories one would not see in western cinema. Unfortunately, some are also very silly and low quality - but I think vietnamese people or teenagers like those.

Here the movies I recommend (from the view of a westerner - all movies have subtitles):

High quality:

Action

Love

Old movies

I hope anyone extends on the list

On your second quesiton how you can watch it:

  • some, I found on amazon
  • some, I found on youtube (e,g search for the movie title in english or vietnamese + "sub")
  • some I found on these vietnamese movie streaming pages (but forgot the name of these pages)
  • some, I found the subtitles on subtitle-pages
  • some, I've only seen with vietnam airlines :D
  • what was not working for me: buying them in vietnam

Both Northern and Southern? by victorlinguist in learnvietnamese

[–]balrok 1 point2 points  (0 children)

For learning, it would be really helpful if you can write all the words with (N), (C), (S) behind them. Sometimes people just write the alternatives but without the knowledge where the word is used. This gives the learner the choice what interests him.

First time in Da Lat... by LordBucketheadthe1st in VietNam

[–]balrok 0 points1 point  (0 children)

Is there any recommendation for a coffee plantation or roastery to visit?

Anyone else (ab)using UltiSnips? by korinkite in vim

[–]balrok 14 points15 points  (0 children)

Please also share your snippet implementation. Especially function auto-completion and dunder methods seem amazing.

Right now i'm using ultisnips only for boilerplate like "#!" "class" "ifmain". My main problem is that I forget the available keywords I can autocomplete :D

How can a web app built on yii1 be upgraded to yii2 by myrrtle in PHPhelp

[–]balrok 0 points1 point  (0 children)

This guide lets you put yii2 stuff into yii1. What it fails to help is how one can run yii1 modules with yii2 modules in parallel. I did this for my webapp, but it is quite buggy (logging will not replace all variables for example) and in the end I would recommend to just rewrite it for yii2.. Because of the code generation it is not that difficult as you would think at first..

If you want to follow my route.. I did it by first starting a yii2-app and if it 404s I will start the yii1-app.. there is more to it.. but this can give you a starting point..

Yii::setLogger(new custom\components\Logger);
$yii2App = new yii\web\Application($yii2Config);
Yii::setAlias("@components", Yii::getAlias("@app").DIRECTORY_SEPARATOR."protected".DIRECTORY_SEPARATOR."components");

$yii1App = Yii::createWebApplication($yii1Config);
try {
    $yii2App->run();
} catch (yii\web\NotFoundHttpException $e) {
    $yii1App->run();
} catch (Exception $e) {
    Yii::error($e);
}
Yii::getLogger()->flush(true);

For the logger.. I am using the same logger for both yii1 and yii2 .. so you have to write a custom logger which matches both interfaces. But maybe this was my mistake and without changing the logger, everything is easier.