#1 Re: mORMot Framework » Error compiling in Lazarus/FPC » 2019-07-28 12:46:30

hnb

I don't know such page with detailed description of each FPC branch.

In general FPC "fixes3.2" seems like right choice for now. The stable 3.2 was not released yet and AFAIK the fixes3.2 is the base for incoming 3.2 stable release.

about Lazarus: Lazarus version has no meaning (it can be eventually more or less comfortable for end user including not working, but you should be able to use FPC from command line wink ). IMO always is worth to try new Lazarus for better UX.

#2 Re: mORMot Framework » Error compiling in Lazarus/FPC » 2019-07-26 11:39:09

hnb

You cannot expect from trunk any stability. Only "patches/fixes" branch and "stable" releases are stable.

#3 Re: mORMot Framework » Error compiling in Lazarus/FPC » 2019-07-26 11:27:48

hnb

No idea yet, this needs investigation. Probably some internal changes in RTTI layout (maybe even compiler bug). Try to use "fixes3.2" in fpcupdeluxe FPC Version instead of trunk.

#4 Re: mORMot Framework » Error compiling in Lazarus/FPC » 2019-07-26 07:19:38

hnb

Probably you should add to Synopse.inc the new directive:

{$modeswitch prefixedattributes-}

the problem is related to initial support of attributes in latest FPC trunk.

#5 Re: mORMot Framework » TSQLRestServer and SessionAccess » 2019-07-08 12:28:29

hnb

The first problem can be partially solved via custom TSQLRestServer.OnSessionCreate.

The second part can be solved via custom TAuthSession:

type
  TCustomAuthSession = class(TAuthSession)
    procedure ComputeProtectedValues; override;
  end;

procedure TCustomAuthSession.ComputeProtectedValues;
begin
  inherited;
  fTimeOutShr10 := (QWord(User.GroupRights.SessionTimeout)*(1000))shr 10;
  Inc(fTimeOutShr10);
  fTimeOutTix := GetTickCount64 shr 10+fTimeOutShr10;
end;

...
  MyServer.SessionClass := TCustomAuthSession;

Default precision is in approximation one second so all seems fine.

#6 mORMot Framework » TSQLRestServer and SessionAccess » 2019-07-08 09:41:58

hnb
Replies: 1

Hi,

I found two problems with sessions.

The first:

when TSQLServer has single user and reOneSessionPerUser is used in TSQLAuthGroup.AllowRemoteExecute set, then the session is never released (deleted) even when session time out occurred.

Second:

the precision of timeout is too low for some automation processes (for example for bot clients). The minimal timeout can be set to one minute, IMO should be possible to set such timeout to second/few seconds in some cases. The behavior cannot be changed in simple way. The usefully would be virtual TSQLRestServer.SessionAccess (current SessionAccess cannot be overridden) or some other solution.

#7 Re: mORMot Framework » Smart Mobile Studio 3 - Compilation error » 2019-04-03 10:15:21

hnb

here is pull request (merged with latest mORMot) https://github.com/synopse/mORMot/pull/183 extracted from warleyalex archive.

Without improved examples - I have only SMS free compiler so examples  are not validated by me. I was able to compile some small project with latest SMS compiler.

Thanks warleyalex!

#9 Re: mORMot Framework » Database Error » 2018-11-13 21:50:47

hnb

AFAIK usage of ZEOS 7.3 is risky (in one of my bugreport (ZEOS bugtracker at sourceforge) some time ago I was warned that I should use 7.2). The recommended version is https://sourceforge.net/p/zeoslib/code- … .2-patches

Anyway whatever was said I was using selected 7.3 with important fixes for me ( PostgreSQL ). You can try to isolate minimal test case and use ZEOS bugtracker at sourceforge to report the problem.

#10 Re: mORMot Framework » Penentration testing / Pen testing » 2018-10-04 08:10:07

hnb

yes but "hacker/attacker" is able to logout user without user knowledge. AFAIK this is still actual : https://synopse.info/forum/viewtopic.php?id=2996

#11 Re: mORMot Framework » Penentration testing / Pen testing » 2018-10-03 16:06:44

hnb
ab wrote:

Note that Google or others do send plain passwords over HTTPS, so the mORMot handshake protocol is more secure for sure - at least you can never see the password, and can't replay an old signature! smile

