• 1 Post
  • 67 Comments
Joined 1 year ago
cake
Cake day: June 18th, 2023

help-circle
  • It has been a while since I have to deal with problem complexities in college, is there even class of problems that would require something like this, or is there a proven upper limit/can this be simplified? I don’t think I’ve ever seen O(n!^k) class of problems.

    Hmm, iirc non-deterministic turing machines should be able to solve most problems, but I’m not sure we ever talked about problems that are not NP. Are there such problems? And how is the problem class even called?

    Oh, right, you also have EXP and NEXP. But that’s the highest class on wiki, and I can’t find if it’s proven that it’s enough for all problems. Is there a FACT and NFACT class?


  • Here is a picture, that may help a little bit. The n is input size, and f(n) is how long does the algorithm runs (i.e how many instructions) it takes to calculate it for input for size n, i.e for finding smallest element in an array, n would be the number of elements in the array. g(n) is then the function you have in O, so if you have O(n^2) algorithm, the g(n) = n^2

    Basically, you are looking for how quickly it grows for extreme values of N, while also disregarding constants. The graph representation probably isn’t too useful for figuring the O value, but it can help a little bit with understanding it - you want to find a O function where from one point onward (n0), the f(n) is under the O function all the way into infinity.



  • Exactly this. I only have pretty vague experience with machine learning, since it was one of the other specializations for my Masters than the one I choose, which however means we still shared some basic courses on the topic, and I definitely share his point of view. I’ve been saying basically the same things when talking about AI, albeit not as expressively, but even with basic insight into ML, the whole craze that is happening around it is such bullshit. But, I’m by no means an expert in the field, so I may be wrong, but it’s nice to finally read an article from an “expert” in the field I can agree with. Because so far, the whole “experts talking AI” felt exactly like the COVID situation, with “doctors” talking against vaccines. Their doomsaying opinion simply contradicts even the little knowledge I have in the ML field.


  • I’d like to mention one exception, because it took me ages to properly debug.

    If your endpoint is serving mirrors for APT, don’t redirect to HTTPS.

    APT packages are signed and validated, so there is no need to use TLS. Lot of docker images (such as Kali) do not have root certificates by default, so they can’t use the TLS, because cert validation fails. You also can’t install the certificates, because they install through APT. If your local mirror redirects to https by default, it will break it for people who choose the mirror, which IIRC happens automatically based on what’s closest to you. I think this issue is still there for Czech Kali package mirror, and it took me so long to figure out (because it’s also not an issue for most of the users, since they have different mirrors), so I like mentioning this when talking http/s. It’s an edge case, but one that I find interresting - mostly because it would never occur to me that this can be an issue, when setting up a mirror.

    But that was more than a year ago, it may be better now.



  • My favourite take on DI is this set of articles from like 12 years ago, written by a guy who has written the first DI framework for Unity, on which are the currently popular ones, such as Zenject, based on.

    The first two articles are pretty basic, explaining his reasoning and why it’s such a cool concept and way forward.

    Then, there’s this update:

    Followed by more articles about why he thinks it was a mistake, and he no longer recommends or uses DI in Unity in favor of manual dependency injection. And I kind of agree - his main reasoning is that it’s really easy for unnecessary dependencies to sneak up into your code-base, since it’s really easy to just write another [Inject] without a second thought and be done with it.

    However, with manual dependency injection through constructor parameters, you will take a step back when you’re adding 11th parameter to the constructor, and will take a moment to think whether there’s really no other better way. Of course, this should not be an relevant issue with experienced programmers, but it’s not as inherently obvious you’re doing something potentially wrong, when you just add another [Inject], when compared to adding another constructor parameter.


  • We’ve had to work in Pharo for our OOP uni course, and it was one of the worse experiences I’ve had in school. Mind you, it was something like 7 years ago, so the language may very well be a lot better now, but the whole “your IDE is the code” felt cubersome, it was buggy and crashed randomly, and in general I spent more time fighting with the IDE than doing something useful.

    It was a bad time, but also a great learning experience. Being forced to work in something that IMO sucks is an useful skill, but I never want to see that language again :D


  • I’m starting to think that “good code” is simply a myth. They’ve drilled a lot of “best practices” into me during my masters, yet no matter how mich you try, you will eventually end up with something overengineered, or a new feature or a bug that’s really difficult to squeeze into whatever you’ve chosen.

    But, ok, that doesn’t proove anything, maybe I’m just a vad programmer.

    What made me sceptical however isn’t that I never managed to do it right in any of my projects, but the last two years of experience working on porting games, some of them well-known and larger games, to consoles.

    I’ve already seen several codebases, each one with different take on how to make the core game architecture, and each one inevitably had some horrible issues that turned up during bugfixing. Making changes was hard, it was either overengineersled and almost impenetrable, or we had to resort tonugly hacks since there simply wasn’t a way how to do it properly without rewriting a huge chunk.

    Right now, my whole prpgramming knowledge about game aechitecture is a list of “this desn’t work in the long run”, and if I were to start a new project, I’d be really at loss about what the fuck should i choose. It’s a hopeless battle, every aproach I’ve seen or tried still ran into problems.

    And I think this may be authors problem - ot’s really easy to see that something doesn’t work. " I’d have done it diferently" or “There has to be a better way” is something that you notice very quickly. But I’m certain that watever would he propose, it’d just lead to a different set of problems. And I suspect that’s what may ve happening with his leads not letting him stick his nose into stuff. They have probably seen that before, at it rarely helps.


  • I had the same issue with gamedev industry, but thankfully Ive very quickly realized that’s how work works, and you usually have a choice - either earn a good living being a code monkey, or find a job in a small company that has passion, but they won’t be able to afford paying you well, or do it in your free time as a hobby. Capitalism and passion doesn’t work together.

    So I went to work part-time in cybersecurity, where the money is enough to reasonably sustain me, and use the free time to work on games in my free time. Recently, Ive picked up an amazing second part time job in a small local indie studio that is exactly the kind of environment I was looking for, with passion behind their projects - but they simply can’t afford to pay a competitive wage. But I’m not there for the money, so Ibdon’t mind and am happy to help them. Since there are no investors whose pocket you fill, but the company is owned by a bunch of my friends, I have no issue with being underpaid.

    But it’s important to realize this as soon as possible, before trying to make a living with something you’re passionate about will burn you out. A job has one purpose - earn you a living. Companies will exploit every single penny they can out of you, so fuck them, don’t give them anything more than a bare minimum, and keep your energy for your own projects.

    And be carefull with trying to earn a living on your own - because whatever you do, no matter how passionate are you, if it’s your only income and your life depends on it, you will eventually have to make compromises to get by. It’s better to keep money separate from whatever you like doing, and just keep your passion pure.

    EDIT: Oh, I forgot to mention one important thing - I’m fortunate to not have children, share living costs with a partner, and live in a city with good public transport, so no need for a car, and free healthcare. I suppose that makes it a lot more easier to get by with just a part time.




  • I’d recommend going for the app dev. I always knew I will be workig in gamedev, but choose my bachelors degree in general software engineering, and only went for Masters in gamedev.

    I’ve been out of school for around 5 years now, and I’m really glad I chose SWE instead of anything more specialized - because it has given me the broadest outlook on IT as possible, from documentation best practices, through UMLs, to various obscure languages from Smalltalk through Lisp, assembly and Prolog to C, Java and C#, while also having some optional classes focused on cybersecurity or AI.

    Most of what I’ve learned, I don’t really remmeber or use daily - but, the information has somewhat stuck with me, and I can quickly recall the general concept every time I enounter a similar problem, which makes research a lot faster. If I need to write something in a language that’s not my main focus, I can be certain that no matter how unknown, I’ve already worked in something with similar concepts. And that makes it so much easier to quickly understand syntax and start writing code.

    I can’t imagine how difficult it would be for me to grasp how the hell is something like Prolog supposed to work, but having to sit through classes on it that I barely remember has left me with a vague recollection of what’s the purpose, so if I encounter anything similar, I can just pick it up almost immediately. And this goes for most of styles of languages or problems - I’ve already dealt with something similar.

    Not to mention that while UML diagrams and general documentation practices may sound pretty boring (and they are), I’ve already encountered situations where the diagram was integral to understanding what are the docs going for - and I was able to get it instead of having to figure it out by myself, because I’ve already worked with them at school.

    Also, having options is nice - After the school, I went to work in Cybersec, even though I had only like one optional class on the topic, and I can see how much it has helped me having a borad overview in comparison to colleagues who didn’t have it. I can write scripts in whatever we encounter, I have a deeper understanding of how other developers write code, what could be wrong, and have a better educated quess at how exactly does the stack we’re black-box testing works. And looking up the more specialized cybersec knowledge is way easier, than researching a stack of technologies I’ve never seen or work with in my life. And that’s where the broader degree has helped me the most with.

    Also, you can probably enroll into optional classes that are outside of your field of study, which I really recommend - I was doing that a lot during my studies, and it were the most memorable and usefull lectures I’ve had.



  • I make second factor public, effectively reverting to 1FA.

    I work as a Red Teamer, and I heavily disagree with this approach. MFA has been a bane of so many engagements. We usually end up with a lot of credentials from the target company that we can’t really use for anything (unless you already are in the network, where some of Windows services don’t require it), because each one is under MFA.

    There’s so many different ways how can you solve the problem of not loosing access to you account. Make offline back-ups of recovery keys, back up your Aegis vault to different places.

    Also, you may have a pretty good level of security awarness, highly reducing the risk of any kind of breach happening to you. But that’s something you can only affect to a degree. Supply chain attacks happen, zero days happen. An extension you are using in your browser may get compromised, and someone pushes a info-stealer instead (which has already happened, i.e with Nano Defender). MFA is what will help you in cases like these.




  • I use comment signing as some kind of a multifactor.

    I have my signing key saved on YubiKey, so it’s pretty difficult that an attacker could gain access to it.

    However, you can still commit through git web browser, and usually have a session for it open when working. If I slipped up and someone got to my PC while I have github open (or managed to steal my session cookies somehow - i.e a rubber ducky driveby), his options are:

    • Commit without signing through SSH. I have ssh key password in my password manager that auto-locks after a minute, so that shouldn’t happen, plus the commit wouldn’t be signed since I have the key with me.
    • Commit something though the browser - he can’t sign it.
    • Add SSH or a new signing key through the browser - I get immediately notified.

    So, the end result should be that thanks to the signing mechanism, I should immediately know that something is wrong. Is it neccessary? Probably not, but I still think it’s worth it, at least for me.

    Now I’m wondering whether it wouldn’t be better to have the ssh key on the Yubikey instead. Hmm. I did only discover commit signing later, and didn’t have ybikey before, so it never occured to me.