Jump to content

lynkfs

Moderators
  • Content Count

    743
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by lynkfs

  1. 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/
  2. 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,
  3. 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 mil
  4. This testcase is the essence of what's happening Thank you
  5. 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.G
  6. unfortunately fix still breaks the neural network component 😬 Maybe some other changes in the random/randomize area ? Trying to get a handle on this
  7. lynkfs

    md5 on win10

    Sometimes downloaded files come with a md5 hash. Md5 is an algorithm which translates any string or any file into a 128 bit value. This value then can be used to verify the integrity of the downloaded file : just re-generate the md5 hashvalue with a proper utility and compare the generated and the published value. Apparently md5 is not that good, but that's beside the point. It is widely used. There are quite a few md5 checksum utilities available, but the other day I found out that this is baked into win10 as well. No need to download and install a separate utility for this purpose.
  8. Thanks for your 'Alea' digging. Your temp solution does work, however it still breaks my neural network component There might be some more dependencies than randomize and random only, or something else Wait till fix arrives (just realised that 'alea' is latin for 'gambling', good choice for a randomiser)
  9. The alea function was originally designed by Johannes Bagoe, as a means to improve generating random numbers The original posts (musings) from him are not available anymore, but some links remain : https://stackoverflow.com/questions/8554243/how-to-use-implement-alea-to-generate-better-random-numbers http://jsfiddle.net/rlemon/PZR4d/ If I copy the function in the links above into a smart project, it eliminates the runtime error. However it still doesn't work correctly so I'll wait till the DWS fix Randomize / Random is an integral part to the neural network component
  10. Since the latest alpha the Randomize function gives a runtime error (Randomize Sets the random generator seed to a random value). Error message : "Uncaught ReferenceError: $alea is not defined" Statement : Randomize; generated code : function Randomize() { Random = $alea() }
  11. yep, fixed the problem, all works as expected 👍
  12. Correct, both snippets compile fine pre and post version 3.9 However the first snippet gives the runtime error in version 3.9, and not in versions before (tested it in all major browsers too) It's not a big deal, just happened to stumble across this minor change in compiler behaviour and true, snippet 1 is a bit confusing to read anyway.
  13. Apparently nested function declarations are no longer supported ? Changing the above code to below solves the problem function computeBrightness(color: Variant): Float; var R, G, B: Integer; begin function parseInt(s: Variant{String}; radix: integer = 0): integer; external "parseInt"; if(color.length=7) then color := color.substring(1); R := parseInt(color.substring(0,2), 16); G := parseInt(color.substring(2,4), 16); B := parseInt(color.substring(4,6), 16); Result := sqrt(R * R * 0.241 + G * G * 0.691 + B * B * 0.068); end; func
  14. Hmmm The code from @warleyalex above used to work for me for a long time function Brightness(colour: String): Float; function computeBrightness(color: Variant): Float; var R, G, B: Integer; function parseInt(s: Variant{String}; radix: integer = 0): integer; external "parseInt"; begin if(color.length=7) then color := color.substring(1); R := parseInt(color.substring(0,2), 16); G := parseInt(color.substring(2,4), 16); B := parseInt(color.substring(4,6), 16); Result := sqrt(R * R * 0.241 + G * G * 0.691 + B * B * 0.068
  15. lynkfs

    alignment

    Since the ide is getting some pretty good improvements, I would like to make the following suggestion : it would be nice if it would be possible to align components in the designer similar to ms-powerpoint : select 2 or more components and align them vertically or horizontally, something like
  16. lynkfs

    css styling

    Smart has its own layout system and Tailwind has some layout functions as well. So you're right, if you want to use them both, then you have to signal Smart what you want to do. It also makes life somewhat complicated. Easiest is just to forget about the layout functions in any css framework (positioning, sizing), and just stick with the Smart layout system. That still leaves many css functions to do with colors, backgrounds, typography, borders, svg and effects @jarto is looking at Bulma, which is sort of similar to Tailwind. Determining which of it's css functions would natura
  17. The 'Open Recent' project list is now properly updated too 👍
  18. lynkfs

    css styling

    Various ways to do this. Probably easiest is to download the latest tailwind css file from https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css and store it in the lib folder and use the $R directive initialization Forms.RegisterForm({$I %FILE%}, TForm1); {$R 'tailwind.css'} This will automatically add a line like this to your index template file : <link rel="stylesheet" href="lib/tailwind.css"> Alternatively, either add a custom template in the Project Manager and add the css file link manually to it, or load the css file in code Apart from any $R direc
  19. lynkfs

    css styling

    One of the plusses of the (opensource) tailwind css library is that it does not have any pre-made components like buttons etc. Instead, any element can be styled using one or more of it's css 'functions'. So this also works for any of the standard SMS components. As an example, see here the new login demo (Featured Demos / Forms & Components / LoginDialog), but styled a bit differently Demo (see hover and focus effects) Usage is quite intuitive : - Give the LoginForm a white background and rounded corners - Display the 'Please login' label in dark grey usi
  20. there are also some browser built-in functions to handle (xml) parsing
  21. lynkfs

    Float 16

    There are many untapped gems in the rtl. Memory processing is one of them (at least for me it is).
  22. set <element>.NativeScrolling to true
  23. lynkfs

    KaTex

    and this works too var html : variant; asm @html = katex.renderToString("c = \\pm\\sqrt{a^3 + b^3}", { throwOnError: false }); end; W3Panel1.InnerHTML := html;
×
×
  • Create New...