The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for June, 2021

MacOS: killing Chrome from the terminal

Posted by jpluimers on 2021/06/14

Every now and then, Chrome hangs to badly on MacOS that the whole Mac GUI becomes unresponsive so even the “Force Quit” dialog does not appear.

Sometimes you are lucky enough that you have a (remote) terminal shell open.

Then you can do either of these:

  • Less hard kill:
    • killall 'Google Chrome'
    • killall Google\ Chrome
  • Hard kill:
    • killall -9 'Google Chrome'
    • killall -9 Google\ Chrome

The less hard kill sometimes brings up an unresponsive task and still allows you to save any changed.

Via:

–jeroen

Posted in Apple, Chrome, Google, Mac OS X / OS X / MacOS, Power User | Leave a Comment »

Keyboard Shortcuts, Markdown, and Autocomplete – Atlassian Documentation

Posted by jpluimers on 2021/06/14

Details at [WayBack] Keyboard Shortcuts, Markdown, and Autocomplete – Atlassian Documentation; summary:

To view all Confluence keyboard shortcuts, do any of the following:

  • Choose the help icon  from the universal sidebar, then choose Keyboard Shortcuts.
  • When viewing a page, press shift+?
  • While editing a page, choose the question mark icon from the editor toolbar.

a list of some of the most common shortcuts:

Markdown

