Difference between revisions of "Template:1010PrAD"

From CompSciWiki
Jump to: navigation, search
m (Small change to the size of the right tab image)
 
(74 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[COMP1010|Program_a_day]]
+
<includeonly>[[Program_a_day|Back to the Program-A-Day homepage]]
<table border=0 cellpadding=5 cellspacing=0 width="100%" border=1 frame=box>
+
{|style="width: 100%; font-weight: normal" cellpadding="5" cellspacing="0"
<tr bgcolor="#F3F3F3">
+
|-
<td colspan=3  width="100%" height="20%" valign="top">
+
!width: 70%; style="font-weight: normal; padding: 15px; background: #E1E7EE; border-left: 1px solid grey; border-top: 1px solid grey; border-bottom: 1px solid grey" align="left" valign="top"|
 
+
=Problem=
<font color="black">
+
{{{Problem|Problem goes here.}}}
=This week...=
+
{{{Introduction|
+
Introduction goes here.
+
}}}
+
 
__NOTOC__ __NOEDITSECTION__
 
__NOTOC__ __NOEDITSECTION__
 +
!align="left" width="5%" style="background:#E1E7EE; border-top: 1px solid grey; border-bottom: 1px solid grey"|&nbsp;
 +
!align="left" width="25%" style="background:#C4D0DD; font-weight: normal; border: 1px solid grey;" valign="top"|
 +
={{{SideSectionTitle|SideSectionTitle}}}=
 +
{{{SideSection|SideSection goes here.}}}
 +
|-
 +
!style="font-weight: normal" align="left" colspan="3" valign="top"|
 +
=Solution=
 +
{{{Solution|Solution goes here.}}}
 +
|-
 +
!colspan="3" valign="top" align="left" style="font-weight: normal"|
 +
=Code=
 +
{{ #if: {{{SolutionCode|}}} | {{#tag:spoiler |{{#tag:pre |{{{SolutionCode}}}}}}} | SolutionCode goes here. Please DO NOT put your code in &lt;pre&gt; tags!}}
 +
|}
  
</font>
+
[[Category:COMP 1010]]
</td>
+
[[Category:Program-A-Day]]
  
 +
[[Program_a_day|Back to the Program-A-Day homepage]]
 +
</includeonly>
 +
<noinclude>
 +
''This template is used for the Program-A-Day page. Instructions and example usage are below.''
  
<td width=30% rowspan=2 valign="top">
+
Original design by [[User:WikiSysop]]. Modified and updated by [[User:BrianT]] and [[User:KarelK]].  
{{{Image|
+
Image goes here.
+
}}}
+
</td>
+
</tr>
+
  
</table>
+
----
  
 +
== Example Code Usage ==
 +
<pre>
 +
{{1010PrAD
 +
|ProblemName=The name of the program
  
 +
|Problem=The problem
  
[[Category:COMP 1010]]
+
|SideSectionTitle=...by students
 +
 
 +
|SideSection=
 +
[[Image:OperatingSystemExample.jpg|center|200px]]
 +
<BR>
 +
An image or By Students section
 +
 
 +
|Solution=The solution...
 +
 
 +
|SolutionCode=public class MySolution
 +
{
 +
  public static void main ( String [] args )
 +
  {
 +
    System.out.println("Hello, world!");
 +
  }
 +
}
 +
}}
 +
</pre>
 +
== Current Issues ==
 +
* In the ''SolutionCode'' parameter, all ''OR'' pipe characters ( {{!}} character ) should be replaced with the pipe wiki template: <code><nowiki>{{!}}</nowiki></code>
 +
* Syntax highlighting will have to wait for the Wikimedia system to be updated to a more recent version.
 +
* Note that there is NO WORDWRAP in use inside &lt;pre&gt; tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any &lt;pre&gt; tags.
 +
 
 +
== Sample Output ==
 +
Please note that the layout gets a bit skewed while displaying the template in itself; if you don't have horribly oversized images, everything will look fine when used in production.
 +
 
 +
'''Everything below this line is the sample output'''
 +
 
 +
----
 +
 
 +
 
 +
{{1010PrAD
 +
|ProblemName=The name of the program
 +
 
 +
|Problem=The problem
 +
 
 +
|SideSectionTitle=...by students
 +
 
 +
|SideSection=
 +
[[Image:OperatingSystemExample.jpg|center|200px]]
 +
<BR>
 +
An image or By Students section
 +
 
 +
|Solution=The solution...
 +
 
 +
|SolutionCode=public class MySolution
 +
{
 +
  public static void main ( String [] args )
 +
  {
 +
    System.out.println("Hello, world!");
 +
  }
 +
}
 +
}}
 +
</noinclude>

Latest revision as of 10:55, 25 November 2010


This template is used for the Program-A-Day page. Instructions and example usage are below.

Original design by User:WikiSysop. Modified and updated by User:BrianT and User:KarelK.


Example Code Usage

{{1010PrAD
|ProblemName=The name of the program

|Problem=The problem 

|SideSectionTitle=...by students

|SideSection=
[[Image:OperatingSystemExample.jpg|center|200px]]
<BR>
An image or By Students section

|Solution=The solution...

|SolutionCode=public class MySolution
{
  public static void main ( String [] args )
  {
    System.out.println("Hello, world!");
  }
}
}}

Current Issues

  • In the SolutionCode parameter, all OR pipe characters ( | character ) should be replaced with the pipe wiki template: {{!}}
  • Syntax highlighting will have to wait for the Wikimedia system to be updated to a more recent version.
  • Note that there is NO WORDWRAP in use inside <pre> tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any <pre> tags.

Sample Output

Please note that the layout gets a bit skewed while displaying the template in itself; if you don't have horribly oversized images, everything will look fine when used in production.

Everything below this line is the sample output



Back to the Program-A-Day homepage

Problem

The problem

 

...by students

OperatingSystemExample.jpg


An image or By Students section

Solution

The solution...

Code

Solution Code

Back to the Program-A-Day homepage