Just wondering... why does Google app engine recognize "special" string data types such as Link, Email, PhoneNumber, PostalAddress and such? They seem to be simple text types, and don't even have any helper methods which would, for example, extract host/port information from Link.
What design decision would warrant such a distinction?
...
I'm having a bit of a hard time. Essentially I need a data structure that would work a bit like a database. I need to be able to have multiple bits of data for each key and have the possibility of having multiple keys with the same name. Then I need to be able to search that data structure and pull the correct keyword and check it agains...
Since structs are value-types, their data is copied when passed into a method as an argument. Example:
int someInt = 7;
DoSomeMethod(someInt); // <-- This is passing the "value" 7.
So far, easy to understand, and you're probably wondering how my question is valid... so consider the following:
public struct TimmysStructOfGoodness
{
...
Suggest an algorithm and data structure for solving the game Globs (http://www.deadwhale.com/play.php?game=131). It's pretty fun in a geeky kind of way.
(MatrixFrog correctly points out this game is also known as FloodIt, and Smashery gave a solution 3 months ago in the link he cites below. All you dudes suggesting pruning/greedy with o...
I'm looking for a common data sctructure that has the capabilities of a Map<K, List<V>>
Currently what I do is something like
public class MapOfLists <K,V>{
private Map<K, List<V>> map = new HashMap<K, List<V>>();
public void addItem(K key, V value){
if(!map.containsKey(key)){
map.put(key, new ArrayList<...
I'm considering using MongoDB or CouchDB on a project that needs to maintain historical records. But I'm not sure how difficult it will be to store historical data in these databases.
For example, in his book "Developing Time-Oriented Database Applications in SQL," Richard Snodgrass points out tools for retrieving the state of data as ...
Partial Class ClientCenter_UpdateSub
Inherits System.Web.UI.Page
Structure PInfo
Dim Name As String
Dim Surname As String
End Structure
Dim OldPInfo As New PInfo
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'bla...
I want to store some objects and then be able to retrieve them later as efficiently as possible. I will also remove some of them under certain conditions. It seems a hash map would be the right choice.
But, from what I've seen, hash maps always associate a value with another? For example, "john" and "555-5555", his phone number.
Now, m...
I want to calculate the balance factor of a node in avl tree without using any recursive procedure. How can i do that? Please tell me method or provide C++ code snippet.
...
I'm interested in teaching myself different data structures, something I currently know very little about. My plan is to implement a few key structures so I understand how they work. I'm looking for suggestions on important data structures to start with.
I'm primarily interested in data structures that are relevant to search applicati...
For clojure's sorted-map, how do I find the entry having the key closest to a given value?
e.g. Suppose I have
(def my-map (sorted-map
1 A
2 B
5 C))
I would like a function like
(find-closest my-map 4)
which would return (5,C), since that's the entry with the cl...
I have got a series of time intervals (t_start,t_end), that cannot overlap, i.e.: t_end(i) > t_start(i+1). I want to do the following operations:
1) Add new (Union of) intervals [ {(1,4),(8,10)} U (3,7) = {(1,7),(8,10)} ]
2) Take intervals out [ (1,7) - (3,5) = {(1,3),(5,7)}
3) Checking whether a point or a interval overlaps with an int...
All the books I've read on data structures so far seem to use C/C++, and make heavy use of the "manual" pointer control that they offer. Since Python hides that sort of memory management and garbage collection from the user is it even possible to implement efficient data structures in this language, and is there any reason to do so inste...
I'm looking to create a little app that allows the user to visual and control (mostly) classical music, in order to better recognize structures such as canon. What would be an appropriate data and file structure to store the music in?
I know very little about music, so this will be a learning experience on two levels for me. I'd like ...
I've just come across a scenario in my project where it I need to compare different tree objects for equality with already known instances, and have considered that some sort of hashing algorithm that operates on an arbitrary tree would be very useful.
Take for example the following tree:
O
/ \
/ \
O O
...
What is wrong with addAtBegin? The list seems to be correct after assigning the newly created node to start, but when control returns to main, the new value is not saved.
typedef struct node
{
int data;
struct node *link;
}node;
node* createList(int data)
{
node *tempNode=(node*)malloc(sizeof(node));
tempNode->data=data...
I wondered if anyone can tell me simply (I know this is not a simple subject) how kernel timer objects are used to synchronize access to data structures in the kernel?
EDIT:
A kernel timer object is part of the kernel's dispatcher objects, which are the kernel's group of synchronization objects. I wanted to also know if the timer obje...
I'm trying to figure out how non-destructive manipulation of large collections is implemented in functional programming, ie. how it is possible to alter or remove single elements without having to create a completely new collection where all elements, even the unmodified ones, will be duplicated in memory. (Even if the original collectio...
What is the name of the binary tree (or the family of the binary
trees), that is balanced, and has the minimum number of nodes
possible for its height?
...
I have to get the message structure of a protobuf message transfered to me without the message's definition. Using UnknownFieldSet methods, I was able to get a string representation of the message as below:
1: "a"
2: {
3:"b"
4:"c"
}
What data structure does field 2 represent ? Using UnknownFieldSet.Field.getGroupList i was able ...