Created with Raphaël 2.0.0

Thursday, April 17, 2025

Number of lines of code for WooCommerce 9.8.1


WooCommerce Counts for 9.8.1


C:\Downloads2025\woocommerce.9.8.1>cloc .
    4608 text files.
    4413 unique files.
     342 files ignored.

github.com/AlDanial/cloc v 2.04  T=37.27 s (118.4 files/s, 17850.1 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                           2931          61027         162858         327479
JavaScript                     667           9846           5018          43924
SCSS                            36           5298            946          23432
JSON                           234              1              0          11434
XML                              2              5             18           4894
SVG                            173              1              8           2575
Text                            28            498              0           2192
CSS                            302            165            160           1857
C                                1            118             25            668
HTML                            25             75            305            116
CSV                              9              9              0             71
JSX                              1              7              3             52
m4                               1              8              0             32
DOS Batch                        1              7              0             30
Bourne Shell                     1              7              4             26
C/C++ Header                     1              4             12              8
-------------------------------------------------------------------------------
SUM:                          4413          77076         169357         418790
-------------------------------------------------------------------------------

Man Hours Estimated

**Average Output**: On average, programmers in a production environment might produce about 10 lines of code per day[3][4]. This figure takes into account the entire development process, including planning, coding, testing, and debugging.

Therefore 47 years 9 months 9 days to develop, by 1 developer. 


WooCommerce launched on September 27, 2011 making it 14yrs old as of year 2025.

Tuesday, April 15, 2025

Number of lines of code for Wordpress 6.7.2


Wordpress 6.7.2 Counts


C:\Downloads2025\wordpress-6.7.2\wordpress>cloc .
    2937 text files.
    2736 unique files.
     488 files ignored.

github.com/AlDanial/cloc v 2.04  T=23.97 s (114.2 files/s, 58341.3 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
JavaScript                     569          74733         130004         447064
PHP                           1243          63371         194670         312328
CSS                            671          17428           3429         128359
JSON                           149              1              0          20671
Text                            20            781              0           3159
SCSS                            11            210             38            766
SVG                             28              0              0            451
HTML                            43            125            357            247
Markdown                         2             20              0             76
-------------------------------------------------------------------------------
SUM:                          2736         156669         328498         913121
-------------------------------------------------------------------------------

Man Hours

**Average Output**: On average, programmers in a production environment might produce about 10 lines of code per day[3][4]. This figure takes into account the entire development process, including planning, coding, testing, and debugging.

Therefore 10 years 4 months 30 days to develop, by 1 developer ideally, however. 

WP launched May 27, 2003; 21 years ago as of 2025.





Friday, April 11, 2025

Count the number of lines of code on Windows with Wordpress and WooCommerce examples




There is an excellent opensource utility called CLOC (Count Lines of Code).

Cloc counts blank lines, comment lines, and physical lines of source code in many programming languages, and is quite performative.

Wordpress Counts

C:\Downloads2025\wordpress-6.7.2\wordpress>cloc .
    2937 text files.
    2736 unique files.
     488 files ignored.

github.com/AlDanial/cloc v 2.04  T=23.97 s (114.2 files/s, 58341.3 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
JavaScript                     569          74733         130004         447064
PHP                           1243          63371         194670         312328
CSS                            671          17428           3429         128359
JSON                           149              1              0          20671
Text                            20            781              0           3159
SCSS                            11            210             38            766
SVG                             28              0              0            451
HTML                            43            125            357            247
Markdown                         2             20              0             76
-------------------------------------------------------------------------------
SUM:                          2736         156669         328498         913121
-------------------------------------------------------------------------------

WooCommerce Counts

C:\Downloads2025\woocommerce.9.8.1>cloc .
    4608 text files.
    4413 unique files.
     342 files ignored.

github.com/AlDanial/cloc v 2.04  T=37.27 s (118.4 files/s, 17850.1 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                           2931          61027         162858         327479
JavaScript                     667           9846           5018          43924
SCSS                            36           5298            946          23432
JSON                           234              1              0          11434
XML                              2              5             18           4894
SVG                            173              1              8           2575
Text                            28            498              0           2192
CSS                            302            165            160           1857
C                                1            118             25            668
HTML                            25             75            305            116
CSV                              9              9              0             71
JSX                              1              7              3             52
m4                               1              8              0             32
DOS Batch                        1              7              0             30
Bourne Shell                     1              7              4             26
C/C++ Header                     1              4             12              8
-------------------------------------------------------------------------------
SUM:                          4413          77076         169357         418790
-------------------------------------------------------------------------------

Tuesday, April 1, 2025

AI Coding Challenge - Part 3 Using DeepSeek to get innermost string between strings

I asked DeepSeek to generate C# code to get the innermost string between strings.

It beat Copilot and the very convoluted Grok in this test. The implementation worked, even with basic edge cases, unbalanced delimiters.



Live Code 



Code signing on Windows with Azure Trusted Signing for a Canadian



Code signing on Windows with Azure Trusted Signing · Melatonin - great article on signing local exe with an Azure certificate.


Just to confirm, if you have a Canadian HST number and use it for TaxID, clearing "Identity Validation" takes a few minutes. 

Monday, March 31, 2025

AI Coding Challenge Major Fail - Part 2 using Grok to get innermost string between strings

I asked Grok to generate C# code to get the innermost string between strings. The initial test case worked, but soon realized with some testing of edge cases, this implementation failed. 















































































Live Code (returns no result for test case that has uneven delimiters).



Wednesday, March 26, 2025

AI Coding Challenge Major Fail - Why AI coding still has a long way to go

I asked Microsoft's AI Chat 'Copilot' to generate C# code to get the innermost string between strings. This is generalized version of getting a string between braces. Copilot generated a very plausible result, and even gave an example input and output. But the output, was very wrong. It was very misleading, given the very convincing Explanation below.

Conveniently, we can test this code for accuracy. 

The output describe is
 "Innermost", which is the ideal output. 

The actual output if you run the code is "Innermost]Middle".

TL;DR

When you go for a credit check, or cancer treatment, or battle policy cost increase, can you so easily argue the 'computer is wrong'? 

Live AI Code


AI Code generated

using System;

public class Program
{
    public static void Main()
    {
        string input = "Outer[Middle[Innermost]Middle]Outer";
        string start = "[";
        string end = "]";

        string result = GetInnermostString(input, start, end);
        Console.WriteLine("Innermost string: " + result);
    }

    public static string GetInnermostString(string input, string start, string end)
    {
        int endIndex = input.LastIndexOf(end);
        if (endIndex == -1) return ""; // End marker not found

        int startIndex = input.LastIndexOf(start, endIndex - 1);
        if (startIndex == -1) return ""; // Start marker not found

        startIndex += start.Length;

        return input.Substring(startIndex, endIndex - startIndex);
    }
}


Corrected AI Code

Monday, March 17, 2025

C# Round Datetime Extension To Nearest Minute, Round Up, Round Down



C# D
ateTime extensions that rounds a datetime Up, Down or Nearest minutes and smaller units are rounded to zero.

As used in my Solo SCRUM Sprinter App - book work effort in Outlook calendar directly every 30mins.




AI CoPilot Improved Code or is it? Added March 17, 2025

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
     
public static class Program
{
 /// <summary>
 /// Rounds datetime up, down or to nearest minutes and all smaller units to zero
 /// </summary>
 /// <param name="dt">ignore, implicitly passed</param>
 /// <param name="rndmin">mins to round to</param>
 /// <param name="directn">Up,Down,Nearest</param>
 /// <returns>rounded datetime with all smaller units than mins rounded off</returns>
 public static DateTime RoundToNearestMinuteProper(this DateTime dt, int rndmin, RoundingDirection directn)
 {
   if (rndmin == 0) //can be > 60 mins
   return dt;
  
   TimeSpan d = TimeSpan.FromMinutes(rndmin); //this can be passed as a parameter, or use any timespan unit FromDays, FromHours, etc.  
  
   long delta = 0;
   Int64 modTicks = dt.Ticks % d.Ticks;
  
   switch (directn)
   {
    case RoundingDirection.Up:
       delta = (modTicks != 0) ? d.Ticks - modTicks : 0;
    break;
    case RoundingDirection.Down:
       delta = -modTicks; 
    break;
    case RoundingDirection.Nearest:
    {
       bool roundUp = modTicks > (d.Ticks / 2);
       var offset = roundUp ? d.Ticks : 0;
       delta = offset - modTicks; 
       break;
    }
   
   }
   return new DateTime(dt.Ticks + delta, dt.Kind); 
 }
 
 public enum RoundingDirection
 {
  Up,
  Down,
  Nearest
 }
 
 public static void Main()
 {
  //var dt = new DateTime(2001, 1, 1, 0, 0, 0, 000);
  //var dt = new DateTime(2018, 08, 03, 10, 7, 30, 000); //8/3/2018 10:00:00 AM Nearest, re 15/2 = 7.5 mins or 7 mins and 30 secs
  var dt = new DateTime(2018, 08, 03, 10, 7, 31, 000); //8/3/2018 10:15:00 AM Nearest
  
  Console.WriteLine(dt.RoundToNearestMinuteProper(15, RoundingDirection.Up)); 
  Console.WriteLine(dt.RoundToNearestMinuteProper(15, RoundingDirection.Down)); 
  Console.WriteLine(dt.RoundToNearestMinuteProper(15, RoundingDirection.Nearest)); 
 }
}

Optimizations: 1/2 of a number use right-shift

int half = number >> 1; // Right-shift by 1 to divide by 2

Wednesday, March 12, 2025

Google Search Console takes design cue from my metadata consulting blog

Nice to see new Google Search Console layout and design took a bit out of my design for this blog. 😉



Saturday, March 8, 2025

Best modern way to remember days of the month

Courtesy of letterboxd.com 2025

Never forget the number of days in the month, using the following memory method or 'mnemonic'.

Odd numerical months are 31 days and even are 30, except when calendar authors got a hangover/vacation in August (08) and bumps the rest of the calendar by 1 month.


Month      Abbreviation  Month
      Numerical      
 Month
No. of days
Johnny
Mnemonic
 Qtr     Season
January Jan. 1 31 odd month Q1 Winter
February Feb. 2 28  (common year)
29  (leap year/4)
Jan-3
(even month - 2)
Q1 Winter
March Mar. 3 31 odd month Q1 Spring
April Apr. 4 30 even month Q2 Spring
May May. 5 31 odd Q2 Spring
June Jun. 6 30 even Q2 Summer
July Jul. 7 31 odd Q3 Summer
August Aug. 8 31 summer
vacation /
hangover
Q3 Summer
September Sep. 9 30 bumped Q3 Autumn
October Oct. 10 31 bump-odd now Q4 Autumn
November Nov. 11 30 bump-even now Q4 Autumn
December Dec. 12 31 bump-odd now Q4 Winter

Historically, August was named by Gaius Julius Caesar Augustus (born Gaius Octavius; 23 September 63 BC – 19 August AD 14. Another way to remember this...

  • Augustus was born in 63 B.C. and named Gaius Octavius (Octavian) and was the grandson of Julius Caesar's sister.
  • In addition to changing Sextilis to Augustus, speculation states that he took one day from February and one from September to add to his month, making it 31 days; because he apparently did not wish to have August with fewer days than Julius (July).


The calendar commonly used in modern America is the Gregorian calendar. It was introduced by Pope Gregory XIII in 1582 and is a modification of the Julian calendar. The Gregorian calendar is widely used worldwide and is the calendar system officially followed by most countries, including the United States.


Date Range Picker Outlook.com and Outlook Client

S
M
T
W
T
F
S
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
S
M
T
W
T
F
S
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
S
M
T
W
T
F
S
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10

 
















































By Tgru001 - Own work, CC BY-SA 4.0, Link to SVG Artwork on Wikipedia

Monday, February 24, 2025

Tim Hortons Phishing Email featuring Yeti 42oz Rambler Drink

For the record, this is a Tim Hortons phishing email attempt that is recently going around, with subject line "dga". 

What to do?  
Report them, goto bottom of page. 


From : Horton<sufiyanmalik75601@gmail.com>

Subject
 :  dga









PHISHING LINKs;

1. https://t.yesware.com/tt/xxx


How to tell this is a Phishing email ?

  1. Check email address in full, if it's not from originating company then it's phishing.
  2. Hover over all links in email, if it's not from the  company's website then forget it.
  3. The best way is to 

How to examine Email Message Source ?

Now lets look at message source
  1. Outlook.com->Actions->View Message Source. 
  2. Gmail.com->More (down arrow to top right)->Show original.
Check for suspicious links, anything that does not originate from apple.com.


Report Phishing Email (not as Spam)

  1. Outlook.com->Junk (at Top)->Phishing Scam
  2. Gmail.com->More (down-arrow to top right)->Report Phishing 

Report Phishing to Google

If you have received this email, take further action by

  1. https://www.google.com/safebrowsing/report_phish/

Report phishing at Microsoft and government agencies

  1. http://www.microsoft.com/security/online-privacy/phishing-faq.aspx

Saturday, February 22, 2025

Live Date Range Filter for Outlook client


Live Data Range picker for Outlook client 

Date Range Picker Outlook Client mainly, and mimics the one on outlook.com

received:>=mm/dd/yyyy

                                        Use in Sent Items Folder 

sent:<=mm/dd/yyyy

                                    from:username@google.com from:username2@google.com ...


 

 

Wednesday, February 19, 2025

How to check or change the minimum password length in Windows

On Widows the max password length can be 127 long. I recommend the length of the current year 2025, a min password length of 25 characters long. 

  1. Open the command prompt as an Administrator. 

  2. To view the current minimum password length, enter the command 

    net accounts 



















  3. To set a minimum password length, enter the command

    net accounts /minpwlen:n

    Range is 0-14, this has not change in Windows 11. National Institute of Standards and Technology recommends a minimum password length from 8 to 14 characters. 




















More uses 

  • net accounts /MAXPWAGE:UNLIMITED - do not expire password

  1. net accounts /maxpwage:days – This sets the maximum number of days after which the user will have to change the password. Replace days with the desired value. Range is from 1-999. If used unlimited, no limit is set. The value of maxpwage should always be greater than minpwage.

  2. net accounts /minpwage:days – This sets the minimum number of days that must pass before the password can be changed. Replace days with the desired value. Range is from 1-999.

  3. net accounts /uniquepw:number – This sets the number of times after which a password can be used again. Replace number with the desired value. Maximum value is 24.















Tuesday, February 18, 2025

Online Data Range picker for Outlook.com and Outlook client


Online Data Range picker for Outlook client 

Date Range Picker Outlook Client mainly, and mimics the one on outlook.com


Buy Me A Coffee