Search Results

Search found 560 results on 23 pages for 'pascal fc'.

Page 3/23 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How would you program Pascal's triangle in R?

    - by Peter Flom
    I am reading, on my own (not for HW) about programming, and one exercise involved programming Pascal's triangle in R. My first idea was to make a list and then append things to it, but that didn't work too well. Then I thought of starting with a vector, and making a list out of that, at the end. Then I thought of making a matrix, and making a list out of that at the end. Not sure which way to even approach this. Any hints? thanks

    Read the article

  • InnoSetup Uninstall Ask Message - Pascal Coding

    - by ryu
    I have created an installer for some of my games and I want the uninstaller to ask me if I want to save my game files. Something like this: when I execute the uninstall.exe to ask me 'Do you want to keep all saved games?' YES or NO. If I hit YES my save files remain and my program files are uninstalled and if I hit NO my program files inclusive save files to be uninstalled. What is the PASCAL code for InnoSetup to do this? Thank you very much! Best regards, Ryan

    Read the article

  • Why execution of a portion of code loaded from external file is not halted by the OS?

    - by menjaraz
    I've harnessed a project released on internet a long time ago. Here comes the details, all irrelevant things being stripped off for sake of concision and clarity. A binary file whose content is descibed below HEX DUMP: 55 89 E5 83 EC 08 C7 45 FC 00 00 00 00 8B 45 FC 3B 45 10 72 02 EB 19 8B 45 FC 8B 55 0C 01 C2 8B 45 FC 03 45 08 8A 00 88 02 8D 45 FC FF 00 EB DD C6 45 FA 00 83 7D 10 01 76 6C 80 7D FA 00 74 02 EB 64 C6 45 FA 01 C7 45 FC 00 00 00 00 8B 45 10 48 39 45 FC 72 02 EB E2 8B 45 FC 8B 4D 0C 01 C1 8B 45 FC 03 45 0C 8D 50 01 8A 01 3A 02 73 30 8B 45 FC 03 45 0C 8A 00 88 45 FB 8B 45 FC 8B 55 0C 01 C2 8B 45 FC 03 45 0C 40 8A 00 88 02 8B 45 FC 03 45 0C 8D 50 01 8A 45 FB 88 02 C6 45 FA 00 8D 45 FC FF 00 EB A7 C9 C2 0C 00 90 90 90 90 90 90 is loaded into memory and executed using the following method snippet var MySrcArray, MyDestArray: array [1 .. 15] of Byte; // ... MyBuffer: Pointer; TheProc: procedure; SortIt: procedure(ASrc, ADest: Pointer; ASize: LongWord); stdcall; begin // Initialization of MySrcArray with random Bytes and display here ... // Instructions of loading of the binary file into MyBuffer using merely **GetMem** here ... @SortIt := MyBuffer; try SortIt(@MySrcArray, @MyDestArray, 15); // Display of MyDestArray (The outcome of the processing !) except // Invalid code error handling end; // Cleaning code here ... end; works like a charm on my box. My Question: How comes it works without using VirtualAlloc and/or VirtualProtect?

    Read the article

  • do console apps run faster than windows based app?

    - by omair iqbal
    i am reletivly new to world of programming i have a few performance questions 1. do console apps run faster than windows based app? 2.are languages like c and pascal faster than object oriented languages like c++ and delphi?i know language speed depends more on compiler than on language itself but do compilers for prcedural languages like c and pascal produce faster code than oo ones like delphi,c++(including c++ compilers that can procuce c code) sorry for my bad english

    Read the article

  • Dealing with Unity's Global Menu and Overlay Scrollbars under Free Pascal/Lazarus

    - by Gustavo Carreno
    I've had some problems under the IDE that were fixed with unsettings and disabling Global menu and the Overlay Scrollbars. I've reported the problem in Lazarus' Mantis: #0021465, #0021467. There is also this bug report talking a bit more about it: #0019266 Their solution was to use unsettings to turn off Global Menu and Overlay Scrollbars. I've had a quick search about the problem and there's an open bug report at Launchpad: overlay scrolling is broken in lazarus. So, is the problem related to "lib overlay scrollbar"? If it is, is there a solution via code, to avoid turning off both the Global Menu and Overlay Scrollbars? If NOT, is there anyone taking notice and fixing the issue? Many thanks, Gus

    Read the article

  • Lazarus Pascal - DB Connection - clarification

    - by itsols
    The following code is from the docs here: Program ConnectDB var AConnection : TSQLConnection; Procedure CreateConnection; begin AConnection := TIBConnection.Create(nil); AConnection.Hostname := 'localhost'; AConnection.DatabaseName := '/opt/firebird/examples/employee.fdb'; AConnection.UserName := 'sysdba'; AConnection.Password := 'masterkey'; end; begin CreateConnection; AConnection.Open; if Aconnection.Connected then writeln('Succesful connect!') else writeln('This is not possible, because if the connection failed, ' + 'an exception should be raised, so this code would not ' + 'be executed'); AConnection.Close; AConnection.Free; end. The main body of the code makes sense to me BUT I don't get where TSQLConnection came from. I cannot use CTRL + Space to autocomplete it either, which means my program has no reference to it. I'm trying to connect to Postgres by the way. Can someone please state what TSQLConnection is? Thanks!

    Read the article

  • FullCalendar lazyFetching

    - by RamaKrishna
    I had enabled lazyFetching option with true/false. and click on any button of calendar then calendar sending multiple ajax calls to get data. Here is my configuration $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: false, disableDragging:true, contentHeight: 500, width: 800, minTime:9, maxTime:21, lazyFetching:true, defaultView:'agendaWeek', loading: function(isLoading, view){ if(isLoading){ $('.fc-button-prev, .fc-button-next , .fc-button-month ,.fc-button-agendaWeek , .fc-button-agendaDay').hide(); $('.products').attr("disabled","disabled"); }else{ $('.fc-button-prev, .fc-button-next , .fc-button-month ,.fc-button-agendaWeek , .fc-button-agendaDay').show(); $('.products').removeAttr("disabled"); } } }); function loadCal(storeId,contactId){ $('#calendar').fullCalendar( 'removeEvents'); $('#calendar').fullCalendar( 'addEventSource','getApptsByStore.action?storeId='+storeId+'&contactId='+contactId); }

    Read the article

  • In what language was MSDOS originally written in?

    - by nebukadnezzar
    In what language was MSDOS originally written in? The Wikipedia Article implies either C, QBasic or Pascal, but: * C was invented to write UNIX, so I don't believe it was used to write MSDOS * Pascal seems popular to teach programming, but not really popular to write Operating systems in * QBasic didn't seem to be very popular for Operating Systems at the time MSDOS was developed (or was *BASIC ever very popular to write Operating Systems in it?) Except these three languages there is also Assembly, but I assume that Microsoft already switched from Assembly to a "higher" level language? Since C was originally invented for UNIX, I still wouldn't think Microsoft is using C... although the Microsoft API is written in C (I find this kind-of oxymoronic, actually). Can anyone enlighten me on this topic?

    Read the article

  • What is the philosophy/reasoning behind C#'s Pascal-casing method names?

    - by Nocturne
    I'm just starting to learn C#. Coming from a background in Java, C++ and Objective-C, I find C#'s Pascal-casing its method-names rather unique, and a tad difficult to get used to at first. What is the reasoning and philosophy behind this? I'm guessing it is because of C# properties. Unlike in Objective-C, where method names can be exactly the same as an instance variables, this is not the case with C#. I would guess one of the goals with properties (as it is with most of the languages that support it) is to make properties truly indistinguishable from variables and methods. So, one can have an "int x" in C#, and the corresponding property becomes X. To ensure that properties and methods are indistinguishable, all method names I'm guessing are also therefore expected to start with an uppercase letter. (This is just my hypothesis based on what I know of C# so far—I'm still learning). I'm very curious to know how this curious guideline came into being (given that it's not something one sees in most other languages where method names are expected to start with a lowercase letter) (EDIT: By Pascal-casing, I mean PascalCase (which is basically camelCase but starting with a capital letter). Method names typically start with a lowercase letter in most languages)

    Read the article

  • Problems compiling peazip on OSX

    - by Yansky
    I'm having some problems with compiling Peazip on OSX (10.6). I emailed the Peazip developer and he said he probably couldn't help me too much as the error seems to be OSX specific and he doesn't have access to an OSX machine any more. The compiler I'm using is Lazarus as the source is in Pascal. The actual compile process seems to go ok, but when I run the peazip.app program launcher, I get the following error: http://img.photobucket.com/albums/v215/thegooddale/Screen-shot-2010-05-22-at-71907-PM.png Here is the app launcher that the compile made: http://forboden.com/coding/peazip.app.zip - you can use an unzip program to look at the files inside (i.e. unzip it twice). I also tried just running the peazip unix file executable that was produced after the compile from the terminal and I got this: http://img.photobucket.com/albums/v215/thegooddale/Screen-shot-2010-05-22-at-72148-PM.png Here are the messages from the compile log from Lazarus while compiling Peazip: http://pastebin.com/qK4bdncL (I asked on the Lazarus forums and they said I can just ignore those "ld: warning: unknown stabs type" warnings). Here is the info from the project_peach.compiled file: <?xml version="1.0"?> <CONFIG> <Compiler Value="/usr/local/bin/ppc386" Date="1238949773"/> <Params Value=" -MObjFPC -Sgi -O1 -gl -k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' -WG -vewnhi -l -Fu/Users/yansky/Desktop/peazip-3.1.src/res/themes/crystalc/ -Fu/Developer/lazarus/components/synedit/units/i386-darwin/ -Fu/Developer/lazarus/ideintf/units/i386-darwin/ -Fu/Developer/lazarus/lcl/units/i386-darwin/ -Fu/Developer/lazarus/lcl/units/i386-darwin/carbon/ -Fu/Developer/lazarus/packager/units/i386-darwin/ -Fu/Users/yansky/Desktop/peazip-3.1.src/ -Fu. -opeazip -dLCL -dLCLcarbon project_peach.lpr"/> </CONFIG> I guess there's little chance that anyone here has experience with Pascal and Lazarus since it's not that popular a language and the compiler is still in beta, but I thought I would post here in the hopes that someone might point me in the right general direction about where/how the peazip.app launcher is breaking.

    Read the article

  • Do console apps run faster than GUI apps?

    - by omair iqbal
    I am relatively new to world of programming. I have a few performance questions: Do console apps run faster than apps with a graphical user interface? Are languages like C and Pascal faster than object oriented languages like C++ and Delphi? I know language speed depends more on compiler than on language itself, but do compilers for procedural languages produce faster code than OO ones (including C++ compilers that can produce C code)?

    Read the article

  • pascal triangle in php (anything wrong with this solution?) [migrated]

    - by zhenka
    I saw that one of the interview questions could be building a pascal triangle. Is there anything wrong with this particular solution I came up with? function pascal_r($r){ $local = array(); if($r == 1){ return array(array(1)); } else { $previous = pascal_r($r - 1); array_push($local, 1); for($i = 0; $i < $r - 2 && $r > 2; $i++){ array_push($local, $previous[$r-2][$i] + $previous[$r-2][$i + 1]); } array_push($local, 1); } array_push($previous, $local); return $previous; } print_r(pascal_r(100));

    Read the article

  • Lazarus: Can't find unit [unit] used by [program]

    - by Ree
    I'm trying to use an external library (wingraph) in a simple program. I have .o and .ppu files. I added the directory that contains them to the list of both "Other Unit Files" and "Include Files" paths under Project-Compiler Options. When building, I still get the error "Can't find unit wingraph used by [program]". The library is Windows specific and I'm compiling on Windows, too. What should I do to solve the problem? Note that I don't have extensive knowledge about Pascal itself nor its tools. I'm just trying to quickly help someone start using the library.

    Read the article

  • Unicode in fpc doesn't work

    - by user1546454
    Hi I'm Romanian and I can't write Unicode in Free Pascal Compiler. I try to write ?,î,â,a,? and it doesn't work. I tried with dos windows changed fonts, tried chcp. I even made a batch file which would do chcp 65001 and start the app. By default when I tried to write these letter I got "?" but when I started it with the batch file it just didn't write anything. I tried AnsiString, UnicodeString, UTF8String and all didn't work. And I think the problem is in the compiler. Does anyone know a solution?

    Read the article

  • Background changes by itself and procedure repeats many times until I release the mouse button

    - by Robert
    Dear community, I am a student, and I'm working on a little slots game (if the same random number comes up 3 timed, you win). I use Borland Pascal 7. I use graph to make this a bit more visual, but when I start the game my background turns from black to grey, and the other problem is that if I click the game start button, the game runs many times until I release the mouse button. How can I solve this? Here is my full program: program slots; uses mymouse,graph,crt; var gdriver,gmode,coin:integer; m:mouserec; a,b,c,coins:string; procedure gomb(x1,y1,x2,y2:integer;szoveg:string); var j,n:integer; begin setcolor(blue); rectangle(x1,y1,x2,y2); setfillstyle(1,blue); floodfill(x1+2,y1+2,blue); setcolor(0); outtextxy((x1+x2)div 2 -textwidth(szoveg) div 2 ,(y1+y2) div 2-textheight(szoveg) div 2,szoveg); end; procedure randomal(var a,b,c:string); begin randomize; STR(random(2)+1,a); STR(random(2)+1,b); STR(random(2)+1,c); end; procedure menu; begin; settextstyle(0,0,1); outtextxy(20,10,'Meno menu'); gomb(20,20,90,50,'Teglalap'); gomb(20,60,90,90,'Inditas'); gomb(20,100,90,130,'Harmadik'); gomb(20,140,90,170,'Negyedik'); end; procedure teglalap(x1,x2,y1,y2,tinta:integer); begin setcolor(tinta); rectangle(x1,x2,y1,y2); end; procedure jatek(var a,b,c:string;var coin:integer;coins:string); begin; clrscr; menu; randomal(a,b,c); if ((a=b) AND (b=c)) then coin:=coin+1 else coin:=coin-1; settextstyle(0,0,3); setbkcolor(black); outtextxy(200,20,a); outtextxy(240,20,b); outtextxy(280,20,c); STR(coin,coins); outtextxy(400,400,coins); end; procedure eger; begin; mouseinit; mouseon; menu; repeat getmouse(m); if (m.left) and (m.x20) ANd (m.x<90) and (m.y20) and (m.y<50) then teglalap(90,90,300,300,blue); if (m.left) and (m.x20) AND (m.x<90) and (m.y60) and (m.y<90) then jatek(a,b,c,coin,coins); until ((m.left) and (m.x20) ANd (m.x<140) and (m.y140) and (m.y<170)); end; begin coin:=50; gdriver:=detect; initgraph(gdriver, gmode, ''); eger; end. Thank you very much, Robert

    Read the article

  • Exchanging strings (PChar) between a Freepascal compiled DLL and a Delphi compiled EXE

    - by John Riche
    After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution involves the following methods in the DLL: function GetAString(): PChar; var aString: string; begin aString := 'My String'; result := StrAlloc(length(aString) + 1); StrPCopy(result, aString); end; procedure FreeString(aString: PChar); begin StrDispose(aString); end; And from the Delphi EXE, to call the GetAString method, I need to Call the GetAString method, save the PChar to an actual Delphi String and call the FreeString method. Is this the best way of exchanging a string from a FreePascal DLL with a Delphi EXE ? Can I avoid the call to FreeString from Delphi ? And finally, if that's the correct solution, how will it behave with Delphi 2010 and the WideString by default: do I need to force WidePChar in FreePascal too ?

    Read the article

  • Lazarus - why I can't assign event to run-time component?

    - by Garret Raziel
    Hello, I have this Lazarus program: unit Unit2; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; type { TForm2 } TForm2 = class(TForm) procedure OnTlacitkoClick(Sender: TObject); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); tlac:TButton; private { private declarations } public { public declarations } end; var Form2: TForm2; implementation { TForm2 } procedure TForm2.OnTlacitkoClick(Sender: TObject); begin showmessage('helloworld'); end; procedure TForm2.FormCreate(Sender: TObject); var i,j:integer; begin tlac:=TButton.Create(Form2); tlac.OnClick:=OnTlacitkoClick; tlac.Parent:=Form2; tlac.Left:=100; tlac.Top:=100; end; initialization {$I unit2.lrs} end. but compiler says: unit2.pas(63,32) Error: Wrong number of parameters specified for call to "OnTlacitkoClick" in tlac.OnClick:=OnTlacitkoClick; expression. I have searched and think that this is legal expression in Delphi. I want simply to registrate OnTlacitkoClick as tlac.OnClick event,not to call this procedure. Is there somethink wrong with the code or must I do it different in Lazarus/Freepascal? Thanks.

    Read the article

  • Circular reference fix?

    - by SXMC
    Hi! I have a Player class in a separate unit as follows: TPlayer = class private ... FWorld: TWorld; ... public ... end; I also have a World class in a separate unit as follows: TWorld = class private ... FPlayer: TPlayer; ... public ... end; I have done it this way so that the Player can get data from the world via FWorld, and so that the other objects in the world can get the player data in a similar manner. As you can see this results in a circular reference (and therefore does not work). I have read that this implies bad code design, but I just can't think of any better other way. What could be a better way to do it? Cheers!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >