389 Posted Topics

Member Avatar for rarment

There are a couple of problems with your code: First you redefined `display` to basically do nothing. With that definition of `display` you'll never get anything printed to the screen, no matter how you define your `foreach` macro. You should get rid of your definition of `display`, and just use …

Member Avatar for sepp2k
0
176
Member Avatar for silvercats

It should also be pointed out, that it's not only variables that take up space - temporary values do too. So if you're thinking about removing variable declarations in favor of larger expressions in order to save memory (or registers), don't - it won't work.

Member Avatar for silvercats
0
162
Member Avatar for vaayaa1

You're trying to apply the prefix `++` operator to the result of the expression `a++`. The result of `a++` is a temporary value and thus not assignable, i.e. it is not an lvalue. Since you're only allowed to use `++` on lvalues, you get the error that you get. Somewhat …

Member Avatar for WaltP
0
124
Member Avatar for zeusprog

If `a` is an n-dimensional numpy array `a[..., j]` will return an (n-1)-dimensional numpy array where each innermost subarray is replaced by its jth element. So for example if `a` is 2-dimensional, `a[..., j]` will be a 1-dimensional array containing the `j`th column of each row. > Nothing in Python, …

Member Avatar for zeusprog
0
142
Member Avatar for Frensi

You call `Time.sleep` once before the loop. Inside the loop you keep making attacks without calling `Time.sleep`. For that reason your program will pause once before the loop. Inside the loop it will keep making attacks without pausing.

Member Avatar for Ene Uran
0
7K
Member Avatar for complete

Are you sure that the file actually contains tabs? It looks like the line simply contains multiple spaces, not tabs.

Member Avatar for Taywin
0
165
Member Avatar for capton

`getValues` is a member function of the `EmployeeForm` class. That class does not have a member called `empList`. `empList` is a member of the `Payroll` class, so you can only access it through a `Payroll` object.

Member Avatar for rubberman
0
230
Member Avatar for krayzeeben

Depending on your operating system data will be moved from your RAM into a swap file or partition once your RAM is full. That said there is no way that your hex editor reads your whole hard drive into memory before displaying it. Not only would reading such large amount …

Member Avatar for sepp2k
0
146
Member Avatar for bugstalker

As someone who knows very little of conio.h, could you explain how cprintf, cscanf, cgets, cputs etc. behave differently than the standard functions of the same name minus the "c" at the beginning?

Member Avatar for Ancient Dragon
1
1K
Member Avatar for shanki himanshu

Yes, they're the same. It only matters whether the `const` appears before or after the `*`. If it appears before the `*` it does not matter whether it appears before or after the typename.

Member Avatar for sepp2k
0
60
Member Avatar for gem.gonzales.9

You've defined gem to take 2 arguments, but you're calling it without any arguments. You should also forward-declare `gem` or define it before the `main` function.

Member Avatar for rithish
0
141
Member Avatar for rotten69

> it is a function according to the javascript documentation. According to which documentation?

Member Avatar for Taywin
0
1K
Member Avatar for Frensi

> However my advice is not to define objects with a __del__() method because they can create uncollectable objects if they are part of a reference cycle Yes, but since his robots don't contain references to each other, that can't happen here. > Also there is no guarantee that the …

Member Avatar for Gribouillis
0
310
Member Avatar for thechampp

This is probably not the solution your instructors are looking for. I imagine your instructors are looking for a solution where you caclulate n!/k! without calculating n!. Note that if you expand n!/k!, it will look like this: 1 * 2 * ... * n -------------------------- 1 * 2 * …

Member Avatar for sepp2k
0
98
Member Avatar for manishanibhwani

A whitespace character (including \n) in the format string will cause scanf to discard any whitespace in the input stream upto the next token. If a whitespace character is the last character in the format string that means that the user must already enter the next token, so that scanf …

Member Avatar for WaltP
0
180
Member Avatar for Sneaky Pete

> 250.000 - 50.000 = 249950. Does your system by any chance use a locale where `.` is used as a thousands separator and `,` as the decimal point? Because if so, the users should either input the numbers in a format compatible with the current locale (i.e. use `,` …

Member Avatar for Sneaky Pete
0
238
Member Avatar for lxXTaCoXxl

None of those really seem necessary (or helpful) and some seem like incredibly bad ideas. Your out and in macros, will make your code look very strange. If you want to print an item it will look like `out foo`, which really doesn't make sense syntactically. `out(foo)` or `out << …

Member Avatar for sepp2k
-4
271
Member Avatar for saranyak

The same amount of bytes as there are in all other types of pointers (except possibly function pointers, which might take up a different amount on some platforms). How many that are depends on the platform. You can find out how many bytes are in an int pointer on your …

Member Avatar for sepp2k
0
105
Member Avatar for hmagnum

In this case, replacing the `&&`s with `||`s (i.e. "keep running while at least one of the `HullShip` variables is greater than 0) would have worked too.

Member Avatar for hmagnum
0
116
Member Avatar for dinohead

Dereferencing a pointer does not just read the byte that the pointer directly points to - it also reads the subsequent bytes depending on how large the pointed-to data type is. So if `ptr` is a variable of type `T*` that points to the address 12feac and `sizeof(T)` is 4, …

Member Avatar for dinohead
0
130
Member Avatar for lewashby

You're never actually compiling the code. You need to call `make` to create `perl` and the other binaries you're trying to copy.

Member Avatar for lewashby
0
126
Member Avatar for complete

According to google¹ those error codes mean "missing token", "missing type specifier" and "unexpected token" respectively. So it sounds like you have some sort of syntax error somewhere in your code. ¹ Next time please post the error *message*, not the error code, so I don't have to google it. …

Member Avatar for sepp2k
0
88
Member Avatar for peterparker

Yes, you're right - it's not correct. For one thing, as you said, the number of moves is wrong. Further when I enter 3 as the number of disks, it tells me that after the first step there will be 1 disk on the source pile, 2 disks on the …

Member Avatar for peterparker
0
2K
Member Avatar for lewashby

On the end of that line, right before the `&&`, you have a closing parenthesis. There is no opening parenthesis corresponding to this closing parenthesis anywhere in your script. So you get a syntax error.

Member Avatar for sepp2k
0
82
Member Avatar for vickymehta6789

If you'd post your code, we could tell you whether your problem is with your code or your setup.

Member Avatar for sepp2k
0
105
Member Avatar for ashiiiish

Generally you should not need to manually download any RPMs. Most applications you want to install will be available in the official repositories and can be installed automatically. MySQL definitely is. To install the MySQL client and server either select "Add/Remove Software" from the Applications menu and then search for …

Member Avatar for sepp2k
0
182
Member Avatar for anujthefuhrer

The executable created by lex does not take any command line arguments and if you give it any, it will silently ignore them. It reads its input from stdin and writes its output to stdout. So as L7Sqr said, it doesn't do anything because it's waiting for you to enter …

Member Avatar for sepp2k
0
572
Member Avatar for Plazmotech

I don't know anything about Dwarf Fortress, but it's not possible for a terminal application to change the font used by the terminal (using curses or otherwise). So if Dwarf Fortress does that, it must be creating its own window, not running in the terminal.

Member Avatar for sepp2k
0
129
Member Avatar for HTMLperson5
Member Avatar for I_m_rude

You set j to 0 once before the outer loop starts. So when the inner loop is run for the first time, j goes from 0 to 15. On the second iteration of the outer loop, j will still be 15 because you never reset it to 0 after the …

Member Avatar for I_m_rude
0
210
Member Avatar for manishanibhwani

C is not garbage collected. So the garbage collected is never called because there is no garbage collector (unless you're using a lib which provides one - in which case it depends on the lib of course). The reason that your code (which of course invokes undefined behavior, so might …

Member Avatar for manishanibhwani
0
105
Member Avatar for manishanibhwani

Floats in C are usually stored as 32-bit (i.e. single precision) [IEEE floating point](http://en.wikipedia.org/wiki/IEEE_floating_point) numbers.

Member Avatar for sepp2k
0
115
Member Avatar for HTMLperson5

> Can your mac/linux do this? Yes, of course, it can. It should also be noted, that in that video the user manually resizes the VLC window on which he wants to focus. In the Mac video to which this was a response, the windows was focused and restored to …

Member Avatar for HTMLperson5
-3
461
Member Avatar for soham.m17

The expression `condition ? then_expression : else_expression` evaluates to the result of `then_expression` if `condition` evaluates to `true` and to `else_expression` otherwise. So the above expression evaluates to `1` if `f` is `0` and to `f * fact(f-1)` otherwise.

Member Avatar for soham.m17
0
78
Member Avatar for sandz24

`using my_type = old_type` is a new syntax in C++11 which is basically the same as using `typedef old_type my_type`, with the important difference that it can be templated (whereas typedefs can't be). So in the code you've shown, `matrix<T>` is defined as an alias for `vector< vector<T> >` (for …

Member Avatar for sepp2k
0
167
Member Avatar for jinglylime

The easiest solution would simply be to sort the strings by length (using Java's built-in sort method) and then simply take the first three (or last three depending on the order in which you sorted) strings from the sorted array. That solution would be much shorter, simpler and easier to …

Member Avatar for sepp2k
0
3K
Member Avatar for Iceman10284

> Hint: Open the file and read every string stored on it. Each time you read a string, increment a counter variable. When you've read all the strings from the file, the counter variable will contain the number of names stored in the file. That sounds about right. So why …

Member Avatar for sepp2k
0
541
Member Avatar for ckwolfe

The [System.Console.GetOpt](http://hackage.haskell.org/packages/archive/base/latest/doc/html/System-Console-GetOpt.html) module (which is part of base and thus doesn't add any dependencies to your project) is the proper way to handle command line arguments. Yes, it's easy enough to write your own code for handling command line options, but there's no need to. There's no point in reinventing …

Member Avatar for sepp2k
0
231
Member Avatar for doomsday1216

Scheme does have an if expression. It's used as `(if condition then-expression else-expression)` and works in the obvious way (i.e. it evaluates `then-expression` if the condition is true and `else-expression` if its not - the result of evaluating an if expression is the result of whichever of `then-expression` or `else-expression` …

Member Avatar for sepp2k
0
367
Member Avatar for nyuszi

`(x:y:a:s:d)` (and the other expressions like it) will cause a type error because the right operand to `:` needs to be a list and here it's not. The proper way to achieve what you're trying do would be to use pattern matching like this: compact (D:C:C:C:C:xs) = [C,M] ++ compact …

Member Avatar for sepp2k
0
180
Member Avatar for hubber92
Member Avatar for rahul pareek

Because most C implementations don't perform bounds checking when accessing an array. So when you give an index to an array, that index (multiplied by the size of the element type according to the rules of pointer arithmetic) will simply be added to the address where the array begins and …

Member Avatar for rahul pareek
0
191
Member Avatar for helpneeded87

None of the variables in your loop ever change, so you get the same output on each iteration of your loop. For example you set `rembalance` to `balance - principle`. Since `balance` and `principle` are never changed, `balance - principle` will evaluate to the same value every time, so `rembalance` …

Member Avatar for helpneeded87
0
246
Member Avatar for rithish

Does the [explanation on Wikipedia](http://en.wikipedia.org/wiki/Determinant) help you? If not, could you maybe rephrase your question to be more specific?

Member Avatar for sepp2k
0
116
Member Avatar for osiron

"In file included from ..." is not the error. It tells you where the error occurs. The actual error message comes after that. Anyway an `std::map` is a sorted map and thus needs its keys to be comparable to each other. So if you want to use a given type …

Member Avatar for osiron
0
180
Member Avatar for 3e0jUn

The error message is telling you that you're trying to convert an empty string into a number. So are you sure that your 'money.$' file isn't empty?

Member Avatar for HiHe
0
156
Member Avatar for JubalBarca

You left out the part of other.py where you import main, but if you didn't use the `from main import ...` form of import, you'll have to refer to main's variables, functions and classes as `main.app` etc. instead of just `app`.

Member Avatar for sepp2k
0
236
Member Avatar for javanub123

If your path doesn't start with a drive letter or a (back- or forward-)slash, it's interpreted relative to the current directory. So Chophouse is right, you need to make your path absolute unless Users is a subdirectory of your current directory. You also need to escape your backslashes or use …

Member Avatar for Gribouillis
0
143
Member Avatar for I_m_rude

First of all a isn't a pointer, it's an array. It *decays* to a pointer in certain contexts, but it decays to a pointer to an int-array, not a pointer to an int, so you need to cast it if you want to use it as an int-pointer. And yes, …

Member Avatar for I_m_rude
0
126
Member Avatar for juljan30

According to my compiler the following things are wrong with your code: > bla.c: In function 'main': > bla.c:5:5: error: array size missing in 'SqareNumArray' > bla.c:9:1: error: 'SquareNumArray' undeclared (first use in this function) > bla.c:9:1: note: each undeclared identifier is reported only once for each function it appears …

Member Avatar for WaltP
0
858

The End.