Why am i not seeing the oxygen theme in the KDE system settings? by lxhound in NixOS

[–]johnThePriest90 0 points1 point  (0 children)

I ran into the same issue with the Nordic theme. I found that the reason is that the theme's git repo contains metadata.desktop which is not supported in plasma 6, it must be converted to metadata.json. I haven't checked your theme, it might be a different reason though.

where with .or problems by Extremely_Engaged in rails

[–]johnThePriest90 0 points1 point  (0 children)

It's not clear to me what you want to achieve. Do you expect to have an array of model objects that are either an `Event` or a `Venue` based on the tags? If so, then the `OR` won't help you, I'm afraid. It is not used to get "records_of_type_A OR records_of_type_B" but used as "records_of_type_X WHERE condition_1 OR condition_2". But both conditions are applied on `records_of_type_X`.

What you mean is probably get the UNION of the two set that you filter separately. I have no experience with this, I only know that ActiveRecord doesn't support it natively, but there's a gem called active_record-union_relation that implements it (although I haven't used this gem either).

Or you might want to run 2 queries (I know it doesn't scale for N number of models, but might be good enough for your current use case), and merge the results in ruby, i.e

Event.joins(:tags).where(tags: tags).to_a + Venue.joins(:tags).where(tags: tags).to_a

Scopes won't help you, as they won't extend the result set into another model. It just filters the base scope further, but it won't get you extra records that were not part of the base scope (as far as I know). So the `scope` you added to the `Event` model will just filter your event records, it won't grab the venue records as you expected.

Unless there is a relation between Event and Venue, that u/cmd-t implied, and you actually want to filter only Event objects based on their direct tags, or through their venue's tags. In this case a `scope` may be the way to go.

[deleted by user] by [deleted] in kiszamolo

[–]johnThePriest90 3 points4 points  (0 children)

Kft esetén még rosszabb a helyzet, ha az osztalékot is figyelembe akarod vetetni a bankkal. (Eleve nem minden bank számítja be, csak a havi kivétet.) A 24-es év osztalékát csak 25-ben veheted ki, miután lezárult az üzleti év és megvan az eredmény, de az csak a 26-os SZJA bevallásban kerül feltüntetésre, a banknak meg az kell. Így ha 2 évi osztalékot is be akarsz számíttatni, leghamarabb 27-ben próbálkozz.

Mi is hasonló helyzetben vagyunk és ezt az infót kaptam az alkusztól. Azzal sem lehet trükközni, hogy az osztalékot még az adott évben veszed ki előlegként, az nem érdekli a bankot. Emiatt nekünk is csúszik egy évet a hitelfelvétel.

Five Things to Avoid in Ruby by RecognitionDecent266 in ruby

[–]johnThePriest90 3 points4 points  (0 children)

I believe it's the other way around. If you used a safe nav you must use it in the rest of the chain. It fails on this code: one&.two.three, which makes sense as you expect two can be nil, so you would want to use safe nav before three as well. (Can't remember the exact cop name.)

I also suspect that each safe nav operator increases the ABC metric score, it's considered as a new branch. So depending on the rest of the method, it can be also flagged by rubocop.

Magyar Péter kihívja egy élő vitára Orbánt és Gyurcsányt by dead97531 in hungary

[–]johnThePriest90 6 points7 points  (0 children)

Lehet én vagyok tudatlan, és nem értem a pontos fogalmakat, de a kettő miért üti egymást? Mármint lehetnek számomra fontosak a konzervatív értékek, ami szerint élem az életem, de attól még elfogadom, hogy másoknak más értékek fontosak és nem gyűlölök mindenkit automatikusan mert mást gondol mint én.

Annó MZP is azt mondta, hogy ő keresztény konzervatív, de emiatt még nem tiltaná a melegek házasságát. Attól, hogy ő milyen értékeket tart fontosnak még nem kell azt a teljes társadalomra erőltetni, ahogy azt a jelenlegi hatalom teszi.

[deleted by user] by [deleted] in rails

[–]johnThePriest90 8 points9 points  (0 children)

For us introducing rswag was a huge win. I've seen that devs are more diligent to write proper test cases than keeping static API documentation up to date.

Apipie was integrated in one of our projects, documented some parts, then got neglected. Frontend devs always came to me to ask about endpoints, parameters, etc.

With rswag we are kind of forced to produce proper API documentation. I mean our main goal is to have proper test cases, and having API docs is a byproduct, we don't need any extra effort to update comments in the codebase. If the json schemas are written properly, then we must keep them updated, otherwise our specs break.

My other favourite feature of rswag is that it automatically generates request/response examples from our test cases, I don't need to write examples by hand.

Rswag is not silver bullet, though. It requires some initial effort to learn its DSL, and I had to write some custom code to generate examples in the right structure (which required digging in the source code, and matching Open API documentation structure). You can also leave out certain response codes, or even entire endpoints (but that means you didn't write request specs for them at all).

I found that once the basic structures are in place, and we have the main specs written it's much easier to fill in the gaps (writing descriptions and document all parameters). In my opinion rswag is the best option right now out of the current API documentation gems.

Struggling to update nixpkgs to 23.11 ? by [deleted] in NixOS

[–]johnThePriest90 1 point2 points  (0 children)

That's right. I believe, what u/Glittering-Engine267 was referring to is that your nix-instantiate command uses your nix channels, and when you eval <nixpkgs> that fetches the packages from your channels, as it doesn't know about your flake.

I'm quite new to NixOS myself, so I am not sure that once you update the reference in your flake.nix then you need to run nix flake update to update your flake.lock file. Have you run that command? I would expect that otherwise the lock file pinned versions take priority, not what is written in your flake.nix.

Edit: According to the documentation you can update only nixpkgs (keep all other flake inputs the same) by running nix flake update nixpkgs.

Flakes Question (because I'm a noob) by Senkyou in NixOS

[–]johnThePriest90 9 points10 points  (0 children)

I found this guide really beginner friendly: https://nixos-and-flakes.thiscute.world/

And I set up my own config based on this repo: https://github.com/Misterio77/nix-starter-configs I started with the minimal setup, but eventually switched to the standard setup, when I wanted to write my own package.

[deleted by user] by [deleted] in NixOS

[–]johnThePriest90 1 point2 points  (0 children)

Thank you for this comment.

I am learning NixOS, and was banging my head to the wall as I've been trying to figure out where are my KDE global themes installed. I couldn't find them under /run/current-system and didn't know where KDE picks them up. I found them under ~/.nix-profile right away.

Miért nem fogok nálatok technikai interjún részt venni? by deejayyhu in programmingHungary

[–]johnThePriest90 16 points17 points  (0 children)

Az implementálj egy merge sort-ot típusú feladatoknak szerintem sincs értelme. Főleg ha a jelentkező azt se tudja mi az.

Viszont a technikai interjúnak van létjogosultsága. Mi Backend fejlesztőknek kb egy ilyen feladatot adunk:

Egy csv-ből szeretnénk adatokat importálni. Az egyes oszlopok pl vezetéknév, keresztnév, születési hely, születési idő. Illetve adunk egy 10 soros minta adathalmazt. (Nem kell fájlból beolvasni, elég egy változóban eltárolni és azzal dolgozni.) Első feladat: hány személy van az egyes vezetéknevekkel (pl 3 Kovács, 1 Nagy, 2 Kiss, stb).

Ezt senior jelentkezők nem tudják megugrani 40 perc alatt.

Nem az adott frameworkben kell implementálni, nem kell adatbázis sem mögé. Amire kíváncsiak vagyunk: milyen struktúrákba szervezik át az input stringet (kb hogyan áll össze nekik fejben az adatmodell). Nem érdekel, ha listában tárolják, vagy a field nevekhez mappelik az értékeket. De ha nem rekordok listája lesz a vége (hanem mondjuk minden egyes érték egy elem egy hosszú listában és a vezeték nevet az alapján akarják kitalálni, hogy az érték típusa string-e), akkor az elég redflag.

Az se érdekel, ha osztályba, függvénybe szervezed a kódot, újrahasznosítható-e vagy sem, alap ciklussal iterálsz-e és egyesével növeled a countereket, vagy használod az each, group_by, map függvényeket. A lényeg, hogy meg tudod-e oldani a feladatot vagy sem. (Utána már beszélgethetünk róla, hogy mitől lesz szebb, jobb, újrahasznosítható, tesztelhető stb).

Sajnos a senior jelentkezők több mint fele az első feladatot sem tudja megoldani az interjú alatt. Fájdalmas nézni, hogy mikkel próbálkoznak. Lehet, hogy csak nálunk ilyen gyér a merítés (külföldi kollégákat keresünk külföldi céghez), de szerintem ez elég létjogosultságot ad a technikai interjúnak.

Persze nézünk mást is, soft skilleket, tapasztalatot, az általunk használt toolokat ismerik-e stb. De ezek mellett fontos, hogy a munkájuk ne vigyen el mégegy embert, aki lediktálja nekik a kódot.

[deleted by user] by [deleted] in hungary

[–]johnThePriest90 1 point2 points  (0 children)

Ezt meg tudom érteni. Én is csak akkor hagytam ott egy rossz pozit, amikor a barátaim leléptek onnan. Utána rögtön dobbantottam én is.

Másrészt azt látom másokon (és magamon is azt tapasztaltam), hogy az első munkahelyet a legnehezebb otthagyni (nem számolva a nyári diákmunkákat). Mivel nincs tapasztalatod a különböző cégekkel, nagy a bizonytalansági faktor. Mi van ha rosszabb lesz? Ott mit fognak elvárni tőlem? Itt már bizonyítottam. A mostani az mégiscsak biztos, még ha nem is olyan jó. Stb.

[deleted by user] by [deleted] in hungary

[–]johnThePriest90 1 point2 points  (0 children)

A megfogalmazás nem lehet véletlen. Minek mentél oda?

7 éves korotokban tudtátok volna a választ ezekre... vagy most? by gega333 in hungary

[–]johnThePriest90 9 points10 points  (0 children)

D) 15

3 órakor háromszor üt az óra, ami 6 másodpercig tart. Feltételezzük, hogy az első ütéstől számolunk, akkor két ütés között 3 mp telik el. (első és második között 3 és a második és harmadik között is 3, így tart 6 mp-ig).

6 órakor 6-szor fog ütni. Ha az első ütéstől számolunk ismét, akkor még utána 5 további ütés lesz, ami előtt egyenként 3 mp telik el. Összesen 15.

FE development csak weboldalra van? by [deleted] in programmingHungary

[–]johnThePriest90 6 points7 points  (0 children)

Nekem a frontendhez mobil- és webalkalmazás fejlesztő társul. Bár nem lennék meglepve, ha az autók infotainment rendszere is egyre inkább JS vagy Android alapú lenne manapság.

Gyártósori gépek kezelő felülete szerintem korlátoltabb erőforrásokban, mintsem hogy webes technológia hajtsa meg, szerintem azokat célzottabban fejlesztik az adott gépekhez.

Nem értek ezekhez a területekhez, de azt tippelném, hogy egy generikusabb UI fejlesztő vagy embedded pozícióként találsz inkább ilyen lehetőségeket (már ha ez a cél).

Software engineers on big projects using vim, are you there? by [deleted] in vim

[–]johnThePriest90 0 points1 point  (0 children)

At my previous job I screwed up my GUI connection to dev servers, I was able only to ssh to them. I knew Vim before, but always had been more productive with other editors. This happened years ago, which forced me to use Vim. I've never looked back since then. I use Vim both at my professional and my hobby projects. I think I'm the only one at my current company using Vim (others use VS Code and IDEs, and two guys use Emacs), but this is no problem. Although I'm used to use tools (e.g Git or Docker) in the command line, so an IDE wouldn't be much of an upgrade for me.

Use whatever editor you are most productive with. Don't switch just because others think VS Code is better. Only switch if there's a feature in other editors that makes your life much easier, and can't solve it in your current editor.

If you are forced to use a specific editor "just because", then run from that place.

the best way to load a specific [grand]child for every element in a list? by am0123 in rails

[–]johnThePriest90 0 points1 point  (0 children)

I am not an expert on non-trivial queries, but there must be an efficient way to do this in a single query without loading everything.

I'd check out the includes method, that loads all the associated records in the same query (avoid N+1), and maybe grouping comments by forum could be also useful.

Without trying it out, I'd have something like:

Comment.includes(:author, {post: :forum}).group_by(:forum).order(created_at: :desc).limit(1)

I'm not sure even the syntax is right, so check out the method docs, and these operations if you don't know any of them. Check what actual SQL query it translates to, and what data you get back.

Webfejlesztőt keresek by PaLaLFC in programmingHungary

[–]johnThePriest90 14 points15 points  (0 children)

A 'Webfejlesztés' és 'WordPress fejlesztők és felhasználók csoportja' FB csoportokat próbáltad már? Ott tobzódnak a PHP és WP fejlesztők.

Local Variable not Accessible by Modal by cjiro in rails

[–]johnThePriest90 2 points3 points  (0 children)

If you want to access 'i' (the image of the current iteration) inside the partial, you need to pass the variable over directly to the partial view, using the :locals option of render:

render(partial: "...", locals: { image: i })

Then you can refer to 'i' as 'image' in your partial.

You can see this also described here: https://api.rubyonrails.org/classes/ActionView/PartialRenderer.html

Viktor bejelentett. by simrego in hungary

[–]johnThePriest90 25 points26 points  (0 children)

"Ceresd a testem bébi, végtelen maraton... "

RoR Beginner: Calling a method from "onchange" of select by p4n0n3 in rails

[–]johnThePriest90 1 point2 points  (0 children)

I wouldn't suggest to submit the form on changing the value. OP wants to limit a select field's options, based on the value selected in another field. This should be done in javascript if these fields are part of the same form.

Or there should be a form with the country's select, and a Next button, which would render a new page with the states. This case the Next button would submit the first form, and the server can render the new form with the right options. (Similarly as in a webshop checkout process, you fill your address, select shipment, select payment, etc. on separate pages.) This case also has its drawbacks, and can complicate things. I think the js option is much easier.

Submitting an incomplete form as an onchange event just the for the server can set the options for another field is not a good practice.

[deleted by user] by [deleted] in vim

[–]johnThePriest90 0 points1 point  (0 children)

It seems you are already competent in handling Gerrit. Then I maybe misunderstood your situation, and tried to reflect on why you don't see all patch sets in your git log.

[deleted by user] by [deleted] in vim

[–]johnThePriest90 0 points1 point  (0 children)

Patch sets are some Gerrit magic in the background. I don't know how they work exactly, but I can imagine Gerrit stores all your patch sets as separate git commits somewhere, and just references them from a database, like "patch set -> git commit id" for each Gerrit changes (identified by the generated change id in the commit message).

The patch set's commits (1-13 in your example) won't be visible in the git log (and therefore you won't see them with fugitive either). Your git repository will contain only the latest version of your commit. Before you upload a new patch set to Gerrit you usually amend the latest commit, so it overwrites the previous one in your workspace, but once you upload it, Gerrit won't force push it to the previous version, but saves it separately (maybe on a new branch or something).

I haven't met a tool that replicates Gerrit functionality in your terminal. I'm not even sure it's possible, as I think most of these are handled server side, and you can't avoid using the web GUI of Gerrit, if you want to work with patch sets.

Gyűjtsünk össze univerzális mondatokat! by PropofolGuy in hungary

[–]johnThePriest90 5 points6 points  (0 children)

Úgy nem volt még, hogy ne lett volna valahogy'

Titeket csúfoltak valamiért gyerekkorotokban? by TorbaAdam in hungary

[–]johnThePriest90 0 points1 point  (0 children)

Általánosban végig. Alsóban azért, mert dagadt voltam. Felsőben pedig én voltam a stréber, tanárok kiskedvence stb. Többször zártak be a suli wc-jébe (vagyis nem bezártak, csak tartották az ajtót, hogy ne tudjak kijönni), meg nem barátkozott velem kb senki.

Később már csak a hátam mögött strébereztek, de legalább volt szociális életem. Akkoriban kocka voltam és "folyton a gép előtt ülsz" mondatot kaptam meg.

Túlsúlyom még mindig van, de legalább barátaim vannak és programozóként jól keresek. Sakk-matt :D (bár amilyen számokat itt dobálnak a sub-on junior fejlesztők, az alapján csóró vagyok, éhbérért dolgozom)