• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics in ~comp with the tag "programming". Back to normal view / Search all groups
    1. Is there a programming language that brings you joy?

      Just for a moment, forget all of the technical pros and cons, the static typing, just-in-time compilation, operator overloading, object orientation to the max... Is there a programming language...

      Just for a moment, forget all of the technical pros and cons, the static typing, just-in-time compilation, operator overloading, object orientation to the max...

      Is there a programming language that you've just found to be... fun?

      Is there one that you'd pick above all else for personal or company projects, if you had your druthers, because you would simply be so excited to use it?

      And then, is there something missing in that "fun" language that's preventing it from actually becoming a reality (i.e. small community, lack of libraries, maintenance ended in the 80s, etc.)?

      50 votes
    2. What was your first programming language, what languages do you know now, and what tips do you have for those trying to learn any of those?

      What was your first programming language, what other languages (if any) do you know now, and what tips do you have for those trying to learn any of those? Whether those tips are for beginners or...

      What was your first programming language, what other languages (if any) do you know now, and what tips do you have for those trying to learn any of those? Whether those tips are for beginners or even advanced, to do with APIs, or if you've got a good library to share.

      53 votes
    3. Programming Challenge: creative FizzBuzz

      Pretty standard: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which...

      Pretty standard:

      Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

      The twist: come up with the most creative or unusual way to solve this in your language of choice.

      39 votes
    4. What programming language do you think deserves more credit?

      My pick is Perl5. Even though a lot people (mostly those who’ve never touched Perl) say it’s a “write only” language, I think it does a lot right. It’s easy to prototype with, and it gives you a...

      My pick is Perl5. Even though a lot people (mostly those who’ve never touched Perl) say it’s a “write only” language, I think it does a lot right. It’s easy to prototype with, and it gives you a lot of freedom in how you want to solve a problem; which I think is one of the most important features of a programming language.

      I’d like to know what your picks are!

      33 votes
    5. Programming Challenge: Anagram checking.

      It's been over a week since the last programming challenge and the previous one was a bit more difficult, so let's do something easier and more accessible to newer programmers in particular. Write...

      It's been over a week since the last programming challenge and the previous one was a bit more difficult, so let's do something easier and more accessible to newer programmers in particular. Write a function that takes two strings as input and returns true if they're anagrams of each other, or false if they're not.

      Extra credit tasks:

      • Don't consider the strings anagrams if they're the same barring punctuation.
      • Write an efficient implementation (in terms of time and/or space complexity).
      • Minimize your use of built-in functions and methods to bare essentials.
      • Write the worst--but still working--implementation that you can conceive of.
      24 votes
    6. Programming Mini-Challenge: TicTacToeBot

      I've seen the programming challenges on ~comp as well as quite a few users who are interested in getting started with programming. I thought it would be interesting to post some 'mini-challenges'...

      I've seen the programming challenges on ~comp as well as quite a few users who are interested in getting started with programming. I thought it would be interesting to post some 'mini-challenges' that all could have a go at. I'm certain that many of you might find these pretty straight forward, but I still think there's merit in sharing different approaches to simple problems, including weird-and-wonderful ones.

      This is my first post and I'm a maths-guy who dabbles in programming, so I'm not promising anything mind-blowing. If these gain any sort of traction I'll post some more.

      Starting of with...


      TicTacToeBot


      Info

      You will be writing code for a programme that will check to see if a player has won a game of tic-tac-toe.


      Input

      The input will be 9 characters that denote the situation of each square on the grid.

      • 'X' represents the X-player has moved on that square.
      • 'O' represents the O-player has moved on that square.
      • '#' represents that this square is empty.

      Example:

      |O| |X|
      |X|X|O|    The input for this grid will be O#XXXOO##
      |O| | |
      

      Output

      The expected output is the character representing the winning player, or "#" if the game is not won.

      (e.g. The expected output for the example above is '#' since no player has won)


      29 votes
    7. "Java is fast but in practice, PHP sites run faster as PHP coders take more straightforward approach to design and don't get lost trying to implement exotic design patterns and endless abstractions"

      Granted that it's highly subjective and opinionated, but what this author James Anderson states in this StackOverflow post very much resembles the voices of many like myself who are trying to...

      Granted that it's highly subjective and opinionated, but what this author James Anderson states in this StackOverflow post very much resembles the voices of many like myself who are trying to switch from interpreted/dynamic languages to static and compiled ones like Java/C#. How do Java programmers tackle or respond to this stance?

      35 votes
    8. I want to learn programming. What language should i pick to write cli apps for linux?

      I'm interested in C or Go, but i'm open to ideas. I have plenty of sh scripts i created to integrate my tools and system, so i have some experience and i don't want a scripting language like...

      I'm interested in C or Go, but i'm open to ideas.

      I have plenty of sh scripts i created to integrate my tools and system, so i have some experience and i don't want a scripting language like python.

      My first plan is to learn the basics of the language and rewrite some of those scripts.

      I think my first pick will be a script that uses ffmpeg to convert my flac files to mp3 or opus. I use sndconv -opus/-mp3 and it checks if there are flac files in the folder (i only have full albums), converts and puts in a folder named "$artist - $album".

      My long term goal is to make a cli/tui music player like cmus.

      UPDATE: i'm having plenty of success with Go right now. I just wrote a basic version of my music conversion script. It's just converting a music i pass as argument to mp3, but i'll keep working on it and adding functionality just to dip my toes in Go. It seems like a good language and i'm having fun!

      Thanks for all the answers!

      18 votes
    9. As someone with ADHD, I hate the "RTFM" motto

      I'm a student of software engineering. I'm not a programmer yet, but I use software that is common among this crowd, like i3wm, Neovim and Emacs. I know how to find and read documentation. I've...

      I'm a student of software engineering. I'm not a programmer yet, but I use software that is common among this crowd, like i3wm, Neovim and Emacs. I know how to find and read documentation. I've read the obnoxious How To Ask Questions the Smart Way. Every time I encounter an issue, I do my diligence. I go through the manuals, I google, I read the docs. My main editor, Emacs, has an extensive manual, with plenty of accurate details. I get that's a huge program (more like a platform, really), but let's just say that a black-and-white 650 pages PDF is not the most ADHD friendly thing in the world.

      I'm aware that I chose a career that requires plenty of reading, but I happen to like it a lot and it seems like I have some aptitude for it. I had similar issues in my previous activities anyway. But it's discouraging trying to understand programming and complex software, only to be repelled by people who think everyone has their ability for concentration. Sometimes I completely lose track of time. I can sit on my computer and hyperfocus for up to 48 hours with 20 Chrome tabs open non-stop and Netflix on the background. I may seem productive, but I'm not reading anything. Maybe I read one paragraph or two, and 30 seconds later I can't remember what I was doing. But I still have tasks to accomplish, and sometimes I need help to find useful information on a 700 pages manual.

      Luckily I have a great support and determination and have accomplished a lot, but my peers have no idea what I went through to get to where I am. What I don't have in natural born skills I compensate with a lot of raw effort. Everyone has their difficulties and I'm not seeking compassion, but I'd like to suggest people think twice before dismissing as "lazy" someone you know nothing about. That person might have a mental disorder, a reading disorder or even an intellectual disability. Do you wanna be the guy who told a dyslexic to just read the fucking manual?

      EDIT: of course I get that time and energy are limited commodities... my point is: don't be an asshole about it. Do what you can and you wanna do, but there's no need to use hostile buzzwords when you communicate with less knowledgeable people. You're not even forced to answer... I much prefer not getting an answer than getting a hostile one.

      26 votes
    10. What trick/pattern/concept/whatever did you adopt that has improved your code quality?

      One big thing that has made maintenance of my older code easier has been considering the concept of cyclomatic complexity. In particular, limiting conditional checks to exceptional cases as much...

      One big thing that has made maintenance of my older code easier has been considering the concept of cyclomatic complexity. In particular, limiting conditional checks to exceptional cases as much as is reasonable has made it easier to focus on the "happy" path of code execution and easily track down the errors, and the limited nesting depth has made things easier to read as well. Overall, my code remains relatively flat and I'm not branching through layers of logic trying to track down a simple bug.

      What are some simple things you do to keep your code from being a massive headache long-term?

      26 votes
    11. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      12 votes
    12. Programming Challenge: Dice Roller

      Its been a while since we did one of these, which is a shame. Create a program that takes is an input of the type: "d6 + 3" or "2d20 - 5", and return a valid roll. The result should display both...

      Its been a while since we did one of these, which is a shame.

      Create a program that takes is an input of the type: "d6 + 3" or "2d20 - 5", and return a valid roll.
      The result should display both the actual rolls as well as the final result. The program should accept any valid roll of the type 'xdx'
      Bonuses:

      • Multiplication "d6 * 3"
      • Division "d12 / 6"
      • Polish notation "4d6 * (5d4 - 3)"

      As a side note, it would be really cool if weekly programming challenges became a thing

      33 votes
    13. Programming Challenge: Make a game in 1 hour!

      Background There's been some talk on ~ before, and it seems like there are quite a few people who are either interested in, learning, or working in game development, so I thought this could be a...

      Background

      There's been some talk on ~ before, and it seems like there are quite a few people who are either interested in, learning, or working in game development, so I thought this could be a fun programming challenge.

      This one is fairly open-ended: make a game in 1 hour. Any game, any engine, don't worry about art or sound or anything.

      Doing is the best way to learn. Most people's first project is something overly ambitious, and when they find that it's more difficult than they thought, they can get discouraged, or even give up entirely. This is why the 1 hour limit is important: it forces you to finish something, even if it's small. When you're done, you can come out of it saying you made a game, and you learned from it.

      Chances are the game might not be fun, look bad, be buggy, etc. But don't worry about that, everyone's game will have problems, and if you do create something really fun or innovative, congratulations, you have a prototype that you can expand on later!

      "Rules"

      Like I said before, these "rules" are pretty simple: make a game in (approximately) 1 hour. You can use any tools you want. If you use external assets (art, sound), it's probably best you use something you have the rights to (see resources). If you're completely new to game development/programming, your goal could even be to finish a tutorial.

      If you're the kind of person who tends to get carried away with these things, you might want to post a comment saying you're starting, then another one once you've finished your game.

      Please share your finished game, I'm sure everyone would love to try them! If your game is web-based, it can be hosted for free on Github Pages or Itch.io. If downloadable, it can be hosted for free on Google Drive, Mega, Dropbox, Itch.io, etc.

      Resources

      Engines

      If you're a beginner, a good engine to start with is LÖVE. It's very simple, and uses Lua, which is very easy to learn.

      If you're familiar with another language, you could use a library to make it in that language. Some examples:

      C++: SFML, SDL, Allegro

      Javascript: kontra, Phaser, pixi.js

      Python: pygame

      Rust: Piston, ggez, Amethyst

      If you want something more complex, consider Godot, Unity, or Unreal.

      You can also try something visual like Construct, Clickteam Fusion, or GDevelop

      Art

      For such a short time constraint, I'd suggest you use your own "programmer art": just use some basic shapes. Your primary focus should be gameplay.

      If you think you have time to find something, try looking on OpenGameArt.

      Sound

      You can make simple sound effects very quickly with sfxr (or in this case, a web port of sfxr called jsfxr).

      27 votes
    14. Learning to Program

      Hi folks, I figured this would be a good place to ask a rather simple question. Where do I start to learn to code? I'm in high school, so I have (some) time to dedicate to it, and it seems there...

      Hi folks,

      I figured this would be a good place to ask a rather simple question.

      Where do I start to learn to code?

      I'm in high school, so I have (some) time to dedicate to it, and it seems there are a plethora of websites/resources out there, so I ask: what do you recommend, and why has it worked for you? I have no prior experience. I believe that this would really help out in the long run, as I will graduate high school with an Associate's Degree in Business. Thank you!

      EDIT: Thank you for all your responses! I'll start with Python and move on from there. You guys have been a great help, and I'll vote you up or reply.

      26 votes
    15. Fun programming challenge: figure out which sets of passports grant visa-free access to the whole world

      Hey there, I wanted to know which sets of passports grant together visa-free access to every country in the world, but I could not easily find that info online. So I figured that I could try to...

      Hey there,

      I wanted to know which sets of passports grant together visa-free access to every country in the world, but I could not easily find that info online. So I figured that I could try to write a small program to determine these sets of passports myself, and then it occurred to me that it would probably be a fun programming challenge to organize, so here we go.


      Here's the challenge.

      1. Scrape the data you need for instance from The Henley Passport Index.
      2. Design a clever algorithm to efficiently find out which are the smallest sets of passports that will grant you visa-free access to every country in the world.
      3. Optional. Allow the user to specify which passports they already hold and find out which sets of passports would complement their passports well.
      4. Optional. Rank the sets of passports by how easy it is to acquire citizenship in those countries.

      The choice of the programming language is yours, bonus points if you write it in assembly 😂

      Feel free to collaborate and share your solutions (the algorithms and the actual results) in the comments, and feel free to share your own twists to the challenge that could make it even more fun & interesting.

      The person with the most clever, efficient and elegant algorithm wins!

      Happy coding folks!

      32 votes
    16. Why do so many developers provide only 64-bit or x64 builds of their software these days?

      Doesn't it make sense to only provide 32-bit versions to cover maximum user base? Considering that 64-bit operating systems do support 32-bit apps whereas the inverse isn't true. If you release...

      Doesn't it make sense to only provide 32-bit versions to cover maximum user base? Considering that 64-bit operating systems do support 32-bit apps whereas the inverse isn't true.

      If you release for x32, you'd have covered the maximum users whereas if you release for x64, you'd have covered only that block. At least open source developers who intend for maximum coverage or user-base for their apps should support at least 32-bit (if not both).

      Below is a great answer post in this regard, credits Ken Gregg on Quora:

      Yes, there are a lot of 32-bit programs still being developed/sold/distributed. No, not every program is 64-bit.

      64-bit operating systems on 64-bit hardware can run 32-bit applications. And there are lots of computers still running 32-bit operating systems (and will for quite some time). So, an application developer can release one 32-bit product and cover the 32-bit and 64-bit customers. Releasing and maintaining two products, one 32-bit and one 64-bit, incurs some costs. And providing only a 64-bit version leaves all the 32-bit customers in the dust. It is logical and cost-effective to supply only a 32-bit version to cover both groups, as long as the application doesn’t require 64-bit features.

      Of course, the embedded systems arena still has tons of new development of 32-bit, 16-bit, and even 8-bit software/firmware. The choice of an embedded microcontroller is based on cost, availability, and features required, so software developed in this realm runs the gamut of bitness.

      21 votes
    17. Resources for learning to code

      Tildes is pretty technically minded place, so I figured this would be a good place to get some advice. Programming is something I've taken a class or two on (though it's been long enough that I'd...

      Tildes is pretty technically minded place, so I figured this would be a good place to get some advice. Programming is something I've taken a class or two on (though it's been long enough that I'd like to start from scratch) and I think I have some aptitude for it. The possibility of working from home is also very appealing. However, there are a ton of resources out there, and "learn to code" has been a thing for a while now. Is self-teaching or one of those coding boot camps a viable way to get started in the field? And if so, what are some good resources and practices for getting there? I have some money available, but a degree would be expensive both time and cost wise.

      10 votes
    18. Programming Q&A Thread

      An experiment I've been thinking about lately: a (recurring?) Q&A thread! Ask any questions about programming, answer other users' questions, or post suggestions for future threads. Don't forget...

      An experiment I've been thinking about lately: a (recurring?) Q&A thread! Ask any questions about programming, answer other users' questions, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      

      Meta questions:

      • Should I turn this into a recurring thread?
      • If yes, should it be a weekly or a monthly thing?
      • Should DBA and SysAdmin questions be allowed or should someone else make a separate recurring thread for these?
      22 votes
    19. Inexperienced Programming Question

      TLDR: What programming language would be useful for taking info in an excel file and producing a text file (that is organized and arranged in a particular way) containing that info? Which would be...

      TLDR: What programming language would be useful for taking info in an excel file and producing a text file (that is organized and arranged in a particular way) containing that info? Which would be useful for this problem but also helpful in general? And also, are there any recommended online courses where I could learn it?


      I have no real experience coding or anything but have always wanted to learn. Recently at work we've encountered a problem. My boss had created a matlab program in order to take text/numbers from an excel document and transfer them to a text file, but in an organized way.

      Say you have something you call "Pancakes" and the cell next to it has the number "3", as in there are three pancakes. I want to be able to create a text file that would read something like this:

      NUMBER OF PANCAKES

      • Pancakes: 3

      We recently have changed around the format of the excel document for a different item, for example "French Toast". I've tried to mess with matlab briefly but was unable to change the program to compensate, and I no longer easily have access to matlab.

      I'm seeing this as an opportunity to learn some programming and also fix some stuff at work. So what programming language would be useful for fixing this problem? Which would be useful for this problem, but also helpful in general? And also, are there any recommended online courses where I could learn it?

      Thanks for any help, I appreciate it.

      16 votes
    20. Programming Challenge: Freestyle textual analysis.

      I just realized that I completely glossed over this week's programming challenge. For this week, let's do something more flexible: write a program that accepts a file as input--either through a...

      I just realized that I completely glossed over this week's programming challenge. For this week, let's do something more flexible: write a program that accepts a file as input--either through a file name/path or through standard input--and perform any form of analysis you want on its contents. That's it!

      For instance, you could count the occurrences of each word and find the most common ones, or you could determine the average sentence length, or the average unique words per sentence. You could even perform an analysis on changes in words and sentence structure over time (could be useful for e.g. poetry where metre may play an important role). You can stick with simple numbers or dive right into the grittiest forms of textual analysis currently available. You could output raw text or even a graphical representation. You could even do a bit of everything!

      How simple or complex your solution ends up being is completely up to you, but I encourage you to challenge yourself by e.g. learning a new language or about different textual analysis techniques, or by focusing on code quality rather than complexity, or even by taking a completely different approach to the problem than you ordinarily would. There are a lot of learning opportunities available here.

      11 votes
    21. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      15 votes
    22. Web developers - What is your stack?

      As someone who is not mainly a web developer, I can barely grasp the immensity of options when it comes to writing a web application. So far everything I've written has been using PHP and the Slim...

      As someone who is not mainly a web developer, I can barely grasp the immensity of options when it comes to writing a web application.

      So far everything I've written has been using PHP and the Slim microframework. PHP because I don't use languages like Python/Ruby/JS that much so I didn't have any prior knowledge of those, and I've found myself to be fairly productive with it. Slim because I didn't want a full-blown framework with 200 files to configure.

      I've tried Go because I've used it in the past but I don't see it to be very fit when it comes to websites, I think it's fine for small microservices but doing MVC was a chore, maybe there's a framework out there that solves this.

      As for the frontend I've been trying to use as little JavaScript as possible, always vanilla. As of HTML and CSS I'm no designer so I kind of get by copying code and tweaking things here and there.

      However I've started a slightly bigger project and I don't fancy myself writing everything from scratch (specially security) besides, ORMs can be useful. Symfony4 is what I've been using for a couple of days, but I've had trouble setting up debugging, and the community/docs don't seem that great since this version is fairly new; so I'm considering trying out something more popular like Django.

      So this is why I created the post, I know this will differ greatly depending on the use-case. But I would like to do a quick survey and hear some of your recommendations, both on the backend and frontend. Besides I think it's a good topic for discussion.

      Cheers!

      20 votes
    23. Programming Challenge: Merge an arbitrary number of arrays in sorted order.

      It looks like it's been over a week and a half since our last coding challenge, so let's get one going. This challenge is a relatively simple one, but it's complex enough that you can take a...

      It looks like it's been over a week and a half since our last coding challenge, so let's get one going. This challenge is a relatively simple one, but it's complex enough that you can take a variety of different approaches to it.

      As the title suggests, write a program that accepts an arbitrary number of arrays, in whatever form or manner you see fit (if you want to e.g. parse a potentially massive CSV file, then go nuts!), and returns a single array containing all of the elements of the other arrays in sorted order. That's it!

      Bonus points for creative, efficient, or generalized solutions!

      24 votes
    24. What is the most difficult or complex thing you have programmed, created, or otherwise made?

      I'm mostly just curious what types of in-depth projects you all get up to. The weekly "what are you working on threads" are always full of cool things, so I am curious what people's self-rated...

      I'm mostly just curious what types of in-depth projects you all get up to. The weekly "what are you working on threads" are always full of cool things, so I am curious what people's self-rated most difficult or complex projects have been.

      26 votes
    25. What are the minimal features every good blog should have?

      I've been learning Laravel, and familiarizing myself with the framework by coding up a blogging website. Right now, it's minimally functional, and I'd like to add some more features to it. Since...

      I've been learning Laravel, and familiarizing myself with the framework by coding up a blogging website. Right now, it's minimally functional, and I'd like to add some more features to it. Since this is my first project with Laravel the code is a mess, and it's just about time for me to rewrite the whole thing. Before starting that, I'd like to have a better idea of what my final product should be. I don't want to recreate WordPress in Laravel, but I do want to have something I wouldn't spit at. Basically a project that would be good as a resume builder if I ever needed one.

      So far, my website allows users to...

      • register for an account, log in/out, update their email address and display name
      • create posts with a WISIWYG editor
      • upload files
      • create profiles
      • and manipulate everything through CRUD.

      What do you think the minimal features a blogging platform needs to have to be "complete" and usable as a stand-alone system?

      13 votes
    26. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      9 votes
    27. Programming Challenge: Two Wizards algorithm challenge

      I'm running out of ideas, if you have any, please make your own programming challenge. This challenge is about designing algorithm to solve this problem. Let's have game field of size x, y (like...

      I'm running out of ideas, if you have any, please make your own programming challenge.


      This challenge is about designing algorithm to solve this problem.

      Let's have game field of size x, y (like in chess). There are two wizards, that are standing at [ 0, 0 ] and are teleporting themselves using spells. The goal is to not be the one who teleports them outside of the map. Each spell teleports wizard by at least +1 tile. Given map size and collection of spells, who wins (they do not make any mistakes)?

      Here are few examples:


      Example 1

      x:4,y:5

      Spells: { 0, 2 }

      Output: false

      Description: Wizard A starts, teleporting both of them to 0, 2. Wizard B teleports them to 0, 4. Wizard A has to teleport them to 0,6, which overflows from the map, so he loses the game. Because starting wizard (wizard A) loses, output is false.

      Example 2

      x:4,y:4

      Spells: { 1,1 }

      Output: true

      Example 3

      x:4,y:5

      Spells: { 1,1 },{ 3,2 },{ 1,4 },{ 0,2 },{ 6,5 },{ 3,1 }

      Output: true

      Example 4

      x:400,y:400

      Spells: {9,2},{15,1},{1,4},{7,20},{3,100},{6,4},{9,0},{7,0},{8,3},{8,44}

      Ouput: true


      Good luck! I'll comment here my solution in about a day.

      Note: This challenge comes from fiks, programming competition by Czech college ČVUT (CTU).

      15 votes
    28. Programming Challenge: Translate 24-hour time into words

      This is an adapted version of Talking Clock from /r/DailyProgrammer. The point of this thread is to post your code for solving the task. Other will comment with feedback and new ideas. Post what...

      This is an adapted version of Talking Clock from /r/DailyProgrammer.

      The point of this thread is to post your code for solving the task. Other will comment with feedback and new ideas. Post what language (and version, if relevant) your code is written in.

      Task description

      Your task is to translate a 24-hour formatted time to words.

      Input description

      An hour between 00 and 23 followed by a colon followed by a minute between 0 and 59.

      Output description

      The time expressed in words, in 12-hour format followed by "am" or "pm".

      Sample input

      00:00
      01:30
      12:05
      14:01
      

      Sample output

      It's twelve am
      It's one thirty am
      It's twelve oh five pm
      It's two oh one pm
      
      27 votes
    29. Is it normal to stress about your codebase becoming bad?

      Lately, I've been working on a game in Godot. I've having a lot of fun, but I keep stressing out about my codebase becoming bad. I'm worrying about amassing technical debt, and having to rewrite...

      Lately, I've been working on a game in Godot. I've having a lot of fun, but I keep stressing out about my codebase becoming bad. I'm worrying about amassing technical debt, and having to rewrite huge amounts of code because of bad practices.

      I've been reading best practices documentation for Godot, and learning about game programming patterns, but it's still a worry for me.

      I'm wondering if this is a normal feeling, and how more experienced developers manage it.

      24 votes
    30. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      3 votes
    31. Programming Challenge: Implementing bitwise operators.

      Background: Bitwise operators are operators that perform conditional operations at the binary level. These operators are bitwise AND &, bitwise OR |, bitwise XOR ^, and bitwise NOT ~, not to be...

      Background: Bitwise operators are operators that perform conditional operations at the binary level. These operators are bitwise AND &, bitwise OR |, bitwise XOR ^, and bitwise NOT ~, not to be confused with their logical operator counterparts, i.e. &&, ||, !=, and ! respectively.

      Specifically, these operations take the binary values of the left- and right-hand terms and perform the conditional operation on each matching bit position between both values.

      For instance, 3 | 4 takes the binary value 010 from 2 and 100 from 4. From left to right, we compare 0 || 1, 1 || 0, and 0 || 0 to get 110 as the resulting binary. This produces the integer value 6.

      Goal: Your challenge is to implement one or more of these bitwise operators without using the native operators provided to you by your language of choice. Logical operators are allowed, however. These operators should work on integer values. These operators will likely take on the form of a function or method that accepts two arguments.

      Bonus challenges:

      • Implement all of the operators.
      • Don't use any native binary conversion utilities.
      • Whether or not you implement all operators, write your code in such a way that allows for good code reusability.
      • For statically typed languages, handle integers of different types (e.g. int vs. uint).

      Edit: Minor correction for the sake of accuracy, courtesy of @teaearlgraycold.

      12 votes
    32. I want to learn programming

      I currently don't know anything about programming so am considering picking this up on the side in case I loose my current job and need a backup plan. Anyone knows any good books or online courses...

      I currently don't know anything about programming so am considering picking this up on the side in case I loose my current job and need a backup plan. Anyone knows any good books or online courses or anything else for self-learning?

      My friends said programming is too broad a subject and what you need to learn depends heavily on what fields you want to go in, which I'm ashamed to admit also know nothing about. So I guess I need some career advice too if possible.

      22 votes
    33. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      7 votes
    34. Fortnightly Programming Q&A Thread

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads. Don't forget to format your code using the triple...

      General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

      Don't forget to format your code using the triple backticks or tildes:

      Here is my schema:
      
      ```sql
      CREATE TABLE article_to_warehouse (
        article_id   INTEGER
      , warehouse_id INTEGER
      )
      ;
      ```
      
      How do I add a `UNIQUE` constraint?
      
      9 votes
    35. What are your unsolved programming problems?

      I thought it could be fun to discuss problems that we've encountered in our programming or programming-related work and have never found a solution for. I figure that at worst we can have a lot of...

      I thought it could be fun to discuss problems that we've encountered in our programming or programming-related work and have never found a solution for. I figure that at worst we can have a lot of fun venting about and scratching our heads at things that just don't make any sense to anyone, and at best we might be able to help each other find answers and, more importantly, some closure.

      16 votes