instruction
stringlengths
71
95.1k
This is a rags-to-riches an overdue alternative implementation on my previous question: Let's Break Down the Party This alternative uses the int internal representation suggested by @janos and recursion to arrive at the same results. For starters, here are the changes in Denomination enum to support the internal repres...
I am figuring out how I could make the following query more secure: I have already used mysqli_real_escape_string but I doubt that adds much to security. I have looked into the using prepared statements but I also have to take into account the following line: $check_customer = mysqli_num_rows($run_c); My solution: ...
I've just tried my hand at Quicksort, and I seem to have gotten it working (thanks to Stack Overflow). However, is it "true" Quicksort? And is it decently written? public static void sort(List<Integer> arr, int left, int right) { int i = left - 1; int j = right + 1; if (right - i == 0 || right -...
Dependencies: <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.13</version> </dependency> <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.13</version> </depende...
Can someone help me make a more elegant solution to this function? function convertToHHMM(info) { var suffix='AM'; var hrs = parseInt(Number(info)); var min = Math.round((Number(info)-hrs) * 60); if (hrs >12) { hrs = hrs - 12; suffix='PM'; } if (min < 10) {min='0'+min;} return hrs + ':' + min + ' ' + suffix; }
I decided to build a GUI that would seemlessly create user interfaces for validation functions, functions that check if a string satisfies given rules. An example 'hello, world!' usage is: from gui_validation import gui_validation def is_valid_salutation(salutation): """ Salutations to be valid must start with...
I'm building a random text generator! My idea was to borrow slightly from the string.Format method styling, have a "format string" that controlled the overall construction of the string, and include "control string" segments inside them that classes will inject text into depending on their own logic. For example, the i...
This is the code for my Tic Tac Toe game. The player functions are coded in the class tictactoe and the rest of the functions, which include checking the board for completion, are global functions. Any tips, advice, or even corrections you guys have, please feel free to share them. I am almost brand-new to programming ...
I have written this little thingie to fix a problem of missing pthread_barrier_t in Mac OS/X pthreads. Are there any issues with this code? The header: #ifndef PTHREAD_BARRIER_H #define PTHREAD_BARRIER_H #include <pthread.h> #ifdef __APPLE__ #ifdef __cplusplus extern "C" { #endif #if !defined(PTHREAD_BARRIER_SERIAL...
It is a code eval challenge question https://www.codeeval.com/open_challenges/14/. My answer was accepted, and I modified my code again to improve it. Please let me know is it possible to improve it more. #include <iostream> #include<fstream> #include<algorithm> #include<string> void create_permute( std::string &recor...
This is a kind of follow up to my previous sort implementation review with specific questions to merge sort, and Modern C++ idioms. template<typename InputIt1, typename InputIt2, typename OutputIt, typename Comparator = std::less<typename std::iterator_traits<InputIt1>::value_type >> void mer...
Today I've got a pretty simple snippet to be reviewed. The function is extremely simple, as all it does is retrieve some entities from Core Data and then compares the dueDate attribute to today. I'm here asking about two questions: Is this code reliable? Is this the most efficient way (less lines of code) to accomplis...
I have a small Django project to help organize museum artwork. In my models.py file, my museum object is defined as follows: class Museum(models.Model): """Model representation of an art museum""" title = models.CharField(max_length=50) website = models.URLField() description = models.TextField() im...
I decided to learn Go, knowing Python. My approach is by solving easy problems like this one: You are given two strings, A and B. Find if there is a substring that appears in both A and B. Several test cases will be given to you in a single file. The first line of the input will contain a single integer T, the n...
This will go through and create every possible permutation of a username with a length of between 4 and 255 characters. import itertools # creating file f = open('usernames.txt', 'w') # setting character possibilities chrs = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' # setting lengths min_len...
This is my solution to K&R Ex 1-18 which requires us to remove all trailing blanks and spaces from a string. I specifically wanted to use a separate function for processing the input (via gtLine()) to promote code re-usability. Please tell me ways in which I could have made my program shorter/better. Also, please point...
This is my first time coding in my life. I don't really know much about coding. I googled whatever I need and combined them all together. It works great, but want to know if there is any improvement needed. Is there a better language to write in? import os, csv, re, time from datetime import date, timedelta SendIDs =[...
This is a kind of follow up to my previous sort implementation review with specific questions to quick sort, and Modern C++ idioms. template<typename BidirIt, typename Comparator = std::less<typename std::iterator_traits<BidirIt>::value_type>> void partition(BidirIt first, BidirIt last, ...
I was asked in an interview to write code to check if a given string is a palindrome or can be a palindrome by altering some character without using library function. My logic is to: Compare 1st char with remaining chars. If it exists, remove both from array using removeElement(). If it does not exist in the char arra...
I'm learning Java and was making a program to go along with the board game Clue. I type the name of who didn't do it and it takes them off the list. I want to evolve this program to be able to do other things and include the weapons and locations and maybe even probabilities based on other peoples guesses' during the g...
I am hiding rows for given ids using this code: var idArray = ['A123','B456']; // getting from web services for (var i=0;i<idArray.length;i++) { var id = idArray[i]; $("#eTable tr[data-empid=" + id + "]").hide(); } HTML (Just for example doesn't needs improvement) <table id="eTable"> <tr data-empid="A123" da...
My question is about the equals() method. Most people implement equals() to start like: @Override public boolean equals(Object o) { if (this == o) { return true; } if ( (o == null) || !(o instanceof MyClass) ) { return false; } ... The !(o instanceof MyClass) line here can be very limiting. Once a cla...
There is a file with two words with the same length. Call them first and last. Also there is a file - dictionary with a lot of different words. The task is to find shortest chain of words from dictionary from first word to last so that two neighboring words different just one character. All words of chain must be the...
I wrote a script for a timer. Is there any way to improve the code, with fewer number of lines? JSBIN var app = angular.module('app', []); app.controller('main', function($scope, $interval) { $scope.timer = 0; var clickme = true, startfun; $scope.status = "Start"; var foo = function() { ...
I have the following extension method which checks all cells for values in a table column with the specified header name: public static bool AllCellsInColumnHaveValue(this HtmlTable table, string columnName) { // Find the columnindex of the specified column name var cell = new HtmlHeaderCell(table); cell.Se...
I have the following RegEx which matches any of a selection of inputs (see the list below). While it works fine, I'm wondering if there is a better way of writing it, as it looks a little dirty. I've been using various RegEx builders but couldn't come up with a shorter version, so any tips would be appreciated. -[0-9]...
Is it good way of asking for a number? Should that function return 0 if there is an error? private int getNumberDialog(String message) { try { String resultInString = JOptionPane.showInputDialog(message); int result = Integer.parseInt(resultInString); return r...
I have taught myself some bash and already knew some AppleScript, so I have come up with this SSH chatting tool for OS X users. It allows you to chat from a terminal to another OS X computer. One problem is that this code has to be located in an executable shell file on the computer of the person receiving the messages...
I have lots of dictionary keys with conditional values, ternary in this case: # cover page data_coverPage.append({'reportCalendarOrQuarter': coverPage.reportcalendarorquarter.string if coverPage.reportcalendarorquarter else "N/A", 'filingManager_name': coverPage.filingmanager.find_all('name')[0].text if co...
I wanted to do some exercise and came up with the idea of a good challenge (for my level of course). I tried to implement Laplace's algorithm for computing the determinant, recursively. #include <math.h> #include <stdlib.h> #include <vector> #include <iostream> using namespace std; int getMinimoCount = 0; //ignore the...
I have inherited this code from my company. It is acting as a helper class for a database and written in VB.NET until date. It is working properly and almost 5 to 10 commercial packages I am maintaining is written based on this work. I just want to know if it can be improved. It invariably uses Async, and I am not sure...
I wanted to create the most shortest JavaScript code for an endless rotation of elements, without any controls. The elements can be images or SVG-elements (only the Vanilla JS version will work here) or text-container. It doesn't matter. I came up with this: HTML <div id="container" class="container"> <img src="htt...
I am trying to write a method that will return true if a binary tree is full and complete (each node has 2 children or none and all the leaves of the tree are at the same depth). My idea is to use recursion. I will check for any node if its left son has number of children that is equal to its right son's number of chil...
I have a user, a micropost and a response model. The user has many microposts and has many responses. Microposts have tags using the acts as taggable gem. I need to find the number of responses a user has, to microposts that are tagged with a specific tag. To be clear, for example, how many responses has user 1 given t...
I'm writing a tiny WebGL/JS framework to improve my knowledge of JavaScript and WebGL. Following is a class that wraps a Shader Program and provides methods for setting the shader parameters (AKA uniform variables): ShaderProgram class: "use strict"; /* =========================================================== Shade...
I'm new to writing bash scripts and was wondering if I could get someone's advice on a part of the script I'm working on. Intended purpose of code Check if a package exists using dpkg, and if it doesn't, offer to install it for the user. This snippet is part of a larger script that installs a particular Conky configura...
This is a very simple rock paper scissors game implemented in Haskell. import System.IO (hFlush, stdout) import System.Random (getStdGen, randomR) data RPS = Rock | Paper | Scissors deriving (Eq, Show, Read) instance Ord RPS where Rock `compare` Scissors = GT Scissors `compare` Rock = LT Paper `compare` ...
I am writing a C++ client application which will send some data to server and wait for its response. Now the protocol is to wait for a specific timeout and then retry for specific times. If all goes wrong, the client will report a communication failure. I have implemented the whole matter in a non blocking socket opera...
I currently have an implementation that helps us deduplicate data but I know it's slow. Here's an example, note that I'm using OpenStruct here when really these are Mongoid objects pulled from the database. require 'ostruct' vendor_data = [ OpenStruct.new(activity_id: "abc123"), OpenStruct.new(activity_id: "def456...
I made a method that I can use to avoid having to handle errors from callbacks. What it does is, call the passed method only if the first argument is null. So essentially it will bypass to the last method, if an error occurs. Feedback is welcome. /** * continueIf * * Returns a continuation method that only continues...
Below is one of the versions of my wifimap script: #!/usr/bin/python """ Sniffs on the WiFi network and generates a graph showing the communication between the devices, including information about the announced SSIDs. Will loop infinitely - kill the program with SIGINT in order to stop it gracefully. You can also use ...
I have written two hash map implementations, one that stores Vertices and one that stores self implemented vectors of Edges. They are all fully functioning, however in my application they are quite slow and was hoping if anyone could point out how to improve their speed. Vertex Hash Map public class VertexHashMap { ...
I have a few constants in a game that I'm doing for hobby. I need to store constants for the total size of the a Physical World and the size of the Screen. I can position the world's objects to the screen or vice versa. To position the images on the screen for example I get the position that the body occupies in the p...
I have an Android service which must offload a task to a different thread but schedule the response callback unto the calling thread. After much thinking I came up with this code: public void testRequestingAScheduleUpdateShouldNotBlockAndDeliverItOnTheCallingThread() throws Exception { final StreamSchedule mockSche...
I want to read a file and store the number of occurrences of each word in a Map, using tail recursion. I came up with the following; it seems to work; does it look like it's right? def countWordsinFile(reader:java.util.Scanner, wordCounts:Map[String,Int]): Map[String,Int] = { if (!reader.hasNext()) wordCounts e...
I am trying to build a database structure for a time punching system. What I'm trying to figure out is if what I have is the ideal structure, or if something else exists that I'm overlooking. I want the records to be connected in some way so that I can pull out all of the records into a table and display them by date a...
I'm trying to write a class to handle the collecting and calculating of some data. My intention is to have the controller instantiate the Report object, and a very simple view display it. I figured this would keep the controller thin and keep logic out of the views. class Report def initialize(year_term_ids = []) ...
I had to create a program that had a struct that held data inside of it. I had to read an input file and take the contents and read it into an array of structs. Then, I had to solve for some particular statistical data such as finding the lowest and highest scores from the data. I completed my source code and it runs a...
Here's my first shot at implementing Tic Tac Toe in Ruby. After watching Gary Bernhardt's Functional Core, Imperative Shell, I thought this would be a great exercise in trying out the ideology presented in that screencast. Tear my code apart. Link to GitHub repo (includes video of usage) tic_tac_toe.rb -- the procedura...
I have a JSON input using which I have written below function to recursively create an unordered list. Is there more precise way to achieve it? $(document).ready(function () { var htmlTxt = ""; var cat = []; var htmlStrTxt = ""; var url = "#"; function recurseMenu(parent, leve...
Just interested in any comments about the way the code is written. I am very new to python and programming. I did think about a func with a generator, but thought this approach was better. from datetime import date from datetime import timedelta import calendar import random class rand_dates(object): ''' ...
Wanna learn Rust? Ya rly! I can haz FizzBuzz? No wai! Gimme /bin/cat then. But rustc say LOL! Must handle teh err0rz! Now iz all err0r handlurz, so /bin/lolcat. Rust sux, or OP sux? Plain English translation: Wanted to learn Rust, but didn't want to write FizzBuzz. How about writing /bin/cat? But for every function ...
I'm trying to find useful versatile meta-predicates that are different from the vanilla ones offered currently by library(apply). How about the following two: combine/3 and reduce/3? First, combine/3: combine(_,[],[]). combine(Pred_3,[X|Xs],Ys) :- list_prev_combined_(Xs,X,Ys,Pred_3). list_combined_([],[],_). list_c...
I had an interview recently and discovered that I'd forgotten some of the basics. I've been playing around again and have written a function that will take a binary string (there is no validation yet) and returns the ASCII representation of said string. I'm looking for advice or tips on how it could be improved. I don...
I have a webapp that follows responsive design and has following layout structure. The left layout appears when the window's width > 768px and right layout shows otherwise. Based on preliminary research I think there are no modern pure CSS ways of doing it, so I implemented some jQuery code to solve it. $(window).resi...
Edit. Version 2. I am working on a genetic algorithm in order to solve a little "puzzle." Given a text file with N rows with 4 int each, the idea is to establish 2 bijections between 2 x 2 columns and the same number of 0 in each column. For this purpose, the program is only allowed to shift the data to the right. For...
I have a procedure for normalizing variables, the details of which can be viewed in this white paper. I would like to be able to make the routine scalable to handle any number of variables. Below is the R code for a 4 variable example with a regular correlation coefficient substituted for the preferred nonlinear coeff...
I have an Array of objects, each which contain their own sub Tags Array, and I need to loop through and find a matching id. Array: [ Object { tags: [ { tag_id: 1 }, { tag_id: 2 } ] name: name_1 }, Object { tags: [ { tag_id: 3 }, ...
My code does what it's suppose to do but the code is failing Pylint checks. After pasting my code into Pylint checker, it says that Too many branches (15/12) and its failed me on the Pylint checks. How can this be cleaned up? """Docstring""" import words def nicer_englishify_word(word): """Docstring""" wordx =...
First off, I am very new to WPF. These are the objects I want to display: public class IssueWithComments { public Issue Issue { get; set; } public IReadOnlyList<IssueComment> Comments { get; set; } public IssueWithComments() { Comments = new List<IssueComment>(); } } // Simplified public...
I am trying to format supplied phone numbers for a web application. Users in general will be supplying US-based phone numbers, but it is possible for some users to input a phone number from another country. Here are my assumptions: Default to US if the number of digits is 7 or 10 after stripping non-digits. If not, ...
I am using HandlebarsJS for my templating needs. I have a nested object: { "amount": { "preTax": 15.99, "tax": 0.0, "currencyCode": "USD", "total": 15.99 } } And I have the following template: {{#amount}} <div>PreTax is {{preTax}}. Tax is {{tax}}. Currency Code is {{currencyCode...
I need my trading system demo reviewed. It implemented a simple system which parse the trading flow (logged in file) of different trader and calculate some important feature. packets.h #ifndef PACKET_H #define PACKET_H #include <stdint.h> class Header{ public: char marker[3]; uint8_t msg_type; uint64_t seq...
This is for a high school class I'm taking. Any tips/improvements? import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import javax.swing.JButton; import javax.swing...
I was trying to solve a problem to determine if 2 strings are isomorphic. They are isomorphic when each character in string one can be replaced with another character in string 2. Two different characters may not map to the same value, and same character must not match to different values. Also the length of the string...
import System.Random (randomRIO) import System.IO (hFlush, stdout, getLine) data Tile = EmptyTile | X | O data Player = Player1 | Player2 instance Show Tile where show EmptyTile = " " show X = "X" show O = "O" type Board = (Tile, Tile, Tile, Tile, Tile, Tile, Tile, Tile, Tile) empty...
I had to make a demo for Spring oauth2 with redis store for tokens. Started with the sparklr2 (with tonr2) sample app from here. They are demo apps to show oauth2 powered by spring. Sparklr is the server and tonr is the client. This link has the details. Wanted to replace, the same JVM, in memory backed token store wit...
This is a follow up to the questions: PyDOS shell simulation and PyDOS: Version 2.0 Introducing PyDOS 3.0! With brand new features and improved code, this will blow your mind! New Features (This list will be updated with PyWrite soon) Dialogs are now in a window like design. New start-screen, easier to use. Create you...
Thanks to your wonderful comments regarding the first version of my code, I have been able to improve it. This new version is more readable (I guess). The problem is that it seems to me that there is no overall performance improvement at all. Here is the full source code. const int PUZZLE = 16; const int POPULATION = 5...
I have some underscore-delimited strings like abc_def_ghi. I would like to get a substring out of the string made of one or more delimited substrings, so that if I call: getUnderscoreSubstring("abc_def_ghi",2) then I get: abc_def This is the C# code I'm using: public string getUnderscoreSubstring(string fullStr,int ...
I would like to optimize the second line in my for loop(var phase). I believe moving parts of it outside of the loop would optimize performance. What can I move outside the for loop to improve performance? for (var i = 0; i < items.length; i++) { var phase = Math.sin((document.body.scrollTop / 1250) + (i % 5)); //var p...
I adapted most of the suggestions from answers for my previous question Printing all the permutations of a string in alphabetical order to rewrote my solution again. Please let me know any more changes required or any more suggestions. #include <iostream> #include<fstream> #include<algorithm> #include<string> void cre...
This checks if a font is installed by using fc-list and grep. If the particular font is not installed, it offers to install it for the user. This snippet is part of a larger script that installs a particular Conky configuration along with all of its dependencies with minimal effort from the user. Concerns I have to cr...
I'm currently working my way through a textbook to enhance my beginner Python skills (Goodrich, Data Structures and Algorithms in Python). The first, somewhat in-depth problem involving OOP was the following: Write a Python program to simulate an ecosystem containing bears and fish. The ecosystem consists of a river...
I wanted to make something for the Community Challenge, so I made a simple permutation and combination calculator. I'd like input on: The overall design - any suboptimal choices that could be improved? Naming - This is hard, I know. But is it confusing to follow? Some names seem repetitive, others seem overly long. An...
I want to improve my code or structure. How does it look? Any comments or suggestions? $(function() { function searchGit() { //grab value of search field var search = $('#search').val(); // Validates entered value if (search.length > 0) { //pull json data from url ...
I applied for an Application Developer position. They require all their applicants to complete 1 of 3 programming assignments. I picked one for sales tax calculation. It was quite simple. Write a program the feeds in prices. If the item is a Book, Food or Medical product there is no tax, if not there is a 10% t...
I want to implement the following function: Given a target sum, return the combination that equals the target sum and is the most efficiënt combination in the array of an ArrayList. For example: An ArrayList with the values 9,3,4,6,4,2,1 Then it will return the best possible combination. You can add 9 + 1, which ret...
Q. Write three similar functions, each of which takes as an argument a sequence of intervals and returns the sum of the square of each interval that does not contain 0. Using a for statement containing an if statement. Using map and filter and reduce. Using generator expression and reduce. Hint: Square is a special ...
I have to make a simple program that reads N integers from the user and counts the occurrences of duplicate items. I know that the chosen sorting algorithm has poor performance, but I chose it for its simplicity. I'm looking for suggestions for the last part, in which I count the duplicates. #include <stdio.h> #define...
Is this acceptable? What is the next step to improve algorithm and make them more clear and faster? typedef struct heap_block { struct heap_block* next; size_t size; bool isfree; int x; // for alligment }header; #define Heap_Capacity 16777216 unsigned long long active_size; // # bytes in active allo...
(Largest block) Given a square matrix with the elements 0 or 1, write a program to find a maximum square submatrix whose elements are all 1s. Your program should prompt the user to enter the number of rows in the matrix. The program then displays the location of the first element in the maximum square submatrix and th...
I have a .json file with a complex structure: dict in a dict, it has no constant structure and is dynamically changed. The goal is to make new dict where the keys are numbers of hierarchy and values must be strings that are composed of all previous steps like 2 drinks 2.1 drinks coffee 2.1.1 drinks coffee instant 2.1....
I'm working on a complex Javascript application which includes its own data structure. The previous version's data structure was rather chaotic, and I'm looking to replace it with something where: Every data item is an object which is (effectively) an instance of a class, which imposes a common structure including def...
I am designing a planetary system simulator. The coordinates used are standard for JPanel (0,0 in the upper left corner). My model is based on a class Body: public class Body { private double x, y; // position private double w, h; // dimensions for drawing private double vx = 0, vy = 0; // velocities along ...
This is a follow-up question of this one: Tic Tac Toe game in Haskell I have revised my code. How does it look now? import System.Random (randomRIO) import System.IO (hFlush, stdout, getLine) import Data.List (intercalate) import Data.Array data Tile = EmptyTile | X | O deriving (Eq) data Player = Player1 | Player2 ...
This program takes a command line argument of how many times you would like to encrypt plain text. After you compile the program, input a message you would like to have coded. I'm new to C and curious about how to make this program more efficient. /* *caesar.c * * * *Encrypts user supplied messages according to a user...
I just got the urge to write a small console app to compare all directories name for similarity. I have > 3000 directories and over time some of them are really similar, eg. an update: Test Case ver 1 vs. Test Case ver 2. Well everything is working but it is really slow, it is probably faster for me to sort the directo...
Take the below code that I recently wrote: .navbar-inverse .emphasis-text, .navbar-inverse:hover .emphasis-text, .emphasis-text { color: #1caa98; /* Teal */ } While this may be a dryer way of placing teal on all these link items, would you consider this readable? It seems to me like there is a lot to read, and it'...
I wrote a menu in bash to access network equipment, but now there are too many of them to show in one screen to permit selecting one without scrolling up or down. I need it to be improved. I've considered having two files: The list of each equipment. Inside this file are the headers and an ID to determine if equipment ...
I've written a program in Java that will fetch JSON information from a service through their API and save it. As I'm new to Java, I want my code looking clean as possible and to understand the language's cultural coding standards as soon as possible. I know JSON data is usually mapped to a POJO, but I still haven't bee...
For one of my cases in algorithms I am required to create a model of a load balancer model for multiple processors. Lately I became interested in Scala so I decided that it would be great to create this program in Scala. I'm not really familiar with the concept of functional programming so any feedback will be welcome....
I'm attempting to make a stock trading game in Javascript and I've been trying to find an algorithm to generate fake stock prices. Currently, each Stock object has a minimum value, maximum value, and volatility which I will explain later. The code is as follows: Stock.prototype.generateValue = function () { //mod =...
I was reading about the MIDI spec and I challenged myself to implement a function to convert an int32 to a variable length quantity uint32. I didn't look it up or anything so there might be a way more efficient or tricky way to get the same result, but as far as doing what I set out to accomplish the following code wor...
I work in IT compliance and one of my main duties is ensuring the integrity of employee network accounts. Partial VBA script as currently used is shown below: Public Function validateHireDate(hireDate as String) If Not IsDate(hireDate) Or IsNull(hireDate) Then validateHireDate = "Invalid hire date" Els...
I'm not sure what is the best way to handle css when I have two uses of a class where the difference is one floats left and the other right. An example: img.screenshot{ width:100px; height:110px; padding:5px; } Do I do this: img.screenshot.floatLeft{ float:left } img.screenshot.floatRight{ float:right; } Or this: .fl...
I'm going through the Udacity Intro to HTML and CSS course at the moment, and one of the exercises is to convert this mockup to HTML and CSS. I did the following, and it looks ok-ish: HTML: <!DOCTYPE html> <html> <head> <title>Jane Doette / Front-end Ninja</title> <link rel="stylesheet" href="css/style.css"> </head...
I wrote a small script that finds the solution to the cracker barrel peg game / triangle game. Gist """A small script that finds the solution to the cracker barrel peg game / triangle game. Instructions along with one of the game's solution can be found here: http://www.joenord.com/puzzles/peggame/ It finds the solut...
I wrote a basic Minesweeper game for practice. It consist 3 classes: Main - only as launcher Cell - controling behavior of single cell Board - coordinating behavior of cells. The hardest part for me, was a determining the value of single cells (how many mines is around it), and firing a chain reaction, if some cell ...
I'm working with the XMLSOCCER.COM API. I'm a little confused with how to best design the application. The problem I'm facing is that teams do not have a league ID so I couldn't associate a team with a league by that. In order to associate them my league has a List<Team> and Team has List<Player>. I'm trying to reduc...