* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / BGRAControls:TBGRAShape
« Last post by morknotmindy on Today at 11:33:46 am »
I would like to use BGRAShape to rotate a rectangle, keeping its original dimensions, using the Angle property.
 I have tried the following:

Set the original BGRAShape.Height to 50, Width to 100 and Angle to 45
Use a trackbar to increment the angle, Min 45 Max 90
In the trackbar onchange event try to adjust the BGRAShape dimensions with

BGRAShape1.Width:=Trunc(50*cos((Trackbar1.Position)*pi/180) + 100*sin(Trackbar1.Position*pi/180));

BGRAShape1.Height:= Trunc((50*sin(Trackbar1.Position)*pi/180) +(100*cos(Trackbar1.Position*pi/180)));

This does not maintain the original dimensions.

Is it possible to achieve what I want and if so is Angle related to the centre point of the shape or the X or Y axis? Is the formula I am using just plain wrong?

Grateful for any advice.
 
2
Speed is probably the most important reason.

Speed, but also backwards compatibility requirements with older versions can often more easily be handled in code then adapting the grammar which often leads to multiplication of rules for the related part.

Also error generation is said to be finer and more to the point (less syntax error, more naming the exact issue).

It is not that commercial compilers don't use grammars and generators. Just the flagship ones often do not.

I know a guy that did/does compiler work for a living (mostly delivering C compilers for new DSP parts with some extensions for the C), and they worked very topdown and grammar based, and proof generation etc.

But the whole feature set was signed off on before final implementation started, and rarely iterated.
3
You make me wanna finish my handcoded compiler tutorial
If you do then please add it to the wiki. I will be looking forward to take a look at it. I started with hand coding everything. Then lex/yacc. Then some GUI parser generators. I ended up with GOLD, which spoilt me with it's code and grammar separation, visual and step by step grammar testing and ambiquities finder capabilities, and running it's nice FreePascal engines with parsed tree output. It's not a runtime speed champ and has it's quirks, but it automates most of my work and for what I need is more then enough.
4
Parsing is only part of making a compiler. And LALR parsers only a part of that.
I am aware of that, but such parsers can be used for much more then just compilers....

Most commercial compilers have recursive descent parsers afaik.
Speed is probably the most important reason. Maybe wiki should mention that somewhere...

Maybe the title is simply wrong for what you had in mind.  Make a topic "parser generators" or so, move the parser generators there, and then link that on the "compiler creation" page?
I felt like such segregation would make too much distraction for already loose coupled wiki topics. That's why I wanted to make a single starting place, and that's why I called it a wiki stub. The idea was that when in the future anyone wants to know more about anything from the title we point him to this wiki as a first step. Anyway, I don't mind anyone changing a title or making any deeper reorganization. All improvements are welcome. Please give it any shape you think is better then current one. I started the wiki in the first place because I wanted to preserve and share some of my experience with GOLD Parser Builder. The rest was simply an extension to that.
5
Android / LAMW trunk compile error
« Last post by CC on Today at 10:38:24 am »
SHA-1:  d69a4f91177134e804b748569df1ef932ca1c6fd

Code: Pascal  [Select]
  1. procedure Java_Event_pOnCustomCameraSurfaceCreated(env: PJNIEnv; this: jobject; Obj: TObject);
  2. begin
  3.   gApp.Jni.jEnv:= env;
  4.   gApp.Jni.jThis:= this;
  5.   if Obj is jCustomCamera then
  6.   begin
  7.     jForm(jCustomCamera(Obj).Owner).UpdateJNI(gApp);
  8.     jCustomCamera(Obj).GenEvent_OnCustomCameraSurfaceCreated(Obj); //<<-- compile error
  9.   end;
  10. end;
  11.  

laz_and_controls_events.pas(1776,24) Error: identifier idents no member "GenEvent_OnCustomCameraSurfaceCreated"
6
General / Re: tprocess under linux
« Last post by GetMem on Today at 09:34:37 am »
@cappe

Quote
I need the password.
Can you give me an example?
Did you try this: http://wiki.freepascal.org/Executing_External_Programs#Redirecting_input_and_output_and_running_under_root ?
7
General / Re: tprocess under linux
« Last post by cappe on Today at 09:17:03 am »
I need the password.

Can you give me an example?
8
I've enabled heaptrace log for Lazarus and have three blocks in my addon which have not been freed.
It takes about a minute to build the log when i quit Lazarus.
I've also noticed the slow creation for the stack trace in other apps.

Is there a way to speed this up?
9
Databases / Re: DBGrid mousedown and record number
« Last post by xinyiman on Today at 09:01:40 am »
I have updated the example and if you try to run it now you will see that I try to open a menu on the right mouse button (mousedown). It works well because it selects the right record but moves me to view the records. The toprow property is used on the stringgrid. Here how do I do it?
10
General / Re: Create crossplatform shortcut
« Last post by xinyiman on Today at 08:39:54 am »
Create a link on the desktop. Hi guys, can anyone tell me how to crossplatform a link from a file to the desktop?

Let's assume that in /home/test/ we have the myapp program and we want to create a shortcut on the desktop. How to do it, so that it works even if the file was in c:\test\?
Fpcupdeluxe does create a link on the desktop and it works fine in every major platform. Download the source then study unit fpcuputil, method CreateDesktopShortCut.
Is perfetc. Thank you
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus