> 2 + "2" uses the + operator on a number and a string. In a normal language, this would result in "22" (string concatenation); however, the new language converts the string to an integer and adds them to produce 4.
I asked the mods on Puzzling and they claim it is part of the joke, but then can't tell me what's funny about it... then again, those mods are just like the Programming Puzzles & Code Golf mods, and who knows what they obfuscate.
2
@Nobody - it is.... but, how did the prompt know that before the command was typed?
The joke is that the code 2+2 has added 2 to the digit "2", so that it now is printed as "4". Hence 2+2→ "DONE"; the line number [12] is printed as "[14]", and the number 2 in the output of RANGE(1,5) is printed as "4"
3
In early versions of FORTRAN, it was possible to modify constants like this (because constant values like 2 were stored in modifiable global slots). See Changing the value of 5.
Steve - Never heard of codereview before. I'll check it out. Do I do anything to close the question? Servy - If there isn't a problem to fix, then that is the answer to my question. A lot of questions on stackoverflow deal with a better way of achieving the same results. While I agree that codereview would be a better forum for the question, I think improving coding practice falls into the scope of stackexchange. — Kalev Maricq25 secs ago
The problem is this method:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// when searchcontroller is active, return the number of search results. If inactive simply return the count of the full AED list.
return self.AEDItems.count
}
This method is asking f...
@Mast Moving something from the .c to the .h? I can't see that being a useful suggestion that could also be an on-topic question for Code Review, unless we were being shown several files that duplicated the declaration.
I am trying to optimize my game written in Java and I used the VisualVM launcher for profiling and monitoring my game. What caught me by surprise was that my basic utility to play sound effects was using the most CPU in my game.
I'd really appreciate some tips on improvements which I can implem...
@Per Fair enough. I have the same situation myself right now -- a for loop that works on small data but takes hours on my big data though and I'm about to happily make it my first post on Code Review :) — Hack-R12 secs ago
I have a queue, where new objects are inserted and processed. For processing I use singleton thread that can end and can be restarted.
private Thread backgroundThread;
private final Queue<ImgData> queuedImgs = new LinkedList<>();
public void scheduleNewCodeImg(ImgData imgData) {
LOG.log(Lev...
would this question be a valid candidate for migration to Code Review? it looks like working, non-hypothetical code to me and the asker has a specific issue he's interested in fixing/improving
> I am suspicious that there can be some error of not procesing an item that gets inserted in the very moment of the last iteration ending. I thought about some synchronisation, but I am not sure that synchronizing both methods will help as the process runs in backgrounf thread. Can you point me how to fix this?
So, we are now rewriting some parts of our application. We are trying to avoid the promise anti-pattern and do things properly. But still, Im not very convince with the results.
More precisely, we are rewriting the resolver of a state using ui-router.
So far, this is the current code:
.state(...
I have made a python program for polygonal outer billiards on convex polygons. The program used to run fine earlier however, it has started acting weird lately. I can't seem to figure out the bug in the code. If you can help me to make the program correct then I would appreciate your help.
from ...
So, I have some experience with the github library you're using.
It seems most likely that you might want to make this call synchronously because of some of the problems this library has (you can't make multiple queries at once, and can't open multiple connections to the server because the libra...
but @rolfl from my experience with chat it's simply better to always have someone available that could press the red button, before things get really nasty
RO's have 4 significant things - 1. ability to move messages 2. ability to pin messages 3. ability to kick people 4. italic names (and the glory that comes with that).
I've got a huge dataset in R which contains (among other things) 2 columns indicating "Term Code", which are "Term Code" and "Term Code1".
"Term Code" is the mostly-correct column, which usually contains a 6-digit code for year and academic term:
> head(data$Term_code)
[1] 201230 201230 201230 ...