instruction
stringlengths
71
71.9k
Suppose I have data coming from different sources that tells me information about a large group of stores that has the following (just an example): Necessary to define what store we're dealing with: Store_Name (String) Location (String) Store characteristics: Square_Feet (Double) No_Employees (Double) Years_Open (Do...
I am learning the Strategy pattern but hate the idea of passing a new object to the Context each time I need to change the desired algorithm. Instead I think it would be best to create an enum that holds all of the Concrete Strategy objects, and simply update them with a setter on the context. Below is my implementatio...
I want to extract some values in i-commas(") from lines like this: <P k="9,0,1" vt="191" v="100.99936" z="" /> Example: getCharVal ( cp, char "k=\"", 9) where cp is a pointer the line above should return "9,0,1" The function: #define ENDTAG "/>" #define ICOMMAS '"' char * getCharVal ( char *cp, char *att, size_...
I am writing a simple web application where I have a User entity and set of pre-defined questions to be answered by the User. The answers provided by the users for these questions would need to be stored against the userId and questionId. After a bit of googling and with the help of stackoverflow, I have designed the t...
I'm trying to make a few webpages that will allow us in the tech support team at the factory I work at to provide support faster by adding a simple interface to actions we perform everyday directly on the database. The following is for a simple page where we will enter a list of serial numbers and select from a few ch...
I want to establish a hierarchy, where at each level of the hierarchy, each type can contain a list<its own type>. So Node (root of object class hierarchy) contains a list<Node*>, SpecialNode : Node contains a list of SpecialNode. SpecialNode should not "accidentally" put new SpecialNode children into the list<Node*>...
I'm iterating through a number of text files, trying to locate all carriage-returns, and individually save the text between carriage-returns. I get the index numbers of all carriage-returns, but I haven't got the slightest about saving the text. Basically I want to save every string between two carriage-returns into an...
def truthy(v): if issubclass(v.__class__, numbers.Number): return bool(int(v)) if isinstance(v, basestring): vl = v.lower()[0] if vl == 'y' or vl == 't': return True return False Is there some type/class I missed that can be evaluated by Python as True/False that I miss...
I am sorry for the simple request, but I'm trying to figure out the best way to optimizing the following bit of code. I hate using 20 lines of code when 12-15 will suffice. I also don't like having to use intermediate variables if I don't need to. $total_query_raw = "SELECT SUM( total ) AS total ...
Task Create a matrix of checkboxes. The user must be able to select only 1 checkbox in a row or unselect all of them. Solution <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <script type="text/javascript"> function switch_checkbox(id_selected, id_pair)...
I've made the following and have a few questions: Do I have some (big) mistakes in this approach? (bad practices, 'this code is trash'...) 1.1 If I do, can you suggest what to fix? Are appended element created in good way? Code in success function seems to be a little long. Any way to refactor? CSS code .no-displa...
This is my first real program in python (and my first real program) and I would like to have input by some more advanced programmers on the code, on the writing style and on the amount of comments (is it clear enough?). new_name(scheme) does seems a bit bloated to me, but I can't figure out how to write it in a simpler...
This week's weekend challenge #3 seemed like a great opportunity to learn Ruby! Unfortunately, my workload and looming vacation did not cooperate. :( The puzzle will make forced moves automatically, but I was hoping to implement rules such as Naked Pairs before resorting to brute force. But there's plenty of code to ma...
I've inherited a class in a project which is purposed to execute a function that exists in POST data from a specified class. I've tried to clean this up as much as possible as well as secure it against SQL injection but I'm wondering if I could have done a better job or written this better. Any assistance would be much...
I wrote these classes and I would like to know if this is a correct way. I created a new Project with Blank activity and "Scrollable Tabs + Swipe" as Navigation type. My main activity: public class MyMainActvity extends FragmentActivity { private static String url = "http://www.myurl.it"; static JSONObject jO...
I made a simple Universal-File-Duplicator (Example: make 125 duplicates of one file). Very useful if you want to fill a whole USB flash drive or an old harddisk with an important file (Example: Bitcoin wallet.dat or privatekey) and you don't want to hit Ctrl+V all the time... Suggestions? Improvements? #include "stdafx...
The task is fairly simple. I want to create a collection of intervals and implement an Add method which would insert new intervals to the collection and merge overlapping ones. I would also like this method to somehow tell me which parts of the added interval were not in the collection before adding. Here is an interva...
I'm building an API wrapper for a bookkeeping SOAP API. I have some questions regarding bast practice for structure of the wrapper and for error handling. For now i've structured it like this: EconClient.php class EconClient { public function __construct() { $wsdlUrl = 'https://api.e-conomic.com/secu...
Some time ago I created a markdown parser in clojure and I would like to get some feedback, since I'm a clojure noob in the first place (is the code understandable?/is it idiomatic?/can some things be improved?). So I'm looking for feedback on best practices and design pattern usage (performance isn't my main concern)...
What should the code do: Process client HTML requests, query database and return the answer in XML. Working with a high load. I need to know how can it be optimized. Is something terribly wrong with this code? Input data: HTML-session, MAC-address (in form of GET argument). Output data: XML (session_id, session_sign). ...
public class ConsoleQuery { public static void main(String[] args) throws SQLException { if (args.length == 0) { System.out.println("You must specify name"); return; } String name = args[0]; Map < String, Object > device = getDeviceByName(name); if (de...
I have a method which returns an Array. This array can contain values or can be empty. Here is the code: function getCustomerIds() { //this declaration is at the top to inform about returning value of the method; I don't declare variables at the top var customerIds = []; var linkedContact = getLinkedContact...
We are given a string which is compressed and we have to decompress it. (a(bc2)d2)$ "$" indicates end of string. (abcbcd2)$ abcbcdabcbcd (This is the final uncompressed string.) My code: import java.util.*; class decompress { public static void main(String[] ar) { int end = 0, st = 0; Scan...
Project Euler problem 11 says: In the 20×20 grid below, four numbers along a diagonal line have been marked in bold. [red in the original] 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 ...
The task is to compress a string. eg. "abcbcdabcbcd" Here as you can see some characters are repeated, so it can be compressed. "abcbcdabcbcd" -> "(a(bc2)d2)$" '$' denotes end of string. My code: import java.util.*; class compress { public static void main(String[] ar) { System.out.print(">> "); ...
I'm trying to improve the following code for testability. public function can_apply_extension() { $search_dates = [ Carbon::createFromTimestamp(strtotime($this->billing_verified_to))->subMonth(1), $this->billing_verified_to ]; $record = ORM::factory('a model') ->where('cre...
On the attached fiddle is what I hope will the be future UI for navigation on my own personal portfolio site. I was hoping you guys could critique the JavaScript I wrote to accomplish the most compatibility with the most browsers. I've tested as far back as IE 7 with this code and it works. Whereas the CSS solution is ...
My needs outpace my abilities. This code (mostly) works, but it is really ugly, doesn't always add correctly, and is in desperate need of some help refactoring. I can't wrap my head around what needs done with it. I have a SQLite table WorkLog which contains rows of int, long, long, long, and long. They are _id, unu...
I have this code that shows date pickers when the browser doesn't support <input type="datetime-local">. Any tips on optimizing this code? if (!Modernizr.inputtypes.date) { $(function () { var d = Date.parse($('#StartDatePicker').val()); $('#StartDatePicker').val($.format.date(d, "yyyy-MM-dd hh:mm a...
Check out the fiddle here. This JavaScript will take the row that a user clicks on and make an object with the key coming from the thead element in the table and the value coming from the data in the text in the table cell value. I'm looking for a more professional/succint way of doing this: JS $(document).ready(fun...
I'm writing a helper for asynchronous operations. By default, winjs does not provide a way to wait x seconds before the execution of another function. So I decided to write a helper. (function asyncOperation() { "use strict"; // ------------------------------------------------------------------- // awai...
I'm trying to make a program that calculates your k/d ratio (kill/death, which is used in FPS games to make people believe that it's skill), how many kills you need without dying once to reach a goalKD. It also has a part that calculates how many battles you need if you give the program your average battle kills and ba...
I have a function - TriggerNotifications - that accepts a NotificationType. The Type determines which settings I should pull from the User. The code looks like this: public void TriggerNotification(DbContext db, User user, NotificationType type, string content) { switch (type) { case Not...
Context: I've been learning Python for a few months and I'm able to write codes which do work, but they normally look very ugly and contain a lot of unnecessary code. But I normally struggle to find better ways to do things because of my limited knowledge. I would like some advice on what I can improve on the code belo...
Here's the current code: static string GetResources(string header, string filter, string resourceTemplate) { string themeName; if (!TryGetHeaderValue(header, "theme", out themeName)) return ""; var resources = ""; var path = Path.Combine(HtmlPreview.BaseDirectory, themeName); ...
I have to protect really sensitive information and I have to do it both ways: encryption and decryption. How safe is it? function encrypt($mprhase) { $MASTERKEY = "KEY PHRASE!"; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mc...
I'm pretty new to ASP/MVC but have had some prior programming experience. I am trying to retrieve statistics about URL clicks - total clicks and unique clicks by IP address. I started with: ViewBag.ClicksToday = context.EmailLinkClicks .Where(c => c.CreatedOn == DateTime.Today).Count(); ViewBag.ClicksWeek = conte...
Problem statement is at http://www.codechef.com/DEC13/problems/MARBLEGF Lira is given array A, which contains elements between 1000 and 2000. Three types of queries can be performed on this array: add a given value to a single element on it, subtract a given value from a single element on it and find the sum of the ...
I'm trying to make my code easier to understand by making it more correct and maintainable. Here's the code I'm trying to simplify: $(document).ready(function(){ $('.opretbruger').on('click', function(){ if (opretbruger() === true){ } }); }); var opretbruger = function(){ if($('#brugernavn').val(...
The question is explained well by examples in the comments below. Also I request verifying complexity: O( n * n!), where n is the number of words in the subsets. Review my code for optimizations, best practices etc. /** * Question is better explained by examples: * 1. given * i/p subsets - ["un", "xy", "te", "i...
I'm doing a website in CodeIgniter and I'm loading the content page via jQuery, but I don't know if this is a good practice or not. Could I improve it? jQuery: // Another question here: how can I group the repeated code in a function: $(function() { var control = '../Indoamericana/Intranet/index/Proceso/'; var load...
I'm trying to write a neural network that only requires the user to specify the dimensionality of the network. Concretely, the user might define a network like this: nn = NN([2, 10, 20, 15, 2]) # 2 input, 2 output, 10 in hidden 1, 20 in hidden 2... To do this, I'm trying to adapt some basic code. Please let me know wh...
This week's challenge is essentially about fetching Json data from the Web, and deserializing it into objects. I don't have much time to devote to this one, so what I have is very basic: it displays the names of all pokemons in a WPF ListView: Here's the code for the window: public partial class MainWindow : Window { ...
I have written this InsertSort program in F#. It works, but I am not very happy with it. let rec SubArrayBegin list n = list |> Seq.ofList |> Seq.take n |> List.ofSeq let SubArrayEnd list n = List.rev (SubArrayBegin (List.rev list) ((List.length list) - n - 1)) let InsertSort list = let rec innerIn...
This is my .cs part code where I am calling storeprocedure in LINQ to SQL: var rr_j_cat = db.allcategories().ToList();//its store procedure calling thousands of rows if (rr_j_cat.Count() != 0) { DataTable dt = new DataTable();//making dynamic datatable dt.Columns.Add("sub_id"); //dynamic columns dt.Columns....
I would like to ask you for a code review of my c++11 Thread Pool implementation. Your constructive criticism is welcome! Could you give me some ideas how to extend it? The main idea is to synchronise access to tasks with condition variable. ThreadPoolExecutor.cpp #include "ThreadPoolExecutor.h" #include <algorithm> #i...
I'm looking for code review of part of my replacement of timeout() project. Namely, feedback on SleeperNotifier class: https://github.com/ledestin/frugal_timeout/blob/master/lib/frugal_timeout.rb#L125 If you would like to give feedback on the whole project, by all means do. # {{{1 SleeperNotifier # Executes callbac...
I believe any data structure can be converted to RDF, and I wrote the subroutine below which sort of does this, at least for arbitrarily complex hashes. However, I'm unhappy with it because: $hash2rdf_count should not be global. I don't see an easy fix for this. Where I comment "hopefully it's referring to a scal...
Request for optimization, good practices, recommendations. class NodeMaxDepth { private final NodeMaxDepth parent; public NodeMaxDepth (NodeMaxDepth parent) { this.parent = parent; } public NodeMaxDepth getParent() { return parent; } } /** * Given a list of nodes with p...
I'm currently trying to improve my coding skills, so I'm trying to code a Tic Tac Toe game. At one point a "win check" is needed.I'm using this code to check: public void CheckWin(States state) { if(fieldA1.GetState == state && fieldA2.GetState == state && fieldA3.GetState == state) ReportWin(currentPlay...
I've just completed my first Ruby game. It's a modified BlackJack type game, called Hot 18. I've used all methods for this Ruby game. It's a one-player game, but you can play with 1, 2, or 3 hands. I would like to make it shorter and more efficient. I know it's kinda long, so I'm not asking you to go over everything. ...
In a question I answered I posted the following code: #include <iostream> #include <fstream> #include <algorithm> #include <sstream> int main() { fstream iFile("names.txt", ios::in); // This does not work so replacing with code that does // iFile >> file; // This is not the best way. // But the c...
I have written this code for BubbleSort in F#. Can you review and let me know how I can do this in most functional way. let rec getHighest list = match list with | [x] -> x | [x; y] when x > y -> x | [x; y] -> y | hd1 :: hd2 :: tl when hd1 > hd2 -> getHighest (hd1 :: tl) | hd1 :: tl -> getHigh...
I have written the following program to implement merge sort in F#. Can you please review this and let me know how can I write this in the most functional way (also most efficient and concise)? In my recursion call, mergeSort is called again twice. I think it will be great if these two calls could be made on different ...
I have been working on a javascript heavy project. There are sales, purchases, reports etc. What I've done is created a separate module for each i.e. a separate module for each i.e. a separate one for sale, one for purchase and so on. I am posting one of my modules, all the others have same structure. Can anyone please...
OK... last sort of the day and probably the most fun. F# is really awesome. let rec quickSort list = match list with | [] -> [] | [x] -> [x] | hd :: _ -> quickSort (List.filter (fun x -> x < hd) list) @ hd :: quickSort (List.filter (fun x -> x > hd) list) [<EntryPoint>] let main args = p...
I am new to JavaScript, HTML and CSS, although not to programming. I wanted to style 'select' dropdowns, so I wrote this: What noob mistakes am I making? Is this a good or evil use of JS? <head> <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <!-- <link href="./font...
I'm looking for feedback (both general Java, and Twitter specific) on how I'm getting the Twitter handles of everyone who retweeted me over the last 200 Tweets. Comments welcome. package twitone; import java.util.ArrayList; import twitone.structure.BaseTwitterClass; import twitone.structure.TwitApplicationFactory; i...
I'm making a Hangman game and it seems that my code doesn't provide me much freedom with using layouts. I added an image to my JFrame then I added a JPanel to my image which I'm using for all the JLabels and JTextFields but it seems to me that it's inefficient because in order to change the layout of my JTextFields or ...
In C++11, it is en vogue to use small lambda expressions to produce ad-hoc predicates. However, sometimes it's fun to create predicates in a functional, "point-free" way. That way, no function bodies need to be inspected, the code is mildly self-documenting, and it's a great icebreaker at parties. Suppose I have a std:...
Given an array, find any three numbers which sum to zero. This problem is a continuation of a code kata in Python . I'm learning Scala and would like feedback on more efficient, cleaner, and functional ways of solving (and unit testing) this problem. SumToZero.scala class SumToZeroNotFound(msg:String=null, cause:Thr...
I had a somewhat interesting issue. I had to take an array and turn it into a string with a set of delimiters; then later on take that string and turn it back into an array, splitting at the same delimiters. The twist was the string could be contain anything (including the delimiters). I feel like I over-engineered t...
I have reworked my code as suggested from my previous question: Determine if a word can be constructed from list of subsets. Please instruct me on the complexity along with a review feedback, as explained in the comments below. /** * Question is better explained by examples: * 1. given * i/p subsets - ["un", "xy...
I wrote a python model for the game "snake" that I'm not really satisfied with. My intention was to separate the game logic from the drawing and input handling (which worked quite well) but I've got several points which I don't know how to solve better. To use this model one needs to initialize it with callbacks that ...
I am trying to solve a bioinformatics problems from a Stepic course. The problem posed: find clumps of the same pattern within a longer genome. Motivation: Identifying 3 occurrences of the same pattern within a window of length 500 within a genome allows biologists to find the "replication origin" of a bacterial genome...
Which one of these two is better? This one: middleware.response_redirect = function(){ return function (req, res, next){ var redirect = function(){ if(req.form.redirect) return url.parse(req.form.redirect); return { protocol: "http", hostname: config.domain,...
Follow-up posted -> Follow up to Pay Rate Calculator This little bit of code is just some code that I wrote from a flowchart at the beginning of a programming and logic book that I have added some to. I tried to create it as an object. I would like a review on what I am doing and if I am doing it right, and what I cou...
I want to combine elements in different lists. For example, here are 3 lists. list_a : [ 1,2,3 ] list_b : [ 4,5,6 ] list_c : [ 7,8 ] Selecting elements from list_b and list_c is mutually exclusive. When including an element from list_b, I'd like to also include an element from list_bb; when including an element from ...
I am constructing a binary tree. Let me know if this is a right way to do it. If not please tell me how to?? I could not find a proper link where constructing a general binary tree has been coded. Everywhere BST is coded. 3 / \ 1 4 / \ 2 5 This is the binary tree which i want to make.I should be able to do...
Given the test code: import struct buf = bytearray(b'\xef\xf8\t\xf2') number = struct.unpack("<I", buf)[0] How do I cleanly make it work both under Python 2.6 and Python 3.3? The problem is that struct.unpack in Python 2.6 seems to expect a str object (not unicode), so the only way I managed to come up with in order t...
I've been writing a simple code just for fun: This is a simple WinForms application with which you can measure your typing speed. There are three controls on it, doing the following: rtbResults - The one where you need to be as quick as possible. textBox1 - The one where you submit the reference text. tbBestTime - The...
As a student of C# right now, I am trying my best to get a grasp on many of the systems being taught. I just completed Week 1 of a C# 102 class and the class was assigned a bit of homework. I am curious, from a beginners point of view, how you might restructure this code to make it more readable and understandable. For...
I am writing up a class to handle various templates to be used in a web application. Each template contains various placeholders which will need to be replaced at the time of the build. I am wondering if the method I am using is the best solution, or if I should consider something else. At the moment I have two separat...
Basically, this code takes a keyword and an array of strings, then sorts them based on two things: the number of characters shared with the key, and the distance between them.(As a side note, would this properly be called a sort, not a search?) def search(key, list) # Format for everything pushed to out: # Should t...
I created a weather widget in JavaScript that requests the current weather from Yahoo. The weather request returns a code which corresponds with a current weather image. I don't like Yahoo's images, so I use my own CSS classes that correspond with my own images. Consequently, the following code returns the correct CSS ...
I am/have been building a game for a long time now. The game is a web browser based system, and data is stored using JSON stored in RavenDB. One thing I am very constantly running into as a problem is the notion of Requirements. Anyone who has played a game, particularly an RPG, is probably familiar with this. Requirem...
I feel like I don't understand how polymorphism works in Python. Here is something I put together. class _Tag(object): def __init__(self): #DisjointedTag and JoinedTag will bypass __init__. #Also, self will not be defined within this class. #Bottom line, this class is just for inheritance. ...
I have attached two scripts which calculate the most popular songs according to zipf's law from the following standard input: 6 3 100 one 50 two 10 three 30 four 5 five 10 six The first line details the number of songs to be input followed by the number of songs to return. Each line that follows holds the play counts ...
Any suggestions on how to shorten this would be greatly appreciated. This code takes three parameters through the URL and displays a page with targeted ads. I especially need help on how to cut down the three sections where I replace %20 with spaces. Also, here is the URL with sample parameters - http://timtechsoftware...
I have below Java code to compare two list values with some condition: public boolean compareLists(List<SortData> prevList, List<SortData> modelList) { if (prevList != null && modelList != null && prevList.size() == modelList.size()) { boolean indicator = false; for (SortData modelList...
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits. I submitted the code for th...
I've run my code through Valgrind and managed to not get any memory leaks based on the test code in main. I'm looking for things that I may not have thought to check for, and ways to improve my code in general. Header file: #ifndef DLL_H #define DLL_H struct node{ void *data; struct node *next; ...
Below is the python code to compress js and css files. import sys import os import glob import shutil import fnmatch import os.path import re import argparse import time #Store the time the script starts start_time = time.time() total_files_compressed = 0 total_js_files_compressed = 0 total_css_files_compressed = 0 j...
I wrote some code for linked lists and would like to know what things could/should be done differently. I'm using an index to keep track of the most important information and have 2 sets of functions, one to use the list just to point to data and the other to store the data in the list. Here's the code so far: #include...
Request for review, optimization, best practice recommendations etc. /** * Find the smallest positive number whose individual digits adds to the input number. * eg: consider the input 14, * The smallest number whose digit add to the given number is 59 ie 5 + 9 = 14. * * Complexity: O(n), where n is the input num...
This is a Follow-up to Simple pay rate calculator Here is what I came up with. Hopefully if I have missed something that was said in answers on the previous question, we can still get those things pointed out. I am hoping that I made the code cleaner. Main Method class MainClass { public static void Main (string...
I wanted to consolidate solutions to disparate problems into a single program. I am worried that there is a interface, command pattern, or dictionary solution to what will become a massive switch statement here. However, the main in this program is essentially a meta-program which would switch between the miniature pr...
Review this code for code quality. <!DOCTYPE html> <title>Email obfuscator</title> <style>.email { unicode-bidi: bidi-override; direction: rtl; }</style> <h1>Email obfuscator</h1> <p>A kick-ass email obfuscator, inspired by <a href="http://mathiasbynens.be/demo/email-obfuscator#code">Mathias Bynens's <code>obfuscate_em...
Below is my first attempt at programming a Celsius to Fahrenheit converter in C# winforms. I'm looking for tips and advice on improving my style and what I can do to make the code more efficent/proper, or is it good as is? I apologize ahead of time if i've forgotten any details and would be happy to provide more upon r...
I have started learning about SOLID principles yesterday. I've got a detailed explanation of SOLID principles here. After reading it, and a few other articles, I have tried to apply these principles in one of my projects. This is a tool for importing data from another system. Requirements are as follows: Read some set...
As a challenge to myself, I wrote a solution to this Stack Overflow question. For completeness, the bulk of the question is as follows: Problem Input: [ ['key1', 'value1'], ['key2', [ ['key3', 'value3'], ['key4', [ ... ] ], ['key5', 'value5'] ]...
I don't like to post programming contest code in here, but I really like the question and want to share it with you all. It has been years since Superman started his enmity with the super-genius Lex Luthor. After years of intense battle, Luthor finally decides to end it all by going into the past and capturing Sup...
I was inspired with this question How I can detect when other control changes it bounds? and @Remy Lebeau's answer and decided to write my own control (based on ideas from ExtCtrls.TLabeledEdit). Now I have a few concept problems: Should I re-use already defined TLabelPosition type or use my own? I was thinking that...
I would like some help refactoring this code. This is to improve some of the nonfunctional attributes of the software to improve code readability reduce complexity to improve the maintainability of the source code. package Game; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListe...
I'm in the process of learning python and programmed this exercise in decrypting the Vigenere square cypher as practice. Please comment on best practices, efficiency, or more pythonic ways to do things. #!/usr/bin/env python """Functions for encrypting and decrypting text using the Vigenere square cipher. See: h...
This is for an app built with Express. One of my concerns is the routes ending with / which I did because our previous site was an ASP app. So they named the folders that way for SEO purposes, then the page would be index.aspx .But in my case I just did, for example science.jade and routed it from /science-bruxzir-zir...
I've just completed my first JavaScript game. I strongly welcome any advice/opinions/insults on how crappy or good my game is. Do you notice anything that is poorly done? Is there anything that I can write better/shorter? Here is a link where you can change the code/test the game/etc. http://labs.codecademy.com/Bnov#:...
I have built a partial human brain model and the following is an example of how I use all the classes. I was wondering if anyone could critique my implementation strategies because I feel like the following setup is very clumsy. You can view all the code at: https://github.com/quinnliu/WalnutiQ public class HowToUseMA...
I have solved the question, and in turn felt the need to get it reviewed. Any suggestions for clean up and optimization would help. Also please verify my complexity: \$O(V + E)\$. GraphCycleDetection should be named to Graph, but it was named on purpose to avoid conflict in Eclipse workspaces, so please ignore renaming...
I have such a problem: I'm parsing a lot of HTML files with Simple HTML DOM Parser, that's why I need to use three foreachs to parse the necessary information from it -> I am getting a lot of information and now I have three arrays which keep it. I think that it's dumb to keep the code like that and I want to keep the ...