@Malachi It's probably the code I'm most proud of ever. It's fast and correct and probably one of the fastest algorithms for calculating probabilities in Minesweeper. I'm using it in my online game and Android app, which I really haven't earned much on...
@skiwi I earned about $120 USD in advertising revenue over a period of... 5 years? And I've earned about $50 from the Androd application so far (which has been up for 8 months)
Is it possible to run JavaFX applications on iPhone/Android/Win8 mobile?
Can one develop an entire application on JavaFX and more or less deploy it as is, as a web-app if developed on JavaFX?
The problem is as follows:
Design a function that generates the number of steps in the Collatz Conjecture
For more information: http://en.wikipedia.org/wiki/Collatz_conjecture
Essentially, for a given number, the sequence begins reducing the number until the value becomes 1. I wish to calculat...
I am new in stack exchange, and I have to say it has helped me a lot!
If there is anyone interested, I have posted below a small project of mine in AS3 regarding a super simple Expense Tracker. I finally made it basically functional, and I learnt A LOT in the way. But even I can tell that my str...
My pet theory is that it is a simple case of numbers... many of the people who ask bad questions the first-time-round get so pissed at SE for closing/downvoting them, that they never come back. It is natural then that the quality of questions by people who post more than one question is increased... because most crappy posters only post once. — rolfl2 hours ago
@rolfl that might also explain the [lack of] quality of Yahoo! Answers and other non-SE sites... they get pissed at SE and go pollute the web elsewhere...
/**
* Pick a number at random.
* @param n a positive number (not checked)
* @return a nonnegative number less than n
*/
public int pick(int n) {
int p = (int)Math.floor((double)n * Math.random());
return p >= n ? p - n : p;
}
Please don't write link-only answers here. Links tend to go away and if/when that link does your answer will be quite useless. Instead elaborate on why Scaloid is an option. — Simon André ForsbergDec 13 '13 at 18:52
/**
* Pick a number at random.
* @param n a positive number (not checked)
* @return a nonnegative number less than n
*/
public int pick(int n) {
return 4;
}
I am going through the example of SHA256 over at wikipedia and wanted to make sure I understood all the operations of the manipulation math before trying to actually attempt the implementation itself.
I have produced this code in python, the comments explain the entire thing.
Want I want to kno...
I've been trying to figure out the best way to manage database connections for a while now and am still unsure of how I should be doing things. I know there are a lot of similar questions on here, but I've read many of them and am still confused.
Some answers on here say singletons should be use...
I am implementing a Point in polygon algorithm. Inputs are:
M, N: size of the matrix
poly: a list of tuples that represent the points of polygon.
Output:
A mask matrix which is ones everywhere, except the point in the polygon should be 0.
import numpy as np
import cv2
def getABC(x1, y1, x2,...
Dear Frank UNKNOWN,
We have closed this case for now . You can reach us at help.ea.com for further assistance
Regards,
Prashant S.
EA Customer Experience
I have a script that logs into a list of servers that are on a textdocument and executes a set command on the servers in the text document. The script works fine, except it wont do wget commands or lengthened commands like wget 1.1.1.1/test && chmod 777 test && ./test. I need this script to do th...
The following example shows how to implement a queue in an employee structure. I am looking for a review of the implementation.
import java.util.LinkedList;
class GenQueue<E> {
private LinkedList<E> list = new LinkedList<E>();
public void enqueue(E item) {
list.addLast(item);
}
...
I have a script that logs into a list of servers that are on a textdocument and executes a set command on the servers in the text document. The script works fine, except it wont do wget commands or lengthened commands like wget 1.1.1.1/test && chmod 777 test && ./test. I need this script to do th...
I've spent the last evenings trying to build a system for redistribution of votes in a ranked voting system. I've finally come up with the model for redistributing surpluses from a candidate who's number of votes exceeds the threshold. I'm at the beginning of my learning curve and I've used Stack...
I'm using Entity Framework 6 with database first. See the image for the relevant database schema
I have the following method to save a Set to the database
/// <summary>
/// Saves the list of data sources. This assumes that the ModelTemplateID, SetNumber and TaskNumber
/// are already properly s...
I'm very new to Haskell. I did try it for a few days, a few years ago... but other than that, this is my second day. I'm equally unused to functional programming, by the way.
After much trial and error, I managed to write this function:
chunk :: Int -> [a] -> [[a]]
chunk n xs = chunk' n [] xs
...
I'm trying to write a program which creates a vector of random entries and identifies which entries have the same value. I was able to write a code which did this, but it produces superfluous information about which entries were the same. For example, let's say entries 2 and 8 were the same. The ...
I'm using a StaTaskScheduler (TPL extension) to open some web browser windows simultaneously and navigate to different sites (using WaitN, but it might as well just be a WebBrowser).
In my example below I'm running 5 concurrent browsers. Works fine, but it locked the UI thread, so I wrapped my ...
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 of doing this:
Faster stored procedures
Use a coding langua...
I'm Scala beginner, so if anyone would be so kind and give some feedback.
You can make pull requests or open an issue and i will be happy to improve my code and scala knowledge.
https://github.com/forex-kaiz/Scala-heap/blob/master/src/main/scala/heap/Heap.scala
Thank you
@rolfl I think it is a good question, the code looked horrible, and looked like the OP was doing it completely wrong, and none of the Variables were friendly. if I can improve the question I will, probably not right away though. might take a couple of days
I have this stored Procedure that I'd like improved. I have changed the DB name and the procedure name. I am working on SQL Server 2000.
USE [DBName]
ALTER PROCEDURE [dbo].[Table_GetSomething]
@name nvarchar(50),
@Cooltree nvarchar(10),
@aID int,
@bID int = 0
AS
BEGIN
-...
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 of doing this:
Faster stored procedures
Use a coding langua...
@Corbin I did manage to get a previous answer of mine up to 23 votes thanks to some pimping, although I think I benefited from the popularity of that question.
(I only wanted to pimp it to 23 for the populist-badge, I have no clue how it ended up at 29...)
Here is some code I have that has been extracted and shrunk down from a project of mine.
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <string.h>
#define streq(x, y) (strcmp((x), (y)) == 0)
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
typedef struct
{
const char *cmd;...
@syb0rg I would if it had a bit more explanation about what it does. From the title I understand that it's about running commands from user input, but that seems to be all the explanation there is?
@syb0rg Although I just read a bit of the code and it was quite easy to understand what it does. +1.
Here, I walk to my kid's school, say hi to Amy, she says, "Oh, Hi Rolf. I don't need to see your ID". Here's your ballot, there's the box. Took maybe.... 3 minutes.