language-agnostic

Theoretical Basics of Lambda Functions

Hi all, I was just wondering where I could find some language-agnostic tutorials for what lambda functions are, what their use is, and rough equivalents in languages that don't support them. I would especially love any information on common notations. Thanks! Please let me know if I can elaborate on this at all. EDIT: Oh hey I forgot...

Using regex to match string between two strings

How can I use a regular expression to match text that is between two strings, where those two strings are themselves enclosed two other strings, with any amount of text between the inner and outer enclosing strings? For example, I have this text: outer-start some text inner-start text-that-i-want inner-end some more text outer-end ...

Is there a way to tell if a unicode character is a control, alpha, numeric or symbolic?

Assuming all you have is the binary data and no pre-canned functions, is there a pattern or algorithm to categorize the type of character? ...

GUI Design - ComboBoxes Versus Lists or RadioButtons

When should some GUI elements be used over others? For instance, how do you choose between a ComboBox, RadioButtons, or Listbox? For instance, I have seen ComboBoxes used for as many as two items and radio buttons for two items as well, on the same panel. How do you maintain a constant, intuitive GUI interface that is not confusing to th...

What algorithm should be used when doing filechecksums to find dupes?

Is taking a MD5 sum still suitable for checking for file dupes? I know that it isn't secure, but does that really matter in the case of trying to find file dupes? Should I be using something in the SHA family instead? What is best practice in this use case? ...

Strangest language feature

What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered? Please only one feature per answer. ...

What are the rules/laws in regards to using code posted without an explicit license?

Lets say person X posts some code on a public forum (totally public, even to guests), and they post it without an explicit 'license'. Person Y then comes along and decides to use that code in a proprietary application. Is that legal? What about using the code in an open source application? Is it only legal if they give attribution? Is...

What programming language(s) is algorithmic trading software written in?

Anyone know what programming language(s) is algorithmic trading software mostly written in? Also known as automated trading, algo trading, black-box trading or robo trading. If I wanted to write the above software where would I start? Any tips/trick/advice greatly appreciated. Thank you in advance ;-) ...

Where does performance still matters?

Just wondering: In which fields of programming does performance still matter? I know about some of the classic fields like multimedia/games, embedded-systems and so on, but that can't be all. Do you know about any niches where performance is still relevant? ...

Data structures- what determines inclusion in language library?

With an assignment dealing with access control lists, it was required to construct a doubly-linked list first, as Java doesn't include that in the SUN API. I can understand if the professor wanted us to create the Doubly Linked List from scratch to understand how it works (like writing a sort program vs using the baked in methods), but w...

Tessellating an arbitrary polygon by tiling triangles

I need to fill an arbitrary polygon using a near-uniform tiling of triangles. How would I do this? You may provide either references to existing algorithms or even simply ideas or hints of your own. The following is presumed: The polygon may be convex (but bonus points if you come up with an algorithm that works for concave shapes) Th...

Creating Great API Documentation: Tools and Techniques

I'm tasked with creating a web service that will be used by several different developers using different platforms, working for different companies, and having greatly varying skill levels. As such, I would like to create documentation for this web service API that is both complete, and very easy to understand. Although I'm sure this i...

Boundary representation data structure

I've been reading about using the winged-edge data structure for storing a boundary representation. However, the linked site says that this is one of the oldest data structres for storing b-reps, are there newer better ones? Secondly, is there an implementation of this in C#? ...

Constructive solid geometry mesh

If I construct a shape using constructive solid geometry techniques, how can I construct a wireframe mesh for rendering? I'm aware of algorithms for directly rendering CSG shapes, but I want to convert it into a wireframe mesh just once so that I can render it "normally" To add a little more detail. Given a description of a shape such a...

Creating a hash of a string thats sortable

Is there anyway to create hashs of strings where the hashes can be sorted and have the same results as if the strings themselves were sorted? ...

Bug tracking methodology

I'm working on software for a company that doesn't ever file bug reports, the only complain, "so and so isn't working." Sometimes I can figure out what they're talking about, sometimes not. My pleas for screenshots and more details fall on deaf ears (once they did take a screenshot, then printed it out, scanned in it with their fax machi...

Compiler that recognize different-different languages and send them to their corresponding compilers. Possible ?

I was thinking whether it is possible to bridge asp.net, php and java to form a single page. Actually i dont need any such thing as of now. It was just an idea that stiked to my mind as some features of some languages are good and some features or some other languages are good, so i was thinking what if i combine all these features into...

Splay tree insertion

Going through some excercises to hone my binary tree skills, I decided to implement a splay tree, as outlined in Wikipedia: Splay tree. One thing I'm not getting is the part about insertion. It says: First, we search x in the splay tree. If x does not already exist, then we will not find it, but its parent node y. Second, we perfor...

Please help me find the official name of this programming approach.

I [surely re] invented this [wheel] when I wanted to compute the union and the intersection and diff of two sets (stored as lists) at the same time. Initial code (not the tightest): dct = {} for a in lst1: dct[a] = 1 for b in lst2: if b in dct: dct[b] -= 1 else: dct[b] = -1 union = [k for k in dct] inter = [k for k in dct...

Should the caller initialize "out" parameters?

Many Win32 API functions have parameters specified to be "out". For example, GetIconInfo() description says about the second parameter that The function fills in the structure's members. This implies that the function doesn't ever read the original values stored in the "out" parameter - only changes them - and therefore the caller is fr...