ada

Drawing a flag with diagonal crosses in a V-Shape (ADA)

我的未来我决定 提交于 2020-06-17 00:06:32
问题 I turn to Stackoverflow yet again. having gotten help here previously I hope to be received equally friendly once more. I have an assignment where I need to draw a flag (including a box-like shape around it and a V-shape of crosses in its midst) in ADA. Ive managed to make the box and roughly half of the crosses. can anyone clue me in as to how one easiest fills in the remainder of the crosses? Its supposed to be a V-shape, like this: + + + + + etc with Ada.Text_IO; use Ada.Text_IO; with Ada

Ada - Accessibility check raised within a procedure

五迷三道 提交于 2020-06-16 03:36:53
问题 I previously asked a question regarding accessibility checks being raised in Ada, which @Brian Drummond was kind enough to awnser. The accessibility check was in a function, now I have a similair problem within a procedure; any guidance as to why this is would be greatly appreciated. The code I am working on has been taken from here: https://github.com/raph-amiard/ada-synth-lib The code in main file below is from the the Simple_Sine example which can be found here: https://github.com/raph

What should I do to solve the GNAT GPS “library not found” problem and build my first “Hello World” program on my Mac?

試著忘記壹切 提交于 2020-05-29 03:56:08
问题 I downloaded the GNAT Community 2019 and have installed on my Mac in my home folder "/Users/leon/opt/GNAT" I run the command "gps" in the directory "/Users/leon/opt/GNAT/2019/bin". And GPS showed up, then I created a project, typed the "Hello World" code. Just as the Wikibook shows. with Ada.Text_IO; procedure Hello is begin Ada.Text_IO.Put_Line("Hello, world!"); end Hello; When I clicked the build button, the program just failed to build. The following is the building output. gprbuild -d -P

Printing array of integers generates weird output in Ada

六眼飞鱼酱① 提交于 2020-05-16 05:53:06
问题 I created a simple Ada program that allows a user to populate an array with a maximum of 100 non negative and non zero integers and then prints them out. When I call the function to print out the numbers it prints them out but at the same time it also prints out a bunch of strange and seemingly random numbers. What mistake have I made in my code that is causing the program to output such strange results? This is my first time writing in Ada. For example when I populate the empty array with

How to install Gnatcoll Postgres on Linux Centos 7

一笑奈何 提交于 2020-04-30 09:20:19
问题 I have installed gprbuild, xmlada, and gnatcoll. I am now attempting to install gnatcoll_postgres. Which I have downladed from here: https://github.com/AdaCore/gnatcoll-db/ Within the Postgres folder is a Makefile, which I execute like so... [parallels@localhost postgres]$ ls gnatcoll_postgres.gpr gnatcoll-sql-postgres-gnade.ads gnatcoll-sql-postgres.adb gnatcoll-sql-ranges.adb gnatcoll-sql-postgres.ads gnatcoll-sql-ranges.ads gnatcoll-sql-postgres-builder.adb Makefile gnatcoll-sql-postgres

-fdump-ada-spec: “FILE” not declared

ⅰ亾dé卋堺 提交于 2020-04-30 04:31:22
问题 Cross-posting, no answer on comp.lang.ada. I am trying to generate Ada bindings for the GSL (Gnu Scientific Library) odeiv2 package (ordinary differential equations). So I do the following 2 steps: Go to an empty directory "src" and execute g++ -c -fdump-ada-spec -C /usr/include/gsl/gsl_odeiv2.h Go to an empty directory "obj" and execute gcc -c -gnat05 ../src/*.ads Unfortunately, gsl_odeiv2.h includes stdio.h, and this leads to a series of errors like stdio_h.ads:117:69: "FILE" not declared

Ada - accessibility check raised

耗尽温柔 提交于 2020-04-16 05:51:01
问题 I have downloaded this program from Github: https://github.com/raph-amiard/ada-synth-lib I have attemted the first example and I am presented with an exception. If anybody would be able to give me an insight into why this is, it would be massively appreciated. I've been stumped on this for a long time and I'm really keen to get this working. The error I recieve is: raised PROGRAM_ERROR : waves.adb:110 accessibility check failed Here is the main file: with Waves; use Waves; with Write_To

Ada - accessibility check raised

落花浮王杯 提交于 2020-04-16 05:50:12
问题 I have downloaded this program from Github: https://github.com/raph-amiard/ada-synth-lib I have attemted the first example and I am presented with an exception. If anybody would be able to give me an insight into why this is, it would be massively appreciated. I've been stumped on this for a long time and I'm really keen to get this working. The error I recieve is: raised PROGRAM_ERROR : waves.adb:110 accessibility check failed Here is the main file: with Waves; use Waves; with Write_To

How to read some specific columns in a file?

非 Y 不嫁゛ 提交于 2020-03-03 07:43:07
问题 I have the first few lines of a text file fx.txt with the following contents: t(ms) ForceX(N) ForceY(N) 0.0 10.0 20.0 1.0 15.0 10.9 2.0 12.0 30.0 I would like to read say the contents of the first column and of the third column . How to go about in Ada? Update Here's my updated code: with Ada.Text_IO; use Ada.Text_IO; with Ada.Long_Float_Text_IO; with Ada.IO_Exceptions; procedure Get_Projections is Input_File : File_Type; Value : Long_Float; procedure Open_Data_Read (File : in out Ada.Text_IO

Is it possible to declare Ada range with unlimited upper bound?

僤鯓⒐⒋嵵緔 提交于 2020-02-03 10:13:17
问题 I would like to declare a speed range for a record type in Ada. The following won't work, but is there a way to make it work? --Speed in knots, range 0 to unlimited Speed : float Range 0.0 .. unlimited ; I just want a zero positive value for this number... 回答1: You can't -- but since Speed is of type Float , its value can't exceed Float'Last anyway. Speed : Float range 0.0 .. Float'Last; (You'll likely want to declare an explicit type or subtype.) 回答2: Just for completeness, you can also