Is there a difference between "data structure" and "data type"?

Two of the questions that often come up in the Uni exam, where I study, are: Define data types. Classify and explain datatypes Define data structures. Classify and explain data structures Somehow, aren't they the same thing ? Consider that you are ma

Get the most likely color from a set of words

Are there any libraries existing or methods that let you to figure out the most probable color for a words set? For example, cucumber, apple, grass, it gives me green color. Did anyone work in that direction before?If i have to do that, i will try to

Divide the collection into new tables as well.

I'm trying to create an method to evenly distribute an array into X numbers of new arrays, where there is only allowed 15 items pr array, and you are only allowed to create a new array, if the previous have 10 items, except if the array has less than

Generate hills of different heights and widths like Tiny Wings?

How can I generate rolling hills of different height and width like Tiny Wings? Right now I'm using sin() but it obviously generates uniform hills repeating forever and ever. What's the secret? Thanks!Certainly not a procedural generation expert - bu

How do language links work?

How do language bindings work? For instance how would one make bindings from a library written in one language to another language? Would the bindings be written in the same language as the library or the language the bindings are for? Is it possible

Algorithm to determine if 2 graphs are isomorphic

Disclaimer: I'm a total newbie at graph theory and I'm not sure if this belongs on SO, Math SE, etc. Given 2 adjacency matrices A and B, how can I determine if A and B are isomorphic. For example, A and B which are not isomorphic and C and D which ar

Is not the composition bad for testability?

Typically Composition and Aggregation are treated the same? But they are different and the choice which one to use changes a lot? For e.g: I believe aggregation would be ideal for testing. But composition is not. Maintenance of dependencies is a pain

How does this entire encoding work?

In this code golf question, there is a python answer that encodes the lengths of all integers from 1 to 99 in english to a big number: 7886778663788677866389978897746775667552677566755267756675527886778663788677866355644553301220112001 To get the len

Are there any non-obvious ways to misuse GUIDe?

GUIDs are typically used for uniquely identifying all kinds of entities - requests from external systems, files, whatever. Work like magic - you call a "GiveMeGuid()" (UuidCreate() on Windows) function - and a fresh new GUID is here at your serv

How to display the browser's local time in a web application

I am writing a web app and I would like to display timestamps on the page in the user's localtime. There seems to be several ways to do this but it is not obvious what is a good way. Use geolocation from the IP address to get the timezone - This seem

Playing with infinity - lazy arithmetic

Many modern programming languages allow us to handle potentially infinite lists and to perform certain operations on them. Example [Python]: EvenSquareNumbers = ( x * x for x in naturals() if x mod 2 == 0 ) Such lists can exist because only elements

View compiler warnings

I'm looking for a way to visualize compiler warnings and remarks, by annotating or otherwise showing which lines cause a report. This is much like a modern IDE like NetBeans or Eclipse already does, but I'd like to take output from several compilers

How to avoid blockages?

When using multiple threads, shared memory needs to be locked by critical sections. However, using critical sections causes potential deadlocks. How can they be avoided?One way is to use a hierarchy of critical sections. If you ensure that a parent c

Where to start programming?

Once you have your first set of requirements and design done where do you start programming? (Assume tests will be written in the same order, but before the code). The entry point Framework/Support classes Entity Classes Easiest thing first Hardest t

Flexible, robust and portable discovery of services

I am looking for a way for clients in a LAN to find all the instances of my server application without any configuration. Instead of hacking something myself, I'd like to use an existing solution. Personally, I need it to be done in Python, but I'd h

How do you check if a domain name exists?

Not only easy ones like .com or .net, but also,, .fr, ... ? Should I really make a huge mapping "tld to relevant whois server", or is there an easier way ? if (checkdnsrr('',

Agnostic Language Construction Management System

Several times in my career, I have worked in a software group that determined that a) We needed a build/test system b) We should write our own c) We can have a developer spend a week, get it done and they shouldn't have to touch it again Every time,

The first two uppercase characters of a column in a db table

I've got a column in a database table (SQL Server 2005) that contains data like this: TQ7394 SZ910284 T r1534 su8472 I would like to update this column so that the first two characters are uppercase. I would also like to remove any spaces between the

Golf Code: Four is magic

The puzzle A little puzzle I heard while I was in high school went something like this... The questioner would ask me to give him a number; On hearing the number, the questioner would do some sort of transformation on it repeatedly (for example, he m