The Internet & Search Engines – What a Blessing

This Morning’s Question

It is 6:00AM PST in California on a Sunday. I think to myself, “I wonder if Time and Gravity are related in any way”.

Without Hesitation or Thinking Twice

Steps Taken

  • I open Firefox
  • Enter “time gravity rel” in the Google search box
  • Choose the suggestion: “time gravity relationship”
  • Choose the 2nd entry in the search result: “Gravity’s effect on time confirmed – physicsworld.com”
  • Read this EASY for me to UNDERSTAND article written in 2010 by Edwin Cartlidge, a science writer based in Rome

Overcome by the Blessing

I had to write this blurb in praise of:
– the Lord and
– Her children here on earth
– The Internet, a manifestation of Teilhard de Chardin’s concept of a Universal Connection of Human Consciousness
– Search Engines – Google, et al.

Love and peace,
Joe

My WordPress Markdown

WordPress Markdown Links

  1. WordPress.com’s Markdown Extra and Markdown on WordPress.com
  2. WordPress.com’s Writing & Editing Markdown quick reference
  3. WordPress.com’s Slightly Modified Markdown Version is Markdown Extra
  4. Markdown Syntax
  5. WordPress.com’s Posting Source Code
  6. My Posting Source Code on WordPress
  7. WordPress.com’s Writing & Editing Markdown
  8. Write (More) Effortlessly With Markdown by Matt Wiebe
  9. N.B. Can’t upload zip files into free hosted WordPress.com blogs.
  10. Change a Post’s Date

My Markdown

## Source Code i am confused 
re NOT html encodding quotes and angle brackets 
sometimes backticks work 
sometimes shortcodes work
see this post below & 
https://joecodeswell.wordpress.com/2016/12/03/python-code-creates-a-database-from-csv/

both SOMETIMES work & SOMETIMES FAIL
3 backticks(quotes and angle brackets get html encoded)
backtick backtick backtick python
if a < 'B': print("happy")
BLA BLA BLA
backtick backtick backtick


USE A SHORTCODE

if a < 'B': print("happy")
BLA BLA BLA
[/code ]

## Publishing Rules

- I'll use "- " Item     for UNordered lists
- I'll use "1. " Item    for Orderded lists
- I'll use Definition Lists:

Apple
:   Pomaceous fruit of plants of the genus Malus in 
    the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

