1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>dp.SyntaxHighlighter testing
</title>
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1">
8 <link type=
"text/css" rel=
"stylesheet" href=
"SyntaxHighlighter.css"></link>
11 /* @import url(SyntaxHighlighter.css); */
20 <body bgcolor=
"#cecece">
22 <h3>Smart Tabs
& First Line
</h3>
24 <textarea name=
"code" class=
"c#:firstline[42]">
27 string safeReferrer = null;
28 FileInfo fileInfo = new FileInfo(string.Format(
"{0}/{1}", path, image));
34 <textarea name=
"code" class=
"c#:collapse">
35 // single line comments
37 override protected void OnLoad(EventArgs e)
39 if(Attributes[
"class"] != null)
41 //_year.CssClass = _month.CssClass = _day.CssClass = Attributes[
"class"];
46 /***********************************
47 ** Multiline block comments
48 **********************************/
51 /// Gets or sets currently selected date of birth or
<see cref=
"DateTime.MinValue"/> if selection is incomplete or invalid.
55 String stringWithUrl =
"http://blog.dreamprojections.com";
63 DateTime result = new DateTime(
64 int.Parse(_year.SelectedItem.Value),
65 int.Parse(_month.SelectedItem.Value),
66 int.Parse(_day.SelectedItem.Value)
75 /* return _minDate; */
90 <textarea name=
"code" class=
"javascript">
91 /***********************************
92 ** Multiline block comments
93 **********************************/
95 var stringWithUrl1 =
"http://blog.dreamprojections.com";
96 var stringWithUrl2 = 'http://www.dreamprojections.com';
98 // callback for the match sorting
99 dpSyntaxHighlighter.prototype.SortCallback = function(m1, m2)
101 // sort matches by index first
102 if(m1.index < m2.index)
104 else if(m1.index
> m2.index)
109 // if index is the same, sort by length
110 if(m1.length < m2.length)
112 else if(m1.length
> m2.length)
117 alert('hello // world');
122 <h3>Visual Basic
</h3>
124 <textarea name=
"code" class=
"vb">
129 Imports System.Collections
131 Dim stringWithUrl =
"http://blog.dreamprojections.com"
133 Public Class MyVbClass
134 Private m_MyString As String
137 myString =
"Hello there"
140 Public Property MyString() As String
144 Set(ByVal Value As String)
149 #Region
"This is my region"
151 Public Function MyFunction( ByVal i as Integer ) As Double
160 <textarea name=
"code" class=
"xml">
161 <?xml version=
"1.0" encoding=
"utf-8" ?>
166 <childNode attribute =
"value" attribute='value' attribute=
/>
170 <childNode attribute=
"value"></childNode>
173 this is some CDATA content
174 <!-- comments inside cdata --
>
175 <b alert='false'
>tags inside cdata
</b>
182 -- Multiline comments
<b>tag
</b>
188 <textarea name=
"code" class=
"php">
189 /***********************************
190 ** Multiline block comments
191 **********************************/
193 $stringWithUrl =
"http://blog.dreamprojections.com";
194 $stringWithUrl = 'http://www.dreamprojections.com';
196 ob_start(
"parseOutputBuffer"); // Start Code Buffering
199 function parseOutputBuffer($buf) {
200 global $portal_small_code, $portal_gzcompress;
201 global $PHP_SELF, $HTTP_ACCEPT_ENCODING;
203 // cleaning out the code.
204 if($portal_small_code && !$portal_gzcompress) {
205 $buf = str_replace(
" ",
"", $buf);
206 $buf = str_replace(
"\n",
"", $buf);
207 $buf = str_replace(chr(
13),
"", $buf);
214 <textarea name=
"code" class=
"sql">
219 --SUBSTRING(Phone,
2,
3) AS CityCode,
220 SUBSTRING(Phone,
7,
8) AS PhoneNumber,
221 upper(LanguagePref) AS Language,
223 UpdatedOn AS CreatedOn
227 -- Exclude all test emails
228 Email NOT LIKE '%test%'
229 AND Email NOT LIKE '%asdf%'
236 <textarea name=
"code" id=
"dd" class=
"delphi">
238 (***********************************
239 ** Multiline block comments
240 **********************************)
241 procedure TForm1.Button1Click(Sender: TObject); var
242 Number, I, X: Integer;
245 str := 'http://blog.dreamprojections.com';
248 Caption := 'The Number is ' + IntToStr(Number);
249 for I :=
0 to Number do
257 ListBox1.Items.Add(IntToStr(X));
260 ShowMessage('Hello'); *)
271 <textarea name=
"code" class=
"python:nogutter:nocontrols">
274 string s =
"## comments inside a string"
276 def arrange(plans, lines, totalMinutes):
277 """arrangements of plans taken lines times with an heuristic that the sum
278 of values in one arrangement is less then totalMinutes
280 #if in cache we are done otherwise start calculating and save them to cache
281 if (plans, lines, totalMinutes) in cache:
282 return cache[(plans, lines, totalMinutes)]
284 r = [[plan] for plan in plans]
285 cache[(plans, lines, totalMinutes)] = r
289 for ar in sort(list(arrange(plans, lines-
1, totalMinutes))):
291 one_solution = tuple(sort([plan] + list(ar)))
292 if sum(one_solution) <= totalMinutes and one_solution not in solutions:
293 solutions.append(one_solution)
295 print
"Error:", str(e)
296 cache[(plans, lines, totalMinutes)] = solutions
299 if __name__ ==
"__main__":
301 lines, totalMinutes = int(sys.argv[
1]), int(sys.argv[
2])
302 plans = tuple([int(p) for p in sys.argv[
3:]])
303 print
"for", lines, totalMinutes, plans
304 for sol in arrange(plans, lines, totalMinutes):
308 <h3>Auto Overflow Test
</h3>
311 <div style=
"width: 400px; border-top: 2px solid black;">
313 <textarea id=
"Textarea1" name=
"code" class=
"xml">
314 // this is a long line that will stretch the whole box causing it to scroll horizontally.
315 if($portal_small_code && !$portal_gzcompress) {
316 $buf = str_replace(
" ",
"", $buf);
317 $buf = str_replace(
"\n",
"", $buf);
318 $buf = str_replace(chr(
13),
"", $buf);
325 <script class=
"javascript" src=
"shCore.js"></script>
326 <script class=
"javascript" src=
"shBrushCSharp.js"></script>
327 <script class=
"javascript" src=
"shBrushPhp.js"></script>
328 <script class=
"javascript" src=
"shBrushJScript.js"></script>
329 <script class=
"javascript" src=
"shBrushVb.js"></script>
330 <script class=
"javascript" src=
"shBrushSql.js"></script>
331 <script class=
"javascript" src=
"shBrushXml.js"></script>
332 <script class=
"javascript" src=
"shBrushDelphi.js"></script>
333 <script class=
"javascript" src=
"shBrushPython.js"></script>
334 <script class=
"javascript">
335 dp.SyntaxHighlighter.HighlightAll('code');