Does this Playing "craps" for the win seem like the user is just milking one question for rep? I don't meant to be biased, but it's 3 versions of the question in one single afternoon...
Right, @mjolka / @all. I have edited the results in to the question. I like all the top-3 ads (and most of the others too). There are some decisions to make though.... like how far do we push them, and which ones go where.
Back in April we got together and put together a shortlist of community ads that can be posted to other graduated sites. That was a very successful campaign with probably a thousand or two "click throughs" to Code Review.
Let's reboot the process and roll the ads out again!
Results
The followi...
Could you please accept an answer before asking for an iterative review ? You can accept an answer by clicking the tick mark near the answer that was most helpful to you. — JaDogg1 min ago
It's the time of the year again, namely it is December 2013, and so we shall now refresh our Community Promotion Ads for the new year.
What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purp...
Yesterday and today I've been working on an auto-update system for a game project. I've just pushed the server-side script to the server, and it seems to work great. Since this is public-facing code, though, I certainly wouldn't mind a few more eyes on it before I actually deploy it and changes g...
As much as I like the Jon Skeet one, I don't think it would get much traction on less code-intense sites. Programmers, probably good. I initially thought SO was included...
does anyone know why this doesnt work "http://stack2rss.quickmediasolutions.com/2.2/users/99734/answers?site=codereview" ? It should create an rss for rolfls reviews
Seems like a number of available websites for ads are not really dealing with code... those that (I think) do mostly: Game devs, DBA, Programmers, Webmasters.
Experiments on Programmers Community ads. Now it's time for my dinner.
@JaDogg Guy got decent rep from the first one, and he's learning stuff still, I see it as being OK. He was pointed to the iterative review post, and is working the system.
It would be useful if you could add to your description the most significant changes you have made, and why they make a difference. Also, identify if there are things you specifically did not do, and why you did not do them. This will help people in the iterative review process to identify what is important, and not feel like it's doing the same thing again, and again.... — rolfl ♦12 secs ago
The short answer is, no, this is not too little code to "extract" into a super class.
If you intend for this bit of code to always be the same throughout every use of this class and its subclasses, then it's absolutely appropriate to put the code in the superclass. The primary point is, here, i...
I'm torn. I'm somewhat tempted to VTC this question
I am going through coding challenges and I would like to get feedback on one of them.
I am not sure if i can post the link to the challenge but here it is. CodeEval Challenge
Outside of your window, there's a wire between two
buildings. Bats love to hang there but you notice they never ha...
I haven't run it... but for now, I'll assume it worked if I copy&paste and run it.
The problem is, he hard-coded one of the sample inputs and then coded it assuming every input would match the sample input. It depends on a string in a particular format (three numbers with a space between each)
Yet some of the given sample inputs have 4 numbers with a space between each, for which if we changed nothing but the hard-coded input, he'd produce an incorrect result.
Nevermind, reread problem statement... I think the other inputs might work.
I like community-ads. They have the word community in them, and I find it's a great way of making the "bigger brother" graduated sites give some visibility to beta sites.
On graduated sites, anyone with an account can post any ad on the community-ads meta post, and if/when they get 6 votes, they...
You posted this question with the objective-c tag, and made this comment:
I had to convert the method to C to get it passed through the automated system.
As such, I'm going to assume you're perhaps more interested in a review of the Objective-C stuff, so that's what this'll be. (Essential...
I am trying to use this program for a project for school. I try this code and it gives me a Traceback (most recent call last):
File "python", line 6, in <module>
TypeError: 'str' object is not callable
print "Welcome to my calculator!"
Sym = raw_input("1 = addition 2 = subtraction 3 = multiply...
The getline(cin, s1) function is not prompting me to input a string. it appears as if it is being skipped over even when the if condition is being met. any help? code is below. the problem is in the first if statement.
//Exercise 3.2
#include "stdafx.h"
#include <iostream>
#include <string>
us...
I have a really basic image carousel that I just wrote.
Basically I'm trying to keep it as small and light weight as possible, but I get the feeling that I've gotten way off the beaten path of how these things normally work.
function hide(element, index, array) {
if (index > 0) {
sli...
Most of the current answers assume that you're very set on the characteristics of the planet and offer suggestions on what sort of ship and what sort of scenario would be necessary to recover what bits.
But you state:
The planet has only a very thin atmosphere, so one can assume that the spa...
I came across once-only lisp macro, yet another implementation today, in which the OP is following up on a previous question whereby OP had improved some code, presumably fixing it.
I tried implementing my own macro for the same purpose earlier, but it had a bug, as pointed out at once-only l...
This review is in continuation with Part I mentioned in query.
As part of the assignment given in Part II from this link, here is the solution:
Ocean
/* Ocean.java */
package Project1;
/**
* The Ocean class defines an object that models an ocean full of sharks and
* fish.
* @author mohet0...
Here's some simple code that demonstrates what I'm trying to do
myVar = 1
reader = () ->
getDataFromServer1().then ->
# reads myVar and does stuff according to its value
# returns promise
writer = () ->
getDataFromServer2().then ->
# changes the value of myVar
...
This is my first cut at separating the data access layer out of my very old spaghetti codebase.
I have tried to keep this a simple as possible , it is for a small project, so I am not really interested in learning spring or hibernate or other framework, and I don't mind writing a bit of sql.
I...
The team in my new company does NOT have code review process but I came from companies with code review as a must culture. So, I don't even feel comfortable committing my code without having it reviewed by someone. I'm a firm believer who thinks code review is a way to improve quality and a way t...
Problem Statement:
Create a class diagram and Java code for the following system and
scenario, taking into account the possibility of future extensions.
"The system is a command line utility that prints a short 'quote of
the day' on the user's terminal when run. To begin with the quot...
I want to learn Haskell and figured the best way to do it is to write a simple TicTacToe implementation. However the result feels very unelegant and I think it might be the best playground for your rants and give me an opportunity to learn some lessons.
Here it is
{-|
TODO: -filter symmetric st...
I'm just stuck on some logic statements. specifically the ones that are in the function char GetInteger() so how would I only allow 3 values to cause the loop to exit. basically I only want the variables 0-2 to allow the program to exit the looping char GetInteger() function.
char GetInteger( /*...
Currently I'm overriding create and write to copy the fields onto the partner, is there a cleaner way of updating the partner on save?
@api.multi
def create(self, vals):
if vals.get('allergy_ids'):
self.add_partner_allergies(vals.get('allergy_ids')[0][2],
...
I am trying to implement the Dijkstra algorithm in c++ code that find the shortest for the graph from a text file. The text file contain a matrix that represent a directed graph. Dijkstra algorithm find the shortest path from the source vertex to every other vertices. What i am trying to do in th...
i am using an MVC frame work however i have also in alot of cases just made a function static and opted to call it directly from the View instead of going through the controller
For example
<select name="Athing">
<?php
foreach (Classs::Function($Variable) as $a) {
...
I have an interface IFilter and more types of filters: Filter1, Filter2, Filter3; that I want to call one after the other and the result of one is empty, then I want to stop the process. For this I have thought of:
class FiltersSequence
{
private:
std::vector< IFilter > m_filters;
public:
...
> Kieran Senior [Atlassian]Apr 16, 2013 We don't want to run SourceTree to only be on Windows. SourceTree is for both the Mac and Windows (and for the last few years has been a Mac-only application). The Mac and Windows development streams are different. The Mac version is written in Objective-C and the Windows version in C#. We targeted the platforms specifically for the best possible experience by leveraging the platform-specific features.
We don't have any immediate plans for Linux, but that could change, just as it did for Windows. Right now we're focussing on making the Mac and Window…
I have completed working on my own pure JavaScript Slider library and would like to get some input from other developers. I would like to know how you would improve the code in any way.
JSFiddle here: http://jsfiddle.net/stayko88/knxt31vx/1/
Thanks
I have completed working on my own pure JavaScript Slider library and would like to get some input from other developers. I would like to know how you would improve the code in any way.
( function( window, undefined ) {
function Slider(el, opts) {
/**************
GLOBAL VARS
***************/...
I using a java to modify remote files in different machine by ssh.
At the same time, only one thread is allowed to modify the file in one machine.
I implement the logic like this:
public boolean executeCmd(String ip, String command, String file) throws Exception
{
final String file = ip +...
In my application, we have a number of pages which provide an advanced search capability, with a large number of potential search options (some pages have as few as 3, some as many as 150).
The HTML for the page is generated with a standard .aspx page, and the search criteria themselves are stor...
I will like to improve my codes in Java like creating simulations and games, will need all the help I can get and textbooks to help, will appreciate every suggestion in code improvement. This is a problem solving code so far in interest and percentage calculations.
import javax.swing.JOptionPane...
Can the JVM perform runtime optimization in the following scenario?
We've got the following situation, we have this interface:
public interface ECSResource {
default int getFor(final Entity entity) {
return ResourceRetriever.forResource(this).getFor(entity);
}
}
And a concrete...
I have a data set returned from an SQL database contained below, as you can see all data remains the same apart from one property, "name_alt".
[{
"language_id": "tly",
"language_name": "Talysh",
"speakers_native": 800000,
"total_speakers": 912000,
"name_alt": "Taleshi",
...
I have a NodeJS stream.Readable, ArticleReader. It's job is to read articles, Meantime I have to give it a date to signify the date of the articles, say the default date is today, now I start reading with .on('data') event, and the stream ends. Later I want to change the date and start reading ye...
These problems are part of technical interview I was not officially asked to solve, just wanted to polish and test my skills. Upon submit, I am receiving automated responses stating that answer is wrong on second/third set of testing data. I did test it myself and by now I'm out of ideas for tric...
Is it good to have this:
if(someReally.long().functionCall().equals(something.else())) {
some_button.setEnabled(true);
}
else {
some_button.setEnabled(false);
}
or this:
some_button.setEnabled(someReally.long().functionCall().equals(something.else()));
I figured out how I am going to do the if exists thing. I am going to fill a dataset from a query and if it is empty then the boolean will be false. I don't know what I was thinking yesterday....
Can the JVM perform runtime optimization in the following scenario?
We've got the following situation, we have this interface:
public interface ECSResource {
default int getFor(final Entity entity) {
return ResourceRetriever.forResource(this).getFor(entity);
}
}
And a concrete...
I would be positive, but I don't think it really matters; Even if it doesn't, the performance wouldn't be too bad. After a hit or two from Map.get(), it lands on the fastpath.
The problem is that the way that List<T> detects modifications is by keeping a version field, of type int, incrementing it on each modification. Therefore, if you've made exactly some multiple of 232 modifications to the list between iterations, it will render those modifications invisible as far...
I write a function called 'wrap' that takes two arguments, $string and $length. The function should return the string, but with new lines ("\n") added to ensure that no line is longer than $length characters.
Always wrap at word boundaries if possible, only break a word if it is longer than $len...
I'm using the script below to import a large csv file to my database.
If the table is empty the process takes about 5 minutes to finish on a local machine.
If I'm using the file to update existing values on the same table it takes more than 15 minutes to finish.
My csv file contains about 35,0...
I tried to turn this into LINQ but I am so Noobish when it comes to anything LINQ and could not figure it out.
string BarQuery = "SELECT BarNum FROM Justice.dbo.Atty WHERE BarNum = @SuggestedBarNumber";
using (SqlConnection conn1 = new SqlConnection(ConfigurationManager.AppSettings["AttorneyEve...
I managed to reimplement a pseudo-code gray code addition algorithm in C++ but it does not aways work. Now I will have to check whether the fault comes from my code or from the original algorithm -_____-
I write a fair amount of linq in my day to day life, but mostly simple statements. I have noticed that when using where clauses, there are many ways to write them and each have the same results as far as I can tell. For example;
from x in Collection
where x.Age == 10
where x.Name == "Fido"...
I came up with this tsql:
DECLARE @TimeWindowInSeconds INT
SET @TimeWindowInSeconds = 10
IF OBJECT_ID('tempdb..#Temp') IS NOT NULL
DROP TABLE #Temp
CREATE TABLE #Temp
(
Class INT,
DT DateTime
)
INSERT INTO #Temp (Class, DT)
SELECT 1, '2014-11-05 10:55:00'
UNION ALL...
@Donald.McLean Ah I did not realize that "Bienvenue" was mostly a Canada thing, but indeed I have heard most of those forms used in varying degrees of formality, except for c'est moi qui vous remercie (or just c'est moi) - no, thank you (literally, "it is I who thanks you") that one seems pretty uncommon
@Phrancis I talked to multiple Frenchies at a party and none of them would have said Je vous en prie instead of De rien. I don't trust whoever wrote that article
In Flemish we also say Da's niets (That's nothing) and the Spanish have their De nada
Flemish and Spanish are closer to French than English is, after all.
@Malachi: I'm not familiar with DataContext in particular. Perhaps it's GetTable<>() as this sample indicates?
def factorial(t,n):
if n == 1 : return t
else: x = (t * (n-1))
n = n-1
return factorial(x,n)
print factorial(6,6)
I cant seem to figure out a way to just stick to requiring one parameter input while keeping the program small.. Also I want the function to remain recursive (...
I wrote an application which runs correctly, but I just want to have some feedback on it. Is there something unnecessary, or could there be something more pythonic or did I write some code which django could cover in particular cases ?
This is my views.py
from program.models import contract, ce...
I don't know DataContext exactly but this is how DbContext (EF) works:
please hold
You subclass it and expose the tables you want. And you create specific mapping rules in OnModelCreating, separate EntityTypeConfiguration<T> subclasses or by using annotations
sounds like more work than what I am doing to begin with, I thought it was going to be easier to use, but it seems like I need to create all sorts of stuff to make it work, and do way more work.
Meh, it might look a little daunting but once you added a reference to Entity Framework and subclassed DbContext, entered 2 commands for Migrations, you've already got your entire database structure setup
It really is worth the time to use EF and configure it properly.
Unless you have a simple ToDo app of course. But as soon as you're looking towards a few tables and a few interweaved models, I'd think about EF
I think I need to find a book on EF after I finish reading through my C# book again, and then read through ASP.NET 3.5 (because that is what I have) and then find myself a ASP.NET MVC book
Hmmm... grumpy munky today.... Must be the weather.
Maybe it was this:
> I didn't find this very helpful as I've made it clear this is for an assignment which dictates the numerical method to use and you appear to have used a different method.