You are not logged in.
Sorry ... ;-)
Sample 37 !
Hi Ab,
I cannot get the server of the FishShop demo to run with FPC trunk (win32) on Windows.
It errors out on : "interface not registered".
I tried to debug, but unsuccessful. Would you mind having a look if you are able to reproduce ?
Thanks.
In my sqlite-databases, a datetime looks like:
2017-10-26T15:47:14In your case, its just a float (double). So DateTimeToSQL will not work. Try:
Baby := TSQLBaby.CreateAndFillPrepare( aClient, 'BirthDate>=? and BirthDate<=?',[Double(StartOfTheDay(dt)),Double(EndOfTheDay(dt))]);There you go [replace > with >= and < with <= ... I hope this will work]:
Baby := TSQLBaby.CreateAndFillPrepare( aClient, 'BirthDate>=? and BirthDate<=?',[DateTimeToSQL(StartOfTheDay(dt)),DateTimeToSQL(EndOfTheDay(dt))]);If you use sqlitebrowser, what does the BirthDate column data show ?
You could try this:
Baby := TSQLBaby.CreateAndFillPrepare( aClient, 'BirthDate>? and BirthDate<?',[DateTimeToSQL(StartOfTheDay(dt)),DateTimeToSQL(EndOfTheDay(dt))]);Perhaps the below will help.
Add this into your lpr file:
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
.....
As the servers were running fine, no mORMot code updates were needed.
New features would require a restart naturally, but no new features were needed for these servers.
The servers were collecting climate data (temperature, RH, ...) in buildings.
Hello to all,
I wish all mORMot-coders a happy New Year !
And to support this wish:
We had a power surge on our servers (ARM hardware) last night. UPS got exhausted later.
But until this time, two mORMot-servers had run for 4 years, 129 days and 5 minutes continuously without any hick up !!
So, happy mORMot-coding ... you can have much faith in AB's work !
Greetings, Alfred.
Please try my version of your sources.
For me, these work ... ;-)
I have made some changes to your source, to be able to compile with Delphi and FPC under win32.
Result: I can fully reproduce your problem !
Delphi: 100% success.
FPC: your reported failure.
Will investigate
With a fresh trunk (installed with fpcupdeluxe), the mORMot (TestSQL3.lpi) compiles and runs fine on my system (win10, 32bit).
You should do the following two thing:
1: change the port to something below 1000 ... eg 888
2: run the server as administrator
Your latest commit works out-of-the-box on Android.
Thanks !
Hi Ab,
Your new code does not work either.
But the good news is ... I found out whats wrong : its a compiler error !
The inlining of this function does not work on Android.
If inlining is disabled, both the old code (from yesterday) as well as the new code works.
Strange aspect: the really old code (see post above, from 4 month go) does work with inlining ?!
Just replace the code inside the function with this code (the old code):
function IdemPropNameUSameLen(P1,P2: PUTF8Char; P1P2Len: PtrInt): boolean;
{$ifdef PUREPASCAL}
var i,j: integer;
begin
result := false;
j := 0;
for i := 1 to P1P2Len shr 2 do
if (PCardinal(PtrInt(P1)+j)^ xor PCardinal(@P2[j])^) and $dfdfdfdf<>0 then
exit else
inc(j,4);
for i := j to P1P2Len-1 do
if (PByteArray(P1)^[i] xor ord(P2[i])) and $df<>0 then
exit;
result := true;
end;Works for me 100%. I hope also for you !
First part of problem found: IdemPropNameUSameLen
Thanks to your research !
If reverted, first part of my Android app works again !
Is there a way to prevent android from terminating the the app
Nope. Android 8 is even worse: no permission = failure without warning.
The (very) hard way ... ;-)
E.g.:
ndx := GlobalJSONCustomParsers.RecordSearch(aCustomRecordTypeName);
__android_log_write(ANDROID_LOG_DEBUG,'mORMot CreateFromTypeName ndx: ',PChar(InttoString(ndx)));
So, adding lines that are visible in ADB.
Normally, I make a custom ShowError function that directs this inserted debug-info to a place where I can easily study it.
Than, I am able to easily compare CPU-OS systems. So, I compare expected output on working systems with non-working systems.
As I said, the hard way ... especially on Android !
Still debugging. But perhaps Ab can help at this stage !
This function (inside TJSONCustomParserRTTI.CreateFromTypeName):
ndx := GlobalJSONCustomParsers.RecordSearch(aCustomRecordTypeName);
For a TINTEGERDYNARRAY, ndx is -1 !
So, the whole function (CreateFromTypeName) returns nil !!
Edit:
Just saw the new post. Perhaps the reports are related !?
With latest FPC, mORMot, LAMW, I experience exactly the same error !!
Edit:
With latest FPC, mORMot, LAMW, on arm linux (RPI3) , all goes well !!
So, no alignment issue as it seems.
There is no newer version yet. So this version is still the only version that will patch Lazarus !
You have to use 1.6.1c to install/update Lazarus !!
Only 1.6.1c will patch Lazarus to be suitable for wince.
Strange.
I just did a clean install with fpcupdeluxe 1.6.1c of trunk/trunk.
Installed an arm-wince cross-compiler.
Choose target arm and wince. Selected wince widgetset.
Compile. All works out-of-the-box !
Yep.
I guess there is little change that this patch will make it into Lazarus.
And, due to the reaction, I am not going after it.
However.
https://github.com/newpascal/fpcupdelux … ag/v1.6.1c
This release will patch Lazarus to enable building for wince.
(I do not know if you are on windows, but I can prepare other releases as well ... let me know if you are interested)
I just checked.
Sample 27 : lclclient compiles for arm-wince and produces an exe file !
Due to wince problem, I used a custom setup for WinCE: FPC 3.0.4 and Lazarus 1.6.4, setup with fpcupdeluxe
I just did (few minutes ago) a brand new trunk install, with x86_64 cross-compiler for Linux and mORMot on Win10 with fpcupdeluxe-x86_64-win64 V1.6.0q
I could not reproduce your problem.
What happens if you try to compile mORMot Sample 02 for both Windows as well as for Linux 64bit ?
Source: mORMot latest from GitHub.
Compiles with FPC trunk and NewPascal trunk.
FillDescriptionFromSource(fDescriptions,format('%s%s.pas',[fSourcePath[i], aUnitName]));NewPascal got updated few hours ago.
I just did an install (NewPascal + mORMot) through GIT (with fpcupdeluxe) and all works out of the box.
> Sorry if I'm the one who's misunderstanding the conversation here.
I think I misunderstood (also) !
But thanks for clearing things up !!
> what's lacking is a UI widgets library similar to the TMS ones based on pas2js.
This should be done in full cooperation with the pas2js team, to prevent any future problems.
@warleyalex
>I'm not a lawyer, but for my taste this is far too near a
>copyright violation. Using this as a base for a library would definitely
>give bad publicity.
The above sounds bad.
Pas2js has been sponsored work AND has been open sourced. So, care is needed.
But I think that Lazarus integration is a very logical (and very much needed) next step.
And, as Ab already stated, pas2js + Lazarus + mORMot will be groundbreaking !
It would therefor be good to have full cooperation of Mattias and co already beforehand.
Would you mind asking him/them how he/they see a future integration of pas2js into Lazarus.
About your code.
As I do not have TMS, I cannot judge any potential copyright violation.
But again, we should not cause a fight about this. Much better to have a good start in full agreement with the pas2js team !!
My 2 cents.
@warleyalex
I might have enough time to help you with your efforts.
But important: could you give some more details about the opinion of the Pas2JS team on this. Are they opposed or have reserves ?
Hi Ab,
This is a very welcome and very important feature !
This feature would also validate an announcement on the official Lazarus forum I think !!
For me, using a non-encrypted database has always been very tricky in case of client apps.
If you are able to share your code somewhere, I can have a look also.
To prevent a long conversation and long posts, I would like to suggest that you share your code somewhere.
And also the output (or screen-dumps) of your compile-efforts.
That would make life easier (for me), and increases the changes that we can help you !
I have looked at your error.
It is generated by this code inside FPC compiler sources:
Assign(outfile,owner.AsmFileName);
{$push} {$I-}
Rewrite(outfile,1);
{$pop}
if ioresult<>0 then
begin
fioerror:=true;
Message1(exec_d_cant_create_asmfile,owner.AsmFileName);
end;
This seems clear: the file cannot be created ... access permissions ?
https://www.freepascal.org/docs-html/user/userse66.html
@triguinhu
Again, I need more info to be able to help you !
What Lazarus and FPC version. How did you install FPC/Lazarus/LAMW. What Android version is your target. What Android SDK/NDK/Ant are you using.
@gothbert
I just checked with FPC 3.0.4/Laz 1.8.0 on win64 with win64 executables, and they run perfect !
I do not know how you used the dpr files to build the projects with Lazarus, but here's is how I make it work:
In Lazarus, select open project and open the dpr-file. Select "simple project" when Lazarus asks you to create a project.
In project options (compiler options / parsing), set mode to Delphi.
Hi, I've tried to compile this demo but I can't. There are many errors. Can you share here wich source of mMormot have been used?
You take your time ... ;-)
But serious: you must give me more info (about the errors encountered) to allow me to be able to help you.
About OpenUI5.
A bit abandoned by me. Its so heavy. Takes ages to load. And it has the looks of the 60's. Which is ok for me, because I am from the 60's, but not really suitable for modern times.
Having said that.
I would be very interested in a ongoing discussion about java frameworks to be used with the mORMot.
It could even be a separate forum topic, due to its importance IMHO.
Hint:
Use fpcupdeluxe to install FPC trunk and Lazarus.
(mORMot needs recent FPC trunk)
Use fpcupdeluxe to install cross-compiler for Android.
Install LAMW. You could also use fpcupdeluxe for that: install module LAMW.
Of you go !!
Fpcupdeluxe presents you two mORMots:
the original one: mORMot
a special one: mORMotFPC
The latter was made to be able to use the mORMot during a period of heavy changes of FPC and the mORMot itself.
It has not been updates for a long time now: the original mORMot works flawless now with FPC on many systems.
So, just use the original mORMot.
FCreatedAt: TModTime; ---> FCreatedAt: TCreateTime;
Have you seen this ?
https://synopse.info/forum/viewtopic.php?id=3905
https://synopse.info/fossil/info/d0c1512d051ef958
So, would you mind trying a mORMot >= 1.18.3690
Dunno if this will help, buts its worth a try.
What you ask for is not that easy ... ;-)
A good master-detail design with decoupling of logic and (Grid-)GUI (MVC) asks for considerable effort, even for an expert.
mORMot has a MVC example.
And a Grid.
You will need FPC trunk for working interfaces !
Raspberry (arm-linux) is fully supported.
Good !
Please be confident: much work has been done and will be done to keep FPC and the mORMot a perfect combo !
@vonH
The trunk changes can be found here: http://wiki.freepascal.org/User_Changes_Trunk
I leave it to hnb to explain more about NewPascal, but in general, NewPascal is a very recent trunk without the dangers of trunk.
Well, at the moment, I have 0% knowledge of Docker, other than heard of it and a website visit.
However, there is always a way out with fpcupdeluxe:
a: first get the FPC/Laz-sources in a way convenient for you.
b: point fpcupdeluxe towards these sources and let it do its job.
Look here on how to do this:
https://synopse.info/forum/viewtopic.php?id=1728
TGoogleGeoCodeJSON is your guideline
https://synopse.info/forum/viewtopic.ph … 426#p10426
You can use fpcupdeluxe to install only NewPascal FPC.
Then point CT towards this FPC.