-
Replied To a Post in NP vs NP-Complete vs NP-Hard — what does it all mean?
> usually describing its time complexity, though in principle it could be used to describe space complexity as well. No, you're probably thinking of Big-Oh (which is most often used … -
Began Watching NP vs NP-Complete vs NP-Hard — what does it all mean?
What are the differences between NP vs NP-Complete vs NP-Hard ? I am aware of many resources all over the web. I'd like to read your explanations to undrestand better -
Replied To a Post in NP vs NP-Complete vs NP-Hard — what does it all mean?
NP means a NTM can solve it in polynomial time (or equivelantly that a DTM can verify the result in polynomial time). Note that NP is a superset (possibly, but … -
Replied To a Post in "no instance for overloaded function"
Your programm will not be .net dependent if you choose "Win32 console application", only if you choose "C++/CLI". The name "Win32 console application" may suggest that will depend on the … -
Replied To a Post in "no instance for overloaded function"
> Is there no way to program standard C++ CLI applications without having this ".NET CLR"? To create C++ code that will work for general purpose, instead for Windows only? … -
Began Watching "no instance for overloaded function"
I tried to build really basic associative array but it turned out I don't have enough knowledge, so I tried something less, and less, and less, because I kept failing … -
Replied To a Post in "no instance for overloaded function"
> no instance of overloaded function "System::Console::WriteLine" matches the argument list argument types are: (const std::string) I've never used C++/CLI, but it looks like `std::string` is a distinct type from … -
Began Watching Interpreter
Hello, how does an Interpreter work ? I read up on it and it seems you just parse each line and then (somehow) execute the lines. I suppose the code … -
Replied To a Post in Interpreter
Whether you can parse each line individually depends on the language. I'd say in most languages, you'd need to parse the program as a whole. But yes, a simple (as … -
Gave Reputation to mike_2000_17 in Move semantics c++11
This is a bit tricky to explain, because it involves a number of implementation details about `std::vector`. It is clearer if we expand the main code a bit, with some … -
Began Watching Move semantics c++11
Hi It's been a while i'm learing C++ but still i have some issue with `Move semantics` and some other stuff. I wrote this class but i don't know why … -
Replied To a Post in Move semantics c++11
If you know how many elements you're going to add to the vector (or you at least have a reasonable upper bound), you can also use `reserve` to reserve the … -
Began Watching call function from an if
I have this code which if i press msgbox yes it opens another frame but if i do same thing from another function (counter) i get an error. Can someone … -
Replied To a Post in call function from an if
The `controller` variable is not defined within the `counter` method. You need to either pass it as a parameter or make it a member of the object (by doing `self.controller … -
Began Watching Is this correct or not ...(Discrete Math)
# Is {(1,1), (2,2), (3,3)} symmetric? transitive? Yes! Yes! ## Why is R = {(1,2), (2,3), (1,3), (2,1)} not transitive? Because (1,1) and (2,2) are missing. ## # -
Replied To a Post in Is this correct or not ...(Discrete Math)
> Is {(1,1), (2,2), (3,3)} symmetric? transitive? Yes! Yes! Obviously I'm not your grader, but I'd expect that you need to give some explanation along with your answers to get … -
Began Watching Not compiling properly (new to C++)
I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown … -
Replied To a Post in Not compiling properly (new to C++)
`gcc` produces a binary executable, not a shell script. To run it, type `./main.out`. -
Replied To a Post in Clarification on Char
EOF is not captured in the char data type. EOF is represented as an int with the value -1. Now you say "why can't we just use a char with … -
Began Watching Clarification on Char
Hi, I have this doubt i have read that "We must declare c to be a type big enough to hold any value that getchar returns We can't use char … -
Replied To a Post in Clarification on Char
No a char value can not be larger than what fits inside a char. However what getchar returns does not have to be a char value. It could also be … -
Began Watching RoR - NoMethodError, undefined method
I have created an app with simple login authentication, it is actually a twitter clone. The user logs in and access the pages, etc. But when the user posts something … -
Replied To a Post in RoR - NoMethodError, undefined method
It looks like the Ribbit class does not have a `userid=` method - presumably because you did not define one and the corresponding table does not have a `userid` column … -
Gave Reputation to Moschops in reading from urandom file
You're also using `printf` incorrectly. When you are printing out the value of an int, printf does not want the address of that int. It wants the int itself. `printf("%d", … -
Began Watching reading from urandom file
Hi everyone and good morning :) . i want to simply read from the linux file "urandom" a random number and print it out on screen.just simple as that. this … -
Replied To a Post in reading from urandom file
You need to `#include <stdio.h>` to get the declaration of `fopen`. As it is now you're implicitly declaring `fopen` in a way that is incompatible with its definition. You should … -
Began Watching Better than Split()?
So I was recently working on a string program where the strings were easily megabytes long, and I ran into problems with there being out of memory exceptions etc. So … -
Replied To a Post in Better than Split()?
> Something else to consider, using the String.IndexOfAny method will shorten your code considerably And, perhaps more importantly, improve the runtime from being quadratic in the worst case to being … -
Replied To a Post in Convoluted Fibonacci
> is the + operation returning a new big integer object? Yes, exactly. -
Began Watching Convoluted Fibonacci
So the other day I was just experamenting with some code, just for fun, and I ran into some difficulties. So I suppose my question is why the following code … -
Replied To a Post in Convoluted Fibonacci
You're right, that when you do `something = new Something();` that basically assigns a "very safe pointer" (a.k.a. reference) to `something`. In fact when you do `something = anything;`, you're … -
Began Watching C program works but also crashes
Hello, I'm just started to study malloc and realloc, so i just wrote this program to copy two string from user input and consenterate them. then ofcource print it. #include … -
Replied To a Post in C program works but also crashes
How long are the strings you enter? If the first string has more than 2 characters, your first call to `gets` overflows your array. Likewise your second call to `gets` … -
Replied To a Post in zork & adventure python script
Funny, I remember Zork being longer and having a much more sophisticated parser. In all seriousness though, this is not a good example of how to program a Zork-like game. … -
Began Watching Big O notation
Have any of you ever done big O notation? I found some websites that describe it, but not many professional ones. Are there any books that describe it too? -
Replied To a Post in Big O notation
> You're right and that 'variable' is the number of elements. That variable is whatever you say it is. In the context of computer science it's usually the size of … -
Gave Reputation to TalhaMoazSarwar in for loop and pointers, Error
#include <stdio.h> #include <ctype.h> main() { char msg[] = "Hello World!"; char* pmsg = msg; int i = 0; while (*(pmsg + i) != '\0') { if (isupper(*(pmsg + i))) … -
Began Watching problem with function arguments
Hi, me again :) Look at this error please: File "./kivycal-1", line 103, in number_two self.check() TypeError: check() takes exactly 2 arguments (1 given) The error is pointing to here: … -
Replied To a Post in problem with function arguments
Are you sure that that's the definition of `check` that's in scope when you call it? Do you perhaps have any other definitions of `check` in your program, perhaps even … -
Began Watching facing problem using struct and union
hi, If I have a union like union Type { struct Student s; struct Employee e; }type; and a struct person like struct Person { char firstname[10]; char familyname[20]; char … -
Replied To a Post in facing problem using struct and union
You can't, you need a separate field (usually of an enum type) to keep track of which field of the union is set. -
Began Watching javac command not found in linux fedora
Dear all, I am using linux fedora os. But i cannot able to set the java Classpath command. Step 1: whereis java java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz Step 2: … -
Replied To a Post in javac command not found in linux fedora
> javac command not found in linux fedora Have you installed the JDK? > vi .bash_profile > export JAVA_HOME=/usr/bin/java JAVA_HOME should be a directory, not an executable, and you shouldn't … -
Began Watching How does a high-level class/object work on a CPU??
First off, I know this question doesn't exactly belong here... I'm asking here because this is the lowest common ground between binary opcodes and: # python 2.7 class A(object): def … -
Began Watching argument passing in bash using alias
I have a C++ program with a main routine which reads arguments from command line: int main(int argc, const char *argv[]) In my system I have defined some aliases in … -
Replied To a Post in argument passing in bash using alias
If you do make them variables, `dircopy $src $dst` will work fine. -
Gave Reputation to Moschops in Understanding Copy Constructor.
If you don't write a copy constructor, you get one for free anyway. A very basic and simple one. In this case, all it will do is copy the pointer, … -
Began Watching How can i learn java on Arch linux
Hi, I want to learn java as young but i use Arch linux since i was kid so how can i get the emulator or what required softwares.I have java … -
Replied To a Post in How can i learn java on Arch linux
Learning Java on Arch Linux is no different than learning Java on any other system. You don't need an emulator - both the Oralce JDK and OpenJDK are available for … -
Began Watching instance method
Hi, I just wanted to know about instance method? If static modifier is not applied before does it makes it an instance method ? Plz give an example Thanku
The End.