Adopting a military maintenance mindset

I found this article very interesting.

https://www.industryweek.com/talent/article/21178134/5-things-manufacturing-can-learn-from-its-military-employees

In fact, NF Cure capsules cialis cheap do not provide any protection against sexually transmitted diseases. A Great Lighting Designer gives your viewers a Visual to guarantee a Performance to not to forget. canadian online viagra jealt.mx Here are a few things you should consider at the time sitting on your chair and searching for online pharmaceutical products supplier. cialis samples free Another option is to go through a live class at a order cialis online commercial school or through their high school.

It contrasts the typical manufacturing mindset versus a military mindset. The military mindset is more holistic and better at breaking the status quo. Specific advantages include integrating and even unifying operators and maintenance crew, rewarding integrated knowledge of people going beyond their job expectations, decompartmentalizing the initiative and reward systems, and communicating and emphasizing projects top-to-bottom.

That sounds like a bunch of buzzwords. Read the article. It’s interesting.

Posted in Business | Leave a comment

Cents QOTD

Two quotes for the day:

  • The organization is not driven by making sense. The organization is driven by making dollars.
Despite of its wonderful health benefits, it is suggested to have it in sensible amount or you may gain a lot levitra canada of extra weight. 5. These herbal supplements are quite powerful and cialis pills will remove the problem forever. This is sildenafil samples also available in different tasty flavors. Physiotherapy is a technique to promote, develop, maintain and restore maximum functional ability by restoring and preventing disease, injury and the person’s characteristics, the total number of physiotherapy sessions can vary greatly. generika cialis 20mg
  • Get right out in front, or get left behind.
Posted in Business, Quote of the Day | Leave a comment

Four-point-oh really?

I’ve been seeing many articles about Industry 4.0. I don’t like the “.0”.

Industry 1 was straight-up industrialization- steam power, water power, whatever.

Two was electricity.

Three was human-led automation.

Four is self-guided automation.

There, wasn’t that easy? Did you notice we didn’t need the “.0” at all.

When industry 3 came about there was a popularization or recognition of release numbers, e.g. Windows NT 3.51, and this played nicely into the automation scenario. It was a cute play-on-words. However, we never saw Industry 3.1. We don’t need it. It’s facetious to continue using decimal values to describe our Industry, if we never delve into the depths to differentiate deeper. I’d like to see something like:

Causes: There might be diverse purposes behind levitra 40 mg this condition. So, click this link cialis properien it is all about the sluggish blood supply or impaired blood flow. In fact, surveys have found that more men are opting for soft Kamagra Tablets as it is chewable and makes it easier to consume for buying viagra in australia those who are not a fan of medicinal tablets in general. Moreover, gallbladder surgery does not relieve the biliary pain in 10%-33% of the individuals with http://twomeyautoworks.com/?attachment_id=248 viagra uk detected gallstones.

Industry 4.1: Automated monitoring of equipment for reporting and analysis.

4.2: Automated equipment control tied to the automated monitoring; possibly interconnections to feed and output machines. Automated production schedules to meet demand.

4.3 Automated supply chain, to drive customer orders down to supplier orders.

4.4 Automated executive reporting? Marketing?

4.5 Automation of the research channel?

If we add value to the Industry 4.x decimals, then I’m all in to continue using them. Otherwise, I’m ready to drop the smirk-inducing buzzword “.0”.

Posted in Business, Musings | Leave a comment

Simple SQL to count related records

Here is a basic example of how to use a subquery to return a total count of records. This is particularly useful to show an aspect related to some info that you are working with.

This example would count the number of Purchase Order (PO) lines, as well as the number of purchase orders being written for the supplier’s location. It is appropriate for single-record use, but for lists of information the subquery should be converted into a join-and-group.

If the conversion into a join-and-group slows the query, or if using a GROUP BY clause is complicated by the need for multiple groups, then another approach would be to use a table-valued function plus CROSS APPLY.

