C#

General discussions about the c# language, Squirrels | gist.gi...
Dec 19, 2019 09:01
the noise is hidden
Dec 19, 2019 09:01
that's why it seems 0.1 but it's not really 0.1
Dec 19, 2019 09:01
hum ok it has to do with the number of digits printed
Dec 19, 2019 08:58
0.1 cannot be represented accurately in binary
Dec 19, 2019 08:56
If 1/10 cannot be represented in binary accurately, how are most programming languages returning 0.1 as the output instead of 0.1000000...437268
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Mar 20, 2019 19:12
list(map(lambda x: str(x)+","+str(dic[x]), dic))
Mar 20, 2019 19:11
and it's so damn easy
Mar 20, 2019 19:11
to check efficiency
Mar 20, 2019 19:11
just needed to write some code to plot graphics for a c++ solution for my college project
Mar 20, 2019 19:10
i love python omfg
Mar 20, 2019 19:08
yes, works
Mar 20, 2019 19:08
def log(*args, **kwargs):
    print(*args, **kwargs, flush=True)
Mar 20, 2019 19:08
or this:
Mar 20, 2019 19:07
def log(*args):
    print(*args, flush=True)
Mar 20, 2019 19:07
Is there something in python such as
 

C++ Questions and Answers

Solve problems and approach solutions. Just ask and lurkers wi...
Jan 26, 2019 20:10
which is better and why?
Jan 26, 2019 20:10
	int new_x(pos.x);
	int new_y(pos.y);

	int new_x = static_cast<int>(pos.x);
	int new_y = static_cast<int>(pos.y);
Jan 26, 2019 20:09
oh ok
Jan 26, 2019 19:41
is this calling a constructor?
Jan 26, 2019 19:41
I mean the int(x)
Jan 26, 2019 19:41
what is the intanyway?
Jan 26, 2019 19:41
yes, thanks
Jan 26, 2019 19:31
Is doing float x = 3.5; int(x) same as static_cast<int>(x)?
Jan 26, 2019 17:09
what's the proper way to handle these situations?
Jan 26, 2019 17:08
it would be very hard to do an if-statement every single time I call one of these functions
Jan 26, 2019 17:08
I see that most functions I'm using return -1 for errors
Jan 26, 2019 17:08
what's a good way to handle errors/exceptions in c++?
Jan 25, 2019 17:42
now I'm using std::array, which supposedly has everything built-in right?
Jan 25, 2019 17:42
for example I was using C-style arrays and therefore had to do all of that
Jan 25, 2019 17:42
how do I know when to use move constructors, assignments etc.?
Jan 25, 2019 17:03
is this bad practice?
Jan 25, 2019 16:54
this does
Jan 25, 2019 16:54
	int data[5][4];
	int * index = (int *) data;
Jan 25, 2019 16:54
this won't work
Jan 25, 2019 16:54
	int data[5][4];
	int * index = data;
Jan 25, 2019 16:53
my code does not compile without that cast
Jan 25, 2019 16:29
*index++
Jan 25, 2019 16:29
T * index = (T *) data
Jan 25, 2019 16:29
is using the C-style cast the recommended way to loop through it in a linear fashion?
Jan 25, 2019 16:28
when using normal arrays like T data[m][n]
Jan 25, 2019 16:27
that's freaky
Jan 25, 2019 16:22
but i like it
Jan 25, 2019 16:22
c++ is hard
Jan 25, 2019 15:48
Do you have real world examples of using both?
Jan 25, 2019 15:45
So what would be the difference between a move constructor and assignment practically speaking?
Jan 25, 2019 15:45
I get it.
Jan 25, 2019 15:40
So move assignment is used with std::move and with obj = getAnimal() ?
Jan 25, 2019 15:39
I'm trying to wrap my mind around move constructor/assignment.