instruction
stringlengths
71
71.9k
The gamma function is one of a couple nice continuous extensions to the traditional factorial function. I used this Python program as a reference, which in turn, uses this Ada program. As the Ada program describes: The implementation uses Taylor series coefficients of $$Γ(x+1)^{-1}, |x| < \infty$$ The coefficients are...
For loops are the devil. I can't see a way to speed this up with apply or other more speedy functions though... pred <- read.csv("predictions_from_external_multinomial_model.csv") pred$id <- test_users$user_id pred$first <- "a" pred$second <- "b" pred$third <- "c" pred$fourth <- "d" pred$fifth <- "e" for(i i...
I have a simple application reading IO and plotting chart on UI. There is one instance that I need to plot three graphs at a time, and to make this easier, I made a graph form where I declared all non-fixed chart settings during form load and load it to chart as settings when the graph form is called as a new child for...
My Code uses a data set which has been modified using another script Calculating Time Difference and then inserts and populates a Chart with that Data. Save a Macro enabled WorkBook as Book1.xlsm with a Sheet named Book1. To setup data values for testing copy the data below and paste it to cell B19 in your Excel Sheet ...
I've written a small npm module. It is my first module. I'm asking you to review several things: The code. I am rather starter, so any wise critic will be super. Any suggestions or ideas on the library. About module Module is made to provide more comfort in using websockets via node.js, to help in organizing websocke...
I have fetchData method which fills my imagesArray: func fetchData(){ let imageQuery = PFUser.query() imageQuery?.whereKey("username", containedIn: namesArray) imageQuery!.findObjectsInBackgroundWithBlock { (objects: [PFObject]?, error: NSError?) -> Void in if error == nil { for obje...
I've written some code for testing Gilbreath's conjecture in python (2.x). The conjecture was shown (in the 90s) to be true up to n=1012. My code uses the primesieve module to quickly generate primes and, by ignoring blocks of 0s and 2s, only calculates values in the array when necessary. However, it's quite slow; it m...
I had to write a function to split a string that goes into a field if it(the string) were too long for the field, as it would disappear and be unreadable. How's the code lookin' ? function splitText(instr, fieldSize) //instr = string to split into two lines, fieldSize = the width(in characters)of the field where the st...
This is the iterative depth-first search, that does not abuse the stack. Also, I gathered some information from DFS that may be useful; for example, I am able to do topological sort using the result information of DFS, and use topologically sorted graph node set in order to solve the shortest path problem in directed a...
I'm practicing a 1000 point algorithm problem on the topcoder.com arena. The problem is as follows:      You work for an electric company, and the power goes out in a rather large apartment complex with a lot of irate tenants. You isolate the problem to a network of sewers underneath the complex with a step-up transfo...
I have workbook having multiple sheets and having same data on it. Currently I am using macro that .autofilterand copy paste on respective sheets. I am using looping process like:- Sub SCRIPT() Application.ScreenUpdating = False Sheets("SCRIPT").Range("A3:P100").ClearContents Dim ws As Worksheet, lrc As ...
One of the things that's straight-forward in JavaScript is Unicode support. If you want to return ϝ (lowercase digamma, not a simple f), you simply tell it to do so. No look-up, conversion or unreadable Unicode codes required. I want to build a translator between Arabic and Greek numerals. Since my projects tend to tak...
I have built a light version of a battleships program and would love for anyone to critique it. The game does not feature OOP, AI nor multiple boards. I aimed more for functionality than correct variable names and other related things just to get it working temporarily so I'm sorry if some things are named badly. The p...
In the past few days i have started to learn python 3 in my spare time and i am really enjoying it so far. I have attempted many simple programs such as a palindrome checker and reverse a string in an attempt to improve my skills. I was hoping that someone would be able to provide some feedback on the following program...
I've got a part of my application which deals with tracking the dates a particular item is worked on. It is a single aspnet page, which displays controls to either start or stop tracking, depending on the state of the work item. There are up to three controls on the page. A calendar to enter the date that work was stop...
I need improvement on solution to the following problem: Generating random string keys in SQA is relatively simple, something like: request_id = Column(String, default=lambda: uuid.uuid4().hex, primary_key=True) However, I need to to get request_id have format like DIVISION_ABC_REQUEST_223 (this is because PK is ...
In my ongoing quest for an IRC client, I'm working on more stringent validation per RFC 2812. As with everything else I'm doing on this project, I'm trying to implement it all from scratch for the sake of joy/frustration and education. Thus I'm not going to be using any other libraries or tools designed to work with ...
I hacked together a way to make a small graph using Braille unicode codepoints by abusing unicodedata: def plot(timeline): ret = [] for r1, r2 in zip(timeline[::2], timeline[1::2]): character_name = "BRAILLE PATTERN DOTS-" dots = [x for x, y in zip("7321", range(r1))] dots += [x for x, y in zip("8654",...
I am currently for a program I am writing needing to compare two associative arrays by key and value in PHP and get the common elements as well as the difference between the common elements. I have currently arrived at the following solution: <?php $newArr = [0 => ['id' => 'UT5', 'qty' => '4'], 1 => ['id' => 'WRO', 'qt...
I completed an exercise from the Cracking the Coding Interview: Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables are fine. An extra copy of the array is not. Follow-up: Write the test cases for this method. I w...
Is this code a good solution for the question, or is there a better way to do it? package ArraysAndStrings; import java.util.Arrays; public class anagram{ private boolean isAnagram = false; public boolean Anagrams(String str1, String str2){ if(str1.length() != str2.length()){ return isA...
I'm updating a bunch of PHP code that relies on register_globals and uses request data globally. In the process of fixing/updating I spend a lot of time writing code that looks like: <?php $x = isset($_REQUEST['x']) ? $_REQUEST['x'] : $xdefault; // other times loaded from $_GET['x'] or $_POST['x'] $abc = isset($_REQUES...
This: Is a data table we get from our financial platform with lots of useful information. For reference, "--" is also the string they use to denote empty values. This: Is a spreadsheet I built (and had reviewed here) to track our customers' regular income requirements. The code produces reports to show: Whether ...
I have been using Python for only a few days, so I am trying to learn about some best practices. An explanation of what this code is supposed to do is at the bottom of this post. It is an exercise to rewrite a script I made in VBA a while ago and I am doing it to learn Python. Basically the strings of seemingly random ...
I have some parameterized queries in Access 2010. They are often used in VBA functions having the same parameters. In such cases, I give the query and function the same name. The following is such a function (from my actual project): Public Function get_assignments(e_id As Long, yr As Integer, wk As Integer) As DAO.Rec...
This question is follow up to Object Oriented Graph Hierarchy with Depth First Search. I tried to fulfill every point which @LokiAstari mentioned. I think I succeeded in everything except Visitor Pattern. I came to implementation of a function void BiGraph::addAdjacentImpl(int fVertex, int sVertex) in different way. N...
I am practicing a problem in "Cracking the Coding Interview". The problem is to remove duplicates in a linked list without the use of a buffer. I interpreted this as not using a list or any large data structure such as a hash to store unique nodes. My algorithm is inefficient I think. It iterates an anchor across the ...
In order to better understand functional programming in Javascript, I thought I'd try to recreate (as well as extend) some of the higher order functions on the Array object. These methods don't intend to be identical but to have the basic functionality. Any tips/suggestions/feedback would be greatly appreciated! // Arr...
I created a program that will convert a 3-character combo into a 3-string combo. I used a lot of if statements to accomplish the conversion. I'm wondering if there is any way to reduce the lines of code and possibly make it more efficient. using System; using System.Windows.Forms; namespace Adow { public partial c...
I'm not even sure if this is how you're supposed to do it, but this is what I have so far: $.getJSON("/api/get_categories", function(data){ var items = []; $.each(data["categories"], function(key, value){ items.push('<div class="card"><div class="card waves-effect waves-block waves-light"</div><div class="c...
I have this list of results which I display with the jQuery Datatables plugin. This is the Result class and list of results being returned in the JSON format: public class Result { public int articleid { get; set; } public string Name { get; set; } public string Position { get; set; ...
I am reading text files that contain data from observations. The format is not Fixed Width or Delimited, so I built a generator that gets Key, Values pairs and yields a dictionary when it has read a full observation record (~75 pairs in my case). The main loop builds a list from these dictionaries and then loads them i...
I have the following code I am working on, but I think it can be optimised further probably by improving the min/max variable selection, (see below). The idea is to not use actual division, ('/'), to get the quotient and remainder. I think there could be a way to improve performance by further minimising the number of ...
I am writing an application for work. This application will sit on a closed network but I still have to be concerned about security. There will be a maximum of three types of user for this application: User (read only), admin (data edits only) and super admin (access all areas). But at the moment I am trying to get a f...
Type erasure is giving me nuts recently. I'm designing a class that performs symbolic differentiation on a math expression represented as a binary expression tree. The question is more on the design part than on the actual code part so I'm only giving out the method that looks awful to me. public Node derive(final Node...
I'd appreciate if someone could cast an eye over my dodgey coding and give me some feedback. The use / purpose of the sheet/script is to quality grade calls, emails and chats with customers. A form is filled out and then the script takes over. We feed in a persons name, it grabs the last 9 forms for them. It sorts the...
I have implemented a "infix-to-postfix" function that takes as input a list representing the parsed expression, resulted from applying a certain regular expression to an expression, and I would like to have your opinion regarding its correctness and efficiency. Good suggestions are of course more than well-accepted! F...
I would like to improve my code. I am not a Python expert, so I am glad for any help. I would like to remove redundancies, unnecessary code, and change things that might shorten it. #!/usr/bin/env python3 import skilstak.colors as c import random as r def computerPlay(): while cscore < 17: chand.append(deck...
(See the next iteration.) There was a question in Quora about an interview question that asks to write a function for computing integer square roots, so I rolled two of them for fun: Main.java: import java.util.Random; import java.util.function.Function; public class Main { public static long intSqrt1(long number...
In order to convert a code such as: Company company = new Company(); if(currentToken.equals("employee_list")) { company.setEmployees((ArrayList<Employee> parseEmployees(reader)); } else if(currentToken.equals("contractor_list")) { company.setContractors((ArrayList<Contractor> parseContractors(reader...
I have been using this site for a couple of years for great answers and a ton of help. I wrote this program for my class project due 1/23. I am just wondering what you would recommend me changing or improving. I think I have some repetitive code, but I have not learned about defs in Java yet. package project2; import...
Can someone give me advice on cleaning this code? It's more messy then I expected. I got like 10-15 more ifs to be added. I've thought of adding the error messsages in methods and then just check if method returns true, or false it'd throw error.. if( isset($_SESSION["access_token"], $_SESSION["user_email"], $_SESS...
I wrote a chess game in Ruby using object-oriented principles. One of the challenges was deciding which particular methods/actions belonged to a particular class, as there were some that felt as if they could go in any class. General rationale for OOP choices: Pieces should be as dumb as possible. They should return...
I have this code that is working as intended. Since I am still learning VBA and coding, I was wondering if anyone could look at this at let me know if there is another way to write this. This is part of an Add-In I created and is used by several other people (meaning that I installed the Add-In onto their PCs). Sub Ex(...
I was reviewing the following code block and noticed there was validation check at the top. The 3rd line in the function checks if the invoice belongs to the logged in customer. I am wondering what the correct way of doing this might be. Some options that come to me head are: GetInvoice should take an overload and...
I'm new to programming and just made a basic calculator on my own. Can anyone see if there is any room for improvement in the code, like stuff i should do different. package calculator; import java.util.Scanner; public class Main { static Scanner userInput = new Scanner(System.in); public static void main(String[...
I did an exercise (open-ended - without an answer) from a JavaScript book (chapter about functions). Given array of passengers of a flight with their names and ticket types and one need to emulate stewardesses asking passengers for service during the flight depending on their ticket type (first class or coach) (stewa...
Here's what my task is: Dependant on the "Logged In" user, they'll have different access rights and will see different menus. I have tried using the .get() function. choices = {1: "| Student Details", 2: "| Student Grades", 3: "| Finance", 4:"| Staff Details", 5:"| Staff Payments"} print(choices.get(1)) print(choice...
I have solved problem 185 on CodeEval, Glue Shredded Pieces. The solution got a 100% score on all tests (edit: see comments), within the allotted time and memory constraints. I'm looking mostly looking for tips to reduce memory usage (and improving speed) but all comments are welcome. Description Imagine that you are ...
Golly is a cross-platform, Python and Perl extendable (like in this case, Python), free Conway's Game of Life simulator written in C++ (or Python) that runs in arbitrary speed and large, marvelous patterns. Herschel is a pattern named after William Herschel (the heptomino resembles Saturn's planetary symbol ♄, and some...
Write a method named hasMidpoint that accepts three integers as parameters and returns true if one of the integers is the midpoint between the other two integers; that is, if one integer is exactly halfway between them. Your method should return false if no such midpoint relationship exists. Here are two different ve...
The following code fragment constructs different types of neural networks outputs based on the options supplied. Currently, my code just has a huge note that describes what all the options are supposed to do. I wanted to learn how I can make this code less complex or perhaps break its complexity into simpler pieces. An...
I'm very new to Haskell, I've read most of learnyouahaskell.com and played around with some simple things, but this is probably the most 'complicated' bit of Haskell I've written so far. I have an implementation in PHP that does basically the same thing, but it is much much faster.. I'm guessing my bottleneck here is t...
In my sample data table below, all datatypes are varchar(255). | event | timestamp | traceid | | accepted | 2016-01-16T09:35:48.653418931Z | AIP1452936948-44467 | | published_event | 2016-01-16T09:35:48.659767348Z | AIP1452936948-44467 | Here is the expected output: ...
Very often on Stack Overflow, and even on Code Review, I've seen questions and answers that have code that begins by persisting Excel properties like DisplayAlerts and ScreenUpdating to public or private variables, and the restores them at the end of the procedure. Public bScreenUpdating As Boolean Public bEnableEvents...
(See the previous iteration.) My two previous methods for computing the integer square root of a number \$N\$ ran in the \$\mathcal{O}(\sqrt{N})\$ worst case time. Now I have added a method (intSqrt3) that runs in \$\mathcal{O}(\log \sqrt{N})\$ time: Main.java: import java.util.Random; import java.util.function.Functio...
I'm using Ed scripts to track changes in a web app I'm developing. Ed scripts are probably the easiest kind of patch file for a computer to parse: detailed explanation of Ed scripts. I quickly put together the Ruby code below with extremely little thought. I'd like to know what kind of high-level patterns I could use f...
Here is a small project to implement a basic shell. It is a personal ongoing project to keep system call usage fresh. It currently does background processes and some basic signal handling. I am actually looking for code feedback in regards to professionalism. I want to know if my code is clear and easy to understand. I...
I need to examine an application port to see if it opens and I need to put the retry count as a parameter. Since I'm new to Node I wanted to get your feedback on it for improvements. checkAppPr: function (port) { var result = Promise.defer(); var checkStatus = function (next, result, times) { ...
I am writing some C# that will be running on Linux and will extract values from a kernel generated system file that represents readings from a sensor. The file contains two lines of text, and I have a method which will extract two values from the file. The file looks like this: $ cat /sys/bus/w1/devices/28-00000*/w1_sl...
I am doing a function that pixelates black and white images. The function must be called pixelate(img, (pixel_width, pixel_height), mode). The parameter (pixel_width, pixel_height) is a tuple which indicates the size of the resulting pixel values. the function must return a result in any event, even if they are higher ...
I just finished making a Blackjack program, and I hate my global variables in the program. Is there any way to change the code to not use globals and still work? #!/usr/bin/env python3 import skilstak.colors as c import random import time def bet(): global tokens bet.cBet = input("How many tokens would you like...
Given a 2D array of digits, try to find the location of a given 2D pattern of digits. Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as described below: The first line contains two space-separated integers, R and C, indicating...
I have been using ROS alongside Python to enable my built robot to walk. I am aware that my code needs some improvement such as classes etc. This is my first Python / ROS program so any help and pointers would be hugely appreciated. #!/usr/bin/env python # ## launch start_robot_controller.launch before running this. ...
I need to process the data contained in a (relatively) large binary file. The file has the following structure: 40 bytes of initialization, 4 bytes, 1 byte, 4 bytes, 1 byte, ... lots of such 5-byte blocks ... The number of 5-byte blocks (to which I'll refer to as 'timetags' in the following) may vary, but the total si...
You are a computer science professor at South Harmon Institute of Technology, and are in dire need of automatic grading! The good news is you have all of your student's assignments in an easy-to-read format, making automation easy! You will be given a list of unique student names, and then a list of their assignment g...
I am running through some traditional algorithms in Go, and I was hoping to get feedback on efficiency and optimization. Below is a basic selection sort algorithm that takes a parameter to dictate increasing, or decreasing order. // SelectionSort // in: A = {31, 41, 59, 26 , 41, 58} // // Increasing order // out: A = {...
This is a solution to the CodeHhef problem FCTRL2 where we are supposed to find the factorial of numbers up to 100. I have tried several techniques but I am always exceeding their time limit (1 second). Please help me optimize this code to make it execute faster. import java.math.BigInteger; import java.io.*; ...
Basically I need to order a list, so that an element is not the same as the element that comes after or before it. I searched for a solution but couldn't find one so I wrote this function myself. For example, [1,2,2,3,1,3,3] should come out as [3,1,2,3,1,2,3], [3,2,3,1,2,3,1] or [2,1,3,1,3,2,3] and so on. def unorder(a...
There have been already many similar questions to this one (e.g. this and this, just to point two), but I did not find any for clojure. The goal is to compress a string in a RLE-like way: i.e. each character "run" is replaced by the character and the count of the run. Some examples: aaaabbccc --> a4b2c3 b ...
The problem statement is : Given a binary tree, design an algorithm which creates a linked list of all the nodes at each depth (e.g., if you have a tree with depth D, you'll have D linked lists). My Algorithm is to use 2 Queues and BFS to accomplish this. The code is a bit involved and I've tried to make it as si...
I've got an IDictionary<SomeT, DateTime> that does not always contain the desired key-value pair. For that reason, a target method expects a DateTime? that the default TryGetValue method cannot provide a value for directly, because of the added ?. I've written this generic extension with main emphasis on the parameter ...
I wrote this script for a user who wants to toggle the minimized state of a window that minimizes to the tray. The user required a .bat script, so I wrote a bat + PowerShell hybrid script in order to import functions from user32.dll. <# : minimize.bat :: toggles minimized state of a window by its filename :: minimize....
I have a slider with 3 images and left/right arrows. If you click on them, the image changes. You also have 3 bullets below the images and the image changes depending on what bullet you click. I don't want to use buttons "arrows"; I want to use the tag "a." Any ideas on making it better? You'll need to add 3 images "be...
Please mention anything that could help me. from easygui import * import random choice = ["+", "-", "x"] question_number = 1 correct = 0 msgbox("This program is to help you get better at doing maths, you will get given a random set of random questions including +, - and x , at the end the program will tell you how man...
This code is a page scraper using HtmlAgilityPack that creates a DOM document upon construction and allows for node manipulation afterward. HtmlAgilityPack uses XPath Selectors for selecting nodes. An example use case would look like: var me = new PageScraper("http://codereview.stackexchange.com/users/62429/quill", Con...
Please review my implementation of the Minesweeper game Kata. Any and all feedback will be much appreciated. I would love to hear your feedback on readability, simplicity, performance, and any code smells. I even welcome nitpicking. Overall I want to know is the code clean (I know there is always room for improvement)....
Next release of Rubberduck will introduce a very cool @Folder annotation system that the Code Explorer will use to organize modules into - you guessed it - folders: ...which is tremendously awesome, because VBA doesn't have any concept of namespace, and the VBE doesn't offer anything better than a "Classes" folder to ...
I have built a program that handles the basic scheduling requests for CodinGame's Super Computer challenge. Specifications (taken from CodinGame) The Goal In the Computer2000 data center, you are responsible for planning the usage of a supercomputer for scientists. ​Therefore you've decided to organize things a bit by...
This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins. Note: I think takeOrdered is the bottle neck. it takes 45ms per User for 60,000 Users. What can I do further to increase its performance? (Decrease time...
I'm trying to unit test how my class responds to a NEST 1.7 IElasticClient's return values, using NUnit 2.6.4 and Moq 4.2. I feel mocking the Get function requires very "heavy" It.IsAny calls, and am mainly looking for feedback on how to mock IElasticClient in a way that my tests remain readable. My code is mostly 100%...
I have two collections - Movies and Watchlist. Both of these have Views that output Movie and WatchlistMovie Views. If you click add on a movie you should see it appear in the Watchlist colum`. If you remove then the movie should be removed. When clicking the add and remove buttons the view should rerender to show the ...
I have two functions which am currently running separately and would like them to run at once. The cartMaxCalc calculates and populates column O, then minfinder function uses the calculated values of column O with values of column M to finally set the values of column O. I am a novice on VBA and would like some pointer...
I've created a program that will search our work server where Ghostscripts occur. How it accomplishes this is by first sshing to the server specified, running a bash command to search the server for Ghostscripts caused by our guy that uses them, most frequently. If it finds one, it e-mails somebody on my team. It will ...
I've got this kind of data: [ { userId: 1, postId: 1, ... }, { userId: 1, postId: 2, ... }, { userId: 2, postId: 3, ... }, ... ] And I need to group them by postId and userId like this: { 1: { 1: [{ ... }], 2: [{ ... }], ...}, 2: { 3: [{ ... }], ...}, ... } Here is what I've done so far: var posts = {};...
I'm re-writing my module of Standard Methods. Virtually every project I do begins with grabbing some number of Data Tables and putting them in arrays. So, this is my general "Get Worksheet Data" method(s). As always, particularly interested in maintainability, but all feedback is welcome. Public Function GetWsDataArra...
I would like to enable application behaviour based on the presence of a custom annotation that marks the configuration class (normally named something like ApplicationConfig.class) in a Spring 4 application. This feature functions in the same way as do @EnableCache, @EnableRepositories etc, in the sense that adding th...
I explain everything on my current code but this question is more general "HOW TO" work correctly with this in this case but even next time. I have 4 methods in my class, each does something but in general this code just takes data from some API and insert it to another database in the right format: // Getting data fro...
I created a program which collects all the word files from a folder which belongs to our SharePoint library of documents. The program will only grab the documents if they were submitted/are a part of the HR team. These documents are saved in a temporary folder, and then merged together into one large pdf. I thought thi...
I am trying to create a basic angular template where all files are sorted into a modular structure and referenced using the browserify require method. I am very new to browserify and the CommonJS-type import system. Here is a look at the initial structure before I go into details of the file contents: So to start I ha...
I have implemented the "Sum All Numbers in a Range" challenge from Free Code Camp quoted below. The code works like a charm, but I don't think it's idiomatic. The challenge hints imply I should be using Math.max(), Math.min() and Array.reduce(). In addition I used the spread operator from ES6 to simplify both Math call...
I'm trying to learn Java, so I'm doing a few exercises from a programmer project idea book. This exercise requires that the program be able to convert a decimal number to binary and vice versa, like so: Please enter the binary/decimal number to convert:9783569 100101010100100100010001 Please enter the binary/decimal ...
An Super array is defined to be an array in which each element is greater than sum of all elements before that.   For example: {2, 3, 6, 13} is a Super array. (2 < 3, 2+3 < 6, 2 + 3 + 6 < 13) {2, 3, 5, 11} is a NOT a Super array. 2 + 3 < 5 is false. I wrote following code to find the array is Super Array or not . ...
Some days ago, I put up a question here for review about the best way to handle JDBC transactions in the context of an e-commerce Java web application. After a kind suggestion from user @gardenhead, I decided to use the try-with-resources construct to automatically close my resources, namely the statement and the conne...
I wanted to take a stab at implementing a binary search, and here's what I came up with. Is there anything I could have done better, from a code clarity perspective, or code optimization perspective? Any and all criticism would be appreciated: import random # implement a binary search def binary_search(alist, item): ...
I was writing a function in python to extract original values given a list containing cumulative sum values. For eg - Given : cumulative_sum = [1, 3, 6, 10, 15, 21, 28, 36, 45] Output : [1, 2, 3, 4, 5, 6, 7, 8, 9] I came up with two functions A & B and am looking for feedback on them, especially using xrange() vs enu...
I was reading about the elementary sorting algorithms like insertion Sort, selection sort and bubble Sort in Introduction to Algorithms by Cormen and I decided to try and implement it in C. #include<stdio.h> #define MAXSIZE 100 // Maximum number of elements permissible in array void swap(int*,int*); void print(int*,...
I'm looking for feedback on the actual logic of this simple Python 2.7 script. The automated grader passed it, but I expect it could be make more 'pythonic'. It was written for homework, and some of the constraints included basic looping constructs only and no function declarations. This differs from a simple String...
I have re-designed my robot walking code from feedback I received on previous question and would love to hear some feedback and pointers. Main.py: #!/usr/bin/env python # ## launch start_robot_controller.launch before running this. import roslib; roslib.load_manifest('my_dynamixel_tutorial') import rospy import math ...
I wrote a simple 2D renderer in OpenGL that works pretty well. I can render about 16,000k sprites in 1 draw call if it uses the same texture. I wanted to refactor this code out and put it in its own module to make it easier to work with. With this, I can only draw about 100 sprites before things get really slow: mat4* ...