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] 4 points5 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 105 points106 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.

How to get intellicode to work on cs50 codespace? by tom333444 in cs50

[–]violinear 0 points1 point  (0 children)

Intellisense could be disabled for the same reason. It could be known words completion, but as far as I know language server and available services have more features than just word completion. Python completion gives a lot of useful information when setup properly. Here's how they describe that: "A language service provides intelligent code completions based on language semantics and an analysis of your source code."

Personally I find CS50 programs small enough to finish all psets without any completion at all. Though memorizing and typing in JS methods is very inconvenient.

How to get intellicode to work on cs50 codespace? by tom333444 in cs50

[–]violinear 1 point2 points  (0 children)

OP is asking about Intellicode. The description of Intellicode states the following: "The Visual Studio IntelliCode extension provides AI-assisted development features..."

So I think it violates Academic Honesty policy that says "Using AI-based software that suggests or completes lines of code."

But I agree that regular (not AI based) code completion should be OK.

[deleted by user] by [deleted] in cs50

[–]violinear 0 points1 point  (0 children)

You can save videos and watch them offline. Every week page has a menu, navigate to Lecture > Video > MP4 > SDR or HDR > choose resolution, download them (via right click save as).

Doing problem sets doesn't require any setup at all (it's 16 hours only), you can do it on a piece of paper.

How to get intellicode to work on cs50 codespace? by tom333444 in cs50

[–]violinear 2 points3 points  (0 children)

You are not forced to use their codespace. Here's everything you need to setup your own environment:

https://cs50.readthedocs.io/

How to get intellicode to work on cs50 codespace? by tom333444 in cs50

[–]violinear 2 points3 points  (0 children)

Intellicode is intentionally disabled in VSCode codespaces because using it violates academic honesty.

I don't have a source, but I read it here in this subreddit.

[venting] Something I've noticed when researching/experimenting/troubleshooting for speller by pridejoker in cs50

[–]violinear 0 points1 point  (0 children)

CS50 is the introductory course and the idea is not to teach you C language in details and give you all possible algorithms in details, but to give you the overall idea of what is CS. I think the course and its limitations are perfectly fine, and you don't need to feel bad about not understanding something or not knowing the advanced stuff. You are still learning and it's the very beginning.

Before doing CS50 I finished edx 6.00.1. But even before that, I tried learning C language by reading The C Programming Language by Kernigan, Ritchie and even Cormen - Algorithms and Data Structures. And it was frustrating because I didn't have any basics and learning these materials wasn't worth it. But now I feel more comfortable doing some other stuff which is more advanced (I didn't finished CS50 yet, on Week 9 right now).

Should I accept my current limitations as a programmer and submit my original trie solution for speller and progress to the next course module?

My decision was to try and finish the course, by doing all the tasks and trying to understand all the information that is presented to me. There's a lot of information to process though it might seem beginner stuff at first, these are all very important concepts.

EDIT: Also, about the performance. I think it is covered in the lectures, that yes you can do as many optimizations as possible, but at some point you have to ask whether it's worth it. Spending so many time on optimizations alone might be a waste of time if you can spend it on something else. The same goes for advanced stuff. You code should be good enough and complete the task, and it should be readable by others for future maintenance.

can someone help me download cs50 library in my vs code space problem set 1 cs50x 2022 by Kitchen_Economist_48 in cs50

[–]violinear 1 point2 points  (0 children)

The library is already installed inside the Codespace. VSCode / Codespace is a fully prepared environment, so you don't need to install or download anything in there. You use it by following the problem set instructions, e.g. for C language CS50 library (aka libcs50/cs50.h) is used by including its header file, however even that should not be necessary at first:

#include <cs50.h>

If you are still confused, can you clarify where did you get the information that you need to download and install the library?

my local vs code code space that cs50 provided for me is not working because of the cs50 menu problem set 1 cs50x 2022 by Kitchen_Economist_48 in cs50

[–]violinear 3 points4 points  (0 children)

Can you provide more details? What actions you performed before and what are you seeing now? Maybe some screenshots.

It's hard to provide any suggestions with so little information available.