@overactor The way I did it was with a multi-dim array (i.e. a table in my case), just sort in random order and pick the first one that doesn't already have a chute or ladder
but now when I try to run it anywhere I get weird errors like guess isn't defined or something like that. and the other one is that the else if needs a space in it, but that was a different shell
Take a look at following code:
/*abstract*/ class Capturable
{
object _lock = new object();
public bool IsCaptured { get; private set; }
public bool TryCapture()
{
if (!IsCaptured)
lock (_lock)
if (!IsCaptured)
return IsCap...
Alright, thanks! I also believe they don't want a bunch of non-developers signing up, only to get their hands on iOS 9... — MichaelD33Jun 10 '15 at 6:12
Hi, I posted a question a little while ago, and have already gotten some good tips in it. (Thanks @Zak). Is it OK to improve the code in my question, or is that not considered good practice. (I'll of course leave a note thanking the user that helped.)
There is a badge for posting questions on separate days, if you want to work towards that and you posted the question today, you could wait until 00:00Z, but otherwise, no need to wait
Thanks to zak for some great advice on this previous question. This is a follow up question:
I have an Excel workbook with two sheets: "Raw data" and "Summary". In the raw data sheet there are several blocks with data structured like the image below:
I want to create a summary of the data bel...
@Mast no but they don't last as long when you use them while they are charging. the labels on them tell you to use them until they are almost depleted before charging them
@Mast and I said could lead to the battery becoming compromised
@syb0rg To be honest (waiting for an answer from OP), but I think he has the answer already. I'm quite sure it's hard to improve the performance of the vectorized code OP posted. Remains to be seen if it's actually wrong or if it's just floating point errors.
This is a script I made that opens img.png, downloads the json data from the API, writes it on image and displays it. It currently is a community ad over Arqade.
<?php
header('Content-type: image/png'); //setting header to png so it will display as an image
$donationImage = imagecreatefrompng("i...
I have a bunch of binary files that have corresponding structs in them, followed by any number of bytes (this exact # of bytes are given in one of the fields in the structs). I read in data from the binary files to a struct, and assign variables from certain fields in those structs. I was wonderi...
I call it technologically impaired individuals who think I am blowing smoke up their butts when I tell them to be nice to the plug ins.......<rant> <rant><rant><rant><rant>
@ardaozkal So, yesterday I was showing a friend about desktop apps and as a joke made this, just thought to share as it actually would work well as a rick roll.
The code below is a social networking script is the class of the feed, the problem when the fees have many posts and many the followers even presents a giant slow, someone could tell me if there is something wrong with the queries and the script below , thank you
public function __construct($dbo...
Irritates me when people sticks with bad primality tests. To learn programming it is great to write a sieve.. However probabilistic is really the way to go.
@JorgeBucaran Yes, but for large number of processes / jobs, I would use a producer-consumer model where the number of worker goroutines is fixed and well quarantined. For an example see my answer at Bruteforce MD5 Password cracker. — icza40 secs ago
No external math libraries or math library functions are allowed.
2.You will design all mathematical functions from scratch.
3.The user should be able to input the five operators and base 10 digit numbers.
4.The user must be able to input up to five consecutive operators with
associated oper...
While asked only one question here I already see inconvenience of code-review site as it is now. For code-conversation (which in my opinion is code-review, where your code get improved and you change it slightly to have another iteration of improvements or perhaps to demonstrate why previous impr...
Hello everyone I am new to Android development and i am currently working on an android app that fetches changing location coordinates from SQL database and plots on a Map view at regular intervals. But I think this code can be made more efficient as i am unable to fetch locations after a certain...
This is my fist attempt at making a program in C++, I was wondering if my code was good or should it be improved upon. Thanks in advance for the help. Here is the code below. Any help debugging would be greatly appreciated thanks.
#include <iostream>
using namespace std;
int main()
{...
Protip: Releasing data to the OS and at the same time still using it in your program will lead to issuesundefined behavior briefly thinking that your RAM is broken
I think this site needs a lot more work for it to become a good open-source code review platform. Otherwise, it will be blind-sided by something else soon enough!
My biggest bug bears are:
No sane way to integrate with jsfiddle/jsbin.
Dialog is really really hard.
No integration of linting t...
Previously: Countable and uncountable sets in .NET (clean version).
Thesis There is a full featured support of countable sets in .NET: IEnumerable<T>. What about uncountable sets; sets defined by predicate? How can they be manipulated and interact with IEnumerable<T>?
Solution Let’s introduce ...
I'm developing a plugin for Revit (a software to make 3D buildings).
The goal is simple to understand. When there is an intersection between a Wall and a Duct I create an object called Reservation at this location. I need to extract the Curve of the Ducts and the Faces of the Walls in order to c...