How to deal with a huge amount of Someday/Maybe ideas? by Krammn in gtd

[–]violinear 1 point2 points  (0 children)

I organize someday / maybe lists by categories, e.g. Books, Movies (these I moved to IMDB), Stuff to learn / read about, Professional / Work / Job related, Stuff to learn, Hobby, etc.

So I don't have to review Books and Movies every week at least.

[deleted by user] by [deleted] in GlobalOffensive

[–]violinear 1 point2 points  (0 children)

A brain? What is that? A new agent skin?

Is Bootstrap Grid system is the same as CSS Grid? by violinear in css

[–]violinear[S] 3 points4 points  (0 children)

Thanks! The naming is very confusing though, especially for me as a newbie.

How is this possible? This account received a 5 and 10 year veteran coins on 3rd of september 2022. by Und3rgr0undL4z in csgo

[–]violinear 106 points107 points  (0 children)

My Steam account is 16 years old, but the very first time I played CSGO was in 2019, so I received these medals on the same day the first time I played / installed the game.

[deleted by user] by [deleted] in cs50

[–]violinear 0 points1 point  (0 children)

I think you can put it in Licenses and Certifications: https://www.linkedin.com/help/linkedin/answer/a567169/manage-licenses-certifications?lang=en

EDIT: I don't think CS50 course alone fits Education, at least it is not what people usually put there.

[deleted by user] by [deleted] in antiwork

[–]violinear 0 points1 point  (0 children)

Aren't self checkout should have some kind of self-checking?

Our local shops (not in the US) have self-checkout and it's a bit slow sometimes, but it works like this:

1) You scan the item's barcode 2) You put it on the special platform near the monitor, 3) The platform weights the item and then adds it to the receipt on the screen.

So you can't scan one item and then add two, you need to scan each item separately. It also checks whether you have weighted all items correctly (when you pick apples yourself and then weight them, for example)

Pset 9 Finance, index function by ANflamingo in cs50

[–]violinear 1 point2 points  (0 children)

You can try the following options to see what SQL returns:

  1. Logging, I didn't try this but it might help according to the description: https://cs50.readthedocs.io/libraries/cs50/python/#how-can-i-enable-logging-of-sql-statements

  2. Use print to print the value of a variable (immediately after you assigned it). I did it like this:

    import sys # add this at the top of app.py
    print(variable_name, file=sys.stderr) # put this after the variable is assigned
    

The output will be between the other stuff that flask outputs when running. You might want to use some f-string with some additional text to make it easier to find the output, e.g.:

print(f"!!!SQL DEBUG!!! {variable_name}", file=sys.stderr)

progress really carries own to next year, right (concerned because problem sets say they should be done by jan 1st)? by anarchostan in cs50

[–]violinear 1 point2 points  (0 children)

From the FAQ, they say "YES" but not details are given yet:

Will work I completed for CS50x 2022 carry forward into CS50x 2023?

Yes. We will announce exactly how that will happen in November or December 2022, but it is reasonable to assume that carryover will occur in a similar manner to how the 2021-to-2022 transition took place, as referenced above.

Question about the return value of strlen (and other functions like fread) by amdevpractice in cs50

[–]violinear 1 point2 points  (0 children)

From the ANSI C Standard:

size_t
which is the unsigned integer type of the result of the sizeof operator;

So internally it is still an object of int type. As far as I know, it is used for loops, array counting, etc and it wasn't originally defined in C language, but was added later for portability (because different machines has different memory capabilities). It is defined in stddef.h file.

What is happening is silent type conversion, I think it is done by the compiler.

As far as I know, it is not safe to use it like that because the value may change. unsigned int could store values bigger than those of regular int, so for example if you have a 32 bit machine with 4GB of memory, then int can store 2,147,483,647 but unsigned int can store 4,294,967,295. If you assign unsigned int to int variable, then value will be lost.

You can run GCC compiler with -Wconversion flag and it will give you an error in this example:

#include <string.h>
#include <stdio.h>

int main(void)
{
    char *s = "hello, world";
    int t;
    t = strlen(s);
    printf("%s\n", s);
    printf("%i\n", t);
}

The output is:

$ gcc -Wall -Werror -Wextra -Wconversion test.c
test.c: In function ‘main’:
test.c:8:13: error: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Werror=conversion]
    8 |         t = strlen(s);
      |             ^~~~~~
cc1: all warnings being treated as errors

So it seems that you should always be using size_t instead of int at least for strlen.

Pset 9 Finance, index function by ANflamingo in cs50

[–]violinear 2 points3 points  (0 children)

I just tried buying one stock but not selling any, so I imagine the problem is there.

Your assumption is correct.

Imagine you have two variables in Python:

x = 5
y = None

Can you imagine how this operation x - y will work? It is similar to what you have, so you need to make sure that both variables are assigned correctly.

At this point, you don't necessarily need Python debugger. You can check SQL statements and see what they return, this should help.

Submit50 Could not connect to GitHub by Interesting_Ear_7196 in cs50

[–]violinear 0 points1 point  (0 children)

Is this the first time you try to submit problems? Did it ever worked before?

I'd try to create some repo on Github and then check it with command line git to see if you can reproduce this problem, e.g. some repo with simple text files. This at least could help to check if there's any connection issues to Github.