• 1 Post
  • 10 Comments
Joined 1 year ago
cake
Cake day: June 23rd, 2023

help-circle


  • Yea, I wasn’t saying it’s always bad in every scenario - but we used to have this kinda deployment in a professional company. It’s pretty bad if this is still how you’re doing it like this in an enterprise scenarios.

    But for a personal project, it’s alrightish. But yea, there are easier setups. For example configuring an automated deployed from Github/Gitlab. You can check out other peoples’ deployment config, since all that stuff is part of the repos, in the .github folder. So probably all you have to do is find a project that’s similar to yours, like “static file upload for an sftp” - and copypaste the script to your own repo.

    (for example: a script that publishes a website to github pages)


  • I suppose in the days of ‘Cloud Hosting’ a lot of people (hopefully) don’t just randomly upload new files (manually) on a server anymore.

    Even if you still just use normal servers that behave like this, a better practice would be to have a build server that creates builds, like whenever you check code into the Main branch, it’ll create a deploy for the server, and you deploy it from there - instead of compiling locally, opening filezilla and doing an upload.

    If you’re using ‘Cloud Hosting’ - for example AWS - If you use VMs or bare metal - you’d maybe create Elastic Beanstalk images and upload a new Application or Machine Image as a new version, and deploy that in a more managed way. Or if you’re using Docker, you just upload a new Docker image into a Docker registry and deploy those.


  • Hmm, well the first round(s) are doable for beginners. If you want to get into programming, these kinda games are a good way to start, since you’re getting visual feedback of what your bot is actually doing.

    And you can participate in loads of languages, so you can pick anything that you’re somewhat familiar with.

    However, once you’re getting into higher rounds, ranks, and leagues, you’ll be playing against other peoples’ bots. So obviously if you have 0 experience it’ll be way harder to beat people with loads of experience, that understand which algorithms are suitable etc.

    But I’d say go ahead and try it out. Its free. Maybe it turns out to be too difficult, maybe you’ll manage.





  • Is it Java? It looked like Microsoft Java C# to me…

        public static void Main(string[] args)
        {
            var meme = new Meme();
            var joke = GetTheJoke(meme);
        }
        
        public static Joke GetTheJoke(Meme theMeme)
        {
            var memeType = typeof(Meme);
            var jokeField = memeType.GetField("Joke", BindingFlags.NonPublic | BindingFlags.Instance);
            return (Joke)jokeField.GetValue(theMeme);
        }
    

  • How do you “add” types together? Adding numbers makes sense, it has a real world equivalent. Two balls in a cup, add one ball and you have three balls in a cup. Add color to water and you have colored water. Simple. But types? The fuck?

    It makes sense when using some fluent patterns and things like monads. For example:

    User user = new User("Bob"); // User Class
    UserWithPassword user = new User("Bob").WithPassword("Dylan123"); // UserWithPassword Type
    

    A UserWithPassword type would then be a User object wrapper with some IWithPassword interface

    Then you could create extension methods on IWithPassword objects and decorate those objects with password behavior

    You can then have sort of polymorphic behavior by combining types together, and have different functionality available depending on which types you’ve added together