@JoeWallis Do you happen to know how to use cProfile from the commandline while only taking the 10 or so most relevant functions? I've only found the one requiring to edit the script in the docs.
Also a complete non-caring attitude towards money during your studies and early employment because, hey, parents pay everything, what is this thing called money for anyway
@syb0rg Hey, that's another thing to think about. Try putting the def above main in a separate file. It'll get compiled to a .pyc, which tends to work a tad faster. Import that library from your test code.
@syb0rg Must have missed that, or did you forget to tell us? :P
@syb0rg Do you know if the socket is called on each opc.write? If so you could possibly get a speed up by reducing the amount of writes. (I'm assuming the overhead is the killer just like it is in print)
Yeah, it's a conceptual thing but it's about the justification of why you should get paid. I find quantifying what you've done helps, but I'm probs less experienced in total.
I'm tempted to write JAVAscript deliberately to attract flags...
Anyways, I wrote a bot for a PPCG KotH challenge called "Spacewar!". The challenge is written by @El'endiaStarman. The bot is called "Spy".
The controller is hosted here, so take a look for the feel. The API is a bit long, so her...
Welcome to Code Review, where it will take a few hours to answer your question, but we'll give a good answer rather than a quick "hi I didn't read your question but here's the first google result"
Reminder as well (not to harp on) that every code review by necessity has to be crafted by hand. There's no right or wrong answer on CR, we can't just put your code through a program and have it automatically reviewed or Google the result to your review - because it hasn't been written yet.
We write it. For free. Free, Good, Fast. Pick 2. If you want Fast and Good may I suggest you pay someone to do it for you?
I'm tempted to write JAVAscript deliberately to attract flags...
Anyways, I wrote a bot for a PPCG KotH challenge called "Spacewar!". The challenge is written by @El'endiaStarman. The bot is called "Spy".
The controller is hosted here, so take a look for the feel. The API is a bit long, so her...
var CountDown = setInterval(function() {
var currentDate = new Date();
var endingDate = new Date("July 25, 2016 10:51:00");
function count() {
setInterval(function() {
check();
}, 1000);
}
function hide() {
$('#time').hide();
}
fu...
Thank you very much for taking the time to help me out. All your points make sense and I understand why you should do it the way you say. — Robin35 mins ago
@uoɥʇʎPʎzɐɹC That took an hour or so to write. And it's going to save the OP months, maybe years of mistakes I learnt the hard way. Well worth the wait.
The .mo files from my project are not tracked by git (like some other .txt files that need to be created at install time).
I have written a small function in setup.py to create them at install time, that I call in setup():
setup(
.
.
.
data_files=create_extra_files(),
includ...
EdgeCase
Flies at full speed away from the sun towards the edge of the map! When it finds itself pointed towards the sun it will start shooting while turning itself away to get back to the edge. It also enters hyperspace when it's about to hit the sun.
function EdgeCase_setup(team) {
var botV...
I wrote a bot for a Programming Puzzles & Code Gold King of the Hill type of challenge called "Spacewar!". The challenge was written by @El'endiaStarman. The bot is called "Spy".
The controller is hosted here, so take a look for the feel. The API is a bit long, so here's a link.
The bot's logi...
// Get our ship's position
var rotation, x, y, opponentAlive;
if(botVars.color == "red") {
rotation = gameInfo.red_rot;
x = gameInfo.red_x;
y = gameInfo.red_y;
opponentAlive = gameInfo.blue_alive;
}
else if(botVars.color == "blue") {
rotation = gameInfo.blue_rot;
x = gameInfo.blue_x;
y = gameInfo.blue_y;
opponentAlive = gameInfo.red_alive;
}
// Calculate our rotation compared to the sun in degrees
var sunX = gameInfo.sun_x,
sunY = gameInfo.sun_y,
When you use code from StackExchange, like from this answer to the PPCG challenge, you should at the very least add a comment referencing the original source.
@EBrown I was against it at first, but the reasoning behind it is sound. I don't know how much you guys were planning on a discussion. Just saying that it makes sense to have a place dedicated to idle completely CR irrelevant things.
I have this SELECT statement that inserts into a temp table and it is slow! Right now it takes ~1500 ms to run and only deals with ~7000 rows. As the data grows larger the longer it will take.
Some additional information that may be helpful, I am using SQL server 2014.
Is there anyway to impr...
Iron's cookie and session middleware projects seem to be abandoned. I've put together implementations for them, along with a session flash provider. They seem to be working fine. They are all very small, so I'll paste them in their entirety below (each file is linked to a Github repo and each rep...
Hi everyone, is there a C expert that would like to check my last comment on https://codereview.stackexchange.com/questions/135181/feedback-for-a-new-malloc-implementation
@JoeWallis I wrote a short story in which I named the main character "Ju" and I was asked if that was some sort of religious/racial reference. It was easier just to change the character's name.
// try to acquire a page and fit as many slabs as possible in
char* const mem = (char*)ak_os_alloc(NPAGES * AKMALLOC_DEFAULT_PAGE_SIZE);
{// return if no mem
if (ak_unlikely(!mem)) { return AK_NULLPTR; }
}
Why does that 2nd comment not have it's own line. Why is there a function called ak_unlikely in the first place. Why is the whitespace so random.