Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/31/18 in all areas

  1. Stefan Glienke

    Inline Variables Coming in 10.3

    Using that feature in code that also needs to compile in versions before 10.3 makes no sense - however once we migrate to a version that has this feature I will use it in company source code with great joy.
  2. Stefan Glienke

    We need a Delphi Language Server

    If you haven't watched this before it might make it a bit clearer what it means to have modern compiler architecture and what benefits you get from it (like not having to implement everything twice for compiling itself and for tooling):
  3. Larry Hengen

    We need a Delphi Language Server

    I agree that an open source Language Server would be desirable. Omnipascal looks great and even offers the ability to compile Delphi projects now. Someone else wrote a form designer prototype for VSCode. Put all the pieces together and we almost have a portable IDE with VSCode. A language server would enable other IDEs to support the ObjectPascal language and enable EMBT to rip out ErrorInsight, and other parsers in the IDE. if they made use of it. If EMBT used an open source language server, the community could evolve and improve it over time rather than relying on EMBT. As a separation of concerns, it would also make it easier to get a cross platform IDE working, or multiple IDEs on different platforms. If you write code on OS/X and target only Apple devices, it would be nice not to require a Windows VM, or a PC as well. A language server might enable the use of XCode (not sure if it uses language servers) for ObjectPascal development. At some point, a language server could enable Delphi developers to just use the command line compilers, and RTL to target their platform of choice with their editor of choice, and UI framework of choice. https://github.com/alefragnani Seems to have done some work along this line.
  4. Sherlock

    Been stupid for years

    I have been waiting for that reply ever since I first used that nick in an other forum back in 2000. 18 years...wow!
  5. Dalija Prasnikar

    Directions for ARC Memory Management

    One of the problems with ARC enabled and having [unsafe] as default is that you cannot release object that has disabled reference counting. [unsafe] is only for marking additional references on objects whose memory is managed at some different place (reference). Of course, you can say that compiler would need some tweaking to allow destroying such objects, but it is very likely that at some point the whole construct would fall apart. I never gave mush thought to such "solution" because it seems pointless. Point is. ARC compiler was done right as far as its default behavior is concerned. There are few things around DisposeOf that could be polished, and some other minor bugs that are just bugs, not design flaws. ARC compiler fits the best into existing Delphi infrastructure and neatly fixes issues around object and interface references. Other solutions and workarounds will be poor substitutes and will not solve that duality problem. I wish I would be wrong on this one. I sincerely hope I am wrong and that there is another approach that will not be just a band aid, but full fledged solution.
  6. Stefan Glienke

    Directions for ARC Memory Management

    The difference is the implementation, why put something into TObject which is then turned off for everything unless I need it. This is already the case for TMonitor which is kinda arguable. Putting the RefCount field into every single object instance only wastes memory. So if you are for explicit opt-in it not being part of TObject itself is way better. So if we get records that are not running through InitRecord, CopyRecord and FinalizeRecord but directly call their constructor/destructor/copy operator you get rid of all that overhead and don't need records wrapping interfaces (no heapallocation needed as well). If we then possibly also get a way to do operator lifting/hoisting we get rid of the current need to write .Value when accessing the stored value (which is why I wrote IShared<T> where you don't have to).
  7. Bill Meyer

    We need a Delphi Language Server

    Given that I doubt we will ever see a fully repaired IDE, the language server would be a boon, were it not for the issue of a form designer. The notion of using a CSS-like solution reminds me of the Regex joke: I had a problem, but solved it with Regex. Now I have three problems.
  8. Hi, I've created two new components based on TImageList and TImage in FMX. The new components load images from a directory during design and in run-time. Please have a look here: https://github.com/jkour/neImageTools Thanks
  9. Renaud GHIA

    We need a Delphi Language Server

    Yes. Depends of the IDE, but for instance with i-pascal and IntelliJ you can configure the delphi compiler. http://www.siberika.com/img/run/compile.gif
  10. Attila Kovacs

    Inline Variables Coming in 10.3

    {$ENDIF Something}? Rather: procedure DoesSomething; var var1: Integer; {$IFDEF Something} {$IFNDEF DXE103UP} var2: Integer; {$ENDIF} {$ENDIF} begin // use var1 {$IFDEF Something} {$IFDEF DXE103UP} var var2: Integer; {$ENDIF} // use var1 and var2 {$ENDIF} end; How many of you can start using the new syntax without paying attention?
  11. Markus Kinzler

    Inline Variables Coming in 10.3

    http://delphi.org/2018/10/unexpected-benefit-of-inline-variables-compiler-directives/
  12. Stefan Glienke

    Directions for ARC Memory Management

    It would be wrong in the same way as most of the time it is wrong to mix object and interface references because as soon as interface reference is triggering ARC your instance might be prematurely destroyed.
  13. Hi @ertank! I play with your code and do some debugging in the depths of the Delphi SOAP sources. As you can see in the TOPToSoapDomConvert.ProcessResponse (Line 2037 in Tokyo 10.2.3) it calls a inline class helper function IsBareLiteral. Making long story short: Set every time the THTTPRIO.Converter.Options (see Unit Soap.OpConvertOptions) and the Response will be filled. Try this: unit Earsiv.View; interface uses System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, EarsivWebService1, Soap.SOAPHTTPClient, Soap.OpConvertOptions; type TForm5 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private FRIO: THTTPRIO; WS: EarsivWebService; procedure MyHTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream); public end; var Form5: TForm5; implementation {$R *.dfm} procedure TForm5.Button1Click(Sender: TObject); var Request: faturaOlustur; Response: faturaOlusturResponse; begin if not Assigned(FRIO) then begin FRIO := THTTPRIO.Create(nil); FRIO.OnAfterExecute := MyHTTPRIO1AfterExecute; FRIO.URL := 'https://earsiv.efinans.com.tr/earsiv/ws/EarsivWebService'; // the following line are not enough, see MyHTTPRIO1AfterExecute FRIO.Converter.Options := FRIO.Converter.Options + [soDocument, soLiteralParams]; WS := (FRIO as EarsivWebService); end; Request := nil; Response := nil; Request := faturaOlustur.Create(); Request.input := 'Hello'; Request.fatura := belge.Create(); Request.fatura.belgeFormati := belgeFormatiEnum.PDF; try Response := WS.faturaOlustur(Request); finally if Assigned(Response) and Assigned(Response.return) then begin ShowMessage(Response.return.resultCode + sLineBreak + Response.return.resultText); end; Request.Free; Response.Free; end; end; procedure TForm5.MyHTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream); begin FRIO.Converter.Options := FRIO.Converter.Options + [soDocument, soLiteralParams]; end; end.
  14. Stefan Glienke

    Directions for ARC Memory Management

    Afaik it does not. However that is why there is Shared<T> and IShared<T> in Spring. First one is for easy creation because of implicit operator, second is for easy access as its an anonymous method type and the invoke takes almost zero time. With the type inference in 10.3 however the second one also has pretty easy creation as Primoz showed earlier.
  15. Awww, come on. This is good for the brain. a little mental arithmatic keeps your mind sharp. 😄
  16. Neutral General

    Chrome/TamperMonkey for Design

    I can't edit my post above so here's a fixed version: // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/?* // @match https://en.delphipraxis.net/topic/* // @match https://en.delphipraxis.net/discover/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_compact_topic_banner = true; const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true;  const enable_compact_comment = true; const enable_compact_comment_footer = true; const enable_compact_pre = true; const enable_compact_code = true; const enable_compact_survey = true; const enable_username_above_avatar = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const enable_compactDiscover = true; const isDiscover = location.href.indexOf('delphipraxis.net/discover') > 0; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist && !isDiscover) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } const ipsPageHeader = $('DIV.ipsPageHeader'); if (enable_compact_topic_banner) { ipsPageHeader.attr('style', 'padding: 5px;'); } if (enable_modified_topic_banner) { if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { if ($(link).closest('FORM').length > 0) continue; const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } } } if (enable_username_above_avatar && !isDiscover) { var authorOriginal = $('.cAuthorPane_author > strong > a'); authorOriginal.each( function(i, obj) { var txt = obj.innerHTML; var list = obj.parentElement.parentElement.nextSibling.nextSibling; list.innerHTML = '<li><strong>' + obj.outerHTML + '</strong></li>' + list.innerHTML; obj.outerHTML = '<span style="color: #346f99;">.</span>'; }); } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment && !isDiscover) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } if (enable_compact_comment_footer && !isDiscover) { $('.ipsItemControls').attr('style', 'line-height: 25px; height: 25px;'); $('.ipsComment_controls').attr('style', 'line-height: 25px; height: 25px;'); $('.ipsReact_types').attr('style', 'transform: scale(0.75);'); } // Code if (enable_compact_code && !isDiscover) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } if (enable_compact_pre) { stylesheet.insertRule('PRE.ipsCode { max-height: 15em; }'); stylesheet.insertRule('PRE.ipsCode.viewAll { max-height: inherit; }'); stylesheet.insertRule('.codefold { right: 0; position: absolute !important; margin-right: 3em; }'); const a = $('<a href="javascript:void(0);" class="codefold" onclick="$(this).parent().toggleClass(\'viewAll\');">open/close</a>'); $('PRE.ipsCode').prepend(a); } // Survey if (enable_compact_survey && !isDiscover) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar && !isDiscover) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); if (enable_compactDiscover && isDiscover) { $('LI.ipsStreamItem').attr('style', 'padding: 2px 10px !important; margin: 0 0 2px 30px !important;'); $('LI.ipsStreamItem UL.ipsTags').each(function () { $(this).closest('DIV').find('H2').append($(this)); }); } // scroll to start of content if (enable_scroll_to_content) { if ((window.location.href.indexOf('?do') < 0) && window.location.href.indexOf('#') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })();
  17. KodeZwerg

    Where do I store my own images on Android?

    Maby this way work for you? (uses System.IOUtils) AppPath := TPath.GetHomePath; FileName := TPath.Combine(AppPath, 'Filename.ext');
  18. I want to say a big Thank You to Daniel for providing a dedicated place for the MMX Code Explorer Community. This is much more that I would have been able to create by myself. Besides the website https://www.mmx-delphi.de/ this will be the most prominent place to announce new versions, answer questions and discuss new features.
  19. Hi, at least when running the fluid design, a click on the topic title brings me to the top of the page. I'd like to see DP to scroll to the newest entry automatically, as in the German community. ... 🐈 ...
  20. Neutral General

    Title Click to newest entry

    You can do this with the activity streams. But I agree that this should still be the default behaviour if possible.
×