Was going to say you can have your birthday back, but apparently you can't
Thank you so much! I was stuck for a long time and you have made it so clear. Thank you for taking the time to educate a newbie, such as myself. — Simon11 mins ago
Things that could be improved:
Portability:
Every time you add an #import to the top of your C file, you potentially create a dependency. This is especially true for your game.
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include <ctype.h>
#...
Also, this comment needs upvoting:
@DaviddCeFreitas Where do you get that idea from? We only review working code over on Code Review. Please read the guidelines of what questions are on topic for a site before you recommend them. — syb0rg20 secs ago
I have wrote this class that will write JTable to a tab delimited file so that it can be opened in Excel. It works great but is there any way to make it better or is there a way to have it directly open in Excel without having to go through the import screens all of the time?
Question: How can ...
In most examples ListView routine is pretty simple:
Adapter keeps a list of models
In getView() method, it binds
model's property to row's subviews
There's no controller-object which is binding model's properties to views.
It works well for simple cases, but what if model are relatively co...
Given a number, this program would find "all permutations of the pairs that add to squares" from 1 to
number.
Eg: Given input a number 16, one of the possible answers would be:
8:1:15:10:6:3:13:12:4:5:11:14:2:7:9:16 and its reverse
Note that the function called hasIntegerRoot has be...
I'm looking for a design pattern or suggestions that can help refactor my code into something a bit less repetitive. I have a method that has several sequential steps (10-15) that if any of them fail must record detail about the failure to a log and rollback all previous portions of the transacti...
I have written the following Google Spreadsheet script that attempts to loop through all selected cells and then update the value so that it adds an indent, by adding =CONCAT(REPT( CHAR( 160 ), 5),"' + value[row] + '") around the value.
However I am hitting an error when processing the loop and ...
OK I have this program and Im having some trouble with it. In the addRows and subtractRows functions, the program freezes and also the sums are not correct. Can any take a look at this and point out my mistakes? thanks.
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <iomanip>...
OK I have this program and Im having some trouble with it. In the addRows and subtractRows functions, the program freezes and also the sums are not correct. Can any take a look at this and point out my mistakes? thanks.
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <iomanip>...
Note that there is a specific Code Review website where you could post such "questions" and get answers on your coding "standard". — Alexis Wilke7 mins ago
I am in the process of learning javascript, and I am exercising some skills I know to improve them. Here is what I want to do:
prompt user to enter username
after that prompt them with a math question
if they get it wrong, run again, do this up to 3 times
if they fail three times, move on to t...
"what is the best library for image rendering in C#?"
Would be a horrible question because it is completely unclear what you're looking for. A particular image rendering library might be perfect for one person's needs and useless to the proverbial next man.
However, if you list the exact f...
I am working on a project in which I have three datacenter (as of now) and each datacenter will have some machines.
So I am storing the input in a Map of String and List of String as shown below.
Map<String, List<String>> boxBallMap = new LinkedHashMap<String, List<String>>();
Data in the abo...
I'm converting a PHP written with a lot of procedural loops to classes. There is a hierarchy of nested information represented in nested associative arrays. The actual records are from currency markets but I'm using car examples here. I'm looking for general suggestions and criticisms as I don't ...
As @dreza mentioned, you might want to move the code around your LINQ-Statements to a method.
public void changeCategoryTo(String newCategory){
var record = (from n in db.Navigation where n.Category == newCategory
&& n.SectionId == SectionID select n).First();
record.Cat...
Write a program in Java that takes a positive integer and prints out all ways to multiply smaller integers
that equal the original number, without repeating sets of factors. In other words, if your output contains 4 * 3,
you should not print out 3 * 4 again as that would be a re...
@Mat'sMug 1K chat messages? Well, I'm not ready yet. My only experience in SE chats in Lounge<C++> which resulted in me watching the 3 seasons of My Little Pony. I can't remember why. That was pretty traumatic.
Here is a Matlab code to solve Laplace 's equation in 1D with Dirichlet's boundary condition u(0)=u(1)=0 using finite difference method
% solve equation -u''(x)=f(x) with the Dirichlet boundary condition
clear all
close all
N=2;
for j=1:10
a=0;
b=1;
N=2*N;
M(j)=N;
delta_x=(b-a)/N;
k=2;
A=spar...
I need an advice for my simple project. It's a logger system. I have the following files/classes
File - check if file exist is readable etc
ConfigParser - it's an abstract class of which I use the __construct method to do some things. The class is never instantiated directly. It's a decorator.
...
How secure is this encryption?
Secondly, is there something I could do to "turn it up a notch" and make it 'more' secure?
Imports System.Security.Cryptography
Public Class clsCrypt
Private TripleDES As New TripleDESCryptoServiceProvider
'create and return the key and initialization vector has...
I am developing a UI Application for a very simple phone app, the UI is based entirely on the state of Call in a container provided to me by a third party library.
Below is a sample Call object that I am working with;
public class Call {
private boolean isTannoyCall;
private long callS...
I need to get an explanation of how this code works (not the algorithm itself).
Any javascript terms that could be applied to any part of this code are highly appreciated.
Isn't that easier to write this program in a different manner?
thank you.
http://jsfiddle.net/7FMD2/3/
Since its edit, this question contains working code. Could anybody help reopening it? http://codereview.stackexchange.com/questions/42848/level-traverse-a-binary-tree
below is my implementation of templated Node and LinkedList classes. I would really appreciate it if someone would give me pointers on what I can improve.
Thank you!
//LinkedList with SumLists()
#include <iostream>
#include <set>
using namespace std;
template<class T>
class Node
{
public:
...
I need to get an explanation of how this code works (not the algorithm itself).
Any javascript terms that could be applied to any part of this code are highly appreciated.
Isn't that easier to write this program in a different manner?
thank you.
http://jsfiddle.net/7FMD2/3/
Looking for something to shoot?
As a 'toy query', I put the above query together....
What badges could be earned if a question, or answer, had just one more vote?
you could make someone happy with a
[badge:Great Question] (never been awarded... yet)
[badge:Reversal]
[badge:Guru]
[badge:Self-...
It's very fast, but I wonder if hooking into the API (DirectX) and getting the buffer will be faster than this (I don't know how to do that, though).
I don't know either.
What you have here, probably hasn't been reviewed yet, because there's essentially nothing blatantly wrong with it.
W...
> There really isn't an axe over your heads even now. You'd have to, like, torch everyone on the site and then set exploding bear traps for new visitors in order to drop things low enough to get you guys in any sort of danger zone. – Grace Note♦ 52 secs ago
I will admit that I don't want to review the whole code; I will just focus on some simple things:
template<class T>
LinkedList<T>& LinkedList<T>::operator=(LinkedList byValList)
{
std::swap(head, byValList.head);
return *this;
}
You are oly swapping head pointers. Ok, your instance wil...
That immature side of me really feels that some of the new questions deserve exploding bear-traps.... and I can say: See, Grace says your grace period is over!
you have a lot of if statements in your SQL, this screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures.
the benefits
faster stored procedures
use an actual coding language to d...
Graduation does five things for you, mechanically speaking.
Reputation privilege tables are changed. That answer really explains it so I don't need to go further. Given the rep distribution at current, this is actually somewhat negative since you have a pretty tiny fraction of 5% that surpasses...
I spent some time last night reviewing this code. Here are some specific suggestions I can make:
Move your game loop into an if name= "main": statement at the bottom of the code. Currently, if the module is imported, the person who imports it will immediately start playing chess, which isn't de...
I'm thinking of extending the current one, to provide a simple socket protocol so that those who would like to make bots to fight against each other can do so.
And I also have to fix my own AIs to make them better.
@ChrisW raises an interesting possibility that there is IO, and a 'winning design'.
This made me think:
If there is a full month for the challenge, maybe an interesting idea would be to define a socket-layer interface and protocol, and then you can connect two solutions to each other and th...
It's good that you don't try to 'poison' yourself. I have 'poisoned' myself a bit, but I still think that my implementation is quite different from others.
Basically I have taken over a project and found a table that has the following video and video title fields in it (why they didn't create a separate linked table is beyond me):
[VIDEOURL]
[VIDEOTITLE]
[COUKVIDEO1URL]
[COUKVIDEO2URL]
[COUKVIDEO3URL]
[COUKVIDEO4URL]
[COUKVIDEO1TITLE]
[COUKVIDEO2TI...
IMO the comment already addresses the issue. But my rejection isn't binding, 2 users must approve/reject an edit. Let's see what other reviewers think :)