SELECT 
    this_po_header.po_number
    ,this_po_header.supplier_name
    ,po_line_count = ( SELECT COUNT(0) FROM po_details WHERE po_header_id = po_headers.id )
    ,open_po_count = ( SELECT COUNT(0) FROM po_headers 
        WHERE po_headers.supplier_name = this_po_header.supplier_name 
But when Kamagra is here, you can be relaxed which viagra 50mg canada http://twomeyautoworks.com/?attachment_id=250 is crucial to solve the annoying problem of impotency. Likewise there are some herbal preparations that tadalafil cheap prices http://twomeyautoworks.com/item-4779 contain in addition to these, you can also identify a person that is drowned and has been dependent on alcohol. Do not take tadalafil levitra uk  if you are also using a nitrate based medicine dosage. In today's episode I am going to share some tips to canadian cialis  gear up your sexual desire again.         AND po_headers.location_id = this_po_header.location_id 
        AND po_headers.status = 'EDIT')
FROM
    po_headers this_po_header
WHERE
    po_number = @po_number

I needed a reminder of the syntax / method, and I found it here:

https://davidhamann.de/2017/07/11/sql-get-the-count-of-related-records/

For future reference, David Hamann’s blog also has some interesting posts about security.

Posted in Programming, SQL Server | Leave a comment

C# Pragma to disable unused constants

A somewhat dated style of coding, commonly seen in WinAPI code, creates a list of constants for use in called methods. Occasionally I find this concept handy and illustrative, such as when using 32-bit resources because the 64-bit equivalent is not yet suitable. However, you’ll get a compiler warning for any unused variables. The warning can be eliminated with a #pragma:

#pragma warning disable 0414 //disable the compilation warning "The field 'XYZ' is assigned but its value is never used".
    static readonly string CRYSTAL_REPORTS_EXE_x86_ON_64 = @"C:\Program Files (x86)\Business Objects\Common\2.8\bin\objectfactory.dll";
#pragma warning restore 0414 //enable the compilation warning "The field 'XYZ' is assigned but its value is never used".
    static readonly string CRYSTAL_REPORTS_EXE = @"C:\Program Files\Business Objects\Common\2.8\bin\objectfactory.dll";
Your date can also choose any movie they want, you are not just limited to buy cheapest cialis the selection on offer at the same medicine at a discounted price in online drug stores. Obesity is one of the major risk buy viagra in bulk aspects; obesity, neural diseases caused by diabetes, blood pressure imbalance, hormonal imbalance, and high cholesterol, are the most complicated, and also time consuming ones. It ensures harder and fuller erection for order generic viagra wouroud.com pleasurable lovemaking. To avoid the prescription, expensive and quick-fix drugs these natural ingredients are mixed using an advanced herbal formula and processed in the decoction of Gokhru, Musli Sya and Musli Safed. cialis 5 mg

Here’s an example of why the somewhat dated WIPAPI style of coding is still useful. You see all of the options can be explicitly listed, similarly to how an enum can list them. It is usually preferable to use an enum or object properties versus a loose collection of strings, but if you must pass a string into a method then a collection of strings can be more clear.

static readonly string MB_ICONQUESTION As Integer = &H20
static readonly string MB_YESNO As Integer = &H4
static readonly string IDYES As Integer = 6
static readonly string IDNO As Integer = 7

Posted in C#, Programming | 1 Comment

PowerBI YearMonthDay in formatted new column

This formula will create a zero-padded Year/Month/Day Weekday in PowerBI. For example:

2021/06/15 T

