adt

problems with typedef on C

I writing some ADT on C: I have two file date.c and date.h inside date.c I have: typedef struct Date_t { int date; char* month; int year; } Date; inside date.h I have: typedef Date pDate; compiler gives me errors: ..\checking.h:15: error: syntax error before "pDate" can somebody please explain what is wrong with my typedef, ...

Is it possible to define new ADTs in GHCi

While commenting on new features in ghci I wished that ghci had the ability to declare type declaration and declaring new ADT types, someone informed that it was indeed possible, and after searching I found this page which told me I could do let numUniques' :: (Eq a) => [a] -> Int; numUniques' = length . nub Apparently that same sort...

How do I use Haskell's type system to enforce correctness while still being able to pattern-match?

Let's say that I have an adt representing some kind of tree structure: data Tree = ANode (Maybe Tree) (Maybe Tree) AValType | BNode (Maybe Tree) (Maybe Tree) BValType | CNode (Maybe Tree) (Maybe Tree) CValType As far as I know there's no way of pattern matching against type constructors (or the matching functions i...

Error installing ADT plugin in Eclipse on Ubuntu 10.04

I have installed the plugin many times before, but this time I keep getting this error: 'Install' has encountered a problem An error occurred while installing the items Eclipse has some memory issues when running on my machine, so I just want to install the bare minimum plugins, etc. Has anyone got any ideas how to get arou...

What is this abstract data type called?

I'm writing Haskell, but this could be applied to any OO or functional language with a concept of ADT. I'll give the template in Haskell, ignoring the fact that the arithmetic operators are already taken: class Thing a where (+) :: a -> a -> a (-) :: a -> a -> a x - y = x + negate y (*) :: (RealFrac b) => a -> b -> a neg...

In Eclipse, any way to start application in more than one emulator at the same time?

When testing Android layouts, I'm constantly building for three different emulators from Eclipse (with ADT), so I have to run three times and then select each one. Is there any configuration or plugin that allows me to press Run once and the application is started in all three? ...

Eclipse (with adt) won't see/recognise a runnving avd

Hi, I have been trying this for a week or so now. I have followed the tutorial to get hello android working but while an AVD starts the program doesn't run. I am running Windows 7 64 bit with eclipse 3.5.2 running adt 0.9.9 and SDK r7. the sdk is installed in C:\android-sdk-windows eclipse is installed in C:\eclipse What i can do: ...

Name three strategies for internal data storage when implementing a Stack ADT

This was a question my Data Structures teacher put on our recent test. I immediately thought of a List and an Array but I cannot for the life of me think of a third ADT that could be used as internal storage for a Stack. Any help? ...

Android Eclipse ADT device configuration for EVO 4G 4.3" layout

I'm trying to create an ADT layout configuration to match an EVO 4G screen, with its 800x480 resolution and 4.3" screen. The emulator I created by just specifying WVGA800 in the SDK Manager seems to match my physical EVO device perfectly. However, when I try to create a Layout device config (the one you select when you edit an XML view)...

Adding a drawable resource

This must be something I’m just overlooking or possibly my ADT install is out of date. When I attempt to add a new drawable resource to my project I don’t see a type of Drawable in the “New Android XML file dialog.” Here’s what I see when adding a resource: http://img221.imageshack.us/img221/2977/drawable.jpg What am I missing here? ...

Class Hierarchy - ADT Hierarchy ~ Object, Ownership, container, wrapper, iterator, visitor,

I took a data structures class at a community college and transferred over to a university into a software engineering program. The data structures class i took covered. Queue,stack combined with circular arrays, hash tables and trees. My friend is currently taking data structures at the university i transferred to. They are teaching him...

Using Generics with Abstract Data Types in Java

For a CS class I need to solve an assigned problem using three data structures: Queue, PriorityQueue, and Stack. I wanted to write a single solution to the problem using an abstract data structure. I would implement the ADT with a wrapper class of each required data type. This is what I have so far: An interface called Method: public...