Use markdown shortcuts to format text from the comfort of your keyboard.

  1. Either:
    • Type [ and then the first few characters of the page title, user’s name, image name or file name.
    • Type the first few characters of the page title, user’s name, image name, or file name (or select relevant text) and then press ctrl+shift+k.
  2. Click the relevant link from the list of suggestions.

If the item you need is not in the list, either choose Search for ‘xxx’ to continue looking for the page within Confluence, or Insert Web Link to link to an external page.

When a Windows shortcut has Ctrl in it, the MacOS shortcut uses Command.

–jeroen

Posted in Development, Keyboards and Keyboard Shortcuts, Lightweight markup language, MarkDown, Power User, Software Development | Leave a Comment »

Still relevant for current Windows versions: hard drive – defrag /x – consolidate free space not really working – Windows Server 2012 – Server Fault

Posted by jpluimers on 2021/06/11

From my answer at [WayBack] hard drive – defrag /x – consolidate free space not really working – Windows Server 2012 – Server Fault

I’ve tried many tools, starting with defrag C: /X (which tries, but doesn’t give good results) and found out these steps give the best results:

  1. Perform an Ultradefrag full optimisation
  2. Perform a MyDefrag Consolidate free space script on the drive.

Note that MyDefrag (formerly named JkDefrag) is not maintained any more but the 4.3.1 version in the WayBack machine still works very well as the underlying defragmentation APIs in Windows haven’t changed.

References:

The original MyDefrag disappeared two times (temporarily in 2014 because the domain expired, then permanently in 2017 because the domain went off-line).

Luckily, the WayBack machine at archive.org has the latest version saved (not all the links from the archive.org search page have an executable as sometimes it shows the expired domain or a non-existing redirect when the domain got off-line):

Note that chocolatey install --yes mydefrag --version 4.3.11 fails because of the missing download. See [WayBack] Chocolatey Software | MyDefrag 4.3.1.

(The --version parameter trick is from [WayBack] Chocolatey – How to install hidden and unlisted package? – Super User, via [WayBack] “This package is unlisted and hidden from package listings.” – Google Search).

–jeroen

Posted in Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Vista, Windows XP | Leave a Comment »

Winword: parts of the document with numbered, but other parts (Table of Contents, Summary) without numbering

Posted by jpluimers on 2021/06/11

Steps to have only the body parts of your Winword document Heading 1 numbered, but parts like Summary and Table of Contents without numbering.

Related:

Steps:

  1. Create a document with
    • some paragraphs of body text, intertwined with:
      • some paragraphs that should become numbered headings,
      • some paragraphs that should become non-numbered headings
      • room for a table of context
  2. Go to the “Styles” popup (keyboard shortcut Ctrl+Shift+Alt+S, or ribbon “Home” -> section “Styles” -> small button on the lower right of the ribbon section
  3. For each paragraph that should become a heading, apply style “Heading 1” (you can also use keyboard shortcut Ctrl+Alt+1 for this)
  4. Modify the various heading levels so they become numbered: see [WayBack] How to create numbered headings or outline numbering in Word 2007 and Word 2010 | ShaunaKelly.com. I prefer the hierarchical numbered multilevel list without the numbers being indented for the body text, but with indented numbers in the Table of Contents, so lets go.
    1. Start with the stock multi-leveled list definition:
      1. Change from “None” to the multi-level one:
      2. Now create a new one based on it:
        1. “Define New List Style…”:
        2. Rename from “Style1” to “Heading
    2. This involves creating a new list style called “Headings”, based on the numbered list style you like
      • ).
    3. Since by default, these bind to all levels, your document styles “Heading 1”..”Heading 9″ are covered. If for one or more styles, you do not want numbering, see below how to fix that (I do that for a “Heading 1 – no-numbering” style used for the “Summary” heading, and for the “TOC Heading” style.
  5. Mark the “Summary” heading as a new style “Heading 1 – non-numbered”:
    1. Press Ctrl+Shift+S to get to the “Apply Styles” 
    2. Enter the new name “Heading 1 – non-numbered” and press the “New” button: 
    3. Press the “Modify” button 
    4. to view the current style
    5. Press “Format” ->     
    6. Change it from “None” to “None” and press “OK”
    7.  Observe the numbering is gone:
    8. Unlike the “Heading 1” style, the “Style for following paragraphs” is wrong: it needs to be
    9. Now we are done, so press the “OK” button:
    10. Then observe the first numbered “Heading 1” now has got the number “1” instead of the “Summary”:
  6. Insert a “Table of Contents”, for instance after the “Summary”
    1. You might think it will start with a heading “Table of Contents”:
    2. Im some localisations of office, it is prepended with a “1.” and becomes “1. Table of Contents”. If it does, then you have to change style “TOC Heading” and undo the numbering as done with “Heading 1 – non-numbering” by pressing Ctrl+Shift+S when you are in the “Table of Contents” heading:
    3. From there, press the “Modify” button and continue as done with “Heading 1 – non-numbering”:

–jeroen

Posted in Office, Office 2007, Office 2010, Office 2013, Office 2016, Power User, Word | Leave a Comment »

Check if this still happens: some Twitter content in the WayBack machine gets a slash in the URL removed during rendering on Chrome

Posted by jpluimers on 2021/06/11

From my research list; check if this still happens: [WayBack] Saving Twitter content in the WayBack archive: the fully loaded page has a wrong trailing URL (missing the second slash before the authority) · GitHub

  1. Visited https://twitter.com/MarkGraham
  2. Saved it using https://web.archive.org/save/https://twitter.com/MarkGraham
  3. Waited for the save to complete and the page to fully load and got https://web.archive.org/web/20190607081047/https:/twitter.com/MarkGraham
  4. Observed the trailing part is not a valid URL any more https:/twitter.com/MarkGraham: it is missing the second slash before the authority (see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax)

This might be a Twitter.com thing:

Notes:

  • I have only tested this with my Chrome configurations on various machines (both regular and anonymous tabs) over at least a year; I need to figure out what happens when using different browsers.
  • It does not always happen.

Via: [WayBack] Jeroen Pluimers on Twitter: “I understand that the sites themselves pay a big role in this. That’s why I have the mangling of URLs that sometimes happens on my research list. I made this quick summary: …”

–jeroen

Read the rest of this entry »

Posted in Internet, InternetArchive, Power User, SocialMedia, Twitter, WayBack machine | Leave a Comment »

string – Change backslash to forward slash in windows batch file – Stack Overflow

Posted by jpluimers on 2021/06/10

One of the situations where setlocal enabledelayedexpansion comes on handy to replace \ with / which some unix based tools like better: [WayBack] string – Change backslash to forward slash in windows batch file – Stack Overflow

echo off

setlocal enabledelayedexpansion

for %%f IN ("C:\tools\workspace\*") DO (
  set old=%%f
  echo !old!
  set new=!old:\=/!
  echo !new!  
  echo.                 
)

Related, as it explains when the source and target replacements are in variables themselves: [WayBack] command line – String replacement in batch file – Stack Overflow, thanks Joey and Tom Warfield!

You can use the following little trick:

set word=table
set str="jump over the chair"
call set str=%%str:chair=%word%%%
echo %str%

The call there causes another layer of variable expansion, making it necessary to quote the original % signs but it all works out in the end.

Upvoting this answer because it works both ways, with the environment variable in either position, or in both the “before” and “after” positions:

set word=table
set str="jump over the chair"
call set str=%%str:chair=%word%%%
echo %str%
set word1=chair
set word2=desk
set str="jump over the chair"
call set str=%%str:%word1%=%word2%%%
echo %str%'

–jeroen

Posted in Batch-Files, Development, Scripting, Software Development | Leave a Comment »

Sulfur Argon Calcium Samarium

Posted by jpluimers on 2021/06/10

Got this from a friend: Sulfur Argon Calcium Samarium (SArCaSm): the Primary Elements of Humor.

Of course there is Iridium Oxygen Nitrogen Yttrium (IrONy) as well.

–jeroen

Read the rest of this entry »

Posted in Fun, LifeHacker, Power User, Quotes | Leave a Comment »

Delphi: When porting really old code from versions that did not have .dproj files, watch your .dfg and .dof files

Posted by jpluimers on 2021/06/10

I have been bitten by this a few times too much, so time to write it down:

When porting old Delphi code from the Delphi 7 and older era, the options were stored .dof (options) and .cfg (configuration) files.

More modern Delphi versions try to translate these files when generating the .dproj file, in a similar way as they try to upgrade older .dproj files to newer formats.

Many things can go wrong, including these ones I have bumped into multiple times:

  • DCC_DebugInformation having a 0 or false value, but not handling these values correctly (I remember problems around the Delphi XE5 era with this: When the Delphi XE5 commandline compiler fails with error F1026: File not found: ‘False.dpr’)
  • DCC_OutputDependencies not being adhered to (no .d file is being emitted by the compiler), though for the .drc files, DCC_OutputDRCFile works fine)
  • DCC_DebugInformation having a 1 value (Limited Debug information) instead of being absent (Debug information)
  • DCC_SymbolReferenceInfo having a 1 value (Definitions Only) instead of being absent (Reference info)

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

(nullable) rowversion (Transact-SQL) – SQL Server | Microsoft Docs

Posted by jpluimers on 2021/06/09

I was not aware there could be a nullable [WayBack] rowversion (Transact-SQL) – SQL Server | Microsoft Docs, but it is possible:

Duplicate rowversion values can be generated by using the SELECT INTO statement in which a rowversioncolumn is in the SELECT list. We do not recommend using rowversion in this manner.

A nonnullable rowversion column is semantically equivalent to a binary(8) column. A nullable rowversion column is semantically equivalent to a varbinary(8) column.

You can use the rowversion column of a row to easily determine whether the row has had an update statement ran against it since the last time it was read. If an update statement is ran against the row, the rowversion value is updated. If no update statements are ran against the row, the rowversion value is the same as when it was previously read. To return the current rowversion value for a database, use @@DBTS.

You can add a rowversion column to a table to help maintain the integrity of the database when multiple users are updating rows at the same time. You may also want to know how many rows and which rows were updated without re-querying the table.

For example, assume that you create a table named MyTest. You populate some data in the table by running the following Transact-SQL statements.

–jeroen

Posted in Database Development, Development, Software Development, SQL, SQL Server | Leave a Comment »

The state of text reading robots a few years back; I doubt it has improved much since: AI often still is Algorithmic Irresponsibility

Posted by jpluimers on 2021/06/09

The state of text reading robots and AI a few years back; I doubt it has improved much since: [WayBack] Thread by @JFBonnefon: “It’s a big day today: I had a scientific manuscript rejected by a robot. Thread. The bot detected ❝a high level of textual overlap with previous literature […]”.

Basically, it detected all duplicates to be in non-relevant pieces.

Via: [WayBack] Michael Bolton on Twitter: “Thread. Machines read strings. They don’t understand context or intentions. This is how AI comes to stand for Anti-Intellectualism and Algorithmic Irresponsibility (the latter coined by @jamesmarcusbach).… “

Although I could not find that reference through [Archive.is] “Algorithmic Irresponsibility” – Google Search. I could only find two:

–jeroen

Read the rest of this entry »

Posted in AI and ML; Artificial Intelligence & Machine Learning, Development, Software Development | Leave a Comment »