- **In all source code Markdown**, I'll replace "" with "", because "" DISAPPEARS when MD is rendered
- I’ll publish in the Text Editor NOT the Visual Editor
- For Main Headings: Header 2 == ## SPACE Item
- For Links I'll use [Kathleen Battle](http://en.wikipedia.org/wiki/Kathleen_Battle "Kathleen Battle")
- For Anchored Main Headings: ## SPACE Item { # item}    N.B. "}" must be at EOL.
- For Links to Anchors: [Item ](# item)
- For Sub Headings: Bold == **Item**

To add an image
:    I'll place the cursor in the Text Tab and click on the Add Media Button way at the top of the edit page.

For posting code
:    I'll choose from these code types: actionscript3, bash, clojure, coldfusion, cpp, csharp, css, delphi, erlang, fsharp, diff, groovy, html, javascript, java, javafx, matlab (keywords only), objc, perl, php, text, powershell, python, r, ruby, scala, sql, vb, xml .


Code under a Numbered List Item
:    See Example Below:

Get started with PySparkling Steps 

1. Download Spark
  1.1 DONE
2. Point SPARK_HOME to the existing installation of Spark and export variable MASTER.

    backtick backtick backtick bash
    >echo %SPARK_HOME%
    ...\Downloads\ApacheSpark\spark-1.6.2-bin-hadoop2.6

    >echo %MASTER%
    local-cluster[3,2,1024]

    >
    backtick backtick backtick

3. 


Block Quote

> Nice post and great question Joe.

> Spot checking is to discover which algorithms look good on one given dataset. Not across datasets.

> You may need to group algorithms by their expectations then prepare data for each group.

> Most machine learning algorithms expect data to have numeric input values and an integer encoded or one hot encoded output value for classification. This is a good normalized view of a dataset to construct.

> Here’s a tutorial that shows how to spot check 7 machine learning algorithms on one problem in Python, [Spot-Check Regression Machine Learning Algorithms in Python with scikit-learn](http://machinelearningmastery.com/spot-check-regression-machine-learning-algorithms-python-scikit-learn/).

Let’s see how the above renders

Source Code

backticks

if a < 'B': print("happy")
BLA BLA BLA

shortcode

if a echo %SPARK_HOME%
…\Downloads\ApacheSpark\spark-1.6.2-bin-hadoop2.6

&gt;echo %MASTER%
local-cluster[3,2,1024]

&gt;
```
  1. Item Three

Block Quote

Nice post and great question Joe.

Spot checking is to discover which algorithms look good on one given dataset. Not across datasets.

You may need to group algorithms by their expectations then prepare data for each group.

Most machine learning algorithms expect data to have numeric input values and an integer encoded or one hot encoded output value for classification. This is a good normalized view of a dataset to construct.

Here’s a tutorial that shows how to spot check 7 machine learning algorithms on one problem in Python, Spot-Check Regression Machine Learning Algorithms in Python with scikit-learn.

My First Markdown Post

Conversion to Markdown Progress
Next TODO: My Python Idioms
Posting in Markdown Result Summary
I LIKE IT 🙂
WordPress uses Markdown Extra
See “Here’s the Source” below.
N.B. In the source Backtick stands for `
My Rules

  • I’ll publish in the Text Editor NOT the Visual Editor
  • For Main Headings I’ll use: Header 2 == HASH HASH item
  • For Sub Headings: Bold == STAR STAR item STAR STAR
  • For Anchored Main Headings: HASH HASH Item LBRACE HASH item RBRACE
  • For links to Anchors: LSQBRACKET Modules LSQBRACKET (HASH modules)

Sample Python Code Snippet

#!/usr/local/bin/python2.7
r"""
search.py recursively searches searchPath for the fileNamePattern Producing a listing of matching paths 

Usage:   search.py  searchPath                           fileNamePattern
Example: search.py  C:\1d\PeacebookPj\Peacebook-env\     templates
"""
import glob
import sys
import os
import fnmatch

def main(argv=None):
  N_ARGS = 2
  if argv == None: argv=sys.argv
  args = argv[1:]  
  if len(args) != N_ARGS or "-h" in args or "--help" in args:
    print __doc__
    sys.exit(2)
  searchPath = args[0]; fileNamePattern = args[1]

  #see fred lundh http://mail.python.org/pipermail/python-list/2001-February/069987.html & GlobDirectoryWalker below
  for file in GlobDirectoryWalker(searchPath, fileNamePattern):
    print (file)


class GlobDirectoryWalker:
  # a forward iterator that traverses a directory tree

  def __init__(self, directory, pattern="*"):
    self.stack = [directory]
    self.pattern = pattern
    self.files = []
    self.index = 0

  def __getitem__(self, index):
    while 1:
      try:
        file = self.files[self.index]
        self.index = self.index + 1
      except IndexError:
        # pop next directory from stack
        self.directory = self.stack.pop()
        self.files = os.listdir(self.directory)
        self.index = 0
      else:
        # got a filename
        fullname = os.path.join(self.directory, file)
        if os.path.isdir(fullname) and not os.path.islink(fullname):
          self.stack.append(fullname)
        if fnmatch.fnmatch(file, self.pattern):
            return fullname


if __name__ == '__main__':
  sys.exit(main())

OK. Let’s see how it all looks. I hit Publish.

Here’s the Source
N.B. Backtick stands for `

**My Rules**
* I'll publish in the Text Editor NOT the Visual Editor
* I'll use only bold for headings
**Sample Python Code Snippet**
Backtick Backtick Backtick python
#!/usr/local/bin/python2.7
r"""
search.py recursively searches searchPath for the fileNamePattern Producing a listing of matching paths 

Usage:   search.py  searchPath                           fileNamePattern
Example: search.py  C:\1d\PeacebookPj\Peacebook-env\     templates
"""
import glob
import sys
import os
import fnmatch

def main(argv=None):
  N_ARGS = 2
  if argv == None: argv=sys.argv
  args = argv[1:]  
  if len(args) != N_ARGS or "-h" in args or "--help" in args:
    print __doc__
    sys.exit(2)
  searchPath = args[0]; fileNamePattern = args[1]

  #see fred lundh http://mail.python.org/pipermail/python-list/2001-February/069987.html & GlobDirectoryWalker below
  for file in GlobDirectoryWalker(searchPath, fileNamePattern):
    print (file)


class GlobDirectoryWalker:
  # a forward iterator that traverses a directory tree

  def __init__(self, directory, pattern="*"):
    self.stack = [directory]
    self.pattern = pattern
    self.files = []
    self.index = 0

  def __getitem__(self, index):
    while 1:
      try:
        file = self.files[self.index]
        self.index = self.index + 1
      except IndexError:
        # pop next directory from stack
        self.directory = self.stack.pop()
        self.files = os.listdir(self.directory)
        self.index = 0
      else:
        # got a filename
        fullname = os.path.join(self.directory, file)
        if os.path.isdir(fullname) and not os.path.islink(fullname):
          self.stack.append(fullname)
        if fnmatch.fnmatch(file, self.pattern):
            return fullname


if __name__ == '__main__':
  sys.exit(main())
Backtick Backtick Backtick 

OK. Let's see how it all looks. I hit Publish.

Converting to Markdown Publishing

Background
I stumbled upon Matt Wiebe’s post Write (More) Effortlessly With Markdown and his referenced post, Posting Source Code

I need to do something to simplify my post formatting. Leaving this stuff to my “artistic sensibilities” leads to something i have trouble reading.

I also need to make it easier to post code & preformatted text.

Solution
After this post:

  • I will publish with Markdown and keep the formatting to a minimum.
  • I will convert all my posts and pages to Markdown starting with the oldest posts first, then the pages.

WordPress for Programmers & My New Theme

Overall

WordPress for Programmers & Coders: Advice, Themes & Plugins.

Themes

google:  best free wordpress themes for programmer

webdesignerdepot

Now I use: “Silver is the New Black” – Silver is the New Black. Howdy! This theme, Silver is the New Black, is now retired.

I am going to try these until i get one i like. But first

google how to backup my wordpress.com blog

I am now doing Download your content

I Choose the New Theme

[copied from my notes in MS Word]:

webdesignerdepot

·         OneColumn

·         White Paper

·         WP Jurist

·         Best Theme

None of the above show up for free in wordpress.com

I try

·        TRVL – it’s OK [too dark, nice and wide & big]

·        Truly Minimal – seems better than TRVL – I like it – my pic shows up – Python Notes page might be a bit goofy ala code – kind of OK

·        Ryu – TOO BIG – NO MAYBE

·        Superhero – not bad – goofy black bar follows down NG!– Truly Minimal is better

·        Responsive – Feature-full theme with numerous page layouts, widget areas, custom menu areas, breadcrumb naviagtion, a homepage template, social icons, and responsive CSS. PRETTY GOOD

·        Forever – I am using this in the web2py book – not for here

·        White as Milk – NO GOOD

·        Sapphire – bad paragraph spacing like my present theme

·

between Responsive & Truly Minimal

Responsive – looks confused with my formatting

Truly Minimal – looks less confused with my formatting

I choose Truly Minimal

Result – Better than a jab in the eye with a sharp stick. The pages aren’t compact enough top to bottom.

How 2 Create a Python NWC User Tool

Preamble

Read Introduction to User Tool Development. Summary:

  • NWC Staff Clip input to your tool is from STDIN.
  • Main Output back to NWC Staff is to STDOUT.
  • User Interaction via “PROMPT” command line arguments used when calling your tool.

Create your Python Module

Make a Python script to do something to a NoteWorthy Composer clip. Here is a simple example. It copies the NWC clip into a file.

import sys
instr = sys.stdin.read()
f = open('joesFirstTestOut.txt', 'w'); f.write(instr); f.close()

Hook Up your Python Module with NWC

1. Copy your module to:
<path>\Program Files\NoteWorthy Composer 2\Scripts\
2. Hook up NWC to your module
2.1 In NWC Click Menu >> Tools >> User Tools
2.2 In User Tools dialog click "New" button
2.3 In User Tool Description dialog enter:

Group: joe                               <or whatever>
Name: joesFirst.py                       <or whatever>
Command: python scripts\joesFirst.py     <or python scripts\whatever>
Input Type: clip text
Options: 
    compress input:         [ ]
    returns file text:      [ ]
    long task handling:     [ ]
    prompts for user input: [ ]
2.4 In User Tool Description dialog click "OK" button
2.5 In User Tools dialog click "Close" button

Run your Python Module

2.1 In NWC select the staff for which you want the clip
2.2 In NWC Click Menu >> Tools >> User Tools
2.3 In User Tools dialog select your group & command
2.4 In User Tools dialog click "Run" button

N.B. For the example module, the file named 'joesFirstTestOut.txt' 
will appear:
    NOT IN <path>\Program Files\NoteWorthy Composer 2\Scripts\
    BUT IN <path>\Program Files\NoteWorthy Composer 2\Scripts\

For More Information about NWC2 Scripting

Read also Getting started with NWC2 User Tools