Dropping the site design change from the graduation package is understandable. It is obviously a large amount of effort to draft, consult, and implement a design. I agree that lack of a site design is a poor excuse for holding back the growth of a site. I've lobbied hard for this proposal for ...
@RomanPushkin Thanks for stopping by. Actually, I suspect that you already know the answer to the best-practices question: don't patch Object.prototype, it's a bad idea.
I've built a simple decorator that wraps a function in a general Pygame game loop. It also allows for the programmer to set the tick rate.
import pygame
import sys
pygame.init()
def game_loop(tick_rate=60):
"""
This simple decorator wraps functions
with a pygame game loop. Here's...
I've built a simple decorator that wraps a function in a general Pygame game loop. It also allows for the programmer to set the tick rate.
import pygame
import sys
pygame.init()
def game_loop(tick_rate=60):
"""
This simple decorator wraps functions
with a pygame game loop. Here's...
I'm creating a Javascript app for a esoteric language, Marbelous. One of the features of this language are the devices. Each cell has a device, and each device has certain properties.
In order to represent this, I've created a massive object (or in my mind: HashMap) to store all of this data. ...
OK, this makes more sense. See my answer. Your Java is far from nice, if you're interested in making the code better, post it on code review. Please, clean it up a bit first. — maaartinus49 secs ago
This code allows me to compare two complex objects, which are stored in a relational database, to see what has been removed from the objects. These objects have a unique integer primary key. They are also composed of other objects hierarchically.
The Difference method is used within a databas...
public static void reversePrint(Node head)
{
// base case is reached
if(head == null)
{
return;
}
else
{
// reversePrint keeps getting called until it reaches base case.
reversePrint(head.getNext());
// Execute this code right af...
I have recently started researching some computer vision, and in the process of discovering some interesting things I have been compiling some functions that allow me to manipulate images at a low level. I am not interested in replacing any of these functions with already existing, build-in funct...
I am currently trying to learn Lambdas and following the book Java SE8 for the really Impatient and just finished Chapter 1 of it. This is the question, I am trying to get done with:
Didn’t you always hate it that you had to deal with checked exceptions
in a Runnable ? Write a method unchec...
The short answer is that traditionally, graduated sites pretend that beta sites don't officially exist. Therefore, the Stack Overflow Help Center doesn't mention Code Review and Code Golf. I don't know whether that is a hard rule. As Code Review becomes resigned to its perpetually graduated-bu...
I wrote this program where you can input x amount of words that of length x that checks if the grid formed is the same words vertically as they are horizontally i.e.
F I L E
I C E D
L E A D
E D D Y
I wrote this program
import sys
import itertools
numWords = int(raw_input('Enter Number of Word...
Welcome to Code Review. This code is not working as intended, and is not ready for review. However, if I may offer a slight hint: increase your div#header{ height:22px } a bit... — Phrancis20 secs ago
Please tell me how to assign a range of values of a cell in an empty column based on the value of the adjacent sum in the other column. I'm ultimately trying to create a heat map based on the results.
I propose that custom close reasons that contain the phrase "because it belongs on" be blacklisted. That phrase is a pretty reliable indicator that the custom close reason is in violation of the policy.
I have written a multi-platform LLDP Packetsniffer in python. It works fine and does what its supposed to do. It primarily collects a list of network interfaces, and depending on the platform creates a rawsocket(Linux), or calls snoop (Solaris 10/11), or TCPDUMP (AIX) and sniffs for LLDP traffic ...
Last month's announcement about our updated criteria for graduation and site closure sparked some solid examination into the intended nature of public beta and graduation.
One thing these discussions showed us is that, contrary to what the Community Team had long believed, getting a custom desig...
I am currently preparing for my exam and I am trying to implement some abstract data types with linked lists as preparation for the exam. I found an older exam from my prof. and he wants us to implement an ADT stack with an inner class ListElement.
He has given us the interface, so it doesn't ne...
I know that in answer, you are not allowed to ask:
How do I implement X?
However, in an answer, can you suggest implementations and provide code for them?
Your code is nice, but it could really use X:
My scenario:
Recently, I wrote an answer for a linked list question and, towards ...
@nhgrif I haven't forgot the Concordance challenge you gave me a while back, that's what I'm thinking about right now
So I have this regex /([A-Za-z]?\-?[A-Za-z])+/g which matches complete words, including hyphenated-words all into separate strings of characters. What I'd like to do is exactly reverse it, so it omits all complete words and selects everything else (punctuation, spaces, etc.). I tried adding ^s is various places with no success
So I could write a sort of utility function what matches the characters, and then just use a not operator on it in the programming language to select everything else then?
What does "Losing the BETA" do to a site's activity?
It is hard to anticipate the impact of the "graduation" process. The following is a SEDE query that shows the graduation impact on all the sites I am aware of that have graduated in the past 2 years or so (using this SEDE query to identify ele...
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancisjust now
I'm having to dabble with caching and multithreading (thread per request), and I am absolute beginner in that area, so any help would be appreciated
My project requirements are:
Cache one single large object that has ether interval refresh or refresh from user
Because retrieving object data is...
void chrrem (char arr[], size_t len, size_t pos)
{
memmove(arr + pos, arr + (pos + 1), (len - pos) + 1);
}
It is supposed to be just fast.
Erases the character pointed by pos (starting from 0)
What is your question? I read your question. Looks nice to have a trait that is extended by both an object and a class. You never ask anything. You mentioned that you couldn't find a solution that looks "neater". Would your concern maybe be better served at codereview.stackexchange.com ? — Madoc7 secs ago
@Madoc: Hypothetical code is off-topic on Code Review. — Jamal20 secs ago
import java.util.*;
import java.util.regex.*;
class Main {
public static void main(String[] args) {
String greenEggs = "I like green eggs and ham! " +
"I do! I like them, Sam-I-am! " +
"And I would eat them in a boat! " +
"And I would eat them with a goat... " +
"And I will eat them in the rain. " +
"And in the dark. And on a train. " +
"And in a car. And in a tree. " +
"They are so good so good you see! " +
^^ Fun!
Now, I just need to figure out how to print the index with it -_-
My program uses a pointer-based linked list. It opens a text file, add/delete's the content as specified to the linked list.
The program runs on Netbeans (MAC OS X). But when I run the program on Linux (RHEL 6.5), I get a segmentation fault.
I ran gdb and got the error in main (commented in the...
You need to make sure your questions are on topic at codereview.SE, our code must be working. But before going there, your question here is off-topic, take a look at the help center to see what type of questions you can ask — vihan10865 secs ago
I am trying to solve JanuszInTheCasino problem (http://community.topcoder.com/stat?c=problem_statement&pm=13349&rd=16277&rm=&cr=23006590) and one of the test cases (test_one) fails. I can't figure out the problem. Any ideas?
Here is the code:
import java.util.Map;
import static com.google.comm...
I'm very new to the world of Javascript/jQuery.
I used the JS library here and there, but I never really wrote a lot of JS code before. I've been learning a lot it myself via online, and here (StackOverflow.)
I need someone to take a look over my code to :
help me improve it
help me avoid DRY...
It's my code:
#include <iostream>
#include <math.h>
#define _USE_MATH_DEFINES
using namespace std;
int main (void)
{
long double e=exp(1);
long double c=sqrt(163);
long double p=M_PI;
long double x=pow(e,c*p);
cout.precision(150);
cout<<"e="<<e<<"\n"<<"pi="<<p<<"\n"<<"sqrt(163)="<<c<<"\n"<<"...
I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information. — Quill15 secs ago
Thoughts on this question? 2 Close Votes for stub code, but, it's not stub code. At best, missing code.
I'm not entirely sure this belongs on StackOverflow (maybe consider CodeReview). There is likely a very good reason why Singleton isn't implemented as part of .NET (but I can't tell you why), though I have also implemented a thread safe generic singleton class. Personally I think you could get away with just Singleton<T> as I think the remainder of the implementation (TClass) is overkill. Guessing Jon Skeet will be able to shed some light on this topic. In the mean time, check this out from his book: csharpindepth.com/articles/general/singleton.aspx — series0ne40 secs ago
@Hosch250 I think so too, I don't think it deserves close votes, constructuve comments about including implementation in order to get the best review possible sound better
So I just rolled back that question, I want to leave a useful comment though. Any meta posts/other resources that I can point to for guidelines on what make acceptable edits?
void chrrem (char arr[], size_t len, size_t pos)
{
memmove(arr + pos, arr + (pos + 1), (len - pos) + 1);
}
It is supposed to be just fast.
Erases the character pointed by pos (starting from 0)
Note that this function works with a statically allocated array like so:
char arr [256] = "My...