• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "programming". Back to normal view
    1. 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
    2. 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?
      
      2 votes
    3. 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?
      
      4 votes
    4. 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?
      
      2 votes
    5. 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?
      
      16 votes
    6. 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?
      
      4 votes
    7. Are there any good programming podcasts to listen these days?

      When I visit Youtube, their algorithms somehow always manage to come up with the most provocative and mind aggravating political videos and force me to watch them! I go there to do something else...

      When I visit Youtube, their algorithms somehow always manage to come up with the most provocative and mind aggravating political videos and force me to watch them! I go there to do something else and then it takes an entirely different direction.

      I've decided to switch to listening to podcasts for a change, do you know any good one, especially in the areas of Web Development, Engineering Stories, Desktop Development, Windows/Linux, etc.?

      34 votes
    8. How do Reddit, Lemmy, Tildes, etc. process, store, and serve ranked threads/links?

      I'm familiar with how the ranking algorithms work on a high level. What I'm curious about is to how those algorithms are actually applied. How do these platforms actually apply the ranking...

      I'm familiar with how the ranking algorithms work on a high level. What I'm curious about is to how those algorithms are actually applied.

      How do these platforms actually apply the ranking algorithms so that the user sees the threads appropriately ordered? My knowledge is limited to PHP and MySQL, so I'm looking at it through the lense of those systems. I've thought of a few possible ways, but all of them seem pretty resource intensive.

      1. Maintain a table of threads with all relevant information required to calculate ranking, as well as ranking itself. A server side script executing on a routine basis every X minutes (cron job?) updates the rankings on all the threads, so they can be easily ordered. However, people most likely don't care about threads >Y days old, so those can be excluded or automatically deranked somehow.

      2. Maintain a table of threads with all relevant information required to calculate ranking. When a user visits, the last X threads (again, users probably don't care about really old stuff) are pulled out of the database and ran through a ranking and sorting algorithm, reordered and displayed to the user. This seems the most resource intensive?

      I am by no means a professional developer, but I've been dabbling recently and the concept of how these large quantities of data are ranked both perplexes and interests me.

      15 votes
    9. 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
    10. What is the most advanced or creative program you can create using the LOX programming language?

      Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com. My challenge to you is: given the constraints of the Lox language, what are some creative or advanced...

      Lox is a toy programming language that is designed in Java and C at craftinginterpreters.com.

      My challenge to you is: given the constraints of the Lox language, what are some creative or advanced programs you can create?

      This page provides a rundown of the design of Lox.

      To kick it off, here's a simple function that estimates the value of pi:

      fun estimatePi(rounds) {
      	var pi = 0;
      	var alt = 1;
      	for (var i = 0; i < rounds; i = i + 1) {
      		pi = pi + alt * 4/(2 * i + 1);
      		alt = -alt;
      	}
      	return pi;
      }
      
      print "The value of pi is:";
      print getPi(100000);
      
      3 votes
    11. Looking for resources about AI development

      Hello, I'm looking for resources on how to develop AI, aimed at people who already have experience with programming. They don't have to be free, I would just like to aggregate different type of...

      Hello,
      I'm looking for resources on how to develop AI, aimed at people who already have experience with programming.

      They don't have to be free, I would just like to aggregate different type of resources to pick from.

      Thanks!

      14 votes
    12. COM+ alternatives in 2023?

      We are small company and have utilized COM+ on the server for the last 20 years. Strictly Windows and all LAN based communication. We are rewriting in c#. What are some alternatives that I can...

      We are small company and have utilized COM+ on the server for the last 20 years. Strictly Windows and all LAN based communication. We are rewriting in c#. What are some alternatives that I can look in to that may be better in terms of speed or management for COM+?

      7 votes
    13. 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?
      
      11 votes
    14. Anyone know of research using GPTs for non-language tasks

      I've been a computer scientist in the field of AI for almost 15 years. Much of my time has been devoted to classical AI; things like planning, reasoning, clustering, induction, logic, etc. This...

      I've been a computer scientist in the field of AI for almost 15 years. Much of my time has been devoted to classical AI; things like planning, reasoning, clustering, induction, logic, etc. This has included (but had rarely been my focus) machine learning tasks (lots of Case-Based Reasoning). For whatever reason though, the deep learning trend never really interested me until recently. It really just felt like they were claiming huge AI advancements when all they really found was an impressive way to store learned data (I know this is an understatement).

      Over time my opinion on that has changed slightly, and I have been blown away with the boom that is happening with transformers (GPTs specifically) and large language models. Open source projects are creating models comparable to OpenAIs behemoths with far less training and parameters which is making me take another look into GPTs.

      What I find surprising though is that they seem to have only experimented with language. As far as I understand the inputs/outputs, the language is tokenized into bytes before prediction anyway. Why does it seem like (or rather the community act like) the technology can only be used for LLMs?

      For example, what about a planning domain? You can specify actions in a domain in such a manner that tokenization would be trivial, and have far fewer tokens then raw text. Similarly you could generate a near infinite amount of training data if you wanted via other planning algorithms or simulations. Is there some obvious flaw I'm not seeing? Other examples might include behavior and/or state prediction.

      I'm not saying that out of the box a standard GPT architecture is a guaranteed success for plan learning/planning... But it seems like it should be viable and no one is trying?

      9 votes
    15. Newbie here looking for advice on how to get into Programming/CS by building a project

      Been lurking for a week on tildes now and I am really glad this place exists. The crow here is exactly what I have been missing on Reddit for a while now. Having said that, the whole Reddit...

      Been lurking for a week on tildes now and I am really glad this place exists. The crow here is exactly what I have been missing on Reddit for a while now.

      Having said that, the whole Reddit situation has some-what motivated me to get the balls rolling on an idea that I have had for a while and I am looking for advice on the same.

      I have often heard this phrase "Learn programming by building" but whenever I dive in to the resources, I fall flat due to the information overload and the general abstractness that the field has (I appreciate abstractness but here it demotivates me) and I have never found a proper resource that I could follow to actually build something instead of just blindly following tutorials and playing with them.

      So, my question is how do I translate "learn by building a project" into a practical framework.

      I know of 100 days of swift and I really like that approach however I don't think I want to start with swift or build an iOS app right now.

      24 votes
    16. 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
    17. When consuming an API with state rate limits, how should one handle not exceeding them?

      My typical approach is one that I believe is pretty common: Reading the response header for current count and waiting if the limit is reached. However, I am currently working with a couple of APIs...

      My typical approach is one that I believe is pretty common: Reading the response header for current count and waiting if the limit is reached.

      However, I am currently working with a couple of APIs which don't implement that and are currently set up with rate limits on an honesty system.

      Is it a case of throwing sleep statements into you code, or using some kind of "bucket" and "lock" system?

      I'd be interested to see any simple implementation people have used (the simpler the better).

      9 votes
    18. Need help solutioning Microsoft APIM

      We have a backend that kind of does REST APIs but cannot handle simple Bearer tokens for authorization and cannot produce the full set of HTTP error codes (the platform just doesn't allow, for...

      We have a backend that kind of does REST APIs but cannot handle simple Bearer tokens for authorization and cannot produce the full set of HTTP error codes (the platform just doesn't allow, for example HTTP 501 to be returned programmatically). There is no Swagger for the API.

      The thought was to use Microsoft API Management Services as a proxy of sorts. It would handle the Bearer token upfront, and then just proxy / wildcard the requests/responses to the backend. The hard part is that it needs to parse the return response, and if there is something like "{ errorCode: 501 }" property in the JSON, it needs to return HTTP 501 instead of the regular payload.

      Does anyone have any experience in setting this up? It seems like the basic policy processing won't cut it, and so function apps and logic apps seem to be the ticket. We want to keep this facade layer as thin as possible. Microsoft APIM is the only platform we're allowed to consider at this time.

      4 votes