-
Content Count
598 -
Joined
-
Last visited
-
Days Won
7
Posts posted by Tommi Prami
-
-
On 5/22/2024 at 3:38 PM, PeterPanettone said:Did anyone already run the Delphi IDE on the brand new Microsoft Surface Pro ("CoPilot+PC") with Qualcomm Snapdragon ARM CPU + Integrated Neural Processing Unit ("NPU")?
I went to the roadshow and was left into understanding that those come out after summer.
So most likely no one has tested that, if has, most likely is not allowed to talk much about it.-Tee-
-
On 5/22/2024 at 9:42 AM, Patrick PREMARTIN said:Hi
Just a question for me : why do you declare variables before the nested methods if this behavior disturbs you ?
I don't. Why would I complain about it if it would be my own fault 😄
But there are people that has this habit, in component vendors, open source library writes, possibly in coworkers etc...
-
https://xxhash.com/doc/v0.8.2/index.html
There are some Delphi implementations of some version of xxHash, bot not low level optimized version.-Tee-
PS. posted this in wrong group ;( -
5 minutes ago, Vincent Parrett said:but if I do use them I prefer to pass parameters - I prefer the narrowest scope possible on all variables/fields etc.
Nicely summed up...
-
10 minutes ago, David Heffernan said:I always prefer to pass parameters because it makes it much clearer what the input/output of the function is.
Usually the so called convenience you refer to just leads to obfuscation.
I think this way too.
My main reason is not that much of the how "clean/good" the code is in this case, but is mentally frustrating. Very difficult to keep track what happens and when...
If code is cleaner and better, that is definitely a big bonus.-Tee-
-
1 hour ago, Der schöne Günther said:I think that is the whole point of these nested methods, that they can access all the local variables that were defined before them?
I think that is not the point of nested methods.
To me that that Nested methods see those variables is not the point of the nested methods, that is just as how they work.
Like hammer is nice tool but don't hit random people in the head with it... 🙂
-tee- -
Yellow,
Could not think what else to call then as "Local Global variables"
So let me show.
function Foo(...) var LListOfVariables: TSomeType; procedure Bar1; begin // Complex proc that might or might not use variables defined above, and/or change them end; procedure Bar2; begin // Complex proc that might or might not use variables defined above, and/or change them end; ... begin // Func main body that might or might not call local procs end;
For me this is very hard to wrap my brains around.
For me this pattern requires lot of thinking and overloads my limited memory, to keep in mind that call to local procedure might touch the local variable, even it is not directly passed into them.
I don't have anything against local methods, they wrap nicely some local need, that is specific for that parent method, and only for that. But fight are they good idea at first place, is another matter.-Tee-
-
This appears to be problem with the : Options > User interface > Form Designer > Enable VCL Styles -setting.
Disabling the Mimic* and Enable VCL Styles settings, inheritance works as expected. -
-
20 hours ago, dummzeuch said:Given that most sites don't offer feeds any more or have hidden them so most people won't know they exist, I don't think this will make much of a difference.
I was not thinking this as a traditional website feed, mainly. Buit standard to use in our apps to pass messages/info.
Like your homepage to your app, to pass known bugs, new features etc... As far as I know Wordpress has rss-feed polugin, maybe some other CMS also has. And then you could start to publish something on your website and get the feed to your app.-Tee-
-
https://www.jsonfeed.org/version/1.1/
Looks much cleaner and sane than RSS/Atom.
Hope this catches on, RSS is/was very nice concept, but was kind of sidelined, can't remember why it is not that popular anymore, there was some major reason popularity dropped.-Tee-
-
1 hour ago, Uwe Raabe said:I cannot reproduce here with project and steps from the QP issue. Looks like it is caused by something in your system.
Interesting...
I'll get back to it when Coworkers has tested that also. Some got the same error on production app, but I'll wait for them to check out the trivial test app also.-Tee-
-
4 minutes ago, Lars Fosdal said:Did you try with a new .dproj file?
Did not help.
-
Removed all IDE experts, and tried again and it behaves exactly the same...
It seems that I just need to open the inherited form and StyledElements appear right away.
-tee-
-
1 hour ago, Lajos Juhász said:I saw this in Delphi 11.2, whenever I open those files in D12.1 it removes them.
On this project, it is opposite. Or 12.1 patch 1, adds them.
-
https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-779
IDE adds StyledElements default value to inherited form even though not needed
One coworker can't reproduce. So need more info why that might be,
I have few free plugins installed, like GExpers. Have to uninstall those and try if problem is not in the plugins.-Tee-
-
19 hours ago, Anders Melander said:There's one in DWScript: https://github.com/EricGrange/DWScript/blob/c3a26f0e68a5010767681ea1f0cd49726cd4af5d/Source/dwsUtils.pas#L3169
I haven't used it though but knowing Eric, it's probably both fast and well tested. Pity about the 3-space indents though; Very French 🙂
Have to check that out, thanks...
-
5 hours ago, Remy Lebeau said:By definition, a TryXXX() function does not raise an exception into user code. TryISO8601ToDate() is no different.
No it does not, that is OK, but debugger breaks to it anyhow, as it raised in the TryISO8601ToDate, and that is kind of exception I would not like to ignore. IF it would be TryISO8601ToDateException then yes. But generalm date conversion exception I would like to raise my attention.
-tee-
-
17 hours ago, Der schöne Günther said:That is indeed annoying, but we haven't stumbled upon a "real" bug. We are using String/DateTime conversion for Iso8601 from the System.DateUtils all the time.
We had quite a long time own version, because some reported bug, Think there was some reported bug even quite recently.
-Tee-
-
Yellow,
Seems that Delphis own routines are bit flaky. There has been bugs over years. Last problem I had was that TryISO8601ToDate will raise exception on string it can't parse. Will handle/eat the exception but not most optimal solution I think.
By good,m I mean that handle nicely error cases, maybe has more options that Delphi version. Obviously very well tested. If also fast, I wouldn't complain.
-Tee- -
On 4/12/2024 at 5:53 PM, Stefan Glienke said:TValue has no implicit casting rule for integer -> enum - thus it raises the invalid cast exception because you are passing an Integer to SetValue which gets implicit put into a TValue which gets transported further. It later does a type/cast check against the actual type of the property and fails.
See TValue.Cast or TValue.TryCast and the Conversions matrix for more details.
Have to try to remember that. Not used it too much.
Thanks for helping!-Tee-
-
30 minutes ago, Lars Fosdal said:There also is https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TypInfo.GetEnumProp
which returns a PPropInfo, which again contains a PropType: PPTypeInfo, which you then can use with GetEnumValue?
This lead me one step closer.
var LEnumValue: Integer; LEnumValue := GetEnumValue(LProperty.PropertyType.Handle, AValue); if (LEnumValue <> -1) and LProperty.IsWritable then LProperty.SetValue(FInstance, LEnumValue);
With this I get the actual value, but setting the value does not work (More than less same code is used elsewhere and they work).
It raises EInvalidCast with message 'Invalid class typecast'.
Integer is correct value for the Enum, it is in between bounds. This slightly baffles me now.
-
7 minutes ago, msohn said:I've been using TypeInfo.SetEnumProp for that - works for all Enums that are published properties. It basically is SetOrdProp with GetEnumValue shown by Dalija, so saves you figuring out the enum size.
Oh, I forgot to mention that should work public properties also, I modify original, I still can... MAybe it is now more clear what I am after...
-Tee-
-
10 minutes ago, Dalija Prasnikar said:I would use TypeInfo instead of RTTI as it will be faster. This requires System.TypInfo
procedure TMyThingy.SetEnumPropertyValue(const AValue: string); begin PByte(@FEnumProp)^ := GetEnumValue(TypeInfo(TMyEnum), AValue); end;
You should pay attention on enum type size and use appropriate sized pointer when casting PByte(@EnumProp)^. This will also raise out of range exception if passed string does not match to any value in TMyEnum. You can catch that and set it to some default value if needed.
I think I explained myself poorly. That won't work because it depends on TypeInfo(TMyEnum)
My code must not know/depend on the (hardcoded) type, it should be dynamic. Work with any given property, that is any type of Enum (some limitations may apply, but if works simple enums like one in example, it is OK).
Any chance of getting a signed installer?
in GExperts
Posted
Don't know what is the current situation, and it most likely varies greatly by certificate vendor and so on.
But...
CoWorker wanted to sign free apps, and it was huge mess. What I can remember he could not get the certificate, because he is individual and not the company, and would have needed lawyer and so forth to validate to certificate vendor that he is who he says he is. Or something like that.
And this clearly is large problem, IMHO, Open Source or free apps people or teams are releasing for free and not for business, should have reasonable priced certificate, with reasonable byreogracy. Most likely ones that can solve this might not be here reading this. But this seems like solvable problem.
But is anyone have some ideas how to get certificate for OpenSource/free project, at reasonable price (all of our mileage might vary) and so on, leave comments.
-Tee-