Search Results

Search found 117 results on 5 pages for 'ada'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Optimizing mathematics on arrays of floats in Ada 95 with GNATC

    - by mat_geek
    Consider the bellow code. This code is supposed to be processing data at a fixed rate, in one second batches, It is part of an overal system and can't take up too much time. When running over 100 lots of 1 seconds worth of data the program takes 35 seconds; or 35%. How do I improce the code to get the processing time down to a minimum? The code will be running on an Intel Pentium-M which is a P3 with SSE2. package FF is new Ada.Numerics.Generic_Elementary_Functions(Float); N : constant Integer := 820; type A is array(1 .. N) of Float; type A3 is array(1 .. 3) of A; procedure F(state : in out A3; result : out A3; l : in A; r : in A) is s : Float; t : Float; begin for i in 1 .. N loop t := l(i) + r(i); t := t / 2.0; state(1)(i) := t; state(2)(i) := t * 0.25 + state(2)(i) * 0.75; state(3)(i) := t * 1.0 /64.0 + state(2)(i) * 63.0 /64.0; for r in 1 .. 3 loop s := state(r)(i); t := FF."**"(s, 6.0) + 14.0; if t > MAX then t := MAX; elsif t < MIN then t := MIN; end if; result(r)(i) := FF.Log(t, 2.0); end loop; end loop; end;

    Read the article

  • Loops in ada and the implementation

    - by maddy
    HI all, Below is a piece of code shown and doubts are regarding the implementation of loops C := character'last; I := 1; K : loop Done := C = character'first; Count2 := I; Exit K when Done; C := character'pred(c); I := I + 1; end loop K; Can anyone please tell me what does 'K' stands for.I guess its not a variable.How does 'K' control the execution of the loop? Thanks Maddy

    Read the article

  • Why does C# exit when calling the Ada elaboration routine using debug?

    - by erict
    I have a DLL created in Ada using GPS. I am dynamically loading it and calling it successfully both from Ada and from C++. But when I try to call it from C#, the program exits on the call to Elaboration init. What am I missing? The exact same DLL is perfectly happy getting called from C++ and Ada. Edit: If I start the program without Debugging, it also works with C#. But if I run it with the Debugger, then it exits on the call to ElaborationInit. There are no indications in any of the Windows event logs. If the Ada DLL is Pure, and I skip the elaboration init call, the actual function DLL is called correctly, so it has something to do with the elaboration. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace CallingDLLfromCS { class Program { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)] public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool FreeLibrary(IntPtr hModule); [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate int AdaCallable2_dlgt(int val); static AdaCallable2_dlgt fnAdaCallable2 = null; [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate void ElaborationInit_dlgt(); static ElaborationInit_dlgt ElaborationInit = null; [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate void AdaFinal_dlgt(); static AdaFinal_dlgt AdaFinal = null; static void Main(string[] args) { int result; bool fail = false; // assume the best IntPtr pDll2 = LoadLibrary("libDllBuiltFromAda.dll"); if (pDll2 != IntPtr.Zero) { // Note the @4 is because 4 bytes are passed. This can be further reduced by the use of a DEF file in the DLL generation. IntPtr pAddressOfFunctionToCall = GetProcAddress(pDll2, "AdaCallable@4"); if (pAddressOfFunctionToCall != IntPtr.Zero) { fnAdaCallable2 = (AdaCallable2_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(AdaCallable2_dlgt)); } else fail = true; pAddressOfFunctionToCall = GetProcAddress(pDll2, "DllBuiltFromAdainit"); if (pAddressOfFunctionToCall != IntPtr.Zero) { ElaborationInit = (ElaborationInit_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(ElaborationInit_dlgt)); } else fail = true; pAddressOfFunctionToCall = GetProcAddress(pDll2, "DllBuiltFromAdafinal"); if (pAddressOfFunctionToCall != IntPtr.Zero) AdaFinal = (AdaFinal_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(AdaFinal_dlgt)); else fail = true; if (!fail) { ElaborationInit.Invoke(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ FAILS HERE result = fnAdaCallable2(50); Console.WriteLine("Return value is " + result.ToString()); AdaFinal(); } FreeLibrary(pDll2); } } } }

    Read the article

  • In Ada how do I initialise an array constant with a repeated number?

    - by mat_geek
    I need an array of 820 zeors for using with a mathematical function. In C I could just write the following and the compiler would fill the array: const float EMPTY_NUMBER_A[820] = { 0.0, }; However in Ada that isn't possible. I really don't want to hard code the 820 elements as 0.0. Is there a way to get the compiler to do it? type Number_A is array (1 .. 820) of Float; EMPTY_NUMBER_A : constant Number_A := something; Using Ada 95 and GNAT.

    Read the article

  • Ada Lovelace Day &amp;#8211; My Heroines

    <b>Sulamita Garcia:</b> "I have many heroes that inspired me to go ahead. Valorie Aurora, Telsa Gwynne, Pia Waugh, Akkanna Peck, Carla Schroeder, so many... but today I would like to talk about two women, who were the most inspiring for me from the beginning. One is a historical figure, other you may not know."

    Read the article

  • Women In, Near, and Around Ubuntu - Celebrating Ada Lovelace Day - Part 1

    <b>Ubuntu User:</b> "I have been given the opportunity to meet and get to know so many amazingly talented and skilled women who are in Open Source and more specifically the Ubuntu Community. The women I am writing about make the work and contributions they provide to Ubuntu, Open Source Projects, and initiatives to increase the visibility of women in open source, seem effortlessly awesome!"

    Read the article

  • Evi Nemeth (an Ada Lovelace day tribute)

    <b>LWN.net:</b> "The chief of the Unix side was Evi Nemeth. The first thing that struck most people about Evi was a general sense of distraction and disorganization; it's only later that one realized the she was one of those smart people who make things happen."

    Read the article

  • How to print the address an ada access variable points to?

    - by georg
    I want to print the address of an access variable (pointer) for debugging purposes. type Node is private; type Node_Ptr is access Node; procedure foo(n: in out Node_Ptr) is package Address_Node is new System.Address_To_Access_Conversions(Node); use Address_Node; begin Put_Line("node at address " & System.Address_Image(To_Address(n))); end foo; Address_Image returns the string representation of an address. System.Address_To_Access_Conversions is a generic package to convert between addresses and access types (see ARM 13.7.2), defined as follows: generic type Object(<>) is limited private; package System.Address_To_Access_Conversions is -- [...] type Object_Pointer is access all Object; -- [...] function To_Address(Value : Object_Pointer) return Address; -- [...] end System.Address_To_Access_Conversions; gnat gives me the following errors for procedure foo defined above: expected type "System.Address_To_Access_Conversions.Object_Pointer" from instance at line... found type "Node_Ptr" defined at ... Object_Pointer ist definied as access all Object. From my understanding the type Object is Node, therefore Object_Ptr is access all Node. What is gnat complaining about? I guess my understanding of Ada generics is flawed and I am not using System.Address_To_Access_Conversions correctly. EDIT: I compiled my code with "gnatmake -gnatG" to see the generic instantiation: package address_node is subtype btree__clear__address_node__object__2 is btree__node; type btree__clear__address_node__object_pointer__2 is access all btree__clear__address_node__object__2; function to_address (value : btree__clear__address_node__object_pointer__2) return system__address; end address_node; btree__node is the mangled name of the type Node as defined above, so I really think the parameter type for to_address() is correct, yet gnat is complaining (see above).

    Read the article

  • Flash and ADA compliancy

    - by milesmeow
    Has anyone here created a site or application that is ADA (Section 508) compliant? What features did your site/application support? One example is creating forms in Flash. The standards say that "When electronic forms are used, the form shall allow people using Assistive Technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues." Does Flash allow this? I guess you can build in your own tabbing and triggering voiceovers and such. Just wanted to get a sense of what people have done to tackle this issue.

    Read the article

  • Run a JGNAT program?

    - by anta40
    I just installed JGNAT on Windows (gnat-gpl-2010-jvm-bin.exe) This is a sample code hello.adb from the included manual: with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin Put_Line ("Hello GNAT for the JVM."); end Hello; First, compile it: jvm-gnatmake hello.adb jvm-gnatcompile -c hello.adb jvm-gnatbind -x hello.ali jvm-gnatlink hello.ali Looks fine. So let's run it: java hello Exception in thread "main" java.lang.NoClassDefFoundError: jgnat/adalib/GNAT_libc at hello.main(hello.adb) Caused by: java.lang.ClassNotFoundException: jgnat.adalib.GNAT_libc at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more Any idea why?

    Read the article

  • gnat programming studio auto fix issues

    - by Richard
    hi, I'm using GNAT Programming Studio to update some ada files. I have a style check, which for these old files produces literally thousands of warnings. Helpfully GPS has a little auto fix 'wrench' icon in the locations view, that's great but I don't want to go through and click the wrench ten thousand times. Is there a way to have it correct these errors automatically without me having to click each wrench? They are all right so I want to be changed automatically. I saw some documentation saying you could do it: http://www.adacore.com/wp-content/files/auto_update/gps-docs/Code-Fixing.html But I don't get the auto fix option when I right click. Maybe you need the pro version? I've tried everything I can think of. This would save hours of work, so it's really appreciated if someone could help on this. Thanks!

    Read the article

  • Grab a Copy of Plants vs. Zombies for Free; Courtesy of the ADA

    - by Jason Fitzpatrick
    In a rather unlikely pairing, PopCap Games and the American Dental Association have teamed up to give away copies of PopCap’s smash hit game Plants vs. Zombies; grab a copy for yourself and print off some game coupons to hand out at Halloween. At StopZombieMouth.com they explain the pairing: This Halloween, the ADA and PopCap Games are redefining what a Halloween “treat” can be… by giving FUN instead of candy. We’re giving away Plants vs. Zombies™ download games as a sugar-free alternative, and you can join in the fun. Ask if your local dentist has the limited-edition, collectible Plants vs. Zombies trading cards with the code for a free Plants vs. Zombies download game. Or, download printable free-game coupons here. Now go out and give PvZ fun as a Halloween treat to kids of all ages. And thanks for helping Stop Zombie Mouth! 7 Ways To Free Up Hard Disk Space On Windows HTG Explains: How System Restore Works in Windows HTG Explains: How Antivirus Software Works

    Read the article

  • Twitter Typeahead only shows only 5 results

    - by user3685388
    I'm using the Twitter Typeahead version 0.10.2 autocomplete but I'm only receiving 5 results from my JSON result set. I can have 20 or more results but only 5 are shown. What am I doing wrong? var engine = new Bloodhound({ name: "blackboard-names", prefetch: { url: "../CFC/Login.cfc?method=Search&returnformat=json&term=%QUERY", ajax: { contentType: "json", cache: false } }, remote: { url: "../CFC/Login.cfc?method=Search&returnformat=json&term=%QUERY", ajax: { contentType: "json", cache: false }, }, datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace }); var promise = engine.initialize(); promise .done(function() { console.log("done"); }) .fail(function() { console.log("fail"); }); $("#Impersonate").typeahead({ minLength: 2, highlight: true}, { name: "blackboard-names", displayKey: 'value', source: engine.ttAdapter() }).bind("typeahead:selected", function(obj, datum, name) { console.log(obj, datum, name); alert(datum.id); }); Data: [ { "id": "1", "value": "Adams, Abigail", "tokens": [ "Adams", "A", "Ad", "Ada", "Abigail", "A", "Ab", "Abi" ] }, { "id": "2", "value": "Adams, Alan", "tokens": [ "Adams", "A", "Ad", "Ada", "Alan", "A", "Al", "Ala" ] }, { "id": "3", "value": "Adams, Alison", "tokens": [ "Adams", "A", "Ad", "Ada", "Alison", "A", "Al", "Ali" ] }, { "id": "4", "value": "Adams, Amber", "tokens": [ "Adams", "A", "Ad", "Ada", "Amber", "A", "Am", "Amb" ] }, { "id": "5", "value": "Adams, Amelia", "tokens": [ "Adams", "A", "Ad", "Ada", "Amelia", "A", "Am", "Ame" ] }, { "id": "6", "value": "Adams, Arik", "tokens": [ "Adams", "A", "Ad", "Ada", "Arik", "A", "Ar", "Ari" ] }, { "id": "7", "value": "Adams, Ashele", "tokens": [ "Adams", "A", "Ad", "Ada", "Ashele", "A", "As", "Ash" ] }, { "id": "8", "value": "Adams, Brady", "tokens": [ "Adams", "A", "Ad", "Ada", "Brady", "B", "Br", "Bra" ] }, { "id": "9", "value": "Adams, Brandon", "tokens": [ "Adams", "A", "Ad", "Ada", "Brandon", "B", "Br", "Bra" ] } ]

    Read the article

  • The Benefits of Constants

    - by onaclov2000
    I understand one of the big deals about constants is that you don't have to go through and update code where that constant is used all over the place. Thats great, but let's say you don't explicitly declare it as a constant. What benefit(s) exist(s) to take a variable that HAPPENS to actually not be changed and make it a constant, will this save on processing, and/or size of code...etc? Basically I have a program that the compiler is saying that a particular variable is not changed and thus can be declared a constant, I just wanted to know what the benefit to adding the constant qualifier to it would be, if it makes no difference then making that change adds no value and thus no point wasting time (this same scenario occurs in more then one place) going back and "fixing" all these variables. Thank you, onaclov

    Read the article

  • ???????

    - by Ada Li
    ???????????, ??????????????,??????????   ??????Effie, ????????,?????? ?Google, Baidu????,????,????????,??????,??????   ????????????:“???????, ????????????“ ? ??????????: ??msn:??????????? ??????Sean:Jialin_Rubicon:?????????96????? georgiazhao:?????????????e-visa, ????????,????????? qyjohn_:????????????????,????,???????????????????????????????? ???:???,?????????????,???????,?????   ?????????,????????,???????????,?????? ??John??????,????,???????,?????? Georgia??????,E-Visa?Google??,E-Visa?????,??24????????????,??????????SingID?SingPass.   ????????,????SingID?SingPass?????????????????????,??????chensz????,???,?????SingID?SingPass? ???E-Visa??,????????????,????????????????,?????,???????,????????,????,?????? ????????????,?????????????????,????????????????,??????????Georgia, ?chensz???????,??????????,???????,?????????,??????????????????,?????????

    Read the article

  • airplanes operating system and choice of programing language

    - by adhg
    I was wondring if anyone knows what is the operating system used in commercial airplanes (say Boeing or Airbus). Also, what is the (preferred) real-time programing language? I heard that Ada is used in Boeing, so my question is - why Ada? what are the criteria the Boeing-guys had to choose this language? (I guess Java wouldn't be a great choice if the exactly in lift off the garbage collector wakes up). Thanks!

    Read the article

  • What operating systems are used in airplanes, and what programming languages are they developed in?

    - by adhg
    I was wondering if anyone knows what is the operating system used in commercial airplanes (say Boeing or Airbus). Also, what is the (preferred) real-time programing language? I heard that Ada is used in Boeing, so my question is - why Ada? what are the criteria the Boeing-guys had to choose this language? (I guess Java wouldn't be a great choice if the exactly in lift off the garbage collector wakes up).

    Read the article

  • Woman Is the World's First Computer Programmer? [closed]

    - by Sveta Bondarenko
    This week, on 10th December, we celebrate the 197th birth anniversary of Ada Lovelace, often considered as the world's first computer programmer. Ada became famous not only as a daughter of romantic poet Lord Byron but also as an outstanding 19th century mathematician. Her works on analytical engine are recognized as the first algorithm intended to be processed by a machine. Women always played a crucial role in the computer science evolution, but unfortunately, they are considered to be not so good at programming and engineering as men. Even though the fair sex makes up a growing portion of computer and Internet users, there is still a large gender gap in the field of Computer Science. But all is not lost! According to the study women's enrollment in the computer science raised from 7 percent in 1995 to 42 percent in 2000. And it is still increasing. Soon women will take a well-deserved position among the world's top computer programmers. After all, a number of notable female computer pioneers such as Ada Lovelace, Grace Hopper, and Anita Borg have proven that women make great computer scientists. But will women make great contributions to the modern technologies industry? Or successful and famous female computer programmer is just a pipe dream?

    Read the article

  • How to download a file from a server using Java Socket?

    - by Ada
    Hi, I have an assignment about uploading and downloading a file to a server. I managed to do the uploading part using Java Sockets however I am having a hard time doing the downloading part. I should use Range: for downloading parellel. In my request, I should have the Range: header. But I don't understand how I will receive the file with that HTTP GET request. All the examples I have seen was about uploading a file. I already did it. I can upload .exe, image, .pdf, anything and when I download them back (by my browser), there are no errors. Can you help me with the downloading part? Can you give me an example beacuse I really didn't get it.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >