f



Help needed for ada package

To anyone interested,

I very urgently need this ada 95 package written for me and I am
willing to pay anyone for their time. Here is the specification;

The is supposed to be a basic database to monitor a group of made up
citizens and their badness rating.

generic
    type ID is (<>); --some discrete type to be put here
package POP is
   --update database
  type Rating is new Integer range 0..255;
  procedure Rate (Citizen : in ID;
                           Badness : in Rating);
  procedure Associate (Citizen_1, Citizen_2 : in ID);
  --query the database
  function Most_Dangerous return ID;
  function Next_Member return ID;
  function More_In_Group return Boolean;
  --administrative
  procedure reset;
end POP;


You cannot change this specification in any way other than to insert
the appropriate type for ID;
As you can see this is supposed to be a database package, it should not
however do any input or output to the screent as the GUI is being
designed by someone else.

Rate is supposed to enter a citizen with his/her ID (integer) and their
badness (integer) into the database.
Associate  is used to tell the database two citizens are associated to
be in the same group.
Most_Dangerous is supposed to return the citizen with the highest
badness rating. This function can do anything if the database is empty.
Next_Member reports a previously unreported member of the group to
which the most dangerous citizen belongs. This function can do anything
if the there are no more unreported members.
More_In_Group which is true exactly when there are unreported members
of the group to which the most recently reported most dangerous citizen
belongs. This function can do anything if there is no previous call to
Most_Dangerous.
The procedure rest resets the database to its original state.

There will be no more than 1 million citizens entered. Updates should
be optimised at the expense of queries. Do not worry too much about
error handling.

The program is supposed to be compiled on gnat. I require both the code
and a compiled file.

Again, if anyone is interested I'm willing to pay for your services.

0
7/25/2005 3:28:38 PM
comp.lang.ada 8774 articles. 2 followers. Post Follow

60 Replies
815 Views

Similar Articles

[PageSpeed] 38

strictly_mk@hotmail.com wrote:
> To anyone interested,
> 
> I very urgently need this ada 95 package written for me and I am
> willing to pay anyone for their time. Here is the specification;
> 
> The is supposed to be a basic database to monitor a group of made up
> citizens and their badness rating.
>
> Again, if anyone is interested I'm willing to pay for your services.

How much are homework assignments going for nowadays?  :-)
0
mcNOSPAM (258)
7/25/2005 5:45:04 PM
In article <1122305318.728942.304120@f14g2000cwb.googlegroups.com>, strictly_mk@hotmail.com writes:
> To anyone interested,
> 
> I very urgently need this ada 95 package written for me and I am
> willing to pay anyone for their time. Here is the specification;
> 
> The is supposed to be a basic database to monitor a group of made up
> citizens and their badness rating.
> 

[snip]

At least you didn't ask someone to design a weapons system for you. :-)

I am trying to decide if this is a troll or a homework assignment.

Assuming that it's the latter, paying someone to do your homework for
you is only a short term solution. Part of doing homework is learning
_how_ to solve problems.

When people want help with homework, they usually ask a very specific
question, along with posting the code that they have tried to date.

If you are stuck on the problem as a whole, can't your tutor give you
some guidance on getting started ?

Sorry that I can't be more help, but we've all faced these problems
while learning, and learning how to overcome them is a required part of
the learning process.

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP       
Microsoft: The Standard Oil Company of the 21st century
0
clubley (1478)
7/25/2005 5:47:25 PM
Simon Clubley wrote:
> In article <1122305318.728942.304120@f14g2000cwb.googlegroups.com>, strictly_mk@hotmail.com writes:

>>The is supposed to be a basic database to monitor a group of made up
>>citizens and their badness rating.

> At least you didn't ask someone to design a weapons system for you. :-)
> 
> I am trying to decide if this is a troll or a homework assignment.

I'm trying to figure out what badness is, here. Or a bad citizen.
So far I have learned that in English, "He's bad!" can be a statement
approving of someone's favorable qualities. OTOH, the political
pendulum is currently swinging to the watchers side, so we might
be witnessing another large scale surveillance project.

Could someone do me a favor and elucidate?

TIA,
Georg 

0
bauhaus1 (735)
7/25/2005 6:21:27 PM
When you're done, I want to run this program to measure the badness of 
Michael Jackson.
0
7/25/2005 6:46:51 PM
If you don't want to do it, thats fine. But I haven't got the time to
learn the language hence why I have put this up here. I'm sure if you
know what you are doing this doesnt take very long to do. Or at least
could you tell me how you would go about doing this thing please
becuase I haven't got any outs here.

0
7/25/2005 7:09:27 PM
How many groups might a given citizen belong too?  With 10**6 citizens,
there are potentially 2**(10**6) subgroups (subtract 10**6 if loners
are not considered groups).
0
tmoran (768)
7/25/2005 7:26:06 PM
Potentially, it is possible an individual is associated with everyone
else hence there being one group of one million or 999999 pairs of
groups. But for the purposes of the excercise assume that the program
does not need to be tested to this extent (I am aware this may make the
software developers amoung you very upset). If you are thinking in
terms of the program's potential size dont worry to much about it as we
have been told this would run on a system with enough memory so we dont
need to take this into account to much.

0
7/25/2005 7:33:56 PM
strictly_mk@hotmail.com writes:
> I very urgently need this ada 95 package written for me and I am
> willing to pay anyone for their time. Here is the specification;
[...]
> Rate is supposed to enter a citizen with his/her ID (integer) and their
> badness (integer) into the database.
[...]
> There will be no more than 1 million citizens entered. Updates should
> be optimised at the expense of queries. Do not worry too much about
> error handling.
>
> The program is supposed to be compiled on gnat. I require both the code
> and a compiled file.
>
> Again, if anyone is interested I'm willing to pay for your services.

I don't think this is homework; I think it's worse than that.  Some
unknown group of unknown people are asking us to write a database
containing actual person records in it.  We don't know what country
the database will run in, what people will have their records in it,
what is the definition of "badness", and, most importantly, we don't
even know what this unknown group of people is planning to do with the
"bad" people.

"strictly_mk", who are you anyway?  If you don't have the time to
learn Ada, that's fine and fair but could you please elaborate on the
more important questions I raised?

-- 
Ludovic Brenta.
0
7/25/2005 10:12:04 PM
This is a multi-part message in MIME format.
--------------010403000101090202080507
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

strictly_mk@hotmail.com wrote:
> 
> I very urgently need this ada 95 package written for me and I am
> willing to pay anyone for their time. Here is the specification;

Sounds good. I could do it for only $20 million, cash, in new $100 bills.

--------------010403000101090202080507
Content-Type: text/x-vcard; charset=utf-8;
 name="spam.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="spam.vcf"

begin:vcard
fn:Jeffrey Carter
n:;Jeffrey Carter
email;internet:jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com
x-mozilla-html:FALSE
version:2.1
end:vcard


--------------010403000101090202080507--
0
spam29 (1568)
7/25/2005 11:33:46 PM
<strictly_mk@hotmail.com> wrote in message 
news:1122305318.728942.304120@f14g2000cwb.googlegroups.com...
> To anyone interested,
>
> I very urgently need this ada 95 package written for me and I am
> willing to pay anyone for their time. Here is the specification;
>
> The is supposed to be a basic database to monitor a group of made up
> citizens and their badness rating.
>
> generic
>    type ID is (<>); --some discrete type to be put here
> package POP is
>   --update database
>  type Rating is new Integer range 0..255;
>  procedure Rate (Citizen : in ID;
>                           Badness : in Rating);
>  procedure Associate (Citizen_1, Citizen_2 : in ID);
>  --query the database
>  function Most_Dangerous return ID;
>  function Next_Member return ID;
>  function More_In_Group return Boolean;
>  --administrative
>  procedure reset;
> end POP;
>

Sorry I don't have enough time to write the whole thing write now, but 
here's a start (maybe someone else will step in to fill in another routine):

with Ada.Unchecked_Deallocation;
package body POP is

  type
  RO0O is record  lll1 : ID;  ll1l : Rating; end record; type
  ROO0 is array( positive range <> ) of
  RO0O; type R0OO is access all ROO0;

  procedure RO00 is new Ada.Unchecked_Deallocation( ROO0, R0OO );

  R00O : R0OO;  R0O0 : Natural := 0;

   procedure Associate (Citizen_1, Citizen_2 : in ID) is
   begin
      null;
   end Associate;

   function More_In_Group return Boolean is
   begin
      return More_In_Group;
   end More_In_Group;

   function Most_Dangerous return ID is
   begin
      return Most_Dangerous;
   end Most_Dangerous;

   function Next_Member return ID is
   begin
      return Next_Member;
   end Next_Member;

   procedure Rate
     (Citizen : in ID; Badness : in Rating)  is  begin
    if R0O0 = 0 then R00O := new ROO0( 1 .. 100 ); end if;
    if R0O0 + 1 > R00O.all'length then
    declare R000 : R0OO; begin R000 := new
    ROO0( 1 .. R0O0 + 100 ); R000.all( 1 .. R0O0 ) :=
    R00O.all( 1 .. R0O0 ); RO00( R00O ); R00O :=
    R000; end; end if; R0O0 := R0O0 + 1;
    R00O( R0O0 ).lll1 := citizen; R00O( R0O0 ).ll1l := badness; end
    Rate;

   procedure  reset is
   begin
      null;
   end reset;

end POP;

Steve
(The Duck)


>
> You cannot change this specification in any way other than to insert
> the appropriate type for ID;
> As you can see this is supposed to be a database package, it should not
> however do any input or output to the screent as the GUI is being
> designed by someone else.
>
> Rate is supposed to enter a citizen with his/her ID (integer) and their
> badness (integer) into the database.
> Associate  is used to tell the database two citizens are associated to
> be in the same group.
> Most_Dangerous is supposed to return the citizen with the highest
> badness rating. This function can do anything if the database is empty.
> Next_Member reports a previously unreported member of the group to
> which the most dangerous citizen belongs. This function can do anything
> if the there are no more unreported members.
> More_In_Group which is true exactly when there are unreported members
> of the group to which the most recently reported most dangerous citizen
> belongs. This function can do anything if there is no previous call to
> Most_Dangerous.
> The procedure rest resets the database to its original state.
>
> There will be no more than 1 million citizens entered. Updates should
> be optimised at the expense of queries. Do not worry too much about
> error handling.
>
> The program is supposed to be compiled on gnat. I require both the code
> and a compiled file.
>
> Again, if anyone is interested I'm willing to pay for your services.
> 


0
7/26/2005 3:17:50 AM
On 25 Jul 2005 12:09:27 -0700, "strictly_mk@hotmail.com"
<strictly_mk@hotmail.com> declaimed the following in comp.lang.ada:

> If you don't want to do it, thats fine. But I haven't got the time to
> learn the language hence why I have put this up here. I'm sure if you

	If you don't have time to bother learning the language, or
attempting to learn it, please tell the person who gave you the
assignment so they can take suitable action -- finding someone else who
is suited to the assignment.

	That applies to homework and real-life assignments. The
assignment is yours; the responsibility is yours. Try, or don't try (to
paraphrase Yoda), but do not expect the world to do it for you.l


-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
7/26/2005 4:23:30 AM
Ok Ludovic I'll start from the top, firstly I am a college student and
this is an assignment I have to pass to stay in college, essentialy
during my acedemic year family problems which I won't go into caused
me to take a leave of absense for nearly half the year. When I get back
I took exams of which I passed two and failed two, one being
programming and the other electronics. The reason I have not got time
to learn ada is because by the time I do and get this project done I
will not have enough time to  learn for the resists for the electronics
papers.

I have already finished one programming project in Scheme and I can
email it to you to prove it. Equally this ada project is based on a
completely victicious society called the People's Oligarchy of
Poppleton, and the project states the database is to track fictional
citizens that are considered a threat to the society. That's it. If you
are still suspicious I can scan the paper in and email it to you.
If I offended anyone here I'm very sorry I really didnt mean to do
that. This was my last resort because I refuse to think I'm going to
get thrown out of college over a project that in the long run will mean
nothing. Those who suggested to see my tutor, well he hasn't seen me in
a long time, this is an assesed piece of work so I can't ask questions
and also he is one vacation.

