To goal is to find a suitable helper function to avoid the repeated code here (this differs a lot from my production code, but the idea is the same):
#include <vector>
struct Object {
int num;
std::vector<int> get(Object*) const;
};
int foo (int a, int b) {return (a+1)*(b-1);}
std::ve...
I am coding a game, and I need to detect the color of a rectangles on a canvas, by moving a character and touching them, so that a message will be displayed "this is magenta" and so on. Please find below the game and my coding, so that you will better understand me:
http://jsfiddle.net/marco105...
are you saying those are the actual names of those things in your actual code file? Like, that's the exact same code that's in your IDE right now? — RubberDuck28 secs ago
If your question is not real code…
Unlike other Stack Exchange sites, which encourage general reference questions and offer broadly applicable answers, Code Review aims to offer customized advice specific to your code. To make that work, we need to see real code.
If your question was asking ...
well the close reason already does, but I suspect nobody bothers clicking those...
@RubberDuck oh and the failing test isn't failing too hard: Assert.AreEqual failed. Expected: <ADODB.Recordset> Actual: <Recordset>
Welcome to Code Review! If you want any code reviewed, you need to post it in your question; external links are acceptable for background code, though. — Hosch2505 mins ago
I implemented a search function like this:
private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight)
{
int position = -1;
foreach (string[] r in SearchKeys.Keys)
{
position++;
foreach (stri...
I implemented a search function like this:
private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight)
{
int position = -1;
foreach (string[] r in SearchKeys.Keys)
{
position++;
foreach (stri...
Previous question
Text-based Tetris game
I don't have Linux terminal to be sure whether or not i have implement Linux's version correctly. hopefully, it's OK.
Summary of improving commends that i have been told to do it.
It become OOP
Naming the classes and its function somehow improved an...
put your cursor on any line of code that closes a scope (the line with the }.), then scroll down so as to make the scope-opening line go up outside the screen - VS displays a tooltip with the scope-opening line in it!
@Hosch250 good call :)
moar is bettah
@RubberDuck haha! "I hate to pick on names" .. +1!
I don't know template yet, and I'm not getting the web tutorials really.
Here, hold on.
I think I'm getting it now.
Let me test a couple things.
OK, I got it now.
I was making a couple mistakes.
Sorry.
So, @Jamal, does this second class essentially take any valid types, such as one of my defined classes, int, string, double..., and the first only take an int, so I'd have to define a billion of them if I wanted to cover every possible class?
class T
{
public:
T(int value) : _value(value) { }
int getValue()
{
return _value;
}
void setValue(int value)
{
_value = value;
}
private:
int _value;
};
template<class T>
class U
{
public:
U(T value) : _value(value) { }
int getValue()
{
return _value;
}
void setValue(int value)
{
_value = value;
}
private:
T _value;
};
whenever I double click MainPage.xaml, this appears:
System.Exception
Package failed updates, dependency or conflict validation.
Windows cannot install package App.a13422230.a7787.a4693.a8583.afc6aa0a7a10c because this package depends on another package that could not be found. This package req...
whenever I double click MainPage.xaml, this appears:
System.Exception
Package failed updates, dependency or conflict validation.
Windows cannot install package App.a13422230.a7787.a4693.a8583.afc6aa0a7a10c because this package depends on another package that could not be found. This package req...
I implemented a search function like this:
private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight)
{
int position = -1;
foreach (string[] r in SearchKeys.Keys)
{
position++;
foreach (stri...
I heard a radio program about this on the BBC. A study on the "brain clock" apparently it varies widely between people, but tends to steer towards being an "earlier" person as age increases
No, I wish I could play an instrument lol. Clumsy fingers won't allow. I mostly produce music for local artists (accompaniments and such) and do a few pop/rap instrumentals now and then