Rosetta Code:Village Pump/Suggest a programming task: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎General: mathematical operations)
(→‎General: Added color space request, reorganized slightly, added design pattern list.)
Line 7: Line 7:
=Incomplete=
=Incomplete=
==General==
==General==
* [http://en.wikipedia.org/wiki/B-tree B-Tree]
* The Object oriented category is missing a lot of the basics like calling a method.
* The Object oriented category is missing a lot of the basics like calling a method.
* Explicit implementation of various [[wp:http://en.wikipedia.org/wiki/Category:Software_design_patterns design patterns]]
** Multiple dispatch (aka multimethods) - http://en.wikipedia.org/wiki/Multimethods
** Multiple dispatch (aka multimethods) - http://en.wikipedia.org/wiki/Multimethods
* Closures
* Closures
Line 51: Line 51:
===Data organization and encoding===
===Data organization and encoding===
* Heapsort and maybe some other sorts from http://en.wikibooks.org/wiki/Algorithm_implementation/Sorting
* Heapsort and maybe some other sorts from http://en.wikibooks.org/wiki/Algorithm_implementation/Sorting
* [http://en.wikipedia.org/wiki/B-tree B-Tree]
* SAX. As well as DOM and XPath it would probably be useful to demonstrate parsing a simple XML document with SAX.
* SAX. As well as DOM and XPath it would probably be useful to demonstrate parsing a simple XML document with SAX.
* Base64 encode/decode
* Base64 encode/decode
Line 67: Line 68:
===Mathematical Operations===
===Mathematical Operations===
* Euler's method for approximating solutions to differential equations
* Euler's method for approximating solutions to differential equations
===Color Spaces===
* Conversion from sRGB to HSL, HSV and CMYK.
===Design patterns==
* [[wp:Abstract factory pattern|Abstract factory pattern]]
* [[wp:Active object|Active object]]
* [[wp:Active record pattern|Active record pattern]]
* [[wp:Adapter pattern|Adapter pattern]]
* [[wp:Aggregate pattern|Aggregate pattern]]
* [[wp:Amelioration Patterns|Amelioration Patterns]]
* [[wp:Archetype Pattern|Archetype Pattern]]
* [[wp:Architectural pattern (computer science)|Architectural pattern (computer science)]]
* [[wp:Asynchronous method invocation|Asynchronous method invocation]]
* [[wp:Balking pattern|Balking pattern]]
* [[wp:Barton-Nackman trick|Barton-Nackman trick]]
* [[wp:Behavioral pattern|Behavioral pattern]]
* [[wp:Bridge pattern|Bridge pattern]]
* [[wp:Builder pattern|Builder pattern]]
* [[wp:Chain-of-responsibility pattern|Chain-of-responsibility pattern]]
* [[wp:Command pattern|Command pattern]]
* [[wp:Composite pattern|Composite pattern]]
* [[wp:Concurrency pattern|Concurrency pattern]]
* [[wp:Creational pattern|Creational pattern]]
* [[wp:Curiously recurring template pattern|Curiously recurring template pattern]]
* [[wp:Data transfer object|Data transfer object]]
* [[wp:Data access object|Data access object]]
* [[wp:User:Rvalimaki|User:Rvalimaki]]
* [[wp:Debugging patterns|Debugging patterns]]
* [[wp:Decorator pattern|Decorator pattern]]
* [[wp:Delegation pattern|Delegation pattern]]
* [[wp:Dependency inversion principle|Dependency inversion principle]]
* [[wp:Design Patterns (book)|Design Patterns (book)]]
* [[wp:Design pattern|Design pattern]]
* [[wp:Differentiated service|Differentiated service]]
* [[wp:Dispose pattern|Dispose pattern]]
* [[wp:Distributed design patterns|Distributed design patterns]]
* [[wp:Double dispatch|Double dispatch]]
* [[wp:Double-chance function|Double-chance function]]
* [[wp:Double-checked locking|Double-checked locking]]
* [[wp:Enterprise Integration Patterns|Enterprise Integration Patterns]]
* [[wp:Event handler|Event handler]]
* [[wp:Exception chaining|Exception chaining]]
* [[wp:Extensibility pattern|Extensibility pattern]]
* [[wp:Facade pattern|Facade pattern]]
* [[wp:Factory method pattern|Factory method pattern]]
* [[wp:Factory object|Factory object]]
* [[wp:Factory pattern|Factory pattern]]
* [[wp:Fluent interface|Fluent interface]]
* [[wp:Flyweight pattern|Flyweight pattern]]
* [[wp:Front Controller pattern|Front Controller pattern]]
* [[wp:Fundamental pattern|Fundamental pattern]]
* [[wp:Guarded suspension|Guarded suspension]]
* [[wp:Hash consing|Hash consing]]
* [[wp:Head-Body Pattern|Head-Body Pattern]]
* [[wp:Hierarchical visitor pattern|Hierarchical visitor pattern]]
* [[wp:Hollywood Principle|Hollywood Principle]]
* [[wp:Identity map|Identity map]]
* [[wp:Initialization on demand holder idiom|Initialization on demand holder idiom]]
* [[wp:Interaction design pattern|Interaction design pattern]]
* [[wp:Interceptor pattern|Interceptor pattern]]
* [[wp:Interpreter pattern|Interpreter pattern]]
* [[wp:Inversion of control|Inversion of control]]
* [[wp:Iterator pattern|Iterator pattern]]
* [[wp:Lazy Inheritance|Lazy Inheritance]]
* [[wp:Lazy initialization|Lazy initialization]]
* [[wp:Lazy loading|Lazy loading]]
* [[wp:List of Object-oriented design patterns|List of Object-oriented design patterns]]
* [[wp:Mangler Pattern|Mangler Pattern]]
* [[wp:Marker interface pattern|Marker interface pattern]]
* [[wp:Mediator pattern|Mediator pattern]]
* [[wp:Memento pattern|Memento pattern]]
* [[wp:Message broker|Message broker]]
* [[wp:Mock object|Mock object]]
* [[wp:Model 1|Model 1]]
* [[wp:Model 2|Model 2]]
* [[wp:Model View ViewModel|Model View ViewModel]]
* [[wp:Model-view-presenter|Model-view-presenter]]
* [[wp:Model–view–controller|Model–view–controller]]
* [[wp:User:Damianham/Model View Role|User:Damianham/Model View Role]]
* [[wp:Model–view–adapter|Model–view–adapter]]
* [[wp:Multiton pattern|Multiton pattern]]
* [[wp:Naked objects|Naked objects]]
* [[wp:Nianio|Nianio]]
* [[wp:Null Object pattern|Null Object pattern]]
* [[wp:Object pool|Object pool]]
* [[wp:Observer pattern|Observer pattern]]
* [[wp:Pipeline (software)|Pipeline (software)]]
* [[wp:Portland Pattern Repository|Portland Pattern Repository]]
* [[wp:Presentation-abstraction-control|Presentation-abstraction-control]]
* [[wp:Private class data pattern|Private class data pattern]]
* [[wp:Process patterns|Process patterns]]
* [[wp:Prototype pattern|Prototype pattern]]
* [[wp:Provider model|Provider model]]
* [[wp:Proxy pattern|Proxy pattern]]
* [[wp:Reactor pattern|Reactor pattern]]
* [[wp:Read/write lock pattern|Read/write lock pattern]]
* [[wp:Row Data Gateway|Row Data Gateway]]
* [[wp:Scheduled-task pattern|Scheduled-task pattern]]
* [[wp:Scheduler pattern|Scheduler pattern]]
* [[wp:Separation of presentation and content|Separation of presentation and content]]
* [[wp:Service locator pattern|Service locator pattern]]
* [[wp:Single-serving visitor pattern|Single-serving visitor pattern]]
* [[wp:Singleton pattern|Singleton pattern]]
* [[wp:Proactor pattern|Proactor pattern]]
* [[wp:Specification pattern|Specification pattern]]
* [[wp:State pattern|State pattern]]
* [[wp:Strategy pattern|Strategy pattern]]
* [[wp:Structural pattern|Structural pattern]]
* [[wp:Table Data Gateway|Table Data Gateway]]
* [[wp:Template method pattern|Template method pattern]]
* [[wp:Thread pool pattern|Thread pool pattern]]
* [[wp:Visitor pattern|Visitor pattern]]
* [[wp:Workflow patterns|Workflow patterns]]


==API-specific==
==API-specific==

Revision as of 19:42, 27 November 2009

So you want to see a problem solved? If you're not comfortable creating the task page yourself, feel free to edit this page, and describe the problem below. (To edit this page, click the "edit" tab at the top.)

When making a request, please place it in the Unsorted section.

When reviewing requests, please help sort them into the categories farther down, based on the category descriptions.

Incomplete

General

  • The Object oriented category is missing a lot of the basics like calling a method.
  • Explicit implementation of various wp:http://en.wikipedia.org/wiki/Category:Software_design_patterns design patterns
  • Closures
  • Monads
  • Sentinel value -- What values are commonly used for sentinel purposes. (This may end up beyond language comparison and delve into protocols) --Short Circuit 18:09, 9 June 2009 (UTC)
    • Perhaps Null should be generalized to cover this? --Kevin Reid 21:27, 29 August 2009 (UTC)
  • Check if defined -- Determine whether a variable has a defined value.
  • Applying a list of functions to a value. (As different from applying a function to a list of values.)Rahul 21:23, 9 December 2008 (UTC)
See First-class functions --Paddy3118 15:34, 24 February 2009 (UTC)
Not entirely appropriate. Nothing prevents one from having a list of function pointers in C or C++ to apply to the same pointer or reference to the value in question. However, there appears to be significant discussion whether C is even appropriate in the task you link to. --Short Circuit 07:52, 25 February 2009 (UTC)
Could this be added to Comparing two integers? --Mwn3d 07:28, 21 December 2007 (MST)
Type-variant rather suggests dynamic polymorphism, i.e. when the specific type of the value (and the value itself) depends on the type tag of the object. MS VARIANT is rather a different thing. It is a union, a container type which content depends on the value of the constraint. This is also a form polymorphism, but different, a dynamically constrained type. The type of the object does not vary. A similar case represents unbounded array, which size depends on the actual bounds (the constraint). (Granted, MS VARIANT serves the purpose of dynamic polymorphism, but that is merely because MS wished to keep it conform to non-OO languages.) --Dmitry-kazakov 13:24, 9 April 2009 (UTC)
  • Methinks it is like a weasel: It would be cool to have a collection of Methinks programs here in many languages. Source codes and information.
Will this do: Evolutionary algorithm? --Paddy3118 05:12, 7 October 2009 (UTC)
  • I don't know where this should go, but it would be great to have a use comparison of regular expressions 187.37.58.35 18:40, 3 November 2009 (UTC)
Is this close? --Mwn3d 20:22, 3 November 2009 (UTC)
Probably not quite what he's looking for. Different regex implementations (i.e. .Net's, Perl's, sed, Visual Studio's, etc.) have different extensions and escape sequences. It's likely he's looking for a comparison as though each variant of regex were treated as being distinct languages. Accessing the implementation is one thing, but performing various supported operations is another. --Michael Mol 21:50, 3 November 2009 (UTC)
POSIX specifies two levels of regular expressions, and then there's additional levels beyond that (c.f. Perl and PCRE). There's also a lot of disagreement between different camps here over the type of automaton that should be used in the implementation. It's a mess to be honest (as extensions beyond POSIX EREs aren't standardized). Because of that, if you're going to delve deeper into REs, I advise picking one of the POSIX levels and explicitly stating that that level only be supported. –Donal Fellows 23:03, 3 November 2009 (UTC)
yea in a long term it would be great to have something like Michael Mol said but that's a very nice start, thanks 187.37.58.35 14:39, 4 November 2009 (UTC)
UPDATE: now I noticed this page Regular_expression_matching is there for quite a time, but I didn't found it in the 'by Task' link, that's why I posted, also searching by "Regular expression" in the search box results nothing.. 187.37.58.35 16:17, 4 November 2009 (UTC)
That task is listed under Text processing on the Solutions by Task page. You can also look at Category:Programming Tasks to see a list with no sub-categories. I can set up a redirect from "Regular expressions" for now, though it seems like we need more tasks to cover REs. --Mwn3d 16:20, 4 November 2009 (UTC)
  • Simple, common requirements for 3D animation, including running an operation consistently N times per second, generate and draw basic geometric shapes like spheres, cubes and cylinders, load and display a point mesh and apply a texture to a quad. I'll host any desired data on the server. --Michael Mol 08:29, 13 November 2009 (UTC)

Games

  • Connect Four (or more) with variable and standard game board (6 rows, 7 columns)
    - but watch for trade mark violations etc --Paddy3118 17:33, 29 April 2009 (UTC)
    O.K., the games can be called The Captain's Mistress", because that is the original, much older verson of the "Connect Four" (which was "invented" and copyrighted in 1974 by Milton Bradley, according to the Wikipedia.) --Borisbaran 12:33, 3 May 2009 (UTC)
    Then why not dots-and-crosses (five-in-a-line): discovered a site which call it this way, but I played it when I was eight y.o., and surely it's a very old game people played with paper and a pen long before anyone thought to register a copyright or what on it; instead of different colors, we can use a cross and a dot, and this is the name I knew it: "puntini e crocette" (dots and crosses)... But I think the interesting part would be to program the A.I. opponent... --ShinTakezou 14:07, 5 May 2009 (UTC)
    Reading it better... It's Gomoku! (But a paper can be like a board bigger than 19×19) --ShinTakezou 14:10, 5 May 2009 (UTC)
  • Dots and Boxes is quite a fun game to do, especially since the game has been around for ages and its strategies have been well studied. It's also quite easy to do just the GUI parts of the game, making a simple game for two players. —Dkf 12:15, 18 May 2009 (UTC)
    More possibilities are von Neumann, wireworld, and Langton cellular automata. They're not really games as such, but they're certainly interesting in similar ways. —Donal Fellows 14:58, 9 August 2009 (UTC)
    I've done the Wireworld automaton as a task. —Donal Fellows 11:01, 9 September 2009 (UTC)

Database / Network

  • Simple DB connection and queries.
  • Certificate-authenticated SSL
  • Secure Socket Layer

Data organization and encoding

System calls

  • Copy a directory tree recursively
    • On a local filesystem
    • With an option to specify files or folder to exclude
  • Open a named pipe
  • Demonstrate use of a foreign function interface to call a C-routine or library function

Mathematical Operations

  • Euler's method for approximating solutions to differential equations

Color Spaces

  • Conversion from sRGB to HSL, HSV and CMYK.

=Design patterns

API-specific

  • Provide a SOAP server function

Library-specific

  • Create a COM client (with early binding) (particularly with GCC/MinGW) (if possible under Winelib in linux is also interesting)

Implementation-specific

Language-specific

Duck typing specifically my DuckDecoy Example? --Paddy3118 18:28, 5 May 2009 (UTC)

Project level

If possible, find ways to break these into smaller tasks which can ultimately be assembled into the final project.

Super Simple p2p network

Could be done with FIFOs for streams, and a constant number of clients. Needs to be more specific regarding what it does. --Short Circuit 22:28, 6 December 2007 (MST)
probably means some thing like this http://ansuz.sooke.bc.ca/software/molester/molester. To make it suitable for rc the restrictions need to be spelt out - i.e. fixing the protocol and discovery mechanisms Rahul 20:24, 7 October 2008 (UTC)

implement a table-based native code (macro?) assembler in various HLLs

Stateful behavior simulation

Demonstrate discrete event simulation and stateful behaviour by simulating a simple pick-and-place or storage/retrieval system robot. The robot would be given commands to retrieve from location A and place into location B. The robot would in turn command its 4 motors in sequence in order to accomplish the task. The amount of time that a motor runs would be dependant on the distance required to move. A scheduler would be set up to generate callback events to the motors at proper times to indicate their motion was complete. The complete specification of this task would be somewhat involved. --Rldrenth 18:09, 20 January 2009 (UTC)

This needs to be simplified/clarified from requiring "four motors" to having three commands, "set velocity forward/back", "no-op" and "claw open/close".
Subsequently, it can be divided into four parts:
  1. Call a function at a constant interval
  2. Create a function which reads from a primary queue containing simple commands and a secondary queue containing complex commands, processing exactly one of these commands, and then calls the state update function.
  3. Create a function that converts a complex command "starting from x1, pick up at x2 and drop at x3" to one of the three simple commands
  4. Create a function that updates the state (velocity and position) based on the currently executing command.

In the interest of simplicity, it can be assumed that the program may terminate once the secondary queue is empty, that the robot has a constant velocity either forward or backward, and that the velocity and position values at termination are irrelevant. --Short Circuit 05:40, 19 May 2009 (UTC)

Unit test framework

Demonstrate the use of a unit test framework for your language

Simple Shell

Execute system commands, pipes, I/O redirection, command history, custom PATH variable, etc. --CheesyPuffs144 01:44, 9 August 2009 (UTC)

Prolog interpreter

The Prolog's syntax looks incredibly simple, and I'm wondering how difficult it would be to write a prolog interpreter in various langauges. --Michael Mol 08:21, 13 November 2009 (UTC)

Recently Completed

If a task has been completed, move the request to this category. Add a link to the task page, and sign (add --~~~~) to the request. Completed tasks more than a week old should be removed from the list.

Discuss

  • Querying devices for certain SNMP values and output reponses to .html or .txt-file.
    • Used for:
      • generating webpage where helpdesk can view the VLAN of a user-port
      • querying forwarding database of switch / ARP-table of router
    • Can be extended:
      • with config file for: device list, SNMP-values to interrogate, SNMP community strings, ...
      • support for SNMPv3
      • generating history reports: what mac-address has been on this port, when has a change been made, ...
    • Wanted to do this myself for a long time already using Python or Ruby, but not making a lot of progress. Any help or suggestion would be welcome.
This should probably be split into Query SNMP server and Retrieve configuration setting (for an application, not the SNMP server). There are already tasks for outputting to a file. --Short Circuit 23:43, 16 February 2008 (MST)
  • Win interface... C++ calls to Fortran F90/95 Source Code ... and back...
This should be as trivial as Call function in shared library, if the Fortran code has been compiled into a shared library. (Regardless of OS) --Short Circuit 23:43, 16 February 2008 (MST)
Serialization and deserialization are extremely common programming tasks, and there are a fair number of open formats for the purpose. Serialization and deserialization should probably get their own category under Category:Solutions by Programming Task. Additionally, json.org has a list of existing JSON implementations, sorted by language, to refer to. This should be a very quick thing to implement for JSON. Other formats that should be considered are XML and binary (packed) formats. --Short Circuit 04:38, 20 June 2009 (UTC)
  • Tree traversal: the only place I found that requirement was in Parametric Polymorphism which says to omit Tcl due to lack of static typing. But the task ist still interesting, and should be offered to any language, however typed. --Suchenwi 12:05, 25 May 2009 (UTC)
This is now Tree traversal