Jump to content

lynkfs

Moderators
  • Content Count

    677
  • Joined

  • Last visited

  • Days Won

    114

lynkfs last won the day on March 23

lynkfs had the most liked content!

About lynkfs

  • Rank

Profile Information

  • Gender
    Male
  • Location
    Australia

Recent Profile Visitors

3,051 profile views
  1. lynkfs

    swipe

    just for reference : I'm using the SmartCL.Controller.Swipe controller to enable swiping I noticed that on Android phones I need to change the default parameters to something like constructor TW3SwipeController.Create(const AOwner:TW3TagObj); begin inherited Create(AOwner); FHRange:=TW3SwipeRange.Create(20,90); // [min]---X---[max] //20-40 FVRange:=TW3SwipeRange.Create(20,90); // [min]---Y---[max] //20-40 Latency := 55; //35 Options := []; //[coStrictTarget]; end; otherwise it wouldn't detect a swipe reliably I'll do some more testing on different touch-enabled hardware platforms (btw: the controller has properties to change these parameters in code)
  2. lynkfs

    ide browser sensing

    I'm working on a project which has 2 (inter)faces : one where the user is in a design phase, and one where the end-result is being displayed The idea is that there will be users in the role as designer, and other users which will be just using the end result. These other users should not even be aware of the design environment I'm looking for the best way to distinguish between these 2 states. In principle this could be solved by dividing the project into 2 separate projects letting the user switch between these environments at will (like selecting a menu item, maybe login protected) have a 'switch' parameter in the url (like /index.html?switch=design) I was looking at the option where the switch would be dependent on browser detection (ide browser or any other browser) Exploring options
  3. lynkfs

    opacity settings

    opacity settings of TW3Panel (and probably of the other visual controls as well) are not rendered correctly The css opacity style is a float between 0 and 1, current designer expects an integer between 0 and 255
  4. lynkfs

    ide browser sensing

    or ping the socket server let's ask @jarto
  5. lynkfs

    ide browser sensing

    I suppose we could check the browsers url object. If it is something like 'http://127.0.0.1:8090' it might be the internal ide browser Must be a better way
  6. lynkfs

    ide browser sensing

    What would be the best code to see if a project runs in the IDE-browser or whether it runs natively in any other browser ?
  7. lynkfs

    Database development

    there is also the system.db.pas unit, which provides some db and sql based references
  8. lynkfs

    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
  9. lynkfs

    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)
  10. lynkfs

    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/
  11. lynkfs

    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
  12. 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
  13. lynkfs

    DWS bugs in Alpha (was: randomize)

    How fast it that !
  14. lynkfs

    DWS bugs in Alpha (was: randomize)

    This testcase is the essence of what's happening Thank you
  15. lynkfs

    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)
×