CSC/ECE 517 Fall 2012/ch1 1w10 pk: Difference between revisions
(Created page with "'''1w10: Language extensions (not patterns or packages) for ORM.''' There are many design patterns and software tools for referencing relational dbs from o-o languages. Active...") |
(Added a template) |
||
Line 2: | Line 2: | ||
There are many design patterns and software tools for referencing relational dbs from o-o languages. ActiveRecord, however, is a new approach, integrating support into the Rails framework itself. Do other languages have support that is as tightly integrated as ActiveRecord? Compare the ease of programming with language-level support to the ease of programming with external tools. Improve the existing work. | There are many design patterns and software tools for referencing relational dbs from o-o languages. ActiveRecord, however, is a new approach, integrating support into the Rails framework itself. Do other languages have support that is as tightly integrated as ActiveRecord? Compare the ease of programming with language-level support to the ease of programming with external tools. Improve the existing work. | ||
==Section headings== | |||
''Headings'' organize your writing | |||
into sections. The wiki software | |||
can automatically generate a | |||
[[Help:Section|table of contents]] | |||
from them. Start with 2 'equals' | |||
("==") characters. | |||
===Subsection=== | |||
Using more 'equals' characters | |||
creates a subsection. | |||
====A smaller subsection==== | |||
Don't skip levels, like from two | |||
("==") to four ("====") 'equals' | |||
characters. | |||
;A defined term: A semicolon at the | |||
start of a line is a way of making | |||
a definition where the word being | |||
defined appears in bold. | |||
The definition itself follows the | |||
colon and is not rendered bold by | |||
default. It is not a heading and | |||
does not appear in the table of | |||
contents. | |||
===Lists=== | |||
* ''Unordered [[Help:List|list]]s'' are easy to do: | |||
** Start every line with a star. | |||
*** More stars indicate a deeper level. | |||
**: Previous item continues. | |||
** A new line | |||
* in a list | |||
marks the end of the list. | |||
* Of course you can start again. | |||
# ''Numbered lists'' are: | |||
## Very organized | |||
## Easy to follow | |||
#: Previous item continues | |||
A new line marks the end of the list. | |||
# New numbering starts with 1. | |||
==Format== | |||
===Text formatting=== | |||
{| class="wikitable" | |||
|- valign="top" | |||
! Description | |||
! What you type | |||
! What it looks like | |||
|- id="emph" valign="top" | |||
| | |||
''Italics'', '''bold''', {{Smallcaps|small capital letters}}. | |||
| | |||
<pre>To ''italicize text'', just put | |||
2 apostrophes on each side. | |||
3 apostrophes will '''bold the text''' | |||
5 apostrophes for '''''bold italics''''' | |||
For text as {{Smallcaps|small caps}}, | |||
that uses a [[Help:Template|template]]. | |||
</pre> | |||
| | |||
To ''italicize text'', just put | |||
2 apostrophes on each side. | |||
3 apostrophes will '''bold the text''' | |||
5 apostrophes for '''''bold italics''''' | |||
For text as {{Smallcaps|small caps}}, | |||
that uses a [[Help:Template|template]]. | |||
|- valign=top | |||
| | |||
Small chunks of source code within a line of normal text. | |||
Code is displayed in a monospace font. | |||
| | |||
<pre><nowiki>function <code>int m2()</code> is nice</nowiki></pre> | |||
| | |||
function <code>int m2()</code> is nice | |||
|- valign="top" | |||
| | |||
[[mw:Extension:SyntaxHighlight GeSHi|Syntax highlighting]] for source code. | |||
Computer code has colored text and more stringent formatting. | |||
For example, to define a function: <code>int m2()</code>, with highlights. | |||
| | |||
<pre><nowiki><syntaxhighlight lang="cpp"> | |||
#include <iostream> | |||
int m2 (int ax, char *p_ax) { | |||
std::cout <<"Hello World!"; | |||
return 0; | |||
}</syntaxhighlight></nowiki></pre> | |||
| | |||
<syntaxhighlight lang="cpp"> | |||
#include <iostream> | |||
int m2 (int ax, char *p_ax) { | |||
std::cout <<"Hello World!"; | |||
return 0; | |||
}</syntaxhighlight> | |||
|- valign=top | |||
| | |||
<small>Small text</small>. | |||
| | |||
<pre><nowiki>Use <small>small text</small> if needed. | |||
A span tag can set text font-size as | |||
being <span style="font-size:87%">87% | |||
of prior size</span>, to match an | |||
image caption.</nowiki></pre> | |||
| | |||
Use <small>small text</small> if needed. | |||
A span tag can set text font-size as | |||
being <span style="font-size:87%">87% | |||
of prior size</span>, to match an | |||
image caption. | |||
|- valign="top" | |||
| | |||
<big>Big text</big>. | |||
| | |||
<pre><nowiki> | |||
Better not use <big>big text</big>, | |||
unless <small> it's <big>within</big> | |||
small</small> text. | |||
</nowiki></pre> | |||
| | |||
Better not use <big>big text</big>, | |||
unless <small> it's <big>within</big> | |||
small</small> text. | |||
|- | |||
| | |||
You can include a '''non-breaking space''' (sometimes called '''non-printing character''') where you require two words to always appear together on the same line, such as ''Mr. Smith'' or ''400 km/h'', using '''<code>&nbsp;</code>''' in place of a regular space between the two "words" that need to behave as a single word (never be separated on different lines). | |||
| | |||
<pre>Mr.&nbsp;Smith or 400&nbsp;km/h.</pre> | |||
| | |||
Mr. Smith or 400 km/h. | |||
|- | |||
| | |||
'''Extra spacing''' within text can best be achieved using the [[Template:Pad|pad]] template. | |||
| | |||
<pre><nowiki>Mary {{pad|4em}} had a little lamb.</nowiki></pre> | |||
| | |||
Mary {{pad|4em}} had a little lamb. | |||
|- | |||
| | |||
'''Typewriter font'''. | |||
(Also works beyond the end of a paragraph.) | |||
| | |||
<pre><nowiki><tt>arrow &rarr;</tt> | |||
<tt>''italics'', '''bold'''</tt> | |||
<tt><nowiki>[[link]]</nowiki> | |||
New paragraph </tt>started here.</pre> | |||
| | |||
<tt>arrow →</tt> | |||
<tt>''italics'', '''bold'''</tt> | |||
<tt>[[link]] | |||
New paragraph </tt>started here. | |||
|} | |||
====Link to another wiki article==== | |||
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended). | |||
* Thus the link hereafter is to the Web address <code>en.wikipedia.org/wiki/Public_transport</code>, which is the Wikipedia article with the name "Public transport". See also [[Help:Link#Conversion to canonical form|Canonicalization]]. | |||
* [[Intentionally permanent red link|A red link]] is a page that doesn't exist yet; it can be created by clicking on the link. | |||
* [[Help:Self link|A link to its own page]] will appear only as bold text. | |||
{| class="wikitable" | |||
! What you type | |||
! What it looks like | |||
|- | |||
| | |||
<code><nowiki>London has [[public transport]].</nowiki></code> | |||
| | |||
London has [[public transport]]. | |||
|- | |||
| | |||
<code><nowiki>Link to this own article: "[[Help:Wiki markup]]" will appear only as bold text.</nowiki></code> | |||
| | |||
Link to this own article: "[[Help:Wiki markup]]" will appear only as bold text. | |||
|} |
Revision as of 16:34, 10 September 2012
1w10: Language extensions (not patterns or packages) for ORM.
There are many design patterns and software tools for referencing relational dbs from o-o languages. ActiveRecord, however, is a new approach, integrating support into the Rails framework itself. Do other languages have support that is as tightly integrated as ActiveRecord? Compare the ease of programming with language-level support to the ease of programming with external tools. Improve the existing work.
Section headings
Headings organize your writing into sections. The wiki software can automatically generate a table of contents from them. Start with 2 'equals' ("==") characters.
Subsection
Using more 'equals' characters creates a subsection.
A smaller subsection
Don't skip levels, like from two ("==") to four ("====") 'equals' characters.
- A defined term
- A semicolon at the
start of a line is a way of making a definition where the word being defined appears in bold. The definition itself follows the colon and is not rendered bold by default. It is not a heading and does not appear in the table of contents.
Lists
- Unordered lists are easy to do:
- Start every line with a star.
- More stars indicate a deeper level.
- Previous item continues.
- A new line
- Start every line with a star.
- in a list
marks the end of the list.
- Of course you can start again.
- Numbered lists are:
- Very organized
- Easy to follow
- Previous item continues
A new line marks the end of the list.
- New numbering starts with 1.
Format
Text formatting
Description | What you type | What it looks like |
---|---|---|
Italics, bold, Template:Smallcaps. |
To ''italicize text'', just put 2 apostrophes on each side. 3 apostrophes will '''bold the text''' 5 apostrophes for '''''bold italics''''' For text as {{Smallcaps|small caps}}, that uses a [[Help:Template|template]]. |
To italicize text, just put 2 apostrophes on each side. 3 apostrophes will bold the text 5 apostrophes for bold italics For text as Template:Smallcaps, that uses a template. |
Small chunks of source code within a line of normal text. Code is displayed in a monospace font. |
function <code>int m2()</code> is nice |
function |
Syntax highlighting for source code. Computer code has colored text and more stringent formatting.
For example, to define a function: |
<syntaxhighlight lang="cpp"> #include <iostream> int m2 (int ax, char *p_ax) { std::cout <<"Hello World!"; return 0; }</syntaxhighlight> |
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
}
|
Small text. |
Use <small>small text</small> if needed. A span tag can set text font-size as being <span style="font-size:87%">87% of prior size</span>, to match an image caption. |
Use small text if needed. A span tag can set text font-size as being 87% of prior size, to match an image caption. |
Big text. |
Better not use <big>big text</big>, unless <small> it's <big>within</big> small</small> text. |
Better not use big text, unless it's within small text. |
You can include a non-breaking space (sometimes called non-printing character) where you require two words to always appear together on the same line, such as Mr. Smith or 400 km/h, using |
Mr. Smith or 400 km/h. |
Mr. Smith or 400 km/h. |
Extra spacing within text can best be achieved using the pad template. |
Mary {{pad|4em}} had a little lamb. |
Mary had a little lamb. |
Typewriter font. (Also works beyond the end of a paragraph.) |
<tt>arrow →</tt> <tt>''italics'', '''bold'''</tt> <tt><nowiki>[[link]] New paragraph </tt>started here. |
arrow → italics, bold New paragraph started here. |
Link to another wiki article
- Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
- Thus the link hereafter is to the Web address
en.wikipedia.org/wiki/Public_transport
, which is the Wikipedia article with the name "Public transport". See also Canonicalization. - A red link is a page that doesn't exist yet; it can be created by clicking on the link.
- A link to its own page will appear only as bold text.
What you type | What it looks like |
---|---|
|
London has public transport. |
|
Link to this own article: "Help:Wiki markup" will appear only as bold text. |