Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. EkBass

    JavaScript How to use a list?

    This should be workable, but i assume this is where you have already ended. function getRndInteger(min, max) { return Math.floor(Math.random() * (max - min + 1) ) + min; } function contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return...
  2. EkBass

    JavaScript How to use a list?

    W3Schools has some neat tutorials about this: Check out JavaScript Tutorial
  3. EkBass

    JavaScript Need help with SQL / javascript

    Hi. Let's hope i got you right here. return db.query('UPDATE article SET votes = votes + $1 WHERE article_id = $2 RETURNING *;', [inc_votes, article_id]) By this adjustment, the function incVoteById should update the votes for the article with the given article_id by the specified inc_votes...
  4. EkBass

    C# i don t understand what is wrong here

    Hi. 1. Add the code inside code tags to make it look more human-readable. 2. Explain the problem. I don't see anything food or to-eat-related code there at all.
  5. EkBass

    Fun activity Say hello... in a coding language!

    Ok. Here is really hard way to do it lol. <?xml version="1.0" encoding="UTF-8"?> <message> <letter><title>H</title></letter> <letter><title>e</title></letter> <letter><title>l</title></letter> <letter><title>l</title></letter> <letter><title>o</title></letter>...
  6. EkBass

    New to web development, backend question

    Depends a bit of what you are using. In common backend engines and languages, each request is its own instance, so if person A is manipulating a global value of his instance, it does not affect on person b instance.
  7. EkBass

    Programming convolution

    You could first provide some information about your experience in coding.
  8. EkBass

    Conditional Coding

    Hi. Is this matlab code? Im not sure, what you are up with the code, i suggest you to comment your code much more better. For some reason, i cant now use code tags, so lets do without. Should this: g = (-(2*A)/pi)*(atan(cot((pi)/(1/f1)*t))) be like this: g =...
  9. EkBass

    is "rand() % 100;" not very random?

    This is not sure information, but i think random numbers are in most languages are as float or double. Depending of function from where its returned, its often converted as integer due atleast in history, integers were what most of programmers asked for.
  10. EkBass

    Tech Addiction

    It is pretty normal behaviour from a human, to resist changes and find negative sides from them. It's not wrong or right, it's how most humans just bahaves. Developement usually happens with some false steps, just like childrens has to fall few times when learning to walk or do few stupid things...
  11. EkBass

    is "rand() % 100;" not very random?

    Well, i thought to do some research too with much bigger date. /* randoms a number between 1 and 100 and counts the number of times each number is generated */ function randomArray() { let count = Array.from({length: 100}, () => 0); // lets do few million rounds // for (let i = 0; i <...
  12. EkBass

    Tech Addiction

    In any means, im not defending or offending things. I just think, that often new things and innovations are something between groups of humans. 1. Those who thinks it was better before 2. Those who thinks how world did survive without the innovation
  13. EkBass

    Tech Addiction

    I see good points on what you told. But before and after internet, propaganda has been spreaded. First as mouth-to-mouth stories, then as books, tv-shows, radio and what ever. Modern technology is just another way to spread data which serves individual needs. My father also went to Facebook...
  14. EkBass

    Tech Addiction

    Yes, that is a major problem. I think we are close to what religious texts or similar contexts can do for a human. While others read bible and just want to spread the cool things of it, some others may be ready to cut a head of all who don't do as already. Level of education and knowledge...
  15. EkBass

    Tech Addiction

    There is a point what you say, however i dont see everything in same manner. For example, "visit library instead" or "read a book" is something i have hard to understand. Just like in internet, there is chance of misinformation on written books too. Usually books at library has more accurate...
  16. EkBass

    is "rand() % 100;" not very random?

    Well, if you want random numbers that has some spread, my example is valid. We dont know the needs of certain program someone is working at. Anyway, i think this one is done so i dont care to talk more about this issue. Its gettin more like a philosophical issue instead of programming.
  17. EkBass

    is "rand() % 100;" not very random?

    rand is reliable. You dont need to consider such a issue. There is patterns everywhere, do we want or not.
  18. EkBass

    is "rand() % 100;" not very random?

    Im curious to hear, what you believe to achieve with such a solution? After all, its not up how many different random number functions you create and call, the output follows certain rules and patterns will exists no matter what. If rand returns in first round 1 and in second 2, the numbers are...
  19. EkBass

    JavaScript JavaScript application: Electron, Tauri or something else?

    Yes, it is good practise to seperate html, css and js for each on its own file. Still, if there is not significant amount of js nor css in your html file, i would not bother myself too much for adding it there. CommonJS is for front-end and EXMA modules are for backend, or client-side and...
  20. EkBass

    is "rand() % 100;" not very random?

    What comes to computers, there is not a truelly random numbers. Its tied to the excact moment when the number is produced or a seed passed to a function what produces these numbers. On the other hand, throwing a dice does not produce a random number but a number that comes on top due fysical...
Back
Top Bottom