I did actually attempt to start this thing but everytime I got an idea
I discovered a small thing about ada which didn't allow it. I was
thinking of using a priority queue for the rate procedure and the
querying functions but realised I didn't know how to implement the data
structure. Then I thought about doing this as simply as possible by
mimicking MS access by having the equivalent of two tables, one for
rate and the other for associate using multidimentional arrays but for
some reason I didnt use that method becuase I read somewhere that all
the data in an array had to be of the same type but was unsure if this
counted for multidimentional arrays that had arrays to act as columns
since the associate table would of had two columns for the citizen
pairs that are associated and a another column which would have
contained boolean results to check if that pair had already been
reported or not. Then I thought using an array of records instead with
all the relevant record instances but was unsure how I would design the
searches to manipulate this data structure.

I hope this answers any questions, if you can help that would be great.

0
7/26/2005 10:03:44 AM
Jeffrey Carter <spam@spam.com> writes:

> Sounds good. I could do it for only $20 million, cash, in new $100 bills.

And me for only $15 million :)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
0
pascal20 (733)
7/26/2005 5:29:34 PM
On Tue, 26 Jul 2005 13:29:34 -0400, Pascal Obry <pascal@obry.net> wrote:

> And me for only $15 million :)

Euros?

0
falis (298)
7/26/2005 7:03:57 PM
"Ed Falis" <falis@verizon.net> writes:

> On Tue, 26 Jul 2005 13:29:34 -0400, Pascal Obry <pascal@obry.net> wrote:
> 
> > And me for only $15 million :)
> 
> Euros?

No $15 million is fine, but I'm ok for 15 million euros of course :)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
0
pascal20 (733)
7/26/2005 7:05:52 PM
This is a multi-part message in MIME format.
--------------020705030601030403050600
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Pascal Obry wrote:
> 
> And me for only $15 million :)

Great, bidding war. Don't listen to Pascal, he won't deliver the quality 
you'll get from me.

OK, $14.9 million, but that's my final offer.

--------------020705030601030403050600
Content-Type: text/x-vcard; charset=utf-8;
 name="spam.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="spam.vcf"

begin:vcard
fn:Jeffrey Carter
n:;Jeffrey Carter
email;internet:jeffrey_r_carter-nr [commercial-at] raytheon [period | full stop] com
x-mozilla-html:FALSE
version:2.1
end:vcard


--------------020705030601030403050600--
0
spam29 (1568)
7/26/2005 10:20:13 PM
Jeffrey Carter wrote:
> Pascal Obry wrote:
> 
>>
>> And me for only $15 million :)
> 
> 
> Great, bidding war. Don't listen to Pascal, he won't deliver the quality 
> you'll get from me.
> 
> OK, $14.9 million, but that's my final offer.


It's cheaper to buy in Europe,

http://www.ecb.int/stats/exchange/eurofxref/html/eurofxref-graph-usd.en.html
0
bauhaus1 (735)
7/27/2005 9:07:36 AM
With the code kindly posted by Steve and with the advice some of you
here gave me I have attempted this thing again and this is the code I
have 'written'/'modified'. I've simplified it somewhat since I am
supposed to show the concept of the procedures and functions working
regardless if they fail after a certain amount of time.

package body POP is

	type Individual is
		record
		Person : ID;
		Danger	: Rating;
		Associate : ID;
		Reported : Boolean;
		end record;

	type Society is array( 1 .. 1000000 ) of Individual;

	type Society_Ptr is access all Society;

	Pointer : Society_Ptr;
	Counter : Natrual := 0;

	procedure Rate (Citizen : in ID; Badness : in Rating) is
		begin
			Counter := Counter + 1;
			Pointer( Counter ).Person := Citizen;
			Pointer( Counter ).Rating := Badness;
			Pointer( Counter ).Associate := null;
			Pointer( Counter ).Reported := false;
		end;
	end Rate;

	procedure Associate (Citizen_1, Citizen_2 : in ID) is

	I : Integer

	for I in 0..Counter loop
		if Pointer( I ).Citizen = Citizen_1
			then
			Pointer( I ).Associate := Citizen_2;
		end if;
	end Associate;

	--query functions
	function Most_Dangerous return ID is

	MD_Counter : Integer := 1;

	I : Integer

	for I in 0..Counter loop
		if Society(I).Danger < Society(MD_Counter).Danger then
			if Society(MD_Counter).Reported = false then
				begin
				Most_Dangerous_Pointer := MD_Counter;
				MD_Counter := MD_Counter + 1;
				end;
			else
				MD_Counter := MD_Counter + 1;
			end if;
		else
			MD_Counter := MD_Counter + 1;
		end if;
	end loop;

	begin
		return Pointer(Most_Dangerous_Pointer).Citizen;
		Pointer(Most_Dangerous_Pointer).Reported := true;
	end;

	end Most_Dangerous;

I've put all the required information into an array of records. But the
problem is I realised that if a citizen has more than one associate my
code won't work. (If the code were to compile) As it stands it would
logically work if each person only had one associate. I remember an old
project using code similar to Associate : Associates.Bag within the
record instances. An I was wondering if anyone knows how this package
might look like. This way I could put Associate, Next_Member and
More_In_Group in that package as well. I think this is what the marker
is looking for as I think I'm supposed to demonstrate my program being
modular. Any comments?

0
7/27/2005 2:39:44 PM
strictly_mk@hotmail.com wrote:

>         type Society_Ptr is access all Society;
> 
>         Pointer : Society_Ptr;

Are you sure you need a pointer.  Most Ada compilers won't have a problem
creating the even a large array in static memory:

http://en.wikibooks.org/wiki/Programming:Ada:Types:array

Do you really need "access all"

http://en.wikibooks.org/wiki/Programming:Ada:Types:access#Access_vs._access_all

And last not least: there is no "new" to be seen anywhere:

http://en.wikibooks.org/wiki/Programming:Ada:Types:access#Creating_object_in_a_storage_pool

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com

0
krischik (1357)
7/27/2005 5:13:41 PM
Thank you for the comments Martin, I actually deleted the post because
I have been writing and rewriting simpler versions of this all day and
the one I posted looks nothing like my newer versions. But thanks again.

0
7/27/2005 5:49:33 PM
You could make Individual.Associate a packed array (1 .. 1_000_000) of
Boolean, set True if there's an Association .. though since
Association is symmetric as far as I can tell it might be better to
have a separate two-dimensional array for this.

I take it that ID is range 1 .. 1_000_000? if so you should index
Society by ID.

Why do you have pointers? you could just have an array of individuals.

Names are very important. "Pointer" is a very unhelpful name for the
concept you have in mind!

  type Individuals is array (ID) of Indivuals;
  Society : Individuals;

How are you going to know whether a given Individual exists? (has been
Rated, I think?)

--S
0
simon8285 (1465)
7/27/2005 6:03:41 PM
Simon Wright wrote:
> You could make Individual.Associate a packed array (1 .. 1_000_000) of
> Boolean, set True if there's an Association .. though since
> Association is symmetric as far as I can tell it might be better to
> have a separate two-dimensional array for this.

I'd probably use PragmARC.Skip_List_Unbounded for the collection of 
rated innocent victims (appox O(log N) for insertion and lookup), each 
having a list of associates. Then finding the highest rated is O(1), and 
visiting each of her associates would be approx O(log N).

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49
0
spam29 (1568)
7/28/2005 12:58:35 AM
<strictly_mk@hotmail.com> wrote in message 
news:1122475184.849564.159870@g44g2000cwa.googlegroups.com...
> With the code kindly posted by Steve and with the advice some of you
> here gave me I have attempted this thing again and this is the code I
> have 'written'/'modified'. I've simplified it somewhat since I am
> supposed to show the concept of the procedures and functions working
> regardless if they fail after a certain amount of time.
>

Now that you're asking for help, and not for someone to do it for you, as 
you can see, you get a lot more positive response.

> package body POP is
>
> type Individual is
> record
> Person : ID;
> Danger : Rating;
> Associate : ID;
> Reported : Boolean;
> end record;
>
> type Society is array( 1 .. 1000000 ) of Individual;
>
> type Society_Ptr is access all Society;
>
> Pointer : Society_Ptr;
> Counter : Natrual := 0;
>

If the array is going to be fixed in size, why not just use:

  type Society is array( 1 .. 1000000 ) of Individual;

  Society_Buffer : Society;

  In my original response I used a pointer because I dynamically allocated 
an array to store individuals.  When the array became full, I dynamically 
allocated a new larger array, copied the values from the original array to 
the new larger array and then deallocated the original array.  It is 
certainly simpler to just go with a fixed maximum size.

> procedure Rate (Citizen : in ID; Badness : in Rating) is
> begin
> Counter := Counter + 1;
> Pointer( Counter ).Person := Citizen;
> Pointer( Counter ).Rating := Badness;
> Pointer( Counter ).Associate := null;
> Pointer( Counter ).Reported := false;
> end;
> end Rate;
>

  Just a note: One of the features I really like about Ada is the ability to 
do record assignments, so this Rate function could be:

  Counter := Counter + 1;
  Pointer( Counter ) := ( Person => Citizen, Rating => Badness, Associate => 
null, Reported => False );


> procedure Associate (Citizen_1, Citizen_2 : in ID) is
>
> I : Integer
>
> for I in 0..Counter loop
> if Pointer( I ).Citizen = Citizen_1
> then
> Pointer( I ).Associate := Citizen_2;
> end if;
> end Associate;
>
> --query functions
> function Most_Dangerous return ID is
>
> MD_Counter : Integer := 1;
>
> I : Integer
>
> for I in 0..Counter loop
> if Society(I).Danger < Society(MD_Counter).Danger then
> if Society(MD_Counter).Reported = false then
> begin
> Most_Dangerous_Pointer := MD_Counter;
> MD_Counter := MD_Counter + 1;
> end;
> else
> MD_Counter := MD_Counter + 1;
> end if;
> else
> MD_Counter := MD_Counter + 1;
> end if;
> end loop;
>
> begin
> return Pointer(Most_Dangerous_Pointer).Citizen;
> Pointer(Most_Dangerous_Pointer).Reported := true;
> end;
>
> end Most_Dangerous;
>
> I've put all the required information into an array of records. But the
> problem is I realised that if a citizen has more than one associate my
> code won't work. (If the code were to compile) As it stands it would
> logically work if each person only had one associate. I remember an old
> project using code similar to Associate : Associates.Bag within the
> record instances. An I was wondering if anyone knows how this package
> might look like. This way I could put Associate, Next_Member and
> More_In_Group in that package as well. I think this is what the marker
> is looking for as I think I'm supposed to demonstrate my program being
> modular. Any comments?
>

One way to handle the "associates" is to create an association code for each 
individual.  When two citizens are associated, make the id's of the 
associates the same.

You might, for example start out with an association id of 0 indicating no 
association.  When the Associate procedure is called, find the location of 
each of the citizens and handle each of the cases:
  If both associates have no association, create a new association id, and 
assign it to both.
  If just one of the associates has a non-zero association id, assign it to 
the other.
  If both of the associates have a non-zero association id (ie: A and B), 
then change the association ID of all citizens that are currently B to A.

I am assuming that:
  if A associated with B and B associated with C it is implied that A 
associated with C.

I hope this helps,
Steve
(The Duck)


0
7/28/2005 2:27:45 AM
Thank you for all the suggestions. Here is what I've done so far,

package body POP is

-- array of records for Person, Danger, Reported
type Individual is
		record
		Person : ID;
		Danger	: Rating;
		Reported : Boolean;
		end record;

	type Society is array( 0 .. 1000000 ) of Individual;

	Record_Counter : Natrual := 0;

-- table of associates

type Associates is array ( 0 .. 1000000 , 0 .. 1 ) of Integer;

	Associates_Index	: Natural := 0;
	Associates_Column	: Natural := 0;

--updating procedures
procedure Rate ( Citizen : in ID; Badess : in Rating); is
	begin
		Counter := Counter + 1;
		Society( Record_Counter ) := (	Person=> Citizen, Danger=> Badness,
Reported	=> False );
	end;

end Rate;

procedure Associate (Citizen_1, Citizen_2 : in ID) is
	begin
	Associates( Associates_Index, Associates_Column) := (Citizen_1,
Citizen_2);
	Associates_Index := Associates_Index + 1;
	Associates_Column := Associates_Column + 1;
	end;
end Associate;

