Jump to content

lynkfs

Moderators
  • Content Count

    740
  • Joined

  • Last visited

  • Days Won

    146

Reputation Activity

  1. Thanks
    lynkfs reacted to jarto in Loading binary data   
    The latest update to Alpha contains fixes and improvements that let you now easily download binary data. Here's an example, that I use when I load a SqLite-database:
    var ht:=TW3HttpRequest.Create; ht.OnDataReady:=procedure(Sender: TW3HttpRequest) begin var htstream:=ht.ResponseAsStream; htstream.Position:=0; FDatabase.LoadFromStream(htstream); ht.Free; end; ht.GetBinary(DataBaseName); That new GetBinary-procedure basically sets the responsetype to arraybuffer before doing a normal Get.
  2. Like
    lynkfs reacted to Daniel Eiszele in Checkbox Wordwrap   
    HI @jarto, adding "justify-content: flex-start", "justify-content: center" and "justify-content: flex-end"  to the alignment CSS appears to fix the justification issues without wrecking the word wrapping.
  3. Like
    lynkfs got a reaction from Daniel Eiszele in Checkbox Wordwrap   
    note : I'm not an expert in css, but I did notice that the first div child of the checkbox has a display="inline-block" as an attribute of that element. I think that should be a property of the style (style ="display:flex;width ... etc)
    Also I think the answer is to change the box layout system for these components from block to flex (or grid)
    original :
    <div class="lbxcontent lbxcontent_v_center lbxdisableBreak lbxcontent_h_center" display="inline-block" style="width: 100%;">   <input type="checkbox" display="inline-block" style="width: 16px; height: 16px; position: relative; vertical-align: middle;">   <pre class="lbxcontent lbxenableBreak" display="inline-block" style="position: relative; vertical-align: middle;">This is a long checkbox text</pre> </div> change to :
    <div class="lbxcontent lbxcontent_v_center lbxdisableBreak lbxcontent_h_center" style="display: flex; width: 100%;">   <input type="checkbox" style="width: 16px; height: 16px; position: relative; vertical-align: middle;">   <pre class="lbxcontent lbxenableBreak" style="text-align: left; position: relative; vertical-align: middle;">This is a long checkbox text</pre> </div> changes the rendering from

    to

     
  4. Like
    lynkfs reacted to jarto in Smart Mobile Studio 3.9.1 (1st Alpha release) is available   
    New update is available.
    RTL:
    TW3HttpRequest: Improvements and bug fixes for handling downloading of binary data Bug fixes to TW3CheckBox and TW3RadioButton Word Wrap did not work Right and Center alignments did not work Disable cursor emulation in TStreamReader and TStreamWriter This allows using multiple readers or writers on same stream. If you need every stream reader and writer to have their own cursor, set roEmulateCursor Fix TW3Dataset saving and loading (both streams and JSON) Bug fix to TString.EncodeURL Bug fixes to handling of Opacity IDE:
    Fix default value for Opacity Designer:
    TW3CheckBox and TW3RadioButton support now all properties
  5. Like
    lynkfs reacted to jarto in Database development   
    First picture is from a manually constructed dataset. Second one is from sqlite-database. Doesn't look beautiful, but you can see data-aware versions of TW3Memo, TW3Label and TW3StringGrid. All connected to the same Data source.


  6. Thanks
    lynkfs reacted to jarto in ide browser sensing   
    Login protected is the only safe way to go. If security is not that important in this project, I'd go with the url parameter.
  7. Like
    lynkfs reacted to jarto in opacity settings   
    The Opacity-property should be a number between 0 and 100. The RTL changes that to the proper css value. You also need to set AlphaBlend to true.
    I'll fix the default value.
  8. Like
    lynkfs got a reaction from jarto in Database development   
    there is also the system.db.pas unit, which provides some db and sql based references
  9. Like
    lynkfs got a reaction from IElite in Database development   
    They must have some sort of an sql parser.
    Some links :
    Commercial vcl (delphi tokyo) parser :
    http://sqlparser.com/download.php http://sqlparser.com/dlaction.php?fid=gspdxe10_2_tokyo_trial&ftitle=General%20SQL%20Parser%20VCL%20for%20delphi%20XE10.2%20tokyo%20trial%20version and some really old ones
    https://torry.net/quicksearchd.php?String=sql+parser&Title=Yes http://www.felix-colibri.com/papers/db/sql_parser/sql_parser.html to write a complete sql parser from scratch might be a big job
  10. Like
    lynkfs got a reaction from IElite in Database development   
    I guess there are a couple of approaches :
    - Have access to the meta information when parsing results. Most SQL based rdbms's have type information stored in meta tables, which is accessible by a normal query. Unfortunately this is not standardised, so MySQL, Oracle, DB2, SQL server etc have differently named tables for that purpose. For SQLite see this link.
    - Let the developer define the meta data in the designer while setting up the data link, and store it somewhere persistently (TDatalink ?). Then parse the results with this stored meta data.
    - If you only want to know if a field is numeric or not (I don't think that's your question, but anyway) then there is the poor mans solution : just read the first 100 records or so, and if a field only contains 0-9 then assume that field to be numeric across the whole result set. Not recommended (but I did it once to figure out the left or right alignment of fields in a grid)
  11. Like
    lynkfs got a reaction from jarto in visual design   
    I've been following this company for a while.
    They went from a startup promising a contemporary development product to a web design template producer.
    And I must say, I really like their designs.
    When I need some inspiration for app design, I do have a look at what they're offering
    https://famous.co/
     
  12. Like
    lynkfs got a reaction from jarto in open external link in new tab of browser   
    The other possible downside of using window.open is that it depends on the users browser setting whether it opens a new tab or a new window.
    This behaviour cannot be determined by js, it is dependent on the user.
    While chrome seems to favour using the tab-mechanism, other browsers don't. I've tested a couple which resulted in 'pop-up blocked' messages
    Also mobile browsers don't have tabs, so they will spawn a new window at best.
    (There is something called the tab-api, which gives granular tab processing under program control. This is used for developing browser extensions, which I have never done. It may or may not be possible to use that api in SMS, although I suspect that even if it does, it will have ramifications)
    Another possible option is of course using an iFrame element on the form. Depends on your requirements
  13. Like
    lynkfs got a reaction from Czar in open external link in new tab of browser   
    The other possible downside of using window.open is that it depends on the users browser setting whether it opens a new tab or a new window.
    This behaviour cannot be determined by js, it is dependent on the user.
    While chrome seems to favour using the tab-mechanism, other browsers don't. I've tested a couple which resulted in 'pop-up blocked' messages
    Also mobile browsers don't have tabs, so they will spawn a new window at best.
    (There is something called the tab-api, which gives granular tab processing under program control. This is used for developing browser extensions, which I have never done. It may or may not be possible to use that api in SMS, although I suspect that even if it does, it will have ramifications)
    Another possible option is of course using an iFrame element on the form. Depends on your requirements
  14. Like
    lynkfs reacted to Daniel Eiszele in open external link in new tab of browser   
    Try using BrowserApi.Windowobject.open( ) instead. Note that "window" is of type THandle which means you can utilise any valid javascript method/property on it, but code completion will not work. "Windowobject" on the other hand is of type Jwindow and is built with code completion in mind. 
  15. Like
    lynkfs got a reaction from IElite in Performance due to compiler optimisation   
    The other thing I noticed when comparing the same project generated by SMS3.0.0 and the latest alpha is a marked speed increase.
    I did some tests on the training phase of a neural network, with these results :
    SMS 3.0.0 : Training took 30810 milliseconds.
    SMS 3.1.9 : Training took 18937 milliseconds.
    SMS 3.0.0 : Training took 32611 milliseconds.
    SMS 3.1.9 : Training took 47272 milliseconds.
    SMS 3.0.0 : Training took 34233 milliseconds.
    SMS 3.1.9 : Training took 16627 milliseconds.
    SMS 3.0.0 : Training took 33177 milliseconds.
    SMS 3.1.9 : Training took 18275 milliseconds.
    SMS 3.0.0 : Training took 30762 milliseconds.
    SMS 3.1.9 : Training took 16734 milliseconds.
    SMS 3.0.0 : Training took ... milliseconds. 
    SMS 3.1.9 : Training took 16062 milliseconds.
    Except for 1 outlier, the speed difference of the latest alpha is about on average 1.6 - 1.8 times faster
    This can only be due to compiler optimisation
    Impressive
     
     
  16. Like
    lynkfs got a reaction from Czar in Performance due to compiler optimisation   
    The other thing I noticed when comparing the same project generated by SMS3.0.0 and the latest alpha is a marked speed increase.
    I did some tests on the training phase of a neural network, with these results :
    SMS 3.0.0 : Training took 30810 milliseconds.
    SMS 3.1.9 : Training took 18937 milliseconds.
    SMS 3.0.0 : Training took 32611 milliseconds.
    SMS 3.1.9 : Training took 47272 milliseconds.
    SMS 3.0.0 : Training took 34233 milliseconds.
    SMS 3.1.9 : Training took 16627 milliseconds.
    SMS 3.0.0 : Training took 33177 milliseconds.
    SMS 3.1.9 : Training took 18275 milliseconds.
    SMS 3.0.0 : Training took 30762 milliseconds.
    SMS 3.1.9 : Training took 16734 milliseconds.
    SMS 3.0.0 : Training took ... milliseconds. 
    SMS 3.1.9 : Training took 16062 milliseconds.
    Except for 1 outlier, the speed difference of the latest alpha is about on average 1.6 - 1.8 times faster
    This can only be due to compiler optimisation
    Impressive
     
     
  17. Like
    lynkfs got a reaction from Daniel Eiszele in Performance due to compiler optimisation   
    The other thing I noticed when comparing the same project generated by SMS3.0.0 and the latest alpha is a marked speed increase.
    I did some tests on the training phase of a neural network, with these results :
    SMS 3.0.0 : Training took 30810 milliseconds.
    SMS 3.1.9 : Training took 18937 milliseconds.
    SMS 3.0.0 : Training took 32611 milliseconds.
    SMS 3.1.9 : Training took 47272 milliseconds.
    SMS 3.0.0 : Training took 34233 milliseconds.
    SMS 3.1.9 : Training took 16627 milliseconds.
    SMS 3.0.0 : Training took 33177 milliseconds.
    SMS 3.1.9 : Training took 18275 milliseconds.
    SMS 3.0.0 : Training took 30762 milliseconds.
    SMS 3.1.9 : Training took 16734 milliseconds.
    SMS 3.0.0 : Training took ... milliseconds. 
    SMS 3.1.9 : Training took 16062 milliseconds.
    Except for 1 outlier, the speed difference of the latest alpha is about on average 1.6 - 1.8 times faster
    This can only be due to compiler optimisation
    Impressive
     
     
  18. Like
    lynkfs got a reaction from jarto in Performance due to compiler optimisation   
    The other thing I noticed when comparing the same project generated by SMS3.0.0 and the latest alpha is a marked speed increase.
    I did some tests on the training phase of a neural network, with these results :
    SMS 3.0.0 : Training took 30810 milliseconds.
    SMS 3.1.9 : Training took 18937 milliseconds.
    SMS 3.0.0 : Training took 32611 milliseconds.
    SMS 3.1.9 : Training took 47272 milliseconds.
    SMS 3.0.0 : Training took 34233 milliseconds.
    SMS 3.1.9 : Training took 16627 milliseconds.
    SMS 3.0.0 : Training took 33177 milliseconds.
    SMS 3.1.9 : Training took 18275 milliseconds.
    SMS 3.0.0 : Training took 30762 milliseconds.
    SMS 3.1.9 : Training took 16734 milliseconds.
    SMS 3.0.0 : Training took ... milliseconds. 
    SMS 3.1.9 : Training took 16062 milliseconds.
    Except for 1 outlier, the speed difference of the latest alpha is about on average 1.6 - 1.8 times faster
    This can only be due to compiler optimisation
    Impressive
     
     
  19. Like
    lynkfs reacted to jarto in DWS bugs in Alpha (was: randomize)   
    Filed a bug report of this one with a simple test case:
    https://bitbucket.org/egrange/dwscript/issues/174/code-generation-error-while-declaring-and
  20. Like
    lynkfs got a reaction from jarto in DWS bugs in Alpha (was: randomize)   
    Found the problem with my neural network component. It turns out it has nothing to do with the randomize function, but is an elusive compiler error in the latest alpha
    To illustrate this :
    This code (a matrix multiplication function)
    Function DotX(Matrix1,Matrix2:TMatrix) : TMatrix; var   MyDotX : TMatrix; begin   MyDotX := TMatrix.Create(Matrix1.NrRows,Matrix2.NrColumns);   For var i := 0 to Matrix1.NrRows -1 do begin     For var j := 0 to Matrix2.NrColumns -1 do begin       var sum: float := 0;       For var k := 0 to Matrix1.NrColumns -1 do begin         sum := sum + Matrix1.GetValue(i,k) * Matrix2.GetValue(k,j);         MyDotX.SetValue(i,j,sum);       end;     end;   end;   result := MyDotX; end; is compiled to the following javascript
    3.0.0 function DotX(Matrix1$1, Matrix2) { var Result = null; var MyDotX = null; var i$24 = 0; var j$10 = 0; var sum = 0, k$2 = 0; MyDotX = TMatrix.Create$163($New(TMatrix),parseInt(TMatrix.NrRows(Matrix1$1),10),parseInt(TMatrix.NrColumns(Matrix2),10)); var $temp115; for(i$24=0,$temp115=TMatrix.NrRows(Matrix1$1)-1;i$24<=$temp115;i$24++) { var $temp116; for(j$10=0,$temp116=TMatrix.NrColumns(Matrix2)-1;j$10<=$temp116;j$10++) { sum = 0; var $temp117; for(k$2=0,$temp117=TMatrix.NrColumns(Matrix1$1)-1;k$2<=$temp117;k$2++) { sum+=Number(TMatrix.GetValue$1(Matrix1$1,i$24,k$2)*TMatrix.GetValue$1(Matrix2,k$2,j$10)); TMatrix.SetValue$1(MyDotX,i$24,j$10,sum); } } } Result = MyDotX; return Result }; which works fine in all SMS versions up to 3.0.0
    In the latest alpha though, the line 'sum = 0' is omitted by the compiler, which breaks this function
    @jartoattributes this to an optimisation error in the compiler
    He'll get this fixed
    This error is not tied to matrix multiplication or anything, it will occur in all similar constructs where a variable is declared in the body of a function with a value of zero (in this function the line : var sum: float := 0)
     
  21. Thanks
    lynkfs reacted to jarto in SMS 3 + mORMot = Error   
    @IgorSavkic Thank you for the exe. I got the server running and was able to debug the issue.
    The reason what the SMS Browser does not work here is due to settings. Go to IDE Settings and Internal Browser.
    Then have a look at option Web Security. Click on it until you get a Check Mark or a black rectangle on it. (Black rectangle means that we'll be using Chromium's default value)
    Click ok, restart the IDE and it works.
     
  22. Like
    lynkfs reacted to jarto in Control Alignments   
    This is now fixed in the latest alpha. It required bigger changes but the end result should be better. Like I wrote earlier, the problem was that form1 (in this example) was hidden too early. Let me give you some background, so you guys know better about what's going on when an SMS app is starting:
    If you have multiple forms, they all are constructed during startup. The main form is easy: Just build it and there it is. The other forms are trickier as they need to be built off screen and then hidden. The construction of all forms have to happen with visible=true as ClientRect, ClientWidth and ClientHeight will not otherwise return correct values.
    In this example program, the form was built properly, but resizes were still going on when the form was hidden. That's because setting an alignment caused a delayed resize on the parent control. It has to be delayed as we don't want the parent control to realign all the child components right away when any of them changes alignment. That'd lead to flickering and tons of extra resizes.
    The solution I took was to block all resizes and alignments while the form is being built from form's sfm-file. When all controls have been created and properties set, I recursively call resize and align once on controls from bottom up. In my tests it has worked well. Please let me know if this breaks your code.
  23. Like
    lynkfs reacted to IgorSavkic in SMS 3 + mORMot = Error   
    > The new one has no UserName and Password. When I remove them, I am able to compile and connect to the service.
    It seems you have wrong path or wrong file, check in Project14ServerHttpWrapper.dpr call to AddToServerWrapperMethod, it specifies location of mustache template for SMS, it should resolve to your mORMotUnpackDir\CrossPlatform\templates. If you're running 
    mORMotUnpackDir\SQLite3\Samples\27 - CrossPlatform Clients\Project14ServerHttpWrapper.dpr those paths should match.
    I'm including correct SmartMobileStudio.pas.mustache and mORMotClient files.
    > However, I run into issues with this: XMLHttpRequest with the synchronous flag set to true is deprecated due to its impact on user-perceived site 
    > performance.It's probably because TServiceClientAbstract.Create does a synchronous call in CallRemoteServiceInternal 
    > and CallGetResult returns an unidentified result.
    This has been the case from the start, but it doesn't affect working code. 
    Once when browsers really remove that call it will stop working, there's no solution yet, ab from mORMot isn't using SMS anymore so someone else has to solve it.
    SmartMobileStudio.zip
  24. Like
    lynkfs reacted to IgorSavkic in SMS 3 + mORMot = Error   
    You can download it from https://synopse.info/fossil/wiki?name=Downloads, file is mORMotNightlyBuild.zip.
    Unpack somewhere and copy units from CrossPlatform dir to SMS libraries dir.
    Now you can try some code, 
    go to SQLite3\Samples\27 - CrossPlatform Clients, compile in Delphi Project14ServerHttpWrapper
    run once as admin compiled Project14ServerHttpWrapper.exe, this will register it as a handler within http.sys 
    now start Project14ServerHttpWrapper.exe as normal user and leave it running.
    go to http://localhost:8888/root/wrapper, download SmartMobileStudio client unit
    copy downloaded mORMotClient.pas to Samples\27 - CrossPlatform Clients\SmartMobileStudio
    now compile "27 - CrossPlatform Clients\SmartMobileStudio\Project14Client.sproj in" SMS
    run it with F9, press Server connect, it should give an error
    now try it in Chrome http://127.0.0.1:8090/index.html, and it should work
     
  25. Thanks
    lynkfs reacted to jarto in DWS bugs in Alpha (was: randomize)   
    Eric has not reacted yet, so I'll include my own fix in the next update.
×
×
  • Create New...