Difference between revisions of "User:Kbjarkefur"

Jump to: navigation, search
 
(80 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<body>
  <script src="mainpageJScript.js" type="text/javascript"></script>
  <script type="text/javascript">
    lifeCycleTopics = [
      ['Image file', '[[Impact Evaluation Design]]',
        'A brief introduction to the regression models commonly used in Impact Evaluation. Links to in details resources.'
      ],['Image file','[[Sampling & Power Calculations]]',
        'A brief introduction to the regression models commonly used in Impact Evaluation. Links to in details resources.'
      ],['Image file','[[Human Subjects Approval]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Preparing for Data Collection]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Survey Firm Procurement]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Questionnaire Design]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Questionnaire Translation]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Questionnaire Programming]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Survey Pilot]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Enumerator Training]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Monitoring Data Quality]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Data Management]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Data Cleaning]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Data Analysis]]',
        'This topic discuss all ethical concerns important for the '
      ],['Image file','[[Reproducible Research]]',
        'This topic discuss all ethical concerns important for the '
      ]
    ]
    standAloneTopics = [
      '[[Stata Coding Practices]]','[[Stata Coding Practices]]','[[SCTO Coding Practices|SurveyCTO Coding Practices]]','[[Geo Spatial Data]]','[[Check Lists for Field Coordinators]]','[[i2i Trust Fund for Impact Evaluation]]','[[Impact Evaluation Team]]','[[Cost-effectiveness Analysis]]'
    ]
  </script>
  <div class="cont">


    <table class="header_table">
== About me==
      <tr>
*Kristoffer Bjärkefur
        <td><img src="DIMEi2i.jpg" ></td>
*Work with developing best practice and software tools at DIME
        <td id="welcome">Welcome to the DIME Wiki!<br>To '''Create a New Account''', click [[New_Users | here]].</td>
*See https://github.com/worldbank/ietoolkit
        <td id="contribute">Everyone is encouraged to contribute to this Wiki. We reserve the right to review edits. For instructions on how to contribute to the Wiki click [[DIME Wiki Contributions|here]].
*kbjarkefur@worldbank.org
        </td>
      </tr>
    </table>


  </div>
== Pages on this wiki I frequently need: ==


<div class="border"></div>
*Stylesheet : [[MediaWiki:Common.css]]
*Javascript : [[MediaWiki:Common.js]]


  <div class="cont">
== List example ==
    <div class="lifecycle_cont">
      <div class="title">
        <table style="width:100%">
          <tr><td>Impact Evaluation Life Cycle Topics</tr></td>
        </table>
      </div>
      <script type="text/javascript">
        for ( j = 0 ; j < lifeCycleTopics.length ; ++j )
        {
          document.write(dispTopics_lc(lifeCycleTopics[j]));
        }
      </script>
    </div>
    <div class="standalone_cont">
      <div class="title">
        <table style="width:100%">
          <tr><td>Stand Alone Topics</tr></td>
        </table>
      </div>
      <script type="text/javascript">


        standAloneTopics.sort(function(a, b){return 0.5 - Math.random()});
'''Spacing between a list and the following paragraph needs to be increased. And the indentation infront of an ordered list and a non-ordered list should be the same.'''


        for ( j = 0 ; j < standAloneTopics.length ; ++j )
*ul list item 1
        {
*ul list item 2
          document.write(dispTopics_sa(standAloneTopics[j]));
Not a part of the list
        }
 
      </script>
#ol list item 1
    </div>
#ol list item 2
  </div>
Not a part of the list
</body>
 
'''Strangely this works with second level bullet points'''
*level 1
*level 1
** level 2
** level 2
This text is not a part of the list
 
'''Example where his gets confusing where the text after the list looks like a part of the list (problem is not as big with numbered lists as the indentation is bigger, but it still looks weird)'''
 
*The first reason is that it possible to run all code related to a project by running only one dofile. This is incredible important for replicability.
*The second purpose is to set up globals with folder paths that enables dynamic file paths that in turn allows multiple users run the same code, it shortens the file paths as well as making it possible to move files and folders with minimal updates to the code.
*The third purpose is that this file is the main map to the DataWork folder.
Each of these purposes are described in more detail below.
 
#The first reason is that it possible to run all code related to a project by running only one dofile. This is incredible important for replicability.
#The second purpose is to set up globals with folder paths that enables dynamic file paths that in turn allows multiple users run the same code, it shortens the file paths as well as making it possible to move files and folders with minimal updates to the code.
#The third purpose is that this file is the main map to the DataWork folder.
Each of these purposes are described in more detail below.
 
== Code snippet example ==
 
The first example is using the regular <nowiki><code></nowiki> tag which is great when writing code in the middle of a sentence:
 
'''Ex.1''' Use the ''egen'' function <code>rowtotal()</code> when aggregating variables.
 
However, the <nowiki><code></nowiki> tag is not great when writing multiple lines of code because there is a space in the formatting between the lines. It doesn't feel like a single code snippet.
 
'''Ex.2'''
 
<code>
gen varA = .<br>
replace varA = 1 if gender == 1<br>
replace varA = 0 if gender == 0
</code>
 
One solution to this that I found was to use the <nowiki><pre></nowiki> tag. Multiple lines displays really nice (and I like the color better):
 
'''Ex.3'''
<pre>
gen varA = .
replace varA = 1 if gender == 1
replace varA = 0 if gender == 0
</pre>
 
However, the <nowiki><pre></nowiki> tag is no good for when writing code in the middle of a sentence. '''Ex.4''' is the same code as '''Ex.1''' but with a <nowiki><pre></nowiki> tag instead of a <nowiki><code></nowiki> tag (this was supposed to have been on one line):
 
'''Ex.4''' Use the ''egen'' function <pre>rowtotal()</pre> when aggregating variables.
 
 
'''Summary and suggested solution:''' What I have done in my examples I uploaded today was to use <nowiki><pre></nowiki> for multi-line code examples and <nowiki><code></nowiki> for inline code examples, but as they look quite different in color I do not think it is a great solution. It won't be obvious that both are code examples. Not our top priority perhaps, but since there will be plenty of code examples we should decide on a standard for how we do this.
 
Both the <nowiki><pre></nowiki> tag and the <nowiki><code></nowiki> tag are HTML elements that can be formatted with CSS (I checked the page source and in the HTML they do inteed have those tags). I think Ritesh's team should be able to quite easily format one of them to look more similar to the other. The only issue would be if these tags are used as something else already somewhere on the wiki and changing them will mess up what they are also used for.
 
I do not like the red in the <nowiki><code></nowiki> tag that much as it looks like an error so I'd prefer both of them to be like the <nowiki><pre></nowiki> but keep both of them working as they are now in terms of position and line break.

Latest revision as of 15:49, 18 January 2018

About me

Pages on this wiki I frequently need:

List example

Spacing between a list and the following paragraph needs to be increased. And the indentation infront of an ordered list and a non-ordered list should be the same.

  • ul list item 1
  • ul list item 2

Not a part of the list

  1. ol list item 1
  2. ol list item 2

Not a part of the list

Strangely this works with second level bullet points

  • level 1
  • level 1
    • level 2
    • level 2

This text is not a part of the list

Example where his gets confusing where the text after the list looks like a part of the list (problem is not as big with numbered lists as the indentation is bigger, but it still looks weird)

  • The first reason is that it possible to run all code related to a project by running only one dofile. This is incredible important for replicability.
  • The second purpose is to set up globals with folder paths that enables dynamic file paths that in turn allows multiple users run the same code, it shortens the file paths as well as making it possible to move files and folders with minimal updates to the code.
  • The third purpose is that this file is the main map to the DataWork folder.

Each of these purposes are described in more detail below.

  1. The first reason is that it possible to run all code related to a project by running only one dofile. This is incredible important for replicability.
  2. The second purpose is to set up globals with folder paths that enables dynamic file paths that in turn allows multiple users run the same code, it shortens the file paths as well as making it possible to move files and folders with minimal updates to the code.
  3. The third purpose is that this file is the main map to the DataWork folder.

Each of these purposes are described in more detail below.

Code snippet example

The first example is using the regular <code> tag which is great when writing code in the middle of a sentence:

Ex.1 Use the egen function rowtotal() when aggregating variables.

However, the <code> tag is not great when writing multiple lines of code because there is a space in the formatting between the lines. It doesn't feel like a single code snippet.

Ex.2

gen varA = .
replace varA = 1 if gender == 1
replace varA = 0 if gender == 0

One solution to this that I found was to use the <pre> tag. Multiple lines displays really nice (and I like the color better):

Ex.3

gen varA = .
replace varA = 1 if gender == 1
replace varA = 0 if gender == 0

However, the <pre> tag is no good for when writing code in the middle of a sentence. Ex.4 is the same code as Ex.1 but with a <pre> tag instead of a <code> tag (this was supposed to have been on one line):

Ex.4 Use the egen function

rowtotal()

when aggregating variables.


Summary and suggested solution: What I have done in my examples I uploaded today was to use <pre> for multi-line code examples and <code> for inline code examples, but as they look quite different in color I do not think it is a great solution. It won't be obvious that both are code examples. Not our top priority perhaps, but since there will be plenty of code examples we should decide on a standard for how we do this.

Both the <pre> tag and the <code> tag are HTML elements that can be formatted with CSS (I checked the page source and in the HTML they do inteed have those tags). I think Ritesh's team should be able to quite easily format one of them to look more similar to the other. The only issue would be if these tags are used as something else already somewhere on the wiki and changing them will mess up what they are also used for.

I do not like the red in the <code> tag that much as it looks like an error so I'd prefer both of them to be like the <pre> but keep both of them working as they are now in terms of position and line break.