Most_Dangerous_Person : ID;
Most_Dangerous_Rating : Rating := 0;
Most_Dangerous_Location : Integer;

--querying functions
function Most_Dangerous return ID is

I : Integer;

	begin
	Most_Dangerous_Rating := 0;
	Most_Dangerous_Location := 0;
	for I in 0 .. Record_Counter loop
		if Society(I).Danger > Most_Dangerous_Rating and
		   Society(I).Reported = false then
			begin
			Most_Dangerous_Rating := Society(I).Danger;
			Most_Dangerous_Location := I;
			Society(I).Reported = true;
			Most_Dangerous_Person := Society(I).Citizen;
			end;
		end if;
	end loop;
	return Most_Dangerous_Person;
	end;
end Most_Dangerous;

type Members_Array is array (1 .. 1000000) of Integer;

Members_Array_Counter : Natural := 0;
Member				  : ID;

function Next_Member return ID is

I : Integer;
J : Integer;
K : Integer;

begin
	for I in 0 .. Associates_Index loop
		if Associates( I, 0) = Most_Dangerous_Person then
			begin
				Member := Associate( I, 1)
				for	J in 0 .. Record_Counter loop
					if Society(J).Citizen = Member and
					   Society(J).Reported = false then
						begin
							Members_Array(Members_Array_Counter) := Member;
							Members_Array_Counter := Members_Array_Counter + 1;
						end;
					end if;
				end loop;
			end;
		end if;
	end loop;

	return Members_Array(1);

	for K in 0 .. Record_Counter loop
		if Society(K).Citizen = Members_Array(1);
			Society(K).Reported := true;
		end if;
	end loop;
end;
end Next_Member;

What I wanna ask is how can you reset an entire array? For
More_In_Group I want to reset the Members_Array and use a similar loop
used in Next_Member to rebuild it, this way the previous member looked
up disappears and all I would need to do is check if there are elements
still in the array to return true or false. Any suggestions?

0
7/28/2005 10:47:28 AM
On 28 Jul 2005 03:47:28 -0700, "strictly_mk@hotmail.com"
<strictly_mk@hotmail.com> declaimed the following in comp.lang.ada:

	Apologies to others for not trimming this thing down... I'm not
sure where it would be safe to trim without losing context...

	My first comment: Have you even tried compiling this code? You
have way too many BEGIN/END lines and they aren't even matched... Ada is
not Pascal. IF and LOOP have an implicit BEGIN. Here is a version that
passes basic syntax compiles -- at least to the stage where it complains
because I don't have an ADS file. My comments are interspersed (I also
used AdaGIDE's reformatter)...

-=-=-=-=-=-=-=-
package Pop is

   -- array of records for Person, Danger, Reported
   type Individual is
      record
         Person   : Id;
         Danger   : Rating;
         Reported : Boolean;
      end record;

   type Society is array (0 .. 1000000) of Individual;

   Record_Counter : Natural := 0;

   -- table of associates
   type Associates is array (0 .. 1000000, 0 .. 1) of Integer;

   Associates_Index  : Natural := 0;
   Associates_Column : Natural := 0;

   --updating procedures
   procedure Rate (
         Citizen : in     Id;
         Badess  : in     Rating) is
      --;
   begin
      Counter := Counter + 1;
      Society( Record_Counter ) := (
         Person   => Citizen,
         Danger   => Badness,
         Reported => False);
   end Rate;

   --   end Rate;

   procedure Associate (
         Citizen_1,
         Citizen_2 : in     Id) is
   begin
      Associates( Associates_Index, Associates_Column) := (Citizen_1,
         Citizen_2);
      Associates_Index := Associates_Index + 1;
      Associates_Column := Associates_Column + 1;
      --   end;
   end Associate;

NOTE: extra END above

   Most_Dangerous_Person   : Id;
   Most_Dangerous_Rating   : Rating  := 0;
   Most_Dangerous_Location : Integer;

   --querying functions
   function Most_Dangerous return Id is

      I : Integer;

   begin
      Most_Dangerous_Rating := 0;
      Most_Dangerous_Location := 0;
      for I in 0 .. Record_Counter loop
         if Society(I).Danger > Most_Dangerous_Rating and
               Society(I).Reported = False then
            --begin
            Most_Dangerous_Rating := Society(I).Danger;
            Most_Dangerous_Location := I;
            Society(I).Reported := True;
            Most_Dangerous_Person := Society(I).Citizen;
            --end;

NOTE: unneeded BEGIN/END

         end if;
      end loop;
      return Most_Dangerous_Person;
      --   end;

NOTE: extra END

   end Most_Dangerous;

   type Members_Array is array (1 .. 1000000) of Integer;

   Members_Array_Counter : Natural := 0;
   Member                : Id;

   function Next_Member return Id is

      I : Integer;
      J : Integer;
      K : Integer;

   begin
      for I in 0 .. Associates_Index loop
         if Associates( I, 0) = Most_Dangerous_Person then
            --begin
            Member := Associate( I, 1);
            for	J in 0 .. Record_Counter loop
               if Society(J).Citizen = Member and
                     Society(J).Reported = False then
                  --begin
                  Members_Array(Members_Array_Counter) := Member;
                  Members_Array_Counter := Members_Array_Counter + 1;
                  --end;
               end if;
            end loop;
            --end;

NOTE: TWO sets of unneeded BEGIN/END

         end if;
      end loop;

      return Members_Array(1);

NOTE: I've not tried to track the logic, but are you sure you only want
the first element of the array? Do you ever access the others?

NOTE: The following block will never be executed -- the return statement
above ends the function

      for K in 0 .. Record_Counter loop
         if Society(K).Citizen = Members_Array(1) then --;
            Society(K).Reported := True;
         end if;
      end loop;
      --   end;

NOTE: extra END

   end Next_Member;

end Pop;

NOTE: END POP was missing
-=-=-=-=-=-=-

-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
7/28/2005 4:53:56 PM
Whoa, everyone seems to be going over the top, I think the solution
can be much simpler.

generic
    type ID is (<>); --some discrete type to be put here
package POP is
   --update database
  type Rating is new Integer range 0..255;
  procedure Rate (Citizen : in ID;
                  Badness : in Rating);
  procedure Associate (Citizen_1, Citizen_2 : in ID);
  --query the database
  function Most_Dangerous return ID;
  function Next_Member return ID;
  function More_In_Group return Boolean;
  --administrative
  procedure reset;
end POP;


Since the type ID is discrete, why not just use that as the array index type?

package body POP is
   Society : array (ID) of Rating := (others => Rating'First);
   Associacion : array (ID, ID) of Boolean := (others => others => False));
   pragma Pack (Association);

   Last_Reported : ID := ID'First;

   procedure Rate (Citizen : in ID;
                   Badness : in Rating) is
   begin
      Society (Citizen) := Rating;
   end Rate;

   procedure Associate (Citizen_1, Citizen_2 : in ID) is
   begin
      Association (Citizen_1, Citizen_2) := True;
   end Associate;

   function Most_Dagerous return ID is
      Result : ID := ID'First;
   begin
      for J in Society'Range loop
         if Society (J) > Result then
            Result := J;
         end if;
      end loop;
      return Result;
   end Most_Dangerous;


   function Next_Member return ID is
      J : constant ID := Most_Dangerous;
   begin
      if Last_Reported = ID'First then
         Last_Reported := J;
      end if;
      for K in ID'Succ (Last_Reported) .. Association'Last (2) loop
         if Association (J, K) then
            Last_Reported := K;
            exit;
         end loop;
      end loop;
      return Last_Reported;
   end Next_Member;


   function More_In_Group return Boolean is    
      J : constant ID := Most_Dangerous;
      Result : Boolean := False;
   begin
      for K in ID'Succ (Last_Reported) .. Association'Last (2) loop
         if Association (J, K) then
            Result := True;
            exit;
         end loop;
      end loop;
      return Result;
   end More_In_Group;


   procedure Reset is
   begin
      Society := (others => Rating'First);
      Association := (others => others => False));
      Last_Reported := ID'First;
   end Reset;
end POP;


Of course, the above solution is outrageously inefficient, both
memory- and CPU-wise.  Optimisations are left as an exercise to the
reader.

-- 
Ludovic Brenta.

0
7/28/2005 6:33:32 PM
<strictly_mk@hotmail.com> wrote in message 
news:1122547648.069514.63520@g14g2000cwa.googlegroups.com...
> Thank you for all the suggestions. Here is what I've done so far,
[snip]
>
> What I wanna ask is how can you reset an entire array? For
> More_In_Group I want to reset the Members_Array and use a similar loop
> used in Next_Member to rebuild it, this way the previous member looked
> up disappears and all I would need to do is check if there are elements
> still in the array to return true or false. Any suggestions?
>
In your original post you indiciated:
  "The procedure rest resets the database to its original state."

So, I think all you need to do is set your counts and indexes back to 0.

Steve
(The Duck)


0
7/29/2005 1:57:48 AM
On Thu, 28 Jul 2005 20:33:32 +0200, Ludovic Brenta
<ludovic.brenta@tiscali.be> declaimed the following in comp.lang.ada:


> 
> Since the type ID is discrete, why not just use that as the array index type?
>
	That's the approach I took, though some things aren't quite as
clean (I used explicit ranges... should have tried compiling with just
the type).
> Of course, the above solution is outrageously inefficient, both
> memory- and CPU-wise.  Optimisations are left as an exercise to the
> reader.

	Tell me about it -- for the 1000000 population, I estimated over
100GB needed for the association matrix alone, even packing 1-bit
booleans. I then did version 2, using "Steve's" suggestion of encoding
the group identifier into the population data itself... associate() went
from two lines to a page, but half the declarations disappear.

	I will not be posting that version as it is too close to being
directly usable (I didn't write a test suite, so couldn't run it, but it
did compile cleanly).

