-
Content Count
75 -
Joined
-
Last visited
Everything posted by sakura
-
Let's not discuss the GOTO - first, it is not my code, but code from a library I use, second, the full method from the library certainly benefits from it. It is not always possible to optimize for everything cleanly. For full details, follow the links π
- 7 replies
-
- optimization
- bug
-
(and 1 more)
Tagged with:
-
Open Tools API - Mark Module as not Modified
sakura replied to sakura's topic in Delphi IDE and APIs
Yes, no change, the IOTAEditorContent object itself is not even marked as modified, it's the module, which is "knowing" that something has happened. π- 3 replies
-
- ota
- open tools api
-
(and 3 more)
Tagged with:
-
Further on, the function is to ensure a properly nulled reference, even if something fails. A object that failed during Free/Destroy is usually not usable any longer anyways.
-
FreeAndNil 10.4 vs 10.3.1 and Pointers
sakura replied to Sherlock's topic in RTL and Delphi Object Pascal
Yeah, that was my first thought... not really better, though the name of the method itself tells the story. Yet, for someone, who does not quite yet understand all the quirks of Delphi, this is a little frustrating... -
wuppdi Welcome Page for Delphi 10.4?
sakura replied to PeterPanettone's topic in Delphi IDE and APIs
Yepp, I know why π The original Welcome Page was designed by me during the field test, and at that time "wuppdi" was the "thing" at the German Delphi Praxis, and I wanted to include that somehow and that's how it ended up there π wuppdi is a simple CSS class to hide different things. doShow CSS class was used to override wuppdi π -
As a Delphi expert, do you ever need to refactor or improve your code?
sakura replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Don't worry, I've never seen larger projects, where the code could explain all the thinking behind the tinkering, especially the larger picture. I think we all can agree, that good code explains what it is doing quite well, however, rarely, if ever why and never the reason behind he full logic of a multi-year-project. -
As a Delphi expert, do you ever need to refactor or improve your code?
sakura replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@Vincent Parrett Done yet? π Honestly, refactoring does not only mean fixing and improving code itself, though, as stated above, as learning and evolving creature, there is always a chance for that, no matter how expertly you done it, but requirements change, features need to be implemented, and so on. Existing code may anticipate a lot of upcoming changes, but ever everything? So yes, there will always be a need for refactoring. Now, let's go back to my last paragraph and do that π -
German store has ist too. Congrats!
-
Looks like you have some post build events and those try accessing java.
-
I second the Synopse solution. Very darn fast.
-
What would you expect, from 0 to 0 allows for 0 as iteration value. Correct behaviour, back since Pascal times...
-
I have similar results. The compiler on 10.3 is faster without any FixPack, than the compiler of 10.2.3 with the FixPack installed. So, I am fine with that part. ... π ...
-
Missing, at least in Chrome on Windows, a fav icon π ... π ...
-
Thanks π ... π ...
-
For those of you, using TamperMonkey in Chrome, I have created a small script, which, for now, will compact the design just a bit. Feel free to enhance/comment. // ==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/* // @exclude *?do=edit // @grant none // ==/UserScript== (function() { 'use strict'; // fluid list const $ = jQuery; $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); $('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;'); $('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'); }); // thread view const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { 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); } topicControls.remove(); $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); })(); ... π ...
-
Welcome to the English speaking Delphi-PRAXiS
sakura replied to Daniel's topic in Community Management
It almost got to be in Europe, as it is run by a European person (Daniel π). Going abroad, outside the EU, is hard in regards to the DSGVO (privacy laws), as it is almost impossible to guarantee a provider to obey those laws at sensible prices. Especially with US gov agencies trying to access anything and everything nowadays. ... π ... -
Strange, works fine for me now. Anyways, posting a new topic was broke, so here is another fix. π // ==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_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_pre = true; const enable_compact_code = true; const enable_compact_survey = 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'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); 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_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;'); } // 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 } })();
-
Hi, just a tiny tidbit, but wouldn't it be prudent to have the Code-Language default to Pascal? So far, it is HTML. I admit, I've only posted JavaScript at this point π, but I am looking forward to actually be helpful at some point π ... π ...
-
Now it does: // ==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_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_pre = true; const enable_compact_code = true; const enable_compact_survey = 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'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { 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); } topicControls.remove(); } } 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;'); } // 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 } })();
-
The CodeMonkey code editor is not perfect. I can live with that π ... π ...
-
Added Activity Stream: // ==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_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_pre = true; const enable_compact_code = true; const enable_compact_survey = 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'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { 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); } topicControls.remove(); } } 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;'); } // 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) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); ... π ... Fixed for start page after login.
-
Hi, not sure I think this is a good idea. Just hope you'll watch how it works out. Rather would think max. size per attachment would be better. Otherwise users might start deleting attachments made, which can/will lead to broken threads at some point. Mine is now at: You have used 229.84 kB of your 488.28 MB attachment limit. ... π ...
-
I copied the header from the other script and forget to remove exclusions, which shouldn't be needed in this one. ... π ...
-
Couple smaller improvements in previous post. ... π ...
-
You are welcome, have done so much f****ing CSS in the last months, this was a easy one π ... π ...