Top new questions this week:
|
I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long.
Is there a better way to do …
|
I'm new to Python (and generally to programming), and I have recently written this Minesweeper game:
import random
import string
import os
class Square(object):
"""Represent a square in the cell.
…
|
I have written two code pieces of to find if a given string is a palindrome:
public static bool FirstMethod(string str)
{
int i = 0;
int j = str.Length - 1;
while (i<j)
{
…
|
I have been wanting to learn programming for some time now and decided to really give it a shot today. I have edited and read lots of things in Java to fix small issues but never written from scratch. …
|
I am trying to learn PHP in depth by creating this personal CMS. I try to utilize OOP concepts and do best I can...
The way I am trying to design this CMS is to keep including 'modules' within a page …
|
I have this Objective-C code for use in an iOS app that makes a 'bar' on the screen, with a red exclamation mark that flashes in it at random places.
Here's what it looks like:
Header file:
…
|
I've decided that I want to take a stab at test first programming. So, before I tackled writing an isPrime function, I wrote this unit test. It's my first and I'm not sure I'm doing this right.
I was …
|
Greatest hits from previous weeks:
|
is there a more elegant way to solve this problem?
List<String> paramList = new ArrayList<String>( );
paramList.add( "param1" );
paramList.add( "param2" );
StringBuilder result = new …
|
I made a program in Python and wanted it to be faster, so I wrote it on C# because it's compiled. To my surprise, the Python program is much faster. I guess there is something wrong with my C# code, …
|
Can you answer these?
|
I've translated this Java code into Delphi code:
unit Trampoline;
interface
type
ITrampoline<T> = interface
function Get: T;
function Run: ITrampoline<T>;
function …
|
Here is a C++ wrapper for SAFEARRAY, including the ability to expose it as a VARIANT, and to create one out of VARIANT.
I am aware of CComSafeArray, however i don't use VC++ so I do not have …
|
The previous version is here. This version takes suggestions from that review into account:
brainfuck is now an object instead of a function, and brainfuck.run(source) kicks off the interpreter.
…
|