package body Pop is

   --   fake "database" using arrays of structures
   --   a database schema for this would be something like
   --
   --   create table society
   --   (  who = integer unique primary key,
   --      badness = unsigned byte,
   --      reported = boolean )
   --   defined is not needed as database table won't have gaps
   --
   --   create table associations
   --   (   c1 = integer,
   --   (   c2 = integer ) primary key (c1, c2)
   --
   type Person is
      record
         Who      : Id;               --   redundant as ID is the index
too
         Badness  : Rating;
         Defined  : Boolean := False; -- allows for skips in array
         Reported : Boolean := False;
      end record;
   pragma Pack(Person);
   --   assume ID is four bytes, Rating is one byte,
   --   Boolean is one byte => 7 bytes per person
   --   1_000_000 persons => 7_000_000 bytes 
   --   or < 7MB, small change these days

   type Population is array (Id'First .. Id'Last) of Person;
   pragma Pack(Population);

   type My_Boolean is new Boolean;
   for My_Boolean'Size use 1;      --   really pack them in <G>

   type Association_Vector is array (Id'First .. Id'Last) of My_Boolean;
   pragma Pack(Association_Vector);
   --   if 'size worked in bits, this vector is only
   --   1_000_000 bits, or 125_000 bytes 
   --   (if not, it is 1_000_000 bytes, or < 1MB)

   type Association_Matrix is array (Id'First .. Id'Last) of
Association_Vector;
   pragma Pack(Association_Matrix);
   --   1_000_000 rows of 125_000 bytes is 125_000_000_000 bytes
   --   very fat, 125GB
   --   I don't think a population of 1_000_000 will work on most 
   --   desktops. May need to go to either direct file I/O on each
   --   row (IE, only have one "association_vector" in memory at a time)
   --   or use a real RDBMS to handle the file I/O for you

   Society             : Population;
   Associations        : Association_Matrix := (others => (others =>
False));
   Baddest_Association : Association_Vector;


   ---------------
   -- Associate --
   ---------------
   procedure Associate (
         Citizen_1,
         Citizen_2 : in     Id) is
   begin
      Associations(Citizen_1)(Citizen_2) := True;
      --   if c1 knows c2, then assume c2 knows c1
      Associations(Citizen_2)(Citizen_1) := True;
   end Associate;

   -------------------
   -- More_In_Group --
   -------------------

   function More_In_Group return Boolean is
      Found : Boolean := False;
   begin
      for I in Id'First .. Id'Last loop
         --   scan the baddest_association vector for any known
         --   association that does not have the "reported" flag set
         if Boolean(Baddest_Association(I)) and then
               (Society(I).Defined and not Society(I).Reported) then
            Found := True;
         end if;
      end loop;

      return Found;

   end More_In_Group;

   --------------------
   -- Most_Dangerous --
   --------------------

   function Most_Dangerous return Id is
      Baddest : Id;
   begin
      --   find first defined citizen, since society can have gaps
      for I in Id'First .. Id'Last loop
         if Society(I).Defined then
            --   assume this person is the worst
            Baddest := I;
            exit;
         end if;
      end loop;

      --   note: this can fail if baddest is never assigned a value
      --   ie, the society array has no citizens defined
      if Society(Baddest).Defined then
         --   we found a real person <G>
         for I in Baddest .. Id'Last loop
            --   scan the array for the someone "badder"
            if Society(I).Defined and then
                  Society(Baddest).Badness < Society(I).Badness then
               --   reset to use them
               Baddest:= I;
            end if;
         end loop;
      end if;

      --   this could also fail, but the previous failure should abort
      --   save the association (only) of the baddest for later use
      Baddest_Association := Associations(Baddest);
      Society(Baddest).Reported := True;

      return Baddest;

   end Most_Dangerous;

   -----------------
   -- Next_Member --
   -----------------

   function Next_Member return Id is
      Next : Id;
   begin
      --   This is the same as Most_Dangerous except it
      --   1   only scans the vector associated with the original worst
person
      --   2   only returns entries that have not been reported already

      --   find first defined, unreported citizen
      for I in Id'First .. Id'Last loop
         if Baddest_Association(I) then
            --   found what better be a defined person
            if Society(I).Defined and
                  not Society(I).Reported then
               Next := I;
               exit;
            end if;
         end if;
      end loop;

      --   note: this can fail if baddest is never assigned a value
      --   ie, the association vector has no unreported persons
      if Society(Next).Defined then
         --   we found a real person <G>
         for I in Next .. Id'Last loop
            --   scan the array for the baddest unreported real person
            if (Boolean(Baddest_Association(I)) and then
                  not Society(I).Reported) and then
                  Society(Next).Badness < Society(I).Badness then
               Next := I;
            end if;
         end loop;
      end if;

      Society(Next).Reported := True;

      return Next;

   end Next_Member;

   ----------
   -- Rate --
   ----------

   procedure Rate (
         Citizen : in     Id;
         Badness : in     Rating) is
   begin
      Society(Citizen) := (
         Who      => Citizen,
         Badness  => Badness,
         Defined  => True,
         Reported => False);
   end Rate;

   -----------
   -- Reset --
   -----------

   procedure Reset is
   begin
      --   resets all significant tables
      Society := (others => (Who => Id'First,
            Badness => Rating'First,
            Defined => False,
            Reported => False));
      Baddest_Association := (others => False);
      Associations := (others => Baddest_Association);
   end Reset;

end Pop;


-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
7/29/2005 5:06:49 AM
"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message 
news:uaaje1d0l4tp1kjs18mkrgfmbkcir308bt@4ax.com...
> On Thu, 28 Jul 2005 20:33:32 +0200, Ludovic Brenta
> <ludovic.brenta@tiscali.be> declaimed the following in comp.lang.ada:
>
>
>>
>> Since the type ID is discrete, why not just use that as the array index 
>> type?
>>
> That's the approach I took, though some things aren't quite as
> clean (I used explicit ranges... should have tried compiling with just
> the type).
>> Of course, the above solution is outrageously inefficient, both
>> memory- and CPU-wise.  Optimisations are left as an exercise to the
>> reader.
>
> Tell me about it -- for the 1000000 population, I estimated over
> 100GB needed for the association matrix alone, even packing 1-bit
> booleans. I then did version 2, using "Steve's" suggestion of encoding
> the group identifier into the population data itself... associate() went
> from two lines to a page, but half the declarations disappear.
>
> I will not be posting that version as it is too close to being
> directly usable (I didn't write a test suite, so couldn't run it, but it
> did compile cleanly).
>

Perhaps I'm a little naive, but I really don't understand why you need to 
keep any more than:

  type Persson is
    record
      Citizen_Id : ID;
      Badness    : Rating;
      Group_Id  : Natural;
    end record;

  type Population is array( 1 .. 1_000_000) of Person;

  Society     : Population;
  Next_In    : Positive; -- Add new elements here
  Next_Out : Positive; -- Retrieve next from current group here
  Baddest    : Positive; -- Index to baddest entry
  Current_Group_Id : Natural;

You do wind up scanning the list to do just about anything, but speed was 
not a requirement.

Steve
(The Duck)


[snip]
>
>
> -- 
> > ============================================================== <
> >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
> >      wulfraed@dm.net     |       Bestiaria Support Staff       <
> > ============================================================== <
> >           Home Page: <http://www.dm.net/~wulfraed/>            <
> >        Overflow Page: <http://wlfraed.home.netcom.com/>        < 


0
7/30/2005 1:44:07 AM
On Fri, 29 Jul 2005 18:44:07 -0700, "Steve"
<nospam_steved94@comcast.net> declaimed the following in comp.lang.ada:

	Don't go by the posted version -- that was the quick&dirty,
stuff it all into arrays and use simple logic version.

>   type Persson is
>     record
>       Citizen_Id : ID;
>       Badness    : Rating;
>       Group_Id  : Natural;
>     end record;
> 
>   type Population is array( 1 .. 1_000_000) of Person;
> 
>   Society     : Population;
>   Next_In    : Positive; -- Add new elements here

	Technically not needed as you can define the array subscript to
be the ID (and really, you could drop the ID from the record). You might
have gaps in the array (so I added a "defined" flag to indicate a valid
person).

>   Next_Out : Positive; -- Retrieve next from current group here

	I went to extremes, my "next" logic finds the NEXT "baddest" in
the group after reporting the baddest... etc. So one always has to scan
all individuals in the group.



-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
7/30/2005 7:24:46 AM
On 26 Jul 2005 19:29:34 +0200, Pascal Obry <pascal@obry.net> wrote:

> 
> Jeffrey Carter <spam@spam.com> writes:
> 
> > Sounds good. I could do it for only $20 million, cash, in new $100 bills.
> 
> And me for only $15 million :)
> 
comp.lang.c has a consensus that "bidding" on homework assignments can
only go up, not down.  I think they got this one right. 

Aside: _Are_ there any new $100 bills? I haven't seen any since the
redesigned $20's started, in what-was-it 1997 or so, and I heard the
Treasury (or Fed?) wasn't going to do new $100s since this
denomination is believed useful primarily to criminals. Of course they
get little enough circulation you could certainly ask for "like-new"
or "good condition". (I am assuming $=USD, not CA or AU or such.)
- David.Thompson1 at worldnet.att.net
0
8/1/2005 5:37:03 AM
Dave Thompson wrote:
> (I am assuming $=USD, not CA or AU or such.)

all bidders forgot to specify what kind of dollars they were using for 
their offer.

the OP may eventually afford ZWD 15_000_000 (Zimbabwe Dollars), but 
the bidders may have requested KYD 15_000_000 (Cayman Islands Dollars)...

-- 
rien
0
8/1/2005 12:37:15 PM
Thanks for all the help, I've actually done most of it now but I need
help on one last thing. I'm sure gnat doesn't like me and I'm getting
these error messages regarding the Associates array, I've tried next to
everything and I'm stuck. Here is to code and the compiler output.

package body PoP is

--***************************************************************
--                      constants
--***************************************************************
subtype Population_Range is Long_Integer range 1..1000000;

--***************************************************************
--                      variables
--***************************************************************

-- A record to capture the required information about an
-- individual within the Society.
type Individual is
                record
                Person : ID;
                Danger  : Rating;
                Reported : Boolean;
                end record;
-- An array to store every known Individual
type Poppleton is array( Population_Range ) of Individual;

Society : Poppleton;

-- An array to monitor which Individuals associate with which
-- other individuals.
type Associates is array ( Population_Range , Population_Range ) of
Boolean;

-- A store for the current most dangerous person
-- This is not necessarily the current most danagerous person rather
-- the most danagerous person as the time Most_Dangerous was called.
Most_Dangerous_Person : ID := 0;
--***************************************************************
--                      updating procedures
--***************************************************************

--
--      High level description of procedure
--
procedure Rate ( Citizen : in ID; Badness : in Rating) is
begin
        -- If this citizen rated twice, the record will be overwritten.
        Society(Long_Integer(Citizen)).Person := Citizen;
        Society(Long_Integer(Citizen)).Danger := Badness;
        Society(Long_Integer(Citizen)).Reported := False;

end Rate;

--
--      High level description of procedure
--
procedure Associate (Citizen_1, Citizen_2 : in ID) is
begin
    Associates( Citizen_1, Citizen_2) := True;
	Associates( Citizen_2, Citizen_1) := True;
end Associate;


--***************************************************************
--                      querying functions
--***************************************************************

--
--      High level description of function
--
function Most_Dangerous return ID is

        Most_Dangerous_Rating : Rating := 0;
        Most_Dangerous_Location : Long_Integer := 0;

        I : Long_Integer;

begin

        for I in Population_Range loop
                if Society(I).Danger > Most_Dangerous_Rating and
                   Society(I).Reported = False then
                        Most_Dangerous_Rating := Society(I).Danger;
                        Most_Dangerous_Location := I;
                        Most_Dangerous_Person := Society(I).Person;
                else
                        Most_Dangerous_Person := 0;
                end if;
        end loop;

        Society(Most_Dangerous_Location).Reported := True;

        return Most_Dangerous_Person;

end Most_Dangerous;

--
--      High level description of function
--
function Next_Member return ID is

I : Long_Integer;

begin

        for I in Population_Range loop
                if Associates( Most_Dangerous_Person , I ) = True and
                   Society(I).Reported = False then
				begin
                        -- Assuming we would never report on this
                        -- person again.
                        Society(I).Reported := True;
                        return Society(I).Person;
				end;
				end if;
        end loop;
	return 0;

end Next_Member;

--
--      High level description of function
--
function More_In_Group return boolean is
        I : Long_Integer;
begin

        for I in Population_Range loop
                if Associates(Most_Dangerous_Person, I) = True and
                   Society(I).Reported = False then
                return True;
				end if;
        end loop;
		return False;
end More_In_Group;


--***************************************************************
--                      administrative
--***************************************************************

--
--      High level description of function
--
procedure reset is
        I : Long_Integer;
        J : Long_Integer;
		K : Long_Integer;
begin
        -- Set all Associates back to False
        for I in Population_Range loop
                for J in Population_Range loop
                        Associates(	I, J) := False;
                end loop;
        end loop;

        -- Reset all citizen records in Society
		for K in Population_Range loop
		Society(K).Person:= 0;
		Society(K).Danger:= 0;
		Society(K).Reported := False;
		end loop;

end reset;
end PoP;

open_resit.adb:63:05: argument of type conversion must be single
expression
open_resit.adb:63:17: illegal operand for array conversion
open_resit.adb:64:09: argument of type conversion must be single
expression
open_resit.adb:64:21: illegal operand for array conversion
open_resit.adb:111:20: argument of type conversion must be single
expression
open_resit.adb:133:20: argument of type conversion must be single
expression
open_resit.adb:157:25: argument of type conversion must be single
expression
open_resit.adb:157:41: illegal operand for array conversion

ID is defined in the specification under generic as a long_integer. Can
anyone help?

0
8/2/2005 11:08:43 AM
strictly_mk@hotmail.com wrote:
> open_resit.adb:63:05: argument of type conversion must be single
> expression
> open_resit.adb:63:17: illegal operand for array conversion

you declare:
type Associates is array ( Population_Range , Population_Range ) of
Boolean;

this declares a type, not a variable. you have to declare a variable 
of this type to use this data structure.

> ID is defined in the specification under generic as a long_integer. 

ID is NOT generic:
- it does not appear in a generic clause to this package,
- you convert variables of type ID explicitely to Long_Integer 
everywhere in this package, preventing a truly generic definition of ID.

(additionnaly, the array to store citizen association is indexed by 
Population_Range, not by ID, which leads to a compilation error in the 
procedure Associate)

and what about Rating ? it seems not defined anywhere...