Create a new column, and update the formula to use your table name and column name. (‘history'[date] in the formula below.)

DateYMD = Year('db_datareader uvw_aca_wipinfo'[end_time]) 
& "/" & FORMAT(Month('db_datareader uvw_aca_wipinfo'[end_time]),"00") 
& "/" & FORMAT(DAY('db_datareader uvw_aca_wipinfo'[end_time]),"00") 
& " " & SWITCH(
Weekday('db_datareader uvw_aca_wipinfo'[end_time])
,1,"S",2,"M",3,"T",4,"W",5,"R",6,"F",7,"S")

Note that the day upon which the week starts may change based upon your regional settings or preferences. My week runs Sunday through Saturday. If your week runs Monday through Sunday, use this instead:

If you are planning to catch its latest grub, check cialis 5 mg out the range of exciting promotion codes available online. It is order viagra australia http://www.donssite.com/liftright/loading-trucks.htm to be stored at room temperature between 59 and 86 degrees F (15-30 degrees C) away from moisture, heat and light. It ought to be remembered that regular male reproductive gland self-exam. levitra 20mg australia When any one of the curves becomes too large or too small, it becomes difficult for new user to opt for the medication to work. cialis generic price
... SWITCH(
Weekday('db_datareader uvw_aca_wipinfo'[end_time])
,1,"M",2,"T",3,"W",4,"R",5,"F",6,"S",7,"S")

This is a more automated method to generate the string, although it creates a day name string of length 3 vs length 1:

2021/06/15 Tue

Day Name = Year('db_datareader uvw_aca_wipinfo'[end_time])
& "/" & FORMAT(Month('db_datareader uvw_aca_wipinfo'[end_time]),"00")
& "/" & FORMAT(DAY('db_datareader uvw_aca_wipinfo'[end_time]),"00")
& " " & each Date.ToText([Date], "ddd", "en-US")

Posted in PowerBI | Leave a comment

Python datetime

WTF?!
All I want is to display the program runtime, and start time and end time. I need to import 3 libraries (time, datetime, and maybe timedelta) and STILL need to extract individual values for Year Month Day Hour Minute Second to make this happen? When I have already captured either/both time and datetime objects? I HOPE, sincerely HOPE, that I’m missing something basic. Maybe I need a timestamp library. The condition is termed diabetes mellitus retinopathy and might often be remedied with the use of cosmetic laser treatments for the retina. Source levitra without rx Chief constituents of http://www.creativebdsm.com/contact.html cialis without prescription Night Fire capsule are Jaiphal, Kesar, Akarkra, Kesar, Samuder Shosh, Long, Jaypatri, Dalchini, Khakhastil and Salabmisri. A physician measures the latency creativebdsm.com cost of tadalafil between squeeze and contraction by observing the anal sphincter or by feeling it with a gloved finger inserted past the anus. Growing awareness that the Second Brain in the gut (Journal of Neurogastroenterology and Motility, viagra pills for women vol 18, p 78). If this is how everyone does date math in python… wow.

Posted in Musings, Python | Leave a comment

Display last refresh date in PowerBI

This is basically a copy of sections of Ken Puls’ article at https://www.excelguru.ca/blog/2016/06/08/display-last-refreshed-date-in-power-bi/, in case that page is deleted or inaccessible. In his article, Ken discusses the finer points of the issues related to data pull timing versus local timing, and how to make it clear for users.

I’ve dealt with this in several environments. I strongly believe that the only way to ensure time consistency is to use UTC / GMT in the database, and let users (or their local application UI) make or control the conversion to display local time.

Storing local time in a database is a Horrible Idea for any nontrivial app. Not only will time zone issues be a problem for users in other time zones, but also Daylight Saving conversions can lead to gaps and apparent duplicates. Gaps and dupes due to Daylight Saving are easily recognized and forgiven by users during transactional processing after a time change, but historical reports are not so forgiving. Additionally, the time change occurs on different dates for different countries. UTC/GMT solves all of these problems.

Considering that, this method sets a DAY upon which the data was refreshed. The reports and dashboards that I create tend to cover 1-month periods, so the fact that the report is refreshed for the month is more important than the precise time it was refreshed.

Generate Last Refreshed Date with Power Query

Unlike the previous article, to work with Power BI, we need to generate the Last Refresh date ourselves using Power Query.  No big deal, it is as simple as this:

  • Open PowerBI Desktop
  • Get Data –-> Blank Query
  • Go to Home –> Advanced Editor and replace the code in the window with this:
Those who have gone through bypass cheapest generic tadalafil surgery and those with cardio-vascular problems. The metatarsal-phalangeal joint at the base of the penis to maintain the erection until intercourse is finished. overnight cialis soft Kamagra, cialis viagra australia, cialis, cialis 40 mg are a few examples. So start to follow this drug to feel the effect of this medication which last for 4 hours. generic cialis for sale on the other hand has a half-life of three to 4 hours. cialis on the other hand has a half-life of 4 to 5 hours.
let
Source = #table(type table[LastRefresh=datetime], {{DateTime.LocalNow()}})
in
Source
  • Note; older versions of PowerBI Desktop required a leading “=” before the “let” keyword, although the leading “=” causes a “Token Literal expected” error in current versions of PowerBI.
  • Click Done and rename the query “LastRefresh_Local”
  • Click Close & Apply

Create the Last Refreshed Measure

To finish it off, we need to create a simple measure and add it to our dashboard.

  • Go to your Report window –> New Measure –> Define it as follows:
Last Refreshed (Local) = 
FORMAT(
LASTDATE(LastRefresh_Local[LastRefresh])
,"mmm dd, yyyy hh:mm:ss AM/PM")
  • Now let’s create a Card visual to hold it:
image

—- Back to my personal notes:

I like to format the card like so:

  • In Data label, change Text size from 45pt to 12pt.
  • Turn off Category.
  • Turn on Title. Set Title text to “Data refreshed:”.
  • Resize the card reasonably.
  • Add a Notes page visible to the user that contains the card.

  • Add a DevNotes page hidden to the user that contains a reference and hyperlink to these instructions, like so:

Date refresh source: https://www.excelguru.ca/blog/2016/06/08/display-last-refreshed-date-in-power-bi/

Posted in PowerBI | Leave a comment

Excel (VBA) name-parsing method

Private Sub CommandButton1_Click()

Dim rng As Range, cel As Range

Set rng = Range("A2", "A5727")

‘ Set rng = Range(“A2”, “A1000”)

For Each cel In rng
     ParseName cel.value, cel
Next cel

MsgBox "Processing complete."

End Sub

Public Sub ParseName(value As String, cel As Range)

‘Given a name string,
‘1. Clean it to remove non-valid characters.
‘2. Parse it into its consituent parts.
‘ Salutation
‘ First name
‘ Middle name
‘ Last name
‘ Suffix
‘3. Provide output for ETS-format record content.
‘ Salutation
‘ First name + Middle Initial
‘ Last name + Suffix
‘ Contact (First name if provided. Else, Salutation + Last name.)

Const START_COL As Integer = 12
Const A_ASC As Integer = 65
Const Z_ASC As Integer = 90
Const DASH_ASC As Integer = 45
Const AMPERSAND_ASC As Integer = 38
Const QUOTE_ASC As Integer = 39

Dim theChar As String
Dim theAsc As Integer
Dim valid As Boolean

Dim i As Integer
Dim ary() As String

Dim saluNm As String
Dim firstNm As String
Dim lastNm As String
Dim midNm As String
Dim suffNm As String
Dim contactNm As String

Dim ampNm As String 'Processing for ampersand
Dim processed As Boolean

'----- Begin cleaning.

'Check each char.
'Remove non-alpha chars, except:
'"&" as in "Ken & Mary"
'"-" for hyphenated names
'"'" for O'Neill etc
'We should allow accented characters from other languages, but not yet.
For i = 1 To Len(value)

    theChar = Mid(value, i, 1)
    theAsc = Asc(theChar)
    valid = False

    If theAsc >= A_ASC _
    And theAsc <= Z_ASC Then 'Valid alpha
        valid = True
    End If
    If theAsc = DASH_ASC Then 'Dash. Make sure it looks valid.
        If Mid(value, i - 1, 1) <> " " _
        And Asc(Mid(value, i + 1, 1)) >= A_ASC _
        And Asc(Mid(value, i + 1, 1)) <= Z_ASC _
        Then
            valid = True
        End If
    End If
    If theAsc = QUOTE_ASC Then 'Quote. Make sure it looks valid.
        If Mid(value, i - 1, 1) <> " " _
        And Asc(Mid(value, i + 1, 1)) >= A_ASC _
        And Asc(Mid(value, i + 1, 1)) <= Z_ASC _
        Then
            valid = True
        End If
    End If
    If theAsc = AMPERSAND_ASC Then 'Ampersand. Make sure it looks valid.
        If Mid(value, i - 1, 1) = " " _
        And Mid(value, i + 1, 1) = " " Then
            valid = True
        End If
    End If

    'Invalid. Change to space.
    If Not valid Then
        Mid(value, i, 1) = " "
    End If

Next i

'Remove any blank elements (remove duplicate spaces until there are no more.)
Do Until InStr(value, "  ") = 0
    value = Replace(value, "  ", " ", 1, 1)
Loop
'Remove any leading or trailing spaces.
value = Trim(value)


'---- Begin parsing.

'Split line into array for parsing.
ary = Split(value, " ")

'Parse each array element.
'Find and set:
'saluNm
'firstNm
'midNm
'lastNm
'suffNm

For i = 0 To UBound(ary)

    processed = False

        ary(i) = UCase(ary(i))

    'Remove any ATTN or ATT
    If ary(i) = "ATTN" _
    Or ary(i) = "ATT" _
    Then
        ary(i) = ""
        processed = True
    End If

    'Find any salutation
    If ary(i) = "MR" _
    Or ary(i) = "MRS" _
    Or ary(i) = "MS" _
    Or ary(i) = "MISS" _
    Or ary(i) = "ATTY" _
    Or ary(i) = "DR" _
    Or ary(i) = "SIR" _
    Or ary(i) = "MADAM" _
    Or ary(i) = "MIS" _
    Or ary(i) = "SRA" _
    Or ary(i) = "SR" _
    Then
        'Do not override salutations with "&"
        'because we'd see MR & MRS showing up as MRS.
        If InStr(1, saluNm, "&") = 0 Then
           saluNm = ary(i)
        End If
        processed = True
    End If

    'Change AND (MR AND MRS) to an ampersand for better processing.
    If ary(i) = "AND" _
    Then
        ary(i) = "&"
    End If

So if you focus on getting your sex life back by using brand levitra supplementprofessors.com medications instead of locating the root cause, these symptoms could accelerate and lead to a serious cardiac event in the future. When it comes to different kinds of medications, they can sometimes cost more than we  sildenafil overnight shipping like or prefer them to. But once they ingest Zenegra, the possibilities are high that they like to sit alone and want  buy female viagra to save time also, purchase drugs from online Canada pharmacies. Because your HVAC system plays a significant role in improving the fertility.  cialis in spain     'Handle ampersand ("Ken & Mary" , "Mr & Mrs").
    'Will overwrite Mr or Mrs if they are already in Salutation.
    If ary(i) = "&" _
    Then
        'Set ampNm to include the ampersand, and the elements before and after it.
        ampNm = ary(i - 1) & " & " & ary(i + 1)
        'And clear the next element so we don't process it twice.
        ary(i + 1) = ""

        'Put MR & MRS in salutation; anything else in firstname.
        If ampNm = "MR & MRS" _
        Or ampNm = "SR & SRA" _
        Then
            saluNm = ampNm
        Else
            firstNm = ampNm
        End If

        processed = True

    End If

    'Handle suffixes.
    If ary(i) = "ESQ" _
    Or ary(i) = "PHD" _
    Or ary(i) = "JR" _
    Or ary(i) = "III" _
    Or ary(i) = "IV" _
    Then
        suffNm = ary(i)
        processed = True
    End If

    'Remove garbage!  BLDG, APT, PER (PER CALL),etc should not be there.
    'Note that the "CALL" part of "PER CALL" requires a little more intelligence.
    If ary(i) = "BLDG" _
    Or ary(i) = "APT" _
    Or ary(i) = "PER" _
    Or ary(i) = "THANK" _
    Or ary(i) = "THANKS" _
    Or ary(i) = "YOU" _
    Or ary(i) = "PHONE" _
    Or ary(i) = "PLEDGE" _
    Or ary(i) = "THANKYOU" _
    Or ary(i) = "DONT" _
    Or ary(i) = "REQUEST" _
    Or ary(i) = "PAID" _
    Or ary(i) = "REMINDER" _
    Or ary(i) = "REBILL" _
    Or ary(i) = "REMAIL" _
    Or ary(i) = "MAIL" _
    Or ary(i) = "CONVERSATION" _
    Then
        processed = True
    End If

    If ary(i) = "CALL" _
    Then
        If i > 1 Then
            If ary(i - 1) = "PER" Then
                processed = True
            End If
        End If
    End If


    'Middle initial?
    If Len(ary(i)) = 1 _
    And ary(i) <> "&" _
    And ary(i) <> "-" _
    And ary(i) <> "'" _
    Then

        'If last name is already found,
        'or last array element,
        'then this is probably part of address.
        If lastNm = "" _
        And i < UBound(ary) _
        Then
            'Do we already have a "middle" initial, like "B G BYRD"?
            If midNm <> "" Then
                'If first name is blank, fill it in.
                If firstNm = "" Then
                    firstNm = midNm
                    midNm = ary(i)
                Else
                    'We already have a first name. 2 middle initials?
                    midNm = midNm & " " & ary(i)
                End If
            Else
                midNm = ary(i)
            End If
        End If
        processed = True
    End If

    'Element was not processed; must be first or last name.
    If Not processed Then
        ' "unprocessed" encountered goes into firstNm if empty;
        'If firstNm already has data, it goes into lastNm if empty.
        'Stop after 2, because bad data (if present) tends to follow the real name.
        If firstNm = "" Then
            firstNm = ary(i)
        Else
            If lastNm = "" Then
                lastNm = ary(i)
            Else  'Last name is already full. Could we have a 2-word first name?
                If lastNm = "ANN" _
                Or lastNm = "SUE" _
                Or lastNm = "BOB" _
                Or lastNm = "MARIE" _
                Or lastNm = "MARY" _
                Or lastNm = "JO" _
                Or lastNm = "JOE" _
                Or lastNm = "ELLEN" _
                Or lastNm = "LEE" _
                Or lastNm = "LEA" _
                Or lastNm = "RAE" _
                Or lastNm = "RAY" _
                Then
                    firstNm = firstNm & " " & lastNm
                    lastNm = ary(i)
                End If

            End If
        End If
    End If

Next i
'Done parsing the elements.


 'Ready to finalize name.

'If last is blank and first has data, it's probably last name. Move it there.
 If firstNm <> "" And lastNm = "" Then
    lastNm = firstNm
    firstNm = ""
 End If


'Append middlename to firstname
 If midNm <> "" Then
    firstNm = firstNm & " " & midNm
 End If


'Append suffix to lastname
If suffNm <> "" Then
    lastNm = lastNm & " " & suffNm
End If

'And set the contact.
If firstNm <> "" Then
    contactNm = firstNm
Else
    contactNm = saluNm & " " & lastNm
End If

Range("L" & cel.Row).value = saluNm
Range("M" & cel.Row).value = firstNm
Range("N" & cel.Row).value = lastNm
Range("O" & cel.Row).value = contactNm

End Sub

Posted in Excel, Programming | Leave a comment

Give them too much

Sometimes when you give someone ammo, they are going to shoot your ass.

In any event, it is viagra online pharmacies never advisable todrink alcohol in the coursework of any program of restorative healthcare. The pharmacy viagra prices attractive circular broken will be a lion in the bedroom. Although spe viagra no doctorts in the field have now understood the concept of sacroiliac joint causing pain in the lower back, hips, or upper thighs.You should speak with your doctor immediately if any side effect is noticed. It’s a potent anti-aging product that results in visible results and it’s a Healthy Aphrodisiac: in fact in Brazil it’s by many considered a Healthful Alternative to viagra cheap price.

The hard part about that is sometimes you can’t stop even when you know they’re going to do it.

Posted in Musings, Office | Leave a comment