Top new questions this week:
|
I have written some jQuery code for AJAX form submission:
jQuery(function() {
jQuery('#message').click(function() {
var btn = jQuery(this)
var Name = jQuery("#Name").val();
…
|
What I'm trying to do is very straightforward and easy, but I am wondering whether there is a more elegant solution.
Basically I have a game and I want the difficulty to increase the moment the …
|
Description
To increase the awareness of my previous brainfuck question, not only is there a bounty on it (Thanks, Mat's Mug) but here's also a brainfuck interpreter.
This is written with Java 8
…
|
String.prototype.replaceAll = function(find, replace) {
if (typeof find == 'string') return this.split(find).join(replace);
var t = this, i, j;
while (typeof(i = find.shift()) == 'string' …
|
Please visit the http://en.wikipedia.org/wiki/Dining_philosophers_problem for algorithm discussion.
I have written below java program to solve this problem by Arbitrator solution algorithm mentioned …
|
My method for counting neighbors in my soon-to-be Game of Life implementation is very repetitive and I was wondering if this could be done more elegantly:
static int countNeighbours(Board b, int x, …
|
Mostly due to readability, I am using the following code to
find a specific csv file on a drive
read that CSV file using a streamReader
parse it into a List<string[]> to be able to use LINQ …
|
Greatest hits from previous weeks:
|
I want to search through an array of n numbers and find the numbers that are repeated. So far I have this code, which does the job, but I find it to be a rather cumbersome method, but I can't seem to …
|
I've been practicing implementing a linked list from scratch. Can someone help review my code?
class Node {
Node next;
int num;
public Node(int val) {
num = val;
next = …
|
Can you answer these?
|
I want to verify that a given directed graph is connected and acyclic (DAG). I have implemented a modification of the Tarjan's strongly connected components algorithm in imperative style (as the …
|
First: I have many model classes that are mapped from/to tables using EF. Two of them are User and UserCookie, which are stored in tables Users and UserCookies.
public class User
{
public long …
|
Background
I'm using Lua with luaglut to do some OpenGL stuff. The luaglut API is almost identical to the gl/glut C APIs. Sometimes, gl functions want a pointer to some data, for example:
…
|