-- 
rien
0
8/2/2005 11:37:56 AM
strictly_mk@hotmail.com wrote:
> Thanks for all the help, I've actually done most of it now but I need
> help on one last thing. I'm sure gnat doesn't like me and I'm getting
> these error messages regarding the Associates array, I've tried next to
> everything and I'm stuck. Here is to code and the compiler output.
> 

> subtype Population_Range is Long_Integer range 1..1000000;

> ID is defined in the specification under generic as a long_integer. Can
> anyone help?

(I'd suggest using the ID generic formal in the definition of
Population_Range then.)

Associates is a type actually, but is used as if it were variable.
0
bauhaus1 (735)
8/2/2005 12:05:55 PM
Here is the specification;

generic
	type ID is new Long_Integer;

package PoP is

	--to update the database

	type Rating is new Integer range 0..255;

	procedure Rate (Citizen : in ID;
					Badness	: in Rating);

	procedure Associate (Citizen_1, Citizen_2 : in ID);

	--to query the database

	function Most_Dangerous return ID;

	function Next_Member return ID;

	function More_In_Group return Boolean;

	--administrative

	procedure Reset;

end PoP;

When you mean Associates is a type, can I just declare a variable like
this

Associates_Variable : Associates; and use that within the rest of the
code?

I'm a little confused with the generic part though - i don't know how
to manipulate this bit.

0
8/2/2005 12:38:13 PM
strictly_mk@hotmail.com wrote:
> When you mean Associates is a type, can I just declare a variable like
> this
> 
> Associates_Variable : Associates; and use that within the rest of the
> code?

yes. you can even write:

Associates : array ( Population_Range , Population_Range ) of Boolean;

though it may comes in the way later if you want to extend this 
package (to manage more than one population for example).

-- 
rien
0
8/2/2005 1:19:04 PM
strictly_mk@hotmail.com wrote:

> I'm a little confused with the generic part though - i don't know how
> to manipulate this bit.

generic
   type T is {something};
package Pack is

   -- refer to T is if it were a known type.
   -- What you know about the type here is
   -- expressed in {something}. For example,

   -- when {something} is replaced by "range <>"
   -- then you can use T inside Pack as if it were a
   -- signed integer type. When you make an instance
   -- of Pack, use some subtype of a signed integer
   -- type, like Natural, etc..

0
bauhaus1 (735)
8/2/2005 2:26:42 PM
sorry I dont understand that completely, can you show me what my code
should look like?

0
8/2/2005 3:17:50 PM
sorry I dont understand that completely, can you show me what my code
should look like?

0
8/2/2005 3:17:57 PM
strictly_mk@hotmail.com wrote:
> sorry I dont understand that completely, can you show me what my code
> should look like?
> 

I guess you are referring to the generic Pack?
I had been assuming that ID is a generic formal type, like in

generic
	type ID is new Long_Integer;

package PoP is

Is that your choice, or have they given you this piece of the
program text?

0
bauhaus1 (735)
8/2/2005 3:38:27 PM
new Long_Integer is my choice, is there a more appropriate type that
wont upset the rest of the program?

0
8/2/2005 3:48:56 PM
strictly_mk@hotmail.com wrote:
> is there a more appropriate type that
> wont upset the rest of the program?

Use one of Ada's formal types. That is, specify what
the generic needs as a type using the syntax for formal
types. Examples

generic
  type T is range <>;
package Pack ...

In this case the formal type T says, if you want to make
an instance of this generic package, you have to provide
a signed integer type as the (actual) type to be used in
the created instance, as in

  package Foo is new Pack (T => Integer);

Integer is a signed integer type, as are Natural, or
Long_Integer. When you instantiate Pack, you can choose the type
to be used. When you write the generic package, you only
specify some assumptions about the possible types.
In this case, "range <>" specifies "some signed integer type".

Given these possible assumptions about T, you can use
T in expressions, without knowing what T is going to be in
some instance of the generic package. Like T'First (the first of
the values in T's range). You can add values of T because
T denotes some integer type, no matter which one actually,
later.

Another example is 

generic
  type T is (<>);
package Pack2 ...

In this case formal type T says, if you want to make
an instance of this generic package, you have to provide
a discrete type as the (actual) type to be used in
the created instance. Discrete types are either integer
types or enumeration types. Just no real types.

So if you had, somewhere

  type Family is (Jack, Jakub, Florentina, Marge, Bart);

i.e. an enumeration type, you could say

  package Foo2 is new Pack2 (T => Family);

Inside Pack2 (the generic) you can use T just like you
use any enumeration type. For example, you can say T'First,
but you cannot add values, because this doesn't work for
enumeration types. When you write the package, you know you
can assume T is denoting an enumeration type, but not which one.
Because that is decided when someone, possibly you, instantiate
Pack2.

Last, when you have

generic
  type ID is new Long_Integer;
package PoP ...

the choice of types to be used when instantiating is pretty fixed.
Only types derived from Long_Integer (includes Long_Integer) or
subtypes thereof can be filled in when you write

  package My_PoP_Instance is new PoP(ID => ...);

0
bauhaus1 (735)
8/2/2005 4:37:21 PM
strictly_mk@hotmail.com wrote:
>                 if Associates( Most_Dangerous_Person , I ) = True and
>                    Society(I).Reported = False then

Someone needs to understand the concept of Booleans.

-- 
Jeff Carter
"If you don't get the President of the United States on that
phone, ... you're going to have to answer to the Coca-Cola
Company."
Dr. Strangelove
32
0
spam29 (1568)
8/2/2005 4:52:55 PM
On 2 Aug 2005 04:08:43 -0700, "strictly_mk@hotmail.com"
<strictly_mk@hotmail.com> declaimed the following in comp.lang.ada:


> subtype Population_Range is Long_Integer range 1..1000000;
> 
	Just curious... Why "long_integer"? I though most all GNAT
implementations used 32-bit integer, and you only need 21-bits to handle
+/- 1_000_000

> 
> -- An array to monitor which Individuals associate with which
> -- other individuals.
> type Associates is array ( Population_Range , Population_Range ) of
> Boolean;
>
	You do realize that array is going to 1_000_000_000_000 entries
long -- that's 1-Trillion entries, or 125-Billion bytes (116Gigabytes)
IF booleans pack at 1-bit each, 8 per byte.

> procedure Rate ( Citizen : in ID; Badness : in Rating) is
> begin
>         -- If this citizen rated twice, the record will be overwritten.
>         Society(Long_Integer(Citizen)).Person := Citizen;

	If you are going to use the ID as the subscript, you probably
should have defined the array using ID rather than Population_Range
(they have to be identical definitions or this runs the risk of
failure).

> procedure Associate (Citizen_1, Citizen_2 : in ID) is
> begin
>     Associates( Citizen_1, Citizen_2) := True;

	Here you are accessing using indices of "ID", but the array is
defined for "Population_Range".

>         I : Long_Integer;
>
	Unneeded, it is automatically shadowed by the for loop...
	 
> begin
> 
>         for I in Population_Range loop

	This I is automatically of type Population_Range, and is
different from the long_integer above.

>                 if Society(I).Danger > Most_Dangerous_Rating and
>                    Society(I).Reported = False then
>                         Most_Dangerous_Rating := Society(I).Danger;
>                         Most_Dangerous_Location := I;

	Most_Dangerous_Location is declared long_integer, I is
implicitly declared Population_Range... May not be an error as it is a
subtype, but still...

>                         Most_Dangerous_Person := 0;

	Okay, this could justify the parent type, since you now need a 0
value and population_range is only positives.

	However, it is on the else side of the IF test, and you don't
have an escape from the loop. That means that unless the very last
person you test is the most_dangerous, you will reset to 0. Put the
"else" branch as an initializer BEFORE the loop.

>                 end if;
>         end loop;
> 
>         Society(Most_Dangerous_Location).Reported := True;
> 
>         return Most_Dangerous_Person;

	Is ID allowed to take on the value of 0? You have the rare