the only what is possible is usage of current/latest signature to logout user ^^!

#12 Re: NewPascal Distribution » Hello and I need help... » 2018-10-01 19:30:31

hnb

NewPascal has few compiler changes (for example "default field" feature for smart pointers and ARC objects via using https://github.com/maciej-izak/PascalSmartPointers) but in most of cases is similar. Lazarus IDE is exactly the same. The main advantage of NewPascal is simple usage, you don't need to install anything -> "download and run with mORMot" out of box.

I was not able to reproduce you error. You can always try to use fpcupdelux to build your own Lazarus & FPC : https://github.com/newpascal/fpcupdeluxe/releases

#13 Re: mORMot Framework » Penentration testing / Pen testing » 2018-09-14 10:34:07

hnb

Worth to note that OnBeforeBody behaves in different way for http.sys and socket server. For the http.sys OnBeforeBody is executed only when body exist but for sockets server OnBeforeBody is executed always (even when body is empty).

#14 Re: NewPascal Distribution » NewPascal is back to life (v1.0.55) » 2018-08-08 11:14:40

hnb

Yes, but the way to start is a little complicated (is very easy to mess many things), probably you need to wait a little more for "easy to use" version of NewPascal for Android. For now I have this combo for one of my commercial products for Android which works for many months (also with latest version of NewPascal).

#15 Re: NewPascal Distribution » NewPascal is back to life (v1.0.55) » 2018-08-07 23:02:34

hnb

Not much. The sponsorship is a little delayed, if nothing will change in this matter probably I will need to figure some other ways to continue progress for NewPascal. Besides the sponsorship the main problem with Android is deprecated Ant part (which is replaced by Gradle). I have all scripts dedicated for Ant, so here I need to put more work :\. General the combo NewPascal + mORMot + LAMW + crosscompilation Win -> Android ARM7 works great, but the scripts are not fully automated yet. Probably more news in September.

#16 Re: NewPascal Distribution » Compile error in DEBUG mode, but not in RELEASE mode??? » 2018-05-27 21:07:51

hnb

I can't see the attached image. Did you try to clean all *.ppu and *.o files? Btw, 1.9 is the version of Lazarus, current NewPascal is 1.0.55.

#18 Re: NewPascal Distribution » NewPascal is back to life (v1.0.55) » 2018-05-09 08:27:09

hnb

@michalis thanks! and nice to have you in mORMot forum ^^. Welcome!

@edwinsn Not now but stay tuned. I have advanced talks with sponsor so I will be able to spend more time on NewPascal. Before I will start next language features I'd like to finish many CI stuff. We need some automatic regression test (also the tests for mORMot) for all supported platforms. Cross-compilers for Linux, MacOS (and maybe Android) are in the top of TODO list. Every cross compiler will be created by CI systems.

#19 Re: mORMot Framework » NewPascal 1.9 cannot compile mORMot programs » 2018-05-08 10:38:00

hnb
edwinsn wrote:

@hnb,

What were you banned and can you point me to the page of the relative discussion?

to get full picture you need to track April/May mailing list archives (you can read all discussion by clicking "Next message (by thread)" in bottom):

http://lists.freepascal.org/pipermail/f … 38863.html
http://lists.freepascal.org/pipermail/f … 38880.html

after my last message I have got permanent ban smile - I have no access to SVN FPC repository/trunk nor internal "core mailing list".

TLTR, the general summary (this was not first situation):

http://lists.freepascal.org/pipermail/f … 38893.html

#20 Re: mORMot Framework » NewPascal 1.9 cannot compile mORMot programs » 2018-05-07 18:42:59

hnb

This was some time ago, when I was part of FPC core team and NewPascal was almost integrated with official FPC page... Now I have ban in FPC core mailing list and I don't have access to trunk anymore - there is no rational reason for my banishment... I am not able to provide any updates, bug fixes nor new features into FPC trunk. Political decision and revenge of one person in core team...

Anyway still nothing wrong with using FPC trunk instead of NewPascal - individual decision smile.

#21 Re: mORMot Framework » NewPascal 1.9 cannot compile mORMot programs » 2018-05-07 11:30:06

hnb

Both ways are good. Additional advantage of NewPascal is close cooperation with mORMot, so every change in critical parts of NewPascal (RTL, low level details) are handled in mORMot immediately. FPC trunk is also supported but in some situations update for mORMot may be delayed (and mix of FPC trunk and mORMot may be nonfunctional/full of bugs for some time).

Also NewPascal contains additional patches, bugfixes and features. For example "default field" feature or SmartPointers/ARC objects can be used only with NewPascal. I have also plan of special module dedicated for mORMot for extra features of NewPascal.

mORMot is freedom of choice smile

#22 Re: mORMot Framework » NewPascal 1.9 cannot compile mORMot programs » 2018-05-07 10:25:50

hnb

Probably you need latest Zeos (I am not sure here), you can download proper/newest version of Zeos here : https://github.com/newpascal-ccr/zeos

Zeos will be part of next release of NewPascal like mORMot smile .

#23 Re: NewPascal Distribution » NewPascal is back to life (v1.0.55) » 2018-05-07 08:08:02

hnb

good idea, seems that users also likes the concept of ReadMe.md : https://github.com/newpascal/newpascal/issues/4

in current v1.0.55 I was focused on merge, cleaning the code and on fixes for CI ( nodejs modules are really dynamic and often updated wink ).

#24 Re: mORMot Framework » NewPascal 1.9 cannot compile mORMot programs » 2018-05-07 07:26:26

hnb

If you decide to use option 1 then mORMot is ready to use as part of newpascal.zip archive (is located in ccr\mORMot directory) and is detected "out of box" in IDE (you even don't need to configure a project).
If you decide to use option 2 then you need additional step: you can download mORMot via fpcupdelux or you can do download on your own (for example from : https://github.com/synopse/mORMot )

#26 NewPascal Distribution » NewPascal is back to life (v1.0.55) » 2018-05-07 00:33:30

hnb
Replies: 15

Hi,

after more than one year of lack of updates for NewPascal,  NewPascal is back to life in new version v1.0.55 and I have hope to continue progress. This version contains fresh, ready to use mORMot and trunk of Lazarus and modified version of FPC trunk in really lightweight form without needs of installation:

https://github.com/newpascal/newpascal/ … np-v1.0.55

#27 Re: mORMot Framework » Problem with TInterfacedCollection for Lazarus 1.8.2 » 2018-03-15 14:09:38

hnb

Did you try to use in modules :

{$MODE DELPHI}
{$CODEPAGE UTF8}  

?

#28 Re: mORMot Framework » ToTextPairs and InitCSV problem » 2018-03-15 10:55:34

hnb

Rather no. InitCSV don't decode, encoded string by ToTextPairs with twJSONEscape option (there is no way to use in proper way InitCSV when twJSONEscape was used in ToTextPairs).

#29 mORMot Framework » ToTextPairs and InitCSV problem » 2018-03-12 20:03:25

hnb
Replies: 2

Hi,

seems that we have small problem. The data which is saved by :

SomeVar.test := 'test';
LIni := TDocVariantData(SomeVar).ToTextPairs;

and after is loaded:

TDocVariantData(SomeVar).InitCSV(LIni);
WriteLn(SomeVar.test) // print "test"
LIni := TDocVariantData(SomeVar).ToTextPairs;
TDocVariantData(SomeVar).InitCSV(LIni);
WriteLn(SomeVar.test) // print "\"test\""

works improper (the documentation says : the supplied content may have been generated by ToTextPairs() method). The SomeVar.test contains improper string (encoded JSON string).

The partial solution is:

LIni := TDocVariantData(SomeVar).ToTextPairs('=', #13#10, twNone);

but this is not the point. Probably some additional parameter for InitCSV is needed.

#30 Re: mORMot Framework » Is there a XPATH implementation? » 2018-02-19 10:26:13

hnb

the reality is not perfect and usage of JSON is not always possible. Personally I like the idea of :

https://www.npmjs.com/package/xml-js

some ideas from xml-js may be used in mORMot.

#31 Re: Free Pascal Compiler » Need help - SynZip fails on FPC(trunc) Win64 target » 2018-02-16 07:24:02

hnb
ab wrote:

This is a FPC zlib bug...

maybe is worth to report this on FPC mantis bug tracker?

#32 Re: mORMot Framework » TObjProxyVariant - new variant kind » 2018-01-31 22:03:40

hnb

Thanks, for improved/faster implementation. I think that TObjectVariant is better name smile. The description "lazy-loading to object properties from Variant" is perfect description of my intention.

#33 Re: mORMot Framework » TObjProxyVariant - new variant kind » 2018-01-31 14:15:46

hnb

TObjProxyVariant is here because ObjectToVariant not work for all cases. It is not art for the art but comes from practice and is widely used in my projects. Sometimes "pre generated" Variant form object is not best choice.

#34 Re: mORMot Framework » TObjProxyVariant - new variant kind » 2018-01-31 13:58:41

hnb

thanks wink TObjProxyVariant can be optimized a lot : by caching TSQLPropInfoRTTI and by TSynDictionary for fast lookup for property names. Anyway current implementation is fast enough for me.

#35 mORMot Framework » TObjProxyVariant - new variant kind » 2018-01-31 11:31:09

hnb
Replies: 10

Hi,

I almost forgot about my new small feature already implemented some time ago : TObjProxyVariant

https://github.com/synopse/mORMot/pull/79

TObjProxyVariant is a custom variant type used to have direct access to object published properties. Very usable for cases where conversion from object to variant is not sufficient. TObjProxyVariant provides direct access to object properties from Variant instead of conversion to Variant. Example usage with mustache:

{$MODE DELPHI}
{$APPTYPE CONSOLE}

uses
  mORMot, SynMustache;

type
  TA = class
  private
    fi: integer;
    function GetR: Integer;
  published
    property r: Integer read GetR;
    property i: integer read fi write fi;
  end;

  TB = class
  protected
    fa: TA;
  public
    constructor Create;
    destructor Destroy; override;
  published
    property a: TA read fa;
  end;

function TA.GetR: Integer;
begin
  Result := Random(100);
end;

constructor TB.Create;
begin
  fa := TA.Create;
end;

destructor TB.Destroy;
begin
  fa.Free;
end;

var
  b: TB;
  v: variant;
begin
  b := TB.Create;

  TObjProxyVariant.New(v, b);
  v.a.i := 10;
  WriteLn(TSynMustache.Parse('{{a.r}}/{{a.i}}/{{a.r}}/{{a.i}}/{{a.r}}').Render(v));

  b.Free;
  readln;
end.

example output :

54/10/59/10/71

#36 Re: mORMot Framework » Decrypt results differ for Win32 and Win64 (Delphi 10.2) » 2017-12-18 15:18:30

hnb

@ab seems that open array behave in different way than dynamic array

procedure TestMe(const Key: TArray<Byte>);

works as expected.

#37 Re: SyNode » Beta release of SyNode - ES6 JavaScript + NPM modules » 2017-11-08 12:14:03

hnb

@ab github release don't need to be related to stable release. I was thinking about github releases as of kind of storage for our all binaries. For example fpcupdelux has following "binary" releases not related (at all) to fpcupdelux source code:

Libraries for cross-compiling v1.1 : https://github.com/newpascal/fpcupdelux … slibs_v1.1
Darwin i386 binary toolchains for cross-compiling: https://github.com/newpascal/fpcupdelux … sbins_v1.0
GIT for Windows: https://github.com/newpascal/fpcupdelux … Git-2.13.2
GDB 7.11.1 for Windows: https://github.com/newpascal/fpcupdelux … gdb-7.11.1

etc.

we could do the same thing for mORMot for related libraries/object files

#38 Re: SyNode » Beta release of SyNode - ES6 JavaScript + NPM modules » 2017-11-08 08:58:01

hnb

IMO mORMot for github should use "releases" (like fpcupdeluxe and newpascal does - https://github.com/newpascal/fpcupdeluxe/tags, https://github.com/newpascal/newpascal/releases ). 

also is possible to use different categories for releases (by tags) for example sqlite_object_files, js_libraries.

Releases - very good way to keep all binary files around git repository:

https://help.github.com/articles/creating-releases/

#39 Re: mORMot Framework » SIGSEGV for TSynLocker and Pointers » 2017-11-07 08:33:42

hnb

I forgot to add Init/Done in example but SIGSEGV of course still occurs.

#40 mORMot Framework » SIGSEGV for TSynLocker and Pointers » 2017-11-04 22:20:12

hnb
Replies: 1

Hi,

current implementation of TSynLocker is nonfunctional/buggy for pointers. Simple example will raise SIGSEGV

uses
  SynCommons;

var
  Locker: TSynLocker;
begin
  Locker.Init;
  Locker.LockedPointer[0] := Pointer(1);
  Locker.Done;
end. 

bug is very simple to fix:

https://github.com/synopse/mORMot/pull/49

I wonder why my pull request is still not accepted...

#41 Re: NewPascal Distribution » TestSQL3 compiled by FPC memoryleak » 2017-10-02 09:51:06

hnb

the bug was related to FPC & mORMot. I've fixed the bug some time ago for FPC:

https://svn.freepascal.org/cgi-bin/view … sion=35717

and thanks to help of Alfred also for mORMot:

https://github.com/synopse/mORMot/commi … 3cceb24ee8

New version of NewPascal should be released very soon.

#42 Re: mORMot Framework » Error: TSQLDBSQLite3Statement.Step(SeekFirst=true) not implemented » 2017-09-08 20:00:46

hnb

What is strange - it works for few calls. I have error only for i = 2 or for i = 3 (it depends on TSQLRecord)... SQLite is used as external database because I need to use ISQLDBRows.

#43 mORMot Framework » Error: TSQLDBSQLite3Statement.Step(SeekFirst=true) not implemented » 2017-09-08 19:16:36

hnb
Replies: 4

Hi,

maybe I miss something but for simple code like:

  FModel := TSQLModel.Create([TExampleData]);
  FServer := TSQLRestServerDB.Create(FModel, ':memory:');
  FServer.CreateMissingTables;
  FProp := TSQLDBSQLite3ConnectionProperties.Create(FServer.DB);

  for I := 0 to 3 do
  with FProp.Execute('select count(*) from ExampleData', []) do
  begin
    if Step(true) then
      WriteLn(ColumnInt(0));
  end;

I got error: "TSQLDBSQLite3Statement.Step(SeekFirst=true) not implemented for simple". Any ideas?

#44 Re: mORMot Framework » any possible that mORMot Framework be acquired by embarcadero someday » 2017-09-07 20:48:28

hnb

The mORMot acquisition by Embarcadero would be the worst event on my whole life.

#45 Re: NewPascal Distribution » NewPascal icon » 2017-08-10 09:14:48

hnb

Release will be a little delayed:

1. I need to finish some new compiler feature
2. Maybe NewPascal soon will be more official part of FPC smile

#46 Re: NewPascal Distribution » NewPascal icon » 2017-07-16 12:08:05

hnb

Thanks for icon, I will use that icon in next release! New release is planned in this month (or early August). My effort in last days was concentrated to improve FPC trunk and Lazarus trunk in few aspects, few of parts of my work was also related to mORMot. mORMot will work with next NewPascal much better (no need to add any path to project settings for mORMot - this step was required for codetools/code completion for Lazarus IDE).

#47 Re: mORMot Framework » Clear separation of components » 2017-07-05 08:19:24

hnb

Generally ORM systems are known as slow solutions but mORMot is fast so... maybe new namespace FastORM for ORM related stuff? I like dotted namespaces. So for me for example FastORM.Commons would be best wink. Anyway most important for me is separation to packages whatever the name is.

#48 Re: mORMot Framework » Clear separation of components » 2017-07-05 07:49:30

hnb

ab, did you forgot about our initial list of packages? tongue

mORMot_Commons, mORMot_SQLite3 (+ mORMot_SQLite3Static), mORMot_DB, mORMot_REST, mORMot_DDD, mORMot_MVC, mORMot_PDF, mORMot_UI, mORMot_CrossPlatform, mORMot_ZEOS

https://github.com/maciej-izak/mORMot/t … s/Packages

#49 mORMot Framework » Unhandled helpers in mustache » 2017-06-27 09:23:09

hnb
Replies: 0

Hi,

current helpers without parameters are a little problematic:

{{NewGUID}}

will not work. we have workaround (additional fake parameter) which is not intuitive:

{{NewGUID call}}

I have small patch (parameter less helper is searched after context searching):

https://github.com/synopse/mORMot/pull/45

anyway maybe some other syntax for "parameter less" helpers may be better.

Board footer

Powered by FluxBB