language-agnostic

How to control a kiwi drive robot?

I'm on the FIRST robotics team at my high school, and we are working on developing a kiwi drive robot, where there are three omni wheels mounted in a equilateral triangle configuration, like this: The problem is programming the robot to drive the motors such that that the robot moves in the direction of a given joystick input. For exa...

Why is There A Need to Separate "Edit"(update) and "Add"(insert) actions in most CMS?

the CMS our chief coder designed has the update/insert actions handled by one controller. Most of the CMS's I see has separate handlers for update and insert. Why are most CMS's designed this way? Even the REST pattern has separate actions for update and insert (I don't know what they're exactly called though). ...

Expand fill of convex polygon

I have a convex polygon P1 of N points. This polygon could be any shape or proportion (as long as it is still convex). I need to compute another polygon P2 using the original polygons geometry, but "expanded" by a given number of units. What might the algorithm be for expanding a convex polygon? ...

Sample database schema + domain model for trying out an ORM

Is there a (freely available) sample of a DDD domain model with an accompanying schema that makes use of several ORM features (inheritance, value types, etc) that could be used to test an ORM? It's easy to create a simple Order/OrderItem schema, but that never prepares you for the intricacies down the road. (I'm coming at this from a ....

Code Golf: draw ascii art stars

Since this week noone has posted a code-golf challenge, I'll give it a try. I do it so you can do something other than playing with swords during those long compile cycles. The challenge: Draw ASCII art stars, given three numbers on standard input (number of spikes, type of star (star is drawn by joining vertices that are n vertices ap...

interesting programming technology from old times

Hello If you are old programmer or are history of programming/computing buff, what is an interesting programming/computing technology which you liked, which is marginalized today? In other words, which technology do you miss from old times? ps: feel free to make this question sound more English ...

Possible strategies to increase the difficulty of effective bytehacking

I've been asked to patch a few minor flaws in a game of the unreal series. It uses the unrealscript language which produces bytecode in a similar way to Java. One of the issues is that it's possible to edit any packages downloaded to a client and insert a goto instruction to jump over important bits of code. It isn't possible to preven...

When to use which pattern?

Hello, As a junior developper, i'm a bit confused about some design patterns. Sometimes, i just don't know which to use in which context. For exemple, on creational patterns, i don't really know when to use: Factory Prototype Builder Actually, i see some differences; but i also see that you can use multiple solutions like: Callin...

Naming convention: exit status, exit code or return code?

This is maybe a silly question but what should be the proper naming for the exit code variable? exit_code exit_status return_code ...something else? I'm referring to both application or function exit codes. I know that all of them are synonyms but it would be nice to have a single one, just for consistency. Which one should be, and...

Finding minimum subset of objects with atributes.

I have algorithmic problem. I don't know how to solve it. Maybe someone can help me? I have objects. Each object has the same features. It could be illustrated in table: Feature1 Feature2 Feature3 Feature4 Object1 1 0 1 1 Object2 0 0 0 ...

Purpose of abstraction

What is the purpose of abstraction in coding: Programmer's efficiency or program's efficiency? Our professor said that it is used merely for helping the programmer comprehend & modify programs faster to suit different scenarios. He also contended that it adds an extra burden on the program's performance. I am not exactly clear by what...

Writing a simple email server

What would be a good starting point for me to learn about creating an email server? Basically, what I want to do is have a server (such as foo.com) recieving mail for me so if I send an email to ([email protected]) it will dump the contents of the email into /mail/blah/subject and then send it off to my REAL email account. I'm looking to do...

Designing an API - will this approach work?

First off - new to programming and know very little about API design. That said, I'm creating multiple web apps against a layer of web services and a shared data layer. The approach is simply to create several different types of functionality - i.e. user profiles, status updates, file uploads, rss feeds, etc... where each row in the va...

My simple turing machine

I'm trying to understand and implement the simplest turing machine and would like feedback if I'm making sense. We have a infinite tape (lets say an array called T with pointer at 0 at the start) and instruction table: ( S , R , W , D , N ) S->STEP (Start at step 1) R->READ (0 or 1) W->WRITE (0 or 1) D->DIRECTION (0=LEFT 1=RIGHT) N->N...

Better name for "non-negative" value?

I'm validating that the integer is zero or greater. To describe the requirement as "zero or greater" feels too verbose. To say "non-negative" introduces negative language, which I try to avoid when I can. What concise descriptor do you use when describing a value that must be zero or greater? ...

Programing language concise and systematic description

Can you describe in few sentences or bullets program language you know best? It should be concise, not too long, lets say for one or two slides in presentation, but that contains important classifications of that language. Some details about usage and spread, supported platforms and available libraries. Some strengths and weaknesses. Mos...

How to balance the number of items across multiple columns

I need to find out a method to determine how many items should appear per column in a multiple column list to achieve the most visual balance. Here are my criteria: The list should only be split into multiple columns if the item count is greater than 10. If multiple columns are required, they should contain no less than 5 (except for ...

Is there a relationship between calling a function and instantiating an object in pure functional languages?

Imagine a simple (made up) language where functions look like: function f(a, b) = c + 42 where c = a * b (Say it's a subset of Lisp that includes 'defun' and 'let'.) Also imagine that it includes immutable objects that look like: struct s(a, b, c = a * b) Again analogizing to Lisp (this time a superset), say a struct definitio...

What is the intuition behind cache oblivious data structures?

I understand what the expression cache oblivious means. But I was wondering if there is any easy explanation for how data structures can be designed that can use the cache optimally, without knowing the sizes of the cache. Can you please provide such an explanation, preferably with an (easy) example? ...

Agnostic Javascript Framework Adapter for jQuery and Mootools?

Hey all, I'm about to port a series of my jQuery projects over to Vanilla Javascript (pure javascript, no framework) and would like to know if there are any existing [framework adapters / framework agnostic adapters] out there? For instance I'm envisioning something like this: // My Project (function(){ // Fetch all the elements u...