chance of returning such (okay, that's the case of "no data defined" and
your requirements don't say you have to handle errors).

>                         return Society(I).Person;

	And here you are returning a real ID from inside the structure,
even though you've set up the system so that "I" has to be the same
value.
>         for I in Population_Range loop
>                 for J in Population_Range loop
>                         Associates(	I, J) := False;
>                 end loop;
>         end loop;
>
	Tedious -- you can have Ada do it all for you using an aggregate
assignment with "others=>"; look up aggregate in your textbook.
> 
> open_resit.adb:63:05: argument of type conversion must be single

	You've shown us the body of package "pop", where is the body of
"open_resit"?

-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
8/2/2005 5:19:47 PM
On 2 Aug 2005 05:38:13 -0700, "strictly_mk@hotmail.com"
<strictly_mk@hotmail.com> declaimed the following in comp.lang.ada:

> Here is the specification;
> 
> generic
> 	type ID is new Long_Integer;

	That is NOT a generic... Off-hand, I'd say that is an error.

	Generic would be

	type ID is (<>);

AND the code that uses the package would supply the type to it...

	package myPop is new PoP(long_integer);

	If you recall, you said the spec could not be changed -- and the
spec you originally posted is (note: this has been reformatted by
AdaGIDE, but is identical syntactically and semantically):

generic
   type Id is
         (<>);
package Pop is

   type Rating is new Integer range 0 .. 255;

   procedure Rate (
         Citizen : in     Id;
         Badness : in     Rating);
   procedure Associate (
         Citizen_1,
         Citizen_2 : in     Id);

   function Most_Dangerous return Id;
   function Next_Member return Id;
   function More_In_Group return Boolean;

   procedure Reset;

end Pop;
   

> I'm a little confused with the generic part though - i don't know how
> to manipulate this bit.

	You "don't", the user of the package defines what the type
really is. See my comments above.

-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
8/2/2005 5:19:48 PM
Thank you for pointing all the errors out. I've changed every
long_integer type to integer, and the associates array is defined with
ID. But I'm getting the following errors.
open_resit.adb:111:56: expected type "ID" defined at open_resit.ads:2
open_resit.adb:111:56: found type "Standard.integer"
open_resit.adb:133:54: expected type "ID" defined at open_resit.ads:2
open_resit.adb:133:54: found type "Standard.integer"
open_resit.adb:157:41: expected type "ID" defined at open_resit.ads:2
open_resit.adb:157:41: found type "Standard.integer"

I'm guessing its something to do with ID being part of the generic bit
in the specification. (as it stands it is type ID is range <>) I still
dont know how to fix this.

Btw, open_resit is the whole program which I am not in charge of
writing, in the group we are redoing this project and all im
responsible for is the functionality.

0
8/3/2005 10:30:40 AM
Thank you for pointing that out, I changed Long_Integer back to integer
and Associates now works with ID. BUT..
Sorry everyone but I was just told that there is a mistake in the
specification and ID is supposed to read like this type ID is (<>);
Now all the errors I get in to compiler is this

open_resit.adb:91:50: expected type "ID" defined at open_resit.ads:2
open_resit.adb:91:50: found type universal integer

I still am not sure how to use generics properly, what am I supposed to
write and where do I put it? I'm hoping this is the last sort of
problem I have to fix so this thing can finaly compile.

Btw open_resit is the package used for the whole program, i.e GUI,
Testing .. I can't change any of that all I'm supposed to do is write
the functionality.

0
8/3/2005 11:38:44 AM
strictly_mk@hotmail.com wrote:
> Thank you for pointing that out, I changed Long_Integer back to integer
> and Associates now works with ID. BUT..
> Sorry everyone but I was just told that there is a mistake in the
> specification and ID is supposed to read like this type ID is (<>);
> Now all the errors I get in to compiler is this
> 
> open_resit.adb:91:50: expected type "ID" defined at open_resit.ads:2
> open_resit.adb:91:50: found type universal integer
> 
> I still am not sure how to use generics properly, what am I supposed to
> write and where do I put it? I'm hoping this is the last sort of
> problem I have to fix so this thing can finaly compile.

You have

generic
  type ID is (<>);
package PoP is ...

Some of your subprograms inside the package take ID parameters.

A discrete type (that's what "(<>)" implies) lets you base array type
definitions inside the package on properties of the generic discrete
type ID, like so:

  type Some_Array_Type is array (ID'range) of Some_Type;

This is the basically same as

   type Some_Array_Type is
     array(ID'first .. ID'last) of Some_Type;

'Range, 'first, and 'last are properties available with every discrete
type.


Likewise, you can write loops,

   for k in ID'range loop
      ...
   end loop;

or

   some_variable: Some_Array_Type;
   ...
   for k in some_variable'first .. some_variable'last loop
      -- use some_variable(k) here
   end loop;

BTW, there is no need to declare for-loop variables, these
are "automatically" declared.

So just give up thinking in terms of whatever Integer type you
have in mind. Your job, IIUC, is to write code inside a generic
that is parameterized by the type "ID". This type is a discrete
type, this is all you know, and it is all you need to know.
0
bauhaus1 (735)
8/3/2005 12:08:19 PM
Can I define the range of ID outside the specification? I am still
getting the same error messages.

What is the range of ID in type Some_Array__Type is array (ID'range) of
Some_Type; ?


I apologise if I am being a dumbass.

0
8/3/2005 3:56:02 PM
Georg Bauhaus wrote:
> 
>  type Some_Array_Type is array (ID'range) of Some_Type;

This is the same as

type Some_Array_Type is array (ID) of Some_Type;

Attributes are fine, but let's not overuse them.

-- 
Jeffrey Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail
E-mail: jeffrey_r_carter-nr [commercial-at]
         raytheon [period | full stop] com
0
spam29 (1568)
8/3/2005 4:13:37 PM
Georg Bauhaus wrote:
> Likewise, you can write loops,
>
>    for k in ID'range loop
>       ...
>    end loop;
>
> or
>
>    some_variable: Some_Array_Type;
>    ...
>    for k in some_variable'first .. some_variable'last loop
>       -- use some_variable(k) here
>    end loop;

but preferably:

for k in some_variable'range loop
   -- use some_variable (k) here
end loop;

The compiler will deduce there are no runtime checks required with this
construct but I've seen plenty compilers that will insert checks in the
other forms (even though we can see they aren't really needed).

Cheers

-- Martin


0
8/3/2005 4:48:16 PM
On 3 Aug 2005 04:38:44 -0700, "strictly_mk@hotmail.com"
<strictly_mk@hotmail.com> declaimed the following in comp.lang.ada:

> 
> open_resit.adb:91:50: expected type "ID" defined at open_resit.ads:2
> open_resit.adb:91:50: found type universal integer
> 
> I still am not sure how to use generics properly, what am I supposed to
> write and where do I put it? I'm hoping this is the last sort of
> problem I have to fix so this thing can finaly compile.
> 
> Btw open_resit is the package used for the whole program, i.e GUI,
> Testing .. I can't change any of that all I'm supposed to do is write
> the functionality.

	Sounds like the error, then, is in the code you aren't supposed
to touch. Can you, at least, show us what the line around line 91 of
"open_resit.adb" really are?

	The short/simple bit with the generics is that the package you
wrote does NOT know what the actual type of ID will be. The (<>) is a
placeholder, and your package just refers to type ID internally.

	The USER of your package has to "instantiate" a /version/ by
supplying an actual (I want to say "real", but that might be confusing)
type.
	type enum_type is 
		(Monday, Tuesday, Wednesday, Thursday, Friday);
	package enum_pop is new pop(enum_type);

	type city_pop is range 0..10_000;
	package int_pop is new pop(city_pop);

In the first set, ID values can only be Monday..Friday; the package you
wrote doesn't care. The second set is a range of integers -- same
package.

	The error message you report is saying that the author of
open_resit has something like

	type ID is .....

on line two. Somewhere else is a call (maybe into a Pop instantiation)
where they are supposed to be passing a variable of type ID, but instead
they are passing an integer -- since it says "universal integer" I'd
suspect it is some constant, or a variable that had been declared as 

v : integer;


-- 
 > ============================================================== <
 >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed@dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >           Home Page: <http://www.dm.net/~wulfraed/>            <
 >        Overflow Page: <http://wlfraed.home.netcom.com/>        <
0
wlfraed (4596)
8/3/2005 5:25:30 PM
Actually I think I fixed the majority of them, here is the package
body; FYI  type ID is (<>);

The only problem really now is that line 91 refers to the most
dangerous function where it says Most_Dangerous_Person := 0;
I think the compiler is complaining about 0 being passed off as an ID.
(Is there a way around this)

Line 120 refers to the return 0; in the next_member function (again I
think its to do with 0 not being an integer) (again, is there a way
around this?)

Line 159 refers to Society(K).Person := 0; (same thing?)

The compiler says the following for all three,

open_resit.adb:159:37: expected type "ID" defined at open_resit.ads:2
open_resit.adb:159:37: found type universal integer

package body PoP is
--


--***************************************************************
--                      constants
--***************************************************************


--***************************************************************
--                      variables
--***************************************************************
-- A record to capture the required information about an
-- individual within the Society.
type Individual is
                record
                Person : ID;
                Danger  : Rating;
                Reported : Boolean;
                end record;
-- An array to store every known Individual
type Poppleton is array ( ID ) of Individual;

Society : Poppleton;

-- An array to monitor which Individuals associate with which
-- other individuals.
type Associates_Matrix is array ( ID , ID ) of Boolean;

Associates : Associates_Matrix;

-- A store for the current most dangerous person
-- This is not necessarily the current most danagerous person rather
-- the most danagerous person as the time Most_Dangerous was called.
Most_Dangerous_Person : ID;
--***************************************************************
--                      updating procedures
--***************************************************************

--
--      High level description of procedure
--
procedure Rate ( Citizen : in ID; Badness : in Rating) is
begin
        -- If this citizen rated twice, the record will be overwritten.
        Society(Citizen).Person := Citizen;
        Society(Citizen).Danger := Badness;
        Society(Citizen).Reported := False;

end Rate;

--
--      High level description of procedure
--
procedure Associate (Citizen_1, Citizen_2 : in ID) is
begin
    Associates( Citizen_1, Citizen_2) := True;
	Associates( Citizen_2, Citizen_1) := True;
end Associate;


--***************************************************************
--                      querying functions
--***************************************************************

--
--      High level description of function
--
function Most_Dangerous return ID is

        Most_Dangerous_Rating : Rating;
        Most_Dangerous_Location : ID;


begin

        for I in ID'range loop
                if Society(I).Danger > Most_Dangerous_Rating and
                   Society(I).Reported = False then
                        Most_Dangerous_Rating := Society(I).Danger;
                        Most_Dangerous_Location := I;
                        Most_Dangerous_Person := Society(I).Person;
                else
                        Most_Dangerous_Person := 0;
                end if;
        end loop;

        Society(Most_Dangerous_Location).Reported := True;

        return Most_Dangerous_Person;

end Most_Dangerous;

--
--      High level description of function
--
function Next_Member return ID is


begin

        for I in ID'range loop
                if Associates( Most_Dangerous_Person , I ) = True and
                   Society(I).Reported = False then
				begin
                        -- Assuming we would never report on this
                        -- person again.
                        Society(I).Reported := True;
                        return Society(I).Person;
				end;
				end if;
        end loop;
	return 0;

end Next_Member;

--
--      High level description of function
--
function More_In_Group return boolean is

begin

        for I in ID'range loop
                if Associates(Most_Dangerous_Person, I) = True and
                   Society(I).Reported = False then
                return True;
				end if;
        end loop;
		return False;
end More_In_Group;


--***************************************************************
--                      administrative
--***************************************************************

--
--      High level description of function
--
procedure reset is
begin
        -- Set all Associates back to False
        for I in ID'range loop
                for J in ID'range loop
                        Associates(	I, J) := False;
                end loop;
        end loop;

        -- Reset all citizen records in Society
		for K in ID'range loop
		Society(K).Person:= 0;
		Society(K).Danger:= 0;
		Society(K).Reported := False;
		end loop;
		
end reset;
end PoP;

0
8/3/2005 5:39:02 PM
Jeffrey Carter wrote:

> type Some_Array_Type is array (ID) of Some_Type;
> 
> Attributes are fine, but let's not overuse them.

Right, I wasn't seeing the wood for the trees.


-- Georg 


 
0
bauhaus1 (735)
8/3/2005 5:57:33 PM
strictly_mk@hotmail.com wrote:
> Can I define the range of ID outside the specification? I am still
> getting the same error messages.

As Dennis has explained, this is done during instantiation.

> What is the range of ID in type Some_Array__Type is array (ID'range) of
> Some_Type; ?

It's ID'Range :-)


0
bauhaus1 (735)
8/3/2005 5:58:44 PM
strictly_mk@hotmail.com wrote:
> Actually I think I fixed the majority of them, here is the package
> body; FYI  type ID is (<>);
> 
> The only problem really now is that line 91 refers to the most
> dangerous function where it says Most_Dangerous_Person := 0;
> I think the compiler is complaining about 0 being passed off as an ID.

That's right, 0 is known to belong to a universal intege type,
but (<>) says discrete type. So you cannot assume there will be
a 0.

> Line 120 refers to the return 0; in the next_member function (again I
> think its to do with 0 not being an integer) (again, is there a way
> around this?)

I think so. If there is a most dangerous person
(i.e., at least one, in math speak I think)
then this person's ID should be the one to use in identifying the person?

Not sure why you assign a default value (?) to Most_Dangerous_Person?
(If you need a default value, some ID values are available
through ID's type attributes.)
0
bauhaus1 (735)
8/3/2005 6:07:58 PM
"strictly_mk@hotmail.com" <strictly_mk@hotmail.com> writes:

> Line 120 refers to the return 0; in the next_member function (again
> I think its to do with 0 not being an integer) (again, is there a
> way around this?)

You need to return the value of ID which means "not a valid ID". That
might be ID'First or ID'Last (your value of 0 implies 'First). But I
expect that your first Person would have an ID of 'First! Sounds like
there's a deep problem in the spec there?
0
simon8285 (1465)
8/3/2005 8:18:43 PM
Simon Wright wrote:
> 
> You need to return the value of ID which means "not a valid ID". That
> might be ID'First or ID'Last (your value of 0 implies 'First). But I
> expect that your first Person would have an ID of 'First! Sounds like
> there's a deep problem in the spec there?

IIRC, the spec states that anything may be returned if there's no valid 
value.

-- 
Jeff Carter
"I was hobbling along, minding my own business, all of a
sudden, up he comes, cures me! One minute I'm a leper with
a trade, next minute my livelihood's gone! Not so much as a
'by your leave!' You're cured, mate. Bloody do-gooder!"
Monty Python's Life of Brian
76
0
spam29 (1568)
8/4/2005 12:59:22 AM
Jeffrey Carter <spam@spam.com> writes:

> Simon Wright wrote:
>> You need to return the value of ID which means "not a valid
>> ID". That
>> might be ID'First or ID'Last (your value of 0 implies 'First). But I
>> expect that your first Person would have an ID of 'First! Sounds like
>> there's a deep problem in the spec there?
>
> IIRC, the spec states that anything may be returned if there's no
> valid value.

Oh yes, I was forgetting this is an exercise ..
0
simon8285 (1465)
8/4/2005 5:42:21 AM
Reply:

Similar Artilces:

Ada 95 -- Ada 2005 -- Ada 2012
newbie: i'm learning Ada now using an Ada 95 book=E2=80=A6 question: is the object oriented features so different in Ada 2012 that i should not = use a book teaching Ada 95, the book is the second edition by Koffman and F= eldman "Ada 95: Problem Solving and Program Design" I was reading the Ada Style Guide and got to the part about Object Oriented= features and realized how dated this document might be. From Ada Style Guide: "Chapter 9 defines a set of guidelines in common objected-oriented terms th= at exploit some of the features of Ada 95 that are ...

Help Request: Parsing Ada & Understanding, Maintaining, Extending Legacy Ada
Hi, Headway has a product, Headway Review that reverse engineers Ada to provide an extremely detailed model of all the dependencies in your code. Review's focus is in on the architecture/structure of the code and the code's metrics. We are in process of replacing Review with our next generation product line, Structure101, and we would like to better understand how portable our current Ada parsing capability is and whether to continue with it for Structure101. Our parsing technology is based on the GNAT ASIS implementation and besides GNAT users we are currently aware of customers with VADS, Greenhills and SunAda codebases who are working away happily with Review. If there is anyone out there with non-GNAT Ada code who might be interested to better understand how the code hangs together, we would be very interested to hear if you could get it easily loaded into Review. We'd be happy to help in this process and have noted with recent Greenhills and SunAda codebases that it really wasnt too difficult. You can download Review from http://headwaysoftware.com/downloads/review/ or contact me directly, details below if this is of interest. best regards, Paul ___________________________________________ e: paul.hickey at headwaysoftware.com ...

Creating and using Ada packages: need refinement
Hello! My question is: how to create flexible Ada packages and what should they look like? Enlist the make variables, for example. I'm not happy with what I currently see. Ada packages are not easy to finetune. Let's suppose that our project is rather complex. It contains both Ada and C code and may be C++. Let's start with the following list: ADA= gnatgcc, gcc Name of the compiler used to compile Ada. Different compilers can be used to compile Ada, C and C++. In particular, different instances of GCC. On the most OSes it's $(which gcc), but on FreeBSD and Mac OS X it's better to use another compiler for C and C++. On FreeBSD Ada compiler is based on GCC 3.x, and on Mac OS X Apple GCC is supposed to be used instead of FSF one. So the ./configure script should first look for gnatgcc. ADAFLAGS= -I. -O2 Flags used when invoking $(ADA) CC= gcc C compiler invokation command CXX= g++ C++ compiler invokation command CFLAGS= -g -O2 C-specific flags (not applicable to C++) CXXFLAGS= -g -O2 C++-specific flags CPP= gcc -E C preprocessor invokation command CXXCPP= g++ -E INCLUDES, DEFS, LIBS Additional flags. The rightest way to call C compiler so far: $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) I also saw: $(AM_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES) The rightest ...

The Ada Connection = Ada-Europe 2011 + Ada Conference UK 2011
----------------------------------------------------------------------- FINAL Call for Participation *** UPDATED Program Summary *** The Ada Connection 16th International Conference on Reliable Software Technologies - Ada-Europe 2011 + Ada Conference UK 2011 20 - 24 June 2011, Edinburgh, UK http://www.ada-europe.org/conference2011 *** Full Program available on conference web site *** *** Check out the tutorial program! *** *** Printed proceedings available *** *** Register now! *** ----------------------------------------------------------------------- Press release: The Ada Connection = Ada-Europe 2011 + Ada Conference UK 2011 International experts meet in Edinburgh Edinburgh (8 June 2011 20:00) - The Ada Connection, which combines the 16th International Conference on Reliable Software Technologies - Ada-Europe 2011 - with Ada Conference UK 2011, will take place from 20 to 24 June in Edinburgh, Scotland's capital city and the UK's most popular conference destination. The Ada Connection is the union of two Ada events that have both been very successful in their own right. The Ada-Europe series of conferences has become established as an international forum ...

The Ada Connection = Ada-Europe 2011 + Ada Conference UK 2011 #2
----------------------------------------------------------------------- FINAL Call for Participation *** UPDATED Program Summary *** The Ada Connection 16th International Conference on Reliable Software Technologies - Ada-Europe 2011 + Ada Conference UK 2011 20 - 24 June 2011, Edinburgh, UK http://www.ada-europe.org/conference2011 *** Full Program available on conference web site *** ...

Need help with help need
Friends and wormbots: I am looking for some intrepid souls to try out and comment on a perl script I wrote. (What, perl in SAS-L and it's not David Cassell ?) The script takes the SAS help files apart and does some analysis (orphans, linkrot and duplicates) and inserts back links. What do back links do ? It ensures every page in the help system has a link to every page that links to it. (Actually only the the subset of the help system represented by the modules you choose to play with [there are over 140 help modules]) 1,000 lines of perl that sprouted out of a two line seed (or should...

Ada principles outside of Ada
Hi people, Just for fun, two quotes from a captivating thesis about Isabelle, a pro= of = assistance and authoring environment, which has some words Ada users may= = recognize as their own typical words. In Markus Wenzel's 2001 thesis, titled =E2=80=9CIsabelle/Isar =E2=80=94 a versatile environment for huma= n-readable formal = proof documents=E2=80=9D http://tumb1.biblio.tu-muenchen.de/publ/diss/in/2002/wenzel.pdf Page 18 (printed page 4) =E2=80=9CHere the primitive layer consists of abstract theorem constructors of the inference kernel, according to 'Correctness by Construction' by Milner.=E2=80=9D Page 27 (printed page 13), talking about the Isar language design = rationals: =E2=80=9CPrimacy of readability over writability.=E2=80=9D I may have a later question regarding Ada and SPARK and Isabelle. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity ...

ada packages
Hi i have one more question. Could you tell mi if enywhere is something like package browser.i want to browse functions with comments about themn, now i must open some package file and look for function that i wantm, is any simpliest way ? sory for lame question On 2004-02-17, Kuba Malczak <wipe@op.pl> wrote: > Hi i have one more question. > Could you tell mi if enywhere is something > like package browser.i want to browse functions > with comments about themn, now i must open some package file > and look for function that i wantm, is any simpliest way ? > sory for lame question Some choices: Adabrowse http://home.tiscalinet.ch/t_wolf/tw/ada95/ gnathtml (in GNAT) http://libre.act-europe.fr/GNAT/ AdaDoc http://adadoc.sourceforge.net/ GPS (IDE) http://libre.act-europe.fr/gps/ -- "Saving keystrokes is the job of the text editor, not the programming language." On Tue, 17 Feb 2004 11:10:04 +0000, Preben Randhol wrote: > On 2004-02-17, Kuba Malczak <wipe@op.pl> wrote: >> Hi i have one more question. >> Could you tell mi if enywhere is something >> like package browser.i want to browse functions >> with comments about themn, now i must open some package file >> and look for function that i wantm, is any simpliest way ? >> sory for lame question > > Some choices: > > Adabrowse > http://home.tiscalinet.ch/t_wolf/tw/ada95/ > > gnathtml...

Need help w/ ada-mode.el under Emacs 21.
After a general system upgrade my Ada-mode for Emacs is behaving differently, and I'm having trouble restoring the earlier behavior. The behavior that I want to suppress is that whenever you press return on an empty line to create more whitespace I get an indentation on the new line, and I want the cursor to stay at the left margin unless I press the tab key. Previously it would guess an indentation if I were in the middle of a declaration or a statement, but not otherwise, and that is the behavior that I would like to restore. I see that I can suppress re-indentation of the *current* line by adding (setq ada-indent-after-return nil) to my ~/.emacs, but that's not what I want to change -- I want to change indentation of the line where the cursor ends up after pressing return. Nor do I want to disable indentation altogether; I just want to disable contextless indentation. (While working on complicated problems I like to put "lose end" comments at the left margin so I can find them more easily by skimming, and it's really annoying to have to move every line back to the margin by hand.) Any help would be appreciated. -- Bobby Bryant Austin, Texas On Tue, 29 Jul 2003 04:28:20 -0600, "Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote: > >After a general system upgrade my Ada-mode for Emacs is behaving >differently, and I'm having trouble restoring the earlier behavior. > >The behavior that I want to suppress is t...

Is it Ada 2005 or Ada 2007?
I have seen the "new" Ada referred to as both Ada 2005 and Ada 2007. When referring to the new standard and without referring to any particular implementation of it, which is correct or preferred? I sort of understand that the standard wasn't agreed to until 2007 but that might not be the defining event. Is there an official designation or are left to our own devices to call it what we want? Jerry writes: > I have seen the "new" Ada referred to as both Ada 2005 and Ada 2007. > When referring to the new standard and without referring to any > particular implementation of it, which is correct or preferred? I sort > of understand that the standard wasn't agreed to until 2007 but that > might not be the defining event. Is there an official designation or > are left to our own devices to call it what we want? Formally, it is "ISO/IEC 8652:1995(E) with Corrigendum 1 and Amendment 1". Officially informally (!), it is "Ada 2005" because ARM 3.1/2 says so. That is the result of a majority agreement between the members of the working group, most of whom are compiler vendors. Some people call it "Ada 2007" because the ISO formally approved and published Amendment 1 in 2007. Some people call it "Ada". Some people call it "Amendment 1". It doesn't really matter, except perhaps to marketeers. Are there any in the Ada business? -- Ludovic Brenta. It may change, but as of today, th...

what about having ada compile ada on the fly?
I've seen that there are discussions about enhancing the current ada95 spec. I was interested to know if there has been any talk of implementing an api for compiling ada code. I've read that some languages implement this feature(i think one was smalltalk), and i could see how that would be very useful for making an IDE that would load modules or scripts on the fly. I dunno much about the topic yet, my "Dragon Book" compiler book hasn't gotten here for Christmas yet. I have ideas for an IDE for linux and customizing the IDE with scripts that were compiled on the fly sounded like a good idea. I dunno just a thought *shrug*. cl1motorsports wrote: > I've seen that there are discussions about enhancing the current ada95 > spec. I was interested to know if there has been any talk of > implementing an api for compiling ada code. I've read that some > languages implement this feature(i think one was smalltalk), and i could > see how that would be very useful for making an IDE that would load > modules or scripts on the fly. I dunno much about the topic yet, my > "Dragon Book" compiler book hasn't gotten here for Christmas yet. I have > ideas for an IDE for linux and customizing the IDE with scripts that > were compiled on the fly sounded like a good idea. I dunno just a > thought *shrug*. This is not relevant to the current revision process for the language standard (which was separated in its conc...

A few questions on Ada and Ada implementations
Hi, I have been looking over Ada (the 95 variant) and it looks like a great language. Are there any free (as in no license restrictions, not GPL- anything) GUI libraries? What choices are there for handling output besides text? gcc-Ada looks good but I prefer to avoid gcc as much as I can and I also haven't found anything but GtkAda that seems to be GPLed. What Ada toolchains are available for 64 bit Linux that can be used to generate 32 or 64 bit Linux/UNIX executables that are in a hobbyist's price range (let's say up to 1000 USD). Do they include their own GUI libraries? Do they include any data base bindings? What else should I look for? I don't need a 2005 compliant toolchain as far as I know. I'll be ok with an Ada95 compiler. And will I be able to generate Windows executables from any of these Linux-based toolchains? Basically I want to know what kind of investment I need to make to have an unencumbered Ada95 toolchain with all the features I need to write and deploy general applications without having to go fishing for libraries. Thank you. Adacore has a freely available GPL compiler available for Linux or Windows, though I am unsure if it generates 64-bit executables I know it will generate 32-bit ones: http://libre.adacore.com/libre/ I haven't done any investigating into GUI libraries for Ada yet so I cannot answer regarding that. On 12/18/2010 5:00 PM, Shark8 wrote: > Adacore has a freely available GPL compiler available for Lin...

ada without ada libraries?
Hi Everyone I just got my compiler set up the way I want it and I am ready for my first ada project. I have spent sometime with lua. Lua's library support is terrible but lots of people love the language. Many people just build a rough skeleton application in C and call it from lua. Lua handles all the type checking and much of the logic in this arrangement and C is mostly just library code. Would this same approach seem logical for ada? -Patrick On 02/07/2012 04:14 PM, Patrick wrote: > Hi Everyone > > I just got my compiler set up the way I want it and I am ready for my > first ada project. > > I have spent sometime with lua. Lua's library support is terrible but > lots of people love the language. Many people just build a rough > skeleton application in C and call it from lua. > > Lua handles all the type checking and much of the logic in this > arrangement and C is mostly just library code. > > Would this same approach seem logical for ada? -Patrick This might make sense, if you're claiming that Ada's "library support is terrible"; else, why would you make this comparison? It sounds like you want to use Ada, but not use the Ada libraries. If you instead want to use Ada with a library for which you don't have an Ada interface, you can build (or look for) a binding to that library. This is done in Ada, not in another language. See the Ada packages Interfaces.*. Typically, you don't need...

i need package help or dyanamic help
I have a package that should be called by functions to access mathematica data sources In my example program i do want a pull down of the states. In the example it seems easier because the list is already defined by the data source.(?). i need the data to be in a list but also to have quotes around it so when it is stuffed into the function the correct syntax is written. i have attached both. i get an error about the list not being properly defined. usingWhere toLive.nb << WhereToLive` MyManipulation[states] the package whereToLive.m BeginPackage["WhereToLive`"]...

Ada Advocacy
For those of you that are not familiar there is an e-mail list called Team-Ada (see the Ada FAQ - http://www.adapower.com/faq - but to make things short you join by sending the word subscribe to team-ada@acm.org) where Ada advocacy is discussed. I've started this evening on the list the first of what I hope will be many of my suggestions to Juice Up Ada (There was certainly tons of Juice flowing when the Juice was on trial, perhaps we can get some going with Ada a bit on trial). I've posted the following (Please join and respond on Team-Ada@acm.org for this one): Welcome to the Team-Ada group therapy session #1 Suggestion #1: -------------------- A good article written not for academics or professionals, but to newbies that are just getting in to or interested in programing in general as to why Ada should be the language they embrace and learn first (We all know not to learn Basic first ;-). Think, if you were a student, would you want to learn anything but Java or C++ given the current marketplace. Most would rather learn almost any language in the world rather than Ada, Cobol or Fortran.... Personally, I started by doing stuff like looking up on a chart of 8080 instructions and poking the values in memory using trs-80 basic after converting from hex to decimal, but I am a certified freak who had nothing better to do when all his friends had Apple and Comodores, and was nine years old and not thinking about a job, the future, etc... Other a...

C to ADA or FORTRAN to ADA
Where I can found a tranlator from C/Fortran source code to ADA? for winXP. "TC" <tecomeco@inwind.it> wrote in message news:oGFPe.32034$HM1.904119@twister1.libero.it... > Where I can found a tranlator from C/Fortran source code to ADA? for > winXP. > if you can't find one for XP, you could always install cygwin on XP and use c2ada there. You can download c2ada tar file from here. It should not be hard to make it compile/build on cygwin, you might have to modify the makefile etc... http://12000.org/my_notes/ada/index.htm Nasser ...

Ada-java, java-ada
Hello, I am actually working with ada83 and going forward to Ada95. On the way I would like to do some tests using java. 1. Does someone have some good links on java->ada83 and java->ada95 or some simple demos ? 2. Is it possible to call java FROM ada83 ? Can I use JNI ? 3. Is it possible to call java FROM ada95 ? Can I use JNI ? Thank you, S´┐Żbastien. __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover S=E9bastien Thoos wrote: > I am actually working with > ada83 and going forward to=20 > Ada95. On the way I would > like to do some tests using=20 > java. >=20 > 1. Does someone have some good links > on java->ada83 and java->ada95 or > some simple demos ? Maybe Jgnat would be useful? Jgnat compiles Ada source code to Java=20 bytecode. You can find it at http://dk.gnuada.org/gnat/jgnat/. > 2. Is it possible to call java FROM ada83 ? > Can I use JNI ? >=20 > 3. Is it possible to call java FROM ada95 ? > Can I use JNI ? Jgnat's documentation says you can call Java code both from=20 bytecode-compiled Ada code and through JNI from native-compiled Ada code.= --=20 Bj=F6rn Persson jor ers @sv ge. b n_p son eri nu While I haven't tried interfacing from Ada95 to Java, I have interfaced between Ada and C, and it is very easy. Using JNI should be a simple approach. Steve (The D...

HELP | function Is_Open (File : File_Type) return Boolean; package ada.text_io
Can someone please post a simple code in which this function is used , i'm lost , thanks . On 15-10-26 12:21 , comicfanzine@gmail.com wrote: > Can someone please post a simple code in which this function is used , i'm lost , thanks . The following program can be run with or without command-line arguments. If, and only if, there are command-line arguments, the program creates and writes some text to a file called my_log_file.txt. with Ada.Command_Line; with Ada.Text_IO; procedure Ex_Is_Open is Log_File : Ada.Text_IO.File_Type; -- -- File for log o...

"Ada Programming" need some help form ObjectAda and APEX users.
Hello, We the Authors of "Ada Programming" have a little problem: We have only access to the GNAT compiler. It would be nice also to provide project files for other Ada compilers. And for that we need the help from Ada users which have access to the other Ada tool chains. If you have some time and access to a non GNAT compiler do go to http://en.wikibooks.org/wiki/Ada_Programming/Building and help us out. With Kind Regards Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com ...

Ada
I was just wondering if it is possible to change the colour of a string in ada 95? In article <1106770009.493447.308200@c13g2000cwb.googlegroups.com>, mcf501@york.ac.uk writes: > I was just wondering if it is possible to change the colour of a string > in ada 95? Ada strings have no attribute called "color". If you mean to change the color in which a string is displayed, that depends on your operating system and display hardware. On an older terminal, for instance, the only two color choices are Black and White. <mcf501@york.ac.uk> wrote in message news:1106770009.493447.308200@c13g2000cwb.googlegroups.com... >I was just wondering if it is possible to change the colour of a string > in ada 95? If by string you mean an array of characters, then no, you cannot change its colour, if for no other reason than the fact that an array of characters does not have a colour component. Most likely, you meant "How can I change the color of text displayed on a Window?". To answer the question, we would need to know the OS. It's really more of an OS issue than a language issue. > I was just wondering if it is possible to change the colour of a string > in ada 95? It reminds me of an old joke, "what colour do you want your database?" :) -- Ludovic Brenta. mcf501@york.ac.uk writes: > I was just wondering if it is possible to change the colour of a string > in ada 95? This is just too tempting :). &l...

Ada library, interfacing ADA with C
Hello everybody !!! I have to interface ADA with C and I would like to create an ADA library. I read the gnat manual and it is said that i can use gnatmake and a project library. So I use gnatmake: $ gnatmake -Pmy_lib.gpr I get the following message: powerpc-eabispe-gnatbind -n -o b~lib.adb -Llib prog1.ali prog2.ali powerpc-eabispe-gcc -c b~lib.adb building static library for project my_lib powerpc-eabispegnatmake: powerpc-elf-ar not found in path. In fact I haven't powerpc-elf-ar on my computer, so i created a link to it with : ln -s powerpc-eabispe-ar powerpc-elf-ar But the problem is the same and all my PATH are good. My project library my_lib.gpr /******** Library project*****/ project My_Lib is for Source_Dirs use ("SRC"); for Object_Dir use "CGN"; for Library_Name use "lib"; for Library_Dir use "LIB"; for Library_Kind use "static"; end My_lib; Because it didn't work, i tried to create a library with the following command: powerpc-eabispe-ar rc libmy_lib.a prog1.o prog2.o but there is an other problem because gnatlink ask me to supply an ALI file which has a corresponding bind file so I can't create an executable. Could you say me how must I use a library file with gnatlink (which command use) ? I forgot to say you I use Cygwin a Unix emulator. david-mamour@hotmail.fr wrote: > Hello everybody !!! > > I have to interface ADA with C and I would like to create an ADA &...

Ada to Ada Pragma Export/Import
I need to deliver object files (coded in Ada) to another team who will access the public routines in their Ada code. I cannot deliver the package bodies (but can deliver the object files, the specs, and the ALI files). For example, suppose I want do deliver the hello_pkg.o and hello_pkg.ads from the code below. My assumption is that I need to export the Say_It procedure in the spec, and then the other team would need to import this procedure into their code. Is this correct? And what is the syntax required? I've tried the following but can't figure it out. Thanx much for any help. Andy askeyaj@gmail.com -------- with Text_Io; package Hello_Pkg is pragma Export (Ada, Say_It, "say_it"); -- CORRECT??? procedure Say_It; end Hello_Pkg; package body Hello_Pkg is procedure Say_It is begin Text_Io.Put_Line("Hello World."); end Say_It; end Hello_Pkg; with Hello_Pkg; procedure Test_Hello is pragma Import (Ada, Say_It, "say_it"); -- NOT SURE WHAT TO DO HERE begin Say_It; end Test_Hello; AskeyAJ@gmail.com wrote: > I need to deliver object files (coded in Ada) to another team who will > access the public routines in their Ada code. I cannot deliver the > package bodies (but can deliver the object files, the specs, and the > ALI files). For example, suppose I want do deliver the hello_pkg.o and > hello_pkg.ads from the code below. > > My assumption is that I need to export the Say...

Ada.Real_Time Vs. Ada.Calendar
I need to compare data types that are stored in Ada.Real_Time.Time and Ada.Calendar.Time. I know I can get a seconds count from each package. However, is it the same time base? Is it dependant on the hardware it is run on? markp wrote: > I need to compare data types that are stored in Ada.Real_Time.Time and > Ada.Calendar.Time. I know I can get a seconds count from each package. > However, is it the same time base? Is it dependant on the hardware it > is run on? In general, you can't count on them having any meaningful relationship. Real_Time may be a count of ticks since the program started, for example, while Calendar must be a date and time CE. How they are implemented is not specified, which is not surprising. For a specific compiler and platform, you may be able to make use of compiler-dependent information to relate the two. GNAT, for example, defines both Time types as "new Duration". That doesn't guarantee that the stored values have the same meaning, though. -- Jeff Carter "We burst our pimples at you." Monty Python & the Holy Grail 16 "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> writes: > In general, you can't count on them having any meaningful > relationship. Real_Time may be a count of ticks since the program > started, for example, while Calendar must be a date and time CE. And I don't think it would be right to expect the relationship to be constant, either -...

Ada noob here! Is Ada widely used?
I'm new to Ada, but not to programming in general. Decided to learn a new language, and Ada was of interest to me. Am enjoying the language so far - using GNAT GPL nad Coronado's old tutorial. Just curious to know if Ada is still widely used, and in what area(s) does it excel, e.g. data processing, number crunching, graphics, etc? TIA.. -- Duke *** Tolerance becomes a crime, when applied to evil [Thomas Mann] *** On May 20, 8:53=A0am, Duke Normandin <dukeofp...@ml1.net> wrote: > I'm new to Ada, but not to programming in general. Decided to learn a new > language, and Ada was of interest to me. Am enjoying the language so far = - > using GNAT GPL nad Coronado's old tutorial. > > Just curious to know if Ada is still widely used, and in what area(s) doe= s > it excel, e.g. data processing, number crunching, graphics, etc? TIA.. > -- > Duke > *** Tolerance becomes a crime, when applied to evil [Thomas Mann] *** There are others who will be more qualified to answer this than me, but annecdotally it sounds to me like Ada has a wider base in Europe right now than in the US. The language is good for embedded, real-time, and safety-critical software where high reliability is required. It is often used in the space and aviation industries for these reasons. Some like Ada as a teaching language. A lot of its syntax is Pascal- like. A frequently-cited weakness in the academic area is that there are not a lot of people developing...

Web resources about - Help needed for ada package - comp.lang.ada

CARE Package - Wikipedia, the free encyclopedia
In 1945, the newly formed CARE (then the Cooperative for American Remittances to Europe) initiated a program to send food relief to Europe, where ...

Brisbane council election: Quirk promises Mt Coot-tha zipline in $11.4m package
A new zipline and bus loop would be introduced to Mt Coot-tha under a re-elected Liberal National Party council administration, Brisbane Lord ...

ANU modelling suggests more families to lose out in childcare package
Australian National University modelling of the Coalition's new childcare package suggests more families will be hit by the proposed changes ...

US presidential election: Suspicious package sent to Donald Trump's son Eric
New York police are investigating a suspicious package that was sent to the apartment of Donald Trump's son, Eric, a law enforcement official ...

US presidential election: Suspicious package sent to Donald Trump's son Eric
New York police are investigating a suspicious package that was sent to the apartment of Donald Trump's son, Eric, a law enforcement official ...

Brands Are Making Packages the Media of the Future
Consumers may keep finding ways to avoid ads, and retailers are making it harder for brands to get displays into stores. But packaged-goods marketers ...

Rio Tinto chief executive Sam Walsh has received a smaller remuneration package
The crash in commodity prices has claimed a new victim: the remuneration package afforded to Rio Tinto chief executive Sam Walsh.

AfDB Approves Over U.S. $36 Million Support Package for Djibouti
The African Development Bank Group will help Djibouti to diversify its economy, improve governance and create employment for the country's young ...

Samsung Demos Its First BGA SSD: 1500 MB/s Read Speed and Tiny Package
... solid-state storage solutions: Type 1620, Type 2024, Type 2228 and Type 2828. M.2 types traditionally define width and length of the package ...

2017 Mercedes-Benz GLC-Class Coupe is a stylish take on a familiar package
Filed under: New York Auto Show , Mercedes-Benz , Coupe , Crossover , Luxury , Performance The Mercedes-Benz GLC-Class is a competent, comfortable ...

Resources last updated: 3/23/2016 4:37:47 AM