web2py genericIndexJoe.html & layoutJoe.html

genericIndexJoe.html

{{extend 'layoutJoe.html'}}
{{response.menu}} {{# uncommented, makes the menu appear }}
{{ #=BEAUTIFY(response._vars) }}
{{ =response._vars['message'] }}

layoutJoe.html

<!DOCTYPE html>
<!-- copied from ordersarrive >> layoutJoe.html which may be crappy -->

<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="{{=T.accepted_language or 'en'}}"> <!--<![endif]-->
  <head>
    <meta charset="utf-8">
    <!-- www.phpied.com/conditional-comments-block-downloads/ -->
    <!-- Always force latest IE rendering engine
         (even in intranet) & Chrome Frame
         Remove this if you use the .htaccess -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge{{=not request.is_local and ',chrome=1' or ''}}">
    <!--  Mobile Viewport Fix
          j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
          device-width: Occupy full width of the screen in its current orientation
          initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
          user-scalable = yes allows the user to zoom in -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{=response.title or request.application}}</title>
    <!-- http://dev.w3.org/html5/markup/meta.name.html -->
    <meta name="application-name" content="{{=request.application}}">
    <!-- Speaking of Google, don't forget to set your site up:
         http://google.com/webmasters -->
    <meta name="google-site-verification" content="">
    <!-- include stylesheets -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="{{=URL('static','css/bootstrap.min.css')}}"/>
    <link rel="stylesheet" href="{{=URL('static','css/web2py-bootstrap4.css')}}"/>
    <link rel="shortcut icon" href="{{=URL('static','images/favicon.ico')}}" type="image/x-icon">
    <link rel="apple-touch-icon" href="{{=URL('static','images/favicon.png')}}">
    <!-- All JavaScript at the bottom, except for Modernizr which enables
         HTML5 elements & feature detects -->
    <a href="http://=URL('static','js/modernizr-2.8.3.min.js')">http://=URL('static','js/modernizr-2.8.3.min.js')</a>
    <!-- Favicons -->
    {{include 'web2py_ajax.html'}} <!-- this includes jquery.js, calendar.js/.css and web2py.js -->
    {{block head}}{{end}}
  </head>
  <body>
    <div class="w2p_flash alert alert-dismissable">{{=response.flash or ''}}</div>
    <!-- Navbar ======================================= -->
    <nav class="navbar navbar-light navbar-expand-md bg-faded bg-dark navbar-dark justify-content-center">
<!--        <a href="http://web2py.com" class="navbar-brand d-flex w-50 mr-auto">web2py</a> -->
        <a href="http://JoeCodeswell.com" class="navbar-brand d-flex w-50 mr-auto">JoeCodeswell.com</a> 
       <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
         <span class="navbar-toggler-icon"></span>
       </button>
       <div class="navbar-collapse collapse w-100" id="navbarNavDropdown">
         <ul class="navbar-nav w-100 justify-content-center">
          {{for _item in response.menu or []:}}
          {{if len(_item)<4 or not _item[3]:}}
          <li class="nav-item {{if _item[1]:}}active{{pass}}">
            <a class="nav-link" href="{{=_item[2]}}">{{=_item[0]}}</a>
          </li>
          {{else:}}
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="{{=_item[2]}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{=_item[0]}}</a>
            <div class="dropdown-menu">
              {{for _subitem in _item[3]:}}
              <a class="dropdown-item" href="{{=_subitem[2]}}">{{=_subitem[0]}}</a>
              {{pass}}
            </div>
          </li>
          {{pass}}
          {{pass}}
        </ul>
         <form class="form-inline my-2 my-lg-0">
             <input class="form-control mr-sm-2" type="text" placeholder="Search">
         </form>
        {{if 'auth' in globals():}}
        <ul class="nav navbar-nav ml-auto w-100 justify-content-end">
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              {{if auth.user:}}{{=auth.user.first_name}}{{else:}}LOGIN{{pass}}
            </a>
            <div class="dropdown-menu dropdown-menu-right">
              {{if auth.user:}}
              <a class="dropdown-item" href="{{=URL('default','user/profile')}}">{{=T('Profile')}}</a>
              {{if 'change_password' not in auth.settings.actions_disabled:}}
              <a class="dropdown-item" href="{{=URL('default','user/change_password')}}">{{=T('Change Password')}}</a>
              {{pass}}
              <a class="dropdown-item" href="{{=URL('default','user/logout')}}">{{=T('Logout')}}</a>
              {{else:}}
              <a class="dropdown-item" href="{{=URL('default','user/login')}}">{{=T('Login')}}</a>
              {{if 'register' not in auth.settings.actions_disabled:}}
              <a class="dropdown-item" href="{{=URL('default','user/register')}}">{{=T('Sign up')}}</a>
              {{pass}}
              {{if 'retrieve_password' not in auth.settings.actions_disabled:}}
              <a class="dropdown-item" href="{{=URL('default','user/retrieve_password')}}">{{=T('Lost Password')}}</a>
              {{pass}}
              {{pass}}
            </div>
          </li>
        </ul>
        {{pass}}
      </div>
    </nav>

    <!-- Masthead ===================================== -->
    {{block header}}
    {{end}}
    <!-- Main ========================================= -->
    <!-- Begin page content -->
    <div class="container-fluid main-container">
      {{include}}
      {{=response.toolbar() if response.show_toolbar else ''}} 
    </div>

    {{block footer}} <!-- this is default footer -->
    <footer class="footer container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div class="copyright pull-left">{{=T('Copyright ')}} © {{=request.now.year}} Joseph P. Dorocak, Sacramento, CA. All rights reserved.</div>
          <div id="poweredBy" class="pull-right">
            {{=T('Powered by')}}
            <a href="http://www.web2py.com/">web2py</a>
          </div>
        </div>
      </div>
    </footer>
    {{end}}
    <!-- The javascript =============================== -->
    <a href="http://=URL('static','js/bootstrap.bundle.min.js')">http://=URL('static','js/bootstrap.bundle.min.js')</a>
    <a href="http://=URL('static','js/web2py-bootstrap4.js')">http://=URL('static','js/web2py-bootstrap4.js')</a>
    {{block page_js}}{{end page_js}}
    {{if response.google_analytics_id:}}
    <!-- Analytics ==================================== -->
    <a href="http://=URL('static','js/analytics.min.js')">http://=URL('static','js/analytics.min.js')</a>
    <script type="text/javascript">
      analytics.initialize({
      'Google Analytics':{trackingId:'{{=response.google_analytics_id}}'}
      });
    </script>
    {{pass}}
  </body>
</html>





<!-- original stuff below here -->
{{#extend 'layout.html'}}
<!-- <h1>This is the layoutJoe.html template</h1> -->
{{#=BEAUTIFY(response._vars)}}

#markdown, #web2py

web2py Markdown Usage Example

web2py Markdown Usage Example

from gluon.contrib.markdown import WIKI as markdown
def index():
    """ ##
      [see](web2py.com/examples/static/sphinx/gluon/gluon.contrib.markdown.html)
      [Markdown see](https://groups.google.com/g/web2py/c/om9aXi3xg3Y/m/jE4t-KwpBQAJ)

    """
    # response.view = 'genericIndexJoe.html'
    response.flash = T("Welcome!")

    my_md = '''## Welcome to the cov19cty App!
### To generate County Comparison Charts:
1. Click Menu >> Gen Chart >> Multi-County Input Form
  1. Add Your Counties to compare (state, county, typeOfData)
  2. Define Your Time Series
2. Click Menu >> Gen Chart >> Show Multi-County Chart
    '''
    my_html = markdown(my_md)

    # return dict( message=my_html )  
    return my_html

#markdown, #web2py

Enabling Markdown on WordPress.com Sites

On support.wordpress.com see Enabling Markdown

Be sure to post using the HTML Tab.

To use markdown, also see my Markdown Tagged Posts on JoeCodeswell.wordpress.com

#markdown, #wordpress

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.

#markdown, #wordpress

Posting Source Code on WordPress

backtick backtick backtick python
def example_func():
 """This is an example_func inside
 backtick backtick backtick python
 l_squareBracket /code r_squareBracket
 language can = "python" or "html" or ???
 """
 pass
backtick backtick backtick

See also

#markdown, #quicktags, #shortcodes, #wordpress