Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
Made plenty of notes at [[IBM Innovate 2010|http://www-01.ibm.com/software/uk/itsolutions/innovate2010/]].
* [[QM01]]
* [[CLM02]]
* [[SCM03]]
* [[CLM04]]
There was a time you'd have found me in the Systems Development track, but I think my choices show how I'm becoming more interested in the frameworks that need to be put in place around the entire development lifecycle these days.
Inspired by an advert on TV, I have no idea as to the authenticity of this.
Serves 2 very generously
!Ingredients
* one chorizo ring, chopped into hunks.
* one spanish onion, chopped into largeish pieces
* one jar chargrilled peppers in oil
* one tin cherry tomatoes
* one tin cannellini beans
* one tin butter beans
* paprika
* salt/pepper seasoning
!Method
# Fry the onion pieces in the oil from the peppers until soft but not browned.
# Add the butter and canellini beans and fry for another minute.
# Add the chorizo and fry for another minute.
# Add peppers, chopped tomatoes, a good teaspoon of paprika and stir.
# Simmer until thickened, anywhere between ten and twenty minutes, and season to taste.
[[Non-publishing content]]
Serves 2
!Ingredients
* 4 oz plain flour
* 1 teaspoon baking powder
* 1/2 teaspoon salt
* 2 tablespoons caster sugar
* 4 oz milk
* 1 large egg
* 2 tablespeens melted butter for frying
!Method
# Blitz the ingredients together in a food processor.
# Leave for twenty minutes.
# Melt the butter in a pan and cook. You'll get the temperature of the pan right by about pancake three.
An [[Ada 83 Grammar|./src/ada]] written in ayacc that I used a long time ago to write an Ada 83 pretty printer.
Requires ayacc.
I've dusted it off, downloaded and compiled ayacc, and generated sparse ada source code files just to satisfy myself it was free of errors.
Use as a coating for chicken breast that you've flattened with a rolling pin.
!Ingredients
* 1/4 teaspoon salt
* 1 1/2 teaspoons garlic powder
* 1 1/2 teaspoons ground black pepper
* 1 teaspoon ground white pepper
* 1 teaspoon onion powder
* 1 teaspoon ground cumin
* 1/2 teaspoon cayenne
* 1/2 teaspoon paprika
* 1/4 teaspoon fennel seed
!Method
# Mix in a bowl.
# Apply to chicken breasts.
# Grill.
This one comes from [[dR j0n|http://drj0nswanderings.blogspot.com/]].
!Ingredients
* butter
* onions
* ketchup
* brown sugar
* cider vinegar
* Worcestershire sauce
* juice 1/2 lemon
* stock
* American mustard
* salt and pepper
* Louisiana hot sauce, or Tabasco
!Method
# Mix together
# Marinade the meat
# Barbecue!
!Ingredients
* one loaf white bread, crusts removed, chopped into pieces
* one onion, diced
* one carrot, sliced
* cloves
* 300ml double cream
* milk
* 25g butter
!Method
# Sweat the onions in butter.
# Add carrots, cloves and milk and bring to boil. Simmer for 30 minutes.
# Remove the carrots and cloves.
# Add the bread and use a whick to bring to a smooth consistency.
# Simmer for 30 minutes. Add double cream just before serving.
Can be made in advance and frozen.
!Usage
Publish all test result TAP files into a {{{TestResults}}} directory on a convenient server for instance the Test Controller in a [[grinder|The Grinder]] network. Make sure each test is named something sensible such as {{{TC-{id}.tap}}}, then simply run [[this perl script|http://www.akroyd-wallis.co.uk/src/TAP/TAP-analysis/analyser/gen-html-summary.pl]] over them. maybe wrap it in a shell or [[batch|http://www.akroyd-wallis.co.uk/src/TAP/TAP-analysis/analyser/publish-on-test-server.bat]] script to fetch the results.
Have your webserver publish the page. Hint: map the {{{TestResults}}} directory to a Virtual Directory in IIS, or set it up as a site in your apache configuration.
Drop an [[index.html|http://www.akroyd-wallis.co.uk/src/TAP/TAP-analysis/analyser/noresults.html]] into the same folder that gets published when there are no results telling people how to generate them on demand.
Instant and simple [[test result dashboard|http://www.akroyd-wallis.co.uk/src/TAP/TAP-analysis/analyser/summary.html]].
Want a list of all the available button faces in //Word// in a format that you can print out? Just run this macro in an empty document.
{{{
Sub ShowButtonFaces()
Dim id As Integer
Dim toolbar As CommandBar
Dim button As CommandBarButton
Set toolbar = Application.CommandBars.Add
Set button = toolbar.Controls.Add
For id = 1 To 10038
button.FaceId = id
button.CopyFace
Selection.Paste
Selection.TypeText (” “)
Selection.TypeText (id)
Selection.TypeText (“, “)
Next
End Sub
}}}
It wins no prizes for code standards, but hey, it only needs to be simple.
The resulting document takes 24 pages of A4 at 12 point Courier, single line spacing.
!Collaborative software delivery in action
Steve Arnold (IBM)
The IBM toolset, in particular Rational Team Concert compared very favourably with my experience of integrating Open Source toolsets. The functionality supports the same lifecycles, but the project dashboards added real value for project oversight. That and not having to integrate and manage the varying identity systems was a real advantage.
The in-house Akroyd|Wallis lifecycle management toolchain comprises:
* Trac
* subversion - command line interface on all clients, Tortoise on Windows. IDE integration where possible.
* statsvn
* [[custom report generator|Bulk analysis of TAP results]] from [[Test Anything Protocol]] build and test results
I particularly liked the ability to prepare a build for testing that contained a single changeset in isolation from the other changes that the engineer working on the change might also currently be working on. This disentangling of multi-threaded changes in a developers work area is, in my opinion, one of the biggest barriers to scaling agile. It can be worked around by taking a disciplined approach, but if the tool can help support this discipline that's got to be good right?
Another thing I liked was the role of Quality Manager built into the tool. Names are important and this reinforced the fact that quality //has to be built in// to systems, it can't be bolted on afterwards.
Now if only we can get Application Security and InfoSec embedded into the process at an early stage we might be getting somewhere.
!Blazing the trail with the C/ALM 2010
Jean-Michel Lemieux (IBM Canada). Architect - Rational Team Concert
Really impressed by the determination of the development team behind Rational Team Concert to break developers out of their silos. No more throwing systems designs to software developers, then software to a test team.
I liked the way that the toolset also provides an API, so if you have an investment in existing tools you can integrate.
Hmm, we must look at our (very simple) in-house [[TAP|Test Anything Protocol]] [[report generator|Bulk analysis of TAP results]]. There were definite parallels between the ok/not ok results of TAP and Test Conductor, and between the concept of being able to identify blocking tests with the custom TAP parsing we do which highlights failed tests and allows drill down to the actual test points. I'd need to play with a real sample to assess whether the SKIP and TODO directives of TAP which help us to further refine our reports have a place in Team Concert. My gut feeling is that they have proved their worth in the Perl test suite. I'll watch with interest.
This one from [[dR j0n|http://drj0nswanderings.blogspot.com/]]
!Ingredients
* Boiled eggs
* Boiled potatoes, floury ones work best
* 1 green pepper, chopped
* 2 celery stalks, chopped,
* spring onions, chopped
* mayonaisse
* lemon juice
* French dressing
* Ketchup
* American mustard
* salt and pepper
* cayenne pepper
* parsley
!Method
# Mix everything together in a big bowl.
The lifecycle shown below is used by {{logo{Akroyd{{blue{|}}}Wallis}}} for all items under change control. Which means pretty much everything.
The lifecycle satisfies the following needs:
* to control change so that unwanted changes are not introduced.
* to allow testing of a change in isolation from other changes.
* to provide an environment for developing changes that maintains a known good product for delivery to customers.
* to provide an environment to allow integration of a change in a controlled manner.
The lifecycle assumes that artefacts that require testing will be tested in isolation from other changes before embodiment into a product.
[img[The item lifecycle|./graphs/change-process.png]]
For clarity off-normal routes back through the lifecycle, for instance where //assure// determines that rework is required are not shown.
//assure// obiously depends on the nature of the item being changed. It may be a document review, or a full set of unit and integration tests.
A //trigger// could be a problem report, a task, an enhancement request, a defect report.
As the amount of oversight for change control increases on projects the change lifecycle is not altered. What is altered is the rigour applied when moving from one state to the other. For instance early on in a project the review state may consist of an engineer seeking approval for a change from a peer, another engineer at the same level. At later stages of a project the same approval may require a full blown CCB. We often see states and actions becoming conflated and additional states added to the process as levels of oversight are required.
We think this is a mistake.
Another mistake we often see is processes becoming more complicated as individuals do not follow the process. The managers, instead of engaging with the engineers to discover why they aren't following the process - do they not understand it? have they found a better way of doing something? - erect additional barriers to prevent off-normal routes through the states. Over time these additional rules obfuscate the process, make it difficult to maintain, overlarge, inflexible, and most dangerously brittle. Eventually it becomes unable to cope with those exceptional circumstances where you //need// to allow an off-normal route.
Remember that if barriers are too high, people will go around them rather than be prepared to go over them. So make your barriers hard enough to stop uncontrolled change, but easy enough that no-one has any incentive to subvert them. Also remember that it is relatively cheap and safe to create a change (apart from the cost of an engineers wasted time if they work on something they shouldn't have). But it should be hard to get a change back into a deliverable.
If engineers find it hard to create a new change in response to a trigger they'll incorporate it into a work area they already have open for another trigger. At which point the manager has lost oversight. And no, it won't be picked up when the change is finally incorporated into the deliverable. If on the other hand they find it easy to create a change, so you allow them to do //git clone// or //svn copy// to create a working area for a change even before it leaves the review state, they can start a change in response to a new trigger, and not have it corrupt other work. If they then start to work on the change managers may be surprised at the quality of the information that comes to the review when it cones to finally deciding whether to approve or reject implementation. They've discovered that the simple one-line change is no longer so simple after all.
Sometimes you need to change screen resolution from the command line, especially if evaluating applications on limited screen real estate. We wrote [[SetRes|./src/SetRes/]] to meet our needs.
Usage: {{{SetRes {width}x{height}}}}
Output: Silent on success; otherwise, error messages are sent to stderr.
Exit codes:
0 - success
1 - failure
!References
Our code is a .NET app that just wraps the user32 DLL functions.
DEVMODE structure: http://msdn.microsoft.com/en-us/library/dd183565(VS.85).aspx
ChangeDisplaySettings function: http://msdn.microsoft.com/en-us/library/dd183411%28VS.85%29.aspx
EnumDisplaySettings function: http://msdn.microsoft.com/en-us/library/dd162611%28VS.85%29.aspx
pinvoke: http://pinvoke.net/
We're not getting into the tomato debate here.
Serve with rice and possibly flatbread. Have Mexican beer available to cool mouths.
Serves 5
!Ingredients
* 150g pancetta
* 150g chorizo, chopped to about the same size as the pancetta
* 1 tin kidney beans,
* 1/2 tin chopped tomatoes
* 1/2 teaspoon cayenne pepper
* 1 teaspoon paprika
* 1/2 bar 70% cocoa dark chocolate, broken into pieces
* HP barbecue sauce, your preferred version
* [[Dave's|http://www.davesgourmet.com/]] insanity sauce
!Method
# Fry the pancetta and chorizo.
# Add the mince and fry until well browned.
# Add the kidney beans and fry for a further minute.
# Add the tomatoes, cayenne pepper, paprika, HP barbecue sauce to preference, ''one drop'' of Dave's Insanity Sauce and simmer for at least thirty minutes.
# Add chocolate pieces stirring all the time.
# Season to taste and serve.
Background: #fff
Foreground: #000
PrimaryPale: #dcf0ff
PrimaryLight: #78b3e0
PrimaryMid: #1f497d
PrimaryDark: #005da4
SecondaryPale: #dbded6
SecondaryLight: #78b3e0
SecondaryMid: #617a8a
SecondaryDark: #02253a
TertiaryPale: #dbded6
TertiaryLight: #78b3e0
TertiaryMid: #1f497d
TertiaryDark: #000000
Error: #f88
In {{{ifort.cfg}}} disable Microsoft Visual Studio .NET and enable 2005 instead:
{{{
-Qvc9
...
--Qlocation,link."C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin"
}}}
Modify {{{ifortvars.bat}}} to use the correct setup file:
{{{
@cal "%vcinstalldir%\bin\vcvars32.bat" || echo Unable to find Microsoft Visual C++
}}}
Now you should be able to invoke the {{{ifort}}} compiler:
{{{
$ ifort -o {executable} {source files}
}}}
Makefile rule:
{{{
%.obj : %.for
ifort -o $@ $<
}}}
First of all run {{{diskpart}}} to prepare the USB:
{{{
$ diskpart
> list disk
> select disk 1 :: select your usb disk which number you have determined in step 2
> clean
> create partition primary
> select partition 1
> active
> format fs=ntfs quick
> assign
> exit
}}}
{{note{
We had an old USB led around which we were hoping to use as a thumb drive from which we could start a Windows Server 2008 install, but it wouldn't mount for us to run {{{diskpart}}} on it. Turns out it was formatted in FAT16. We had to mount it on a laptop with a proper OS, reformat it to FAT32. This enabled us to then use it back into the Windows box. Make sure that the that the partition scheme is Master Boot Record when reformatting to FAT32 or you'll end up with a FAT32 volume that other ~OSes can read, but ''not'' Windows.
}}}
Now copy the sources from CD, {{{E:\}}}, to the USB ({{{F:\}}}:
{{{
robocopy.exe E:\ F:\ /mir
}}}
!Read more
* A description of {{{diskpart}}}: http://support.microsoft.com/kb/300415
* {{{robocopy}}} command line options: http://technet.microsoft.com/en-us/library/cc733145%28WS.10%29.aspx
Obviously this requires a suitable Windows subversion server (such as [[CollabNet Subversion Server|http://www.collab.net/downloads/subversion/]]), and you’ll need to change paths to the install and repository directories
[[create-subversion-service.bat|./src/svn/create-subversion-service.bat]]
{{{
sc create svnserve binpath=”{install-directory}\svnserve.exe
–service -r {repository-directory}”
DisplayName=”Subversion Service” depend=Tcpip start=auto
}}}
Note that it should be two hyphens in front of service.
[[DOORS User Best Practices (PDF)|http://www.akroyd-wallis.co.uk/documents/papers/20101015-doors-user-best-practices.pdf]]
Command processor commands: http://msdn.microsoft.com/en-us/library/aa932907.aspx
{{{
:: Description
@echo off
if defined DEBUG @ echo on
if (%1) EQU () goto USAGE
:: Check dependencies, for instance if the script requires a filename as the first parameter
if not exist %1 goto ERROR
:: Do whatever it is you need to do
exit /B 0
:USAGE
@echo Usage: %0 [OPTIONS]
exit /B 1
:ERROR
@echo A meaningful error message
exit /B 1
}}}
{{{
fsutil behavior set disable8dot3 1 && (echo Disabled 8.3 filenames) || (echo Could not disable 8.3 filenames)
}}}
Easier than modifying {{{[HKLM]\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation}}}
{{{
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf\(Default) = "@SYS:DoesNotExist" [REG_SZ]
}}}
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editorFooter'><div class='editor' macro='edit tags'><span macro='message views.editor.tagPrompt'></span></div>
<span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
[[Programatically refer to a worksheet]]
[[Best Practice - Constants]]
[[Only show a toolbar for a particular worksheet]]
In the code for the worksheet add the following:
{{{
Private Sub Worksheet_Activate()
On Error Resume Next
‘ assuming the relevant sub is available in the global macros
CreateToolbar
End Sub
Private Sub Worksheet_Activate()
On Error Resume Next
‘ assuming the relevant sub is available in the global macros
DestroyToolbar
End Sub
}}}
If you have some commonly used constants in a workbook, such as conversion factors, or data ranges for validation of fields put them on their own worksheet:
[img[CONSTANTS worksheet|./wiki-images/workbook-constants.png]]
Then for each constant declare a named range that matches the constant name, and encompasses it’s values. The named range can then be used in functions to make their meaning more clear:
[img[Using CONSTANTS worksheet|./wiki-images/workbook-constants.png]]
http://207.67.203.68/F10011Staff/OPAC/index.asp
http://en.wikipedia.org/wiki/File_Allocation_Table#Final_FAT16
FAT16 v FAT32: http://technet.microsoft.com/en-us/library/cc940351.aspx
http://en.wikipedia.org/wiki/File_Allocation_Table#FAT32
FAT16 v FAT32: http://technet.microsoft.com/en-us/library/cc940351.aspx
Federal Information processing Standard 181: http://www.itl.nist.gov/fipspubs/fip181.htm
Obviously it needs [[some proper commands|http://www.mingw.org]] installed…
[[meme.bat|./src/dos/meme.bat]]
{{{
doskey /history | awk “{print $1}” | sort | uniq -c | sort -rn -k1
}}}
The {{{STOP}}} statement behaves differently in Intel Visual Fortran and GNU g77:
|!statement|>|>|!Visual Fortan 10|>|>|!g77|
|~|!exit value|>|!output|!exit value|>|!output|
|{{{stop}}}|0|stdout|-|0|stdout|-|
|~|~|stderr|-|~|stderr|-|
|{{{stop 0}}}|0|stdout|0|0|stdout|0|
|~|~|stderr|-|~|stderr|STOP statement 0 executed|
|{{{stop 1}}}|1|stdout|1|0|stdout|-|
|~|~|stderr|-|~|stderr|STOP statement 1 executed|
|{{{stop {label}}}}|{label}|stdout|-|0|stdout|-|
|~|~|stderr|{label}|~|stderr|STOP {label} statement executed|
|{{{stop '{string}'}}} |0|stdout|-|0|stdout|-|
|~|~|stderr|'{string}'|~|stderr|STOP {string} statement executed|
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[ColorPalette]]: Update the site colours
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
Roasting times: allow 15 minutes/kilo @ 180°C, with 20 minutes @ 200°C to finish
''Do not overcook''
!Method
# Wrap legs in foil to prevent burning.
# Baste regularly in the fat.
# Drain the fat off for the roast potatoes.
# Rest for twenty minutes before carving.
{{{
$ gpupdate /force
}}}
http://technet.microsoft.com/en-us/library/bb490983.aspx
The tiddlers associated with this tag record useful information we've learnt while configuring and managing an HPC cluster.
The roles of users and administrators in HPC are described on the MS technet:
[[http://technet.microsoft.com/en-us/library/gg250662(WS.10).aspx]]
Because backfill can't predict how long a job can run for it can only backfill jobs into the queue if that job has a maximum specified run-time.
* Ensure that the job that may be backfilled doesn't rely on the output of other jobs. If it does, then don't specify a maximum run time.
* Don't specify a run-time that is too short in order to try and get a backfill slot. If the job is halted before it has completed then you've lost any advantage as the job has to be rerun.
* Don't specify a run-time that is overly long as your job won't be backfilled.
Once you have an idea about how long a job actually needs to run, then a slightly pessimistic estimate of maximum run-time will allow the HPC job scheduler to most efficiently queue jobs.
* There is no advantage to being too optimistic in how long your job will run, as it may be cancelled before it has completed.
* There is no advantage in being too pessimistic in how long your job will run, as it may not be brought forward in the queue.
* There is no advantage in leaving run-time blank, as it will //definitely not// be brought forward.
* Defining [[public shares|HPC cluster public shares]]
* Specifying job run-times to take advantage of [[backfilling|HPC backfilling]]
* [[Node templates|HPC node templates]]
* [[Defining roles|HPC role based access]]
* [[Maintenance|HPC maintenance]]
* [[Configuration control|HPC configuration control]]
Brokerage uses the Service Oriented Architecture.
* clients connect to the Head Node
* Head Node creates service on Broker Node
* clients then talk to the Broker Node, which hides the actual services actually running the job on the Compute Nodes
If this is a re-install of WDS for any reason then an error message that the shared folder already exists is given, and WDS will not start.
Start ''Share and Storage Management'' and check that the {{{$REMINST}}} share is not already defined. Delete the share if necessary and restart WDS. The {{{$REMINST}}} share will be recreated by WDS.
!Shares created by HPC
|!Share|!Purpose|!Actual path|
|{{{$CcpSpoolDir}}}|Output spool for compute nodes|{{{%CCP_DATA%\SpoolDir\}}}|
|{{{$Diagnostics}}}|Diagnostic results output folder|{{{%CCP_DATA%\Diagnostics\}}}|
|{{{$HpcServiceRegistration}}}|Centralised service registration folder|{{{%CCP_HOME%\ServiceRegistration\}}}|
|{{{$REMINST}}}|Remote install share for compute nodes|{{{%CCP_DATA%\InstallShare\}}}|
Where:
{{{%CCP_DATA%}}} = {{{%CCP_DATA%\Data}}}
{{{%CCP_Home%}}} = {{{C:\Program Files\Microsoft HPC Pack 2008 R2}}}
!Envronment configuration control
Take into the account the following considerations:
* you want a common area from which developed applications can be run or deployed or installed. This need is satisfied by the {{{$REMINST}}} share created by HPC.
* you want to keep a record of all software applications deployed on and installed on your compute nodes (deployed != installed)
Create the following folders on the head node. There is no need to share these with the compute nodes.
* {{{Software}}} - store all installed software here
* {{{Apps}}} - store all developed apps here, the ones that can be installed by simply copying the relevant files to the compute node.
Installers/executable can then be copied to the {{{$REMINST}}} share on the head node which is accessible to all Compute Nodes during [[maintenance|HPC maintenance]].
!Results
Storing results in a public share on the head node may be more convenient than using local (node) storage and transferring results back. You'll need a good backbone. You may also need to use node-preparation tasks to map the storage area to a drive letter for each job rather than relying on UNC pathnames.
Use a version control tool, (such as [[subversion|Creating a subversion service on Windows]]).
!Items to be configured
* [[Job submission filters|HPC filters]]
* [[Job activation filters|HPC filters]]
* Node templates
* Job templates
* Service configuration
* Tests
* MATLAB MDCS configurations
The SQL Server databases for the cluster can be found at: {{{<servername>\COMPUTECLUSTER}}}
!Job filters
[img[HPC job states|./graphs/hpc-job-filters.png]]
There is exactly one submission hook, and one activation hook. The filter associated with each hook must encompass //all// your rules. It can be a wrapper that calls out to other filters, especially if you want to keep it modular.
Job filters can only be {{{.bat}}}, {{{.cmd}}}, or {{{.exe}}}. If you wish to write a filter as a Powershell script ({{{.ps1}}}), wrap it in a batch file:
{{{
set me=%0
:: assuming .bat is a wrapper for .ps1 of same name
set filter=%me:.bat=%.ps1
:: If there is no PowerShell filter delegate then queue job as is
if not exist %filter% exit 0
start /WAIT powershell.exe -noprofile -command "$LASTEXITCODE = -1; %filter% '%1'; exit $LASTEXITCODE"
exit %errorlevel%
}}}
!Submission filters
[img[Submission filter workflow|./graphs/submission-filter-workflow.png]]
|!Return Value|!Meaning|
|0|Queue job unchanged|
|1|Job modified, queue modified job|
|else|Reject job|
!Activation filters
[img[Activation filter workflow|./graphs/activation-filter-workflow.png]]
|!Return Value|!Meaning|
|0|Start job|
|1|Hold job, and recheck periodically. Other jobs of the same or lower priority are ''blocked''|
|2|Allocate resources, but hold job and recheck periodically. Other jobs may start|
|3|Hold job. Recheck after default hold duration or job's //hold until// property|
|4|Mark job as failed|
|else|same as '2'|
!Filter chaining
We have written a pair of utilities to allow filters to be more easily chained.
!!Synopsis
Each program reads the list of filters defined in the {{{[activation]}}} or {{{[submission]}}} section of the configuration file, {{{[[filters.ini|./src/hpc-filter/filters.ini]]}}}, and applies each filter in turn to the Job passed to it by HPC.
The submission filter returns the highest exit-code encountered in the chain. The first filter to reject the job causes the chain to stop, and subsequent filters are not applied.
The activation filter returns the highest exit-code encountered in the chain, up to a maximum of 4. (Filters that return a value higher than 4 are treated as if they had returned 2).The first filter to fail the job causes the chain to stop, and subsequent filters are not applied.
''Note:'' in the event of an error in the filter chain program the exit code is zero. This non-conventional approach is taken on the basis that it is better that too many jobs are submitted/activated than all jobs being delayed.
!!Installation
* Download all the files you need (available as [[a zip file|./src/hpc-filter/hpc-filters.zip]] that includes two dummy filters), and save them somewhere convenient on the head node.
* Update {{{filters.ini}}} to include the activation and submission filters you'd like to use. Use full paths to the executables:
{{{
; The first reject/fail filter result encountered will stop the chain from processing
; Use full path to the filter
[submission]
; Example of a filter that does nothing
C:\Public\HPC-Configuration\Job-Filters\dummy-filters\queue-unchanged.exe
[activation]
; Example of a filter that does nothing
C:\Public\HPC-Configuration\Job-Filters\dummy-filters\activate-start.exe
}}}
* Configure the head node to point to these executables:
[img[HPC filters configuration|./images/hpc-filters-configuration.png]]
!!Bugs & omissions
The filter chain can only contain filters written as {{{.bat}}}, {{{.cmd}}}, and {{{.exe}}}. We are working on {{{.ps1}}} support.
!Cluster setup
The head node absolutely //must// be joined to the domain before setting up the cluster.
!Task sequencing
Tasks are not sequential by default, HPC will try and start as many tasks in parallel as it can.
* Use task groups to schedule tasks which must be completed before others can be started.
* Use Node Preparation and Node Release tasks to copy or install applications, tidy up from previous runs, tidy up after this run, and push results back to the head node (or wherever results are consolidated).
!Node groups
Node groups are formed by intersection //not// union.
So a node group //baz// formed of nodes in groups //foo// and //bar// only contains those nodes that are in both //foo// AND //bar//.
!Topology
Do //not// put anything but compute or broker nodes on your Private or Application networks.
!DNS settings
To remove the delays caused by DNS lookups, and to reduce network traffic, the cluster uses the {{{hosts}}} file. This is pushed out by the Head Node.
If there are problems connecting to nodes this is where you should look first. In particular SOA infrastructure relies upon {{{Private.*}}} entries for proper execution.
If you want to manually manage the {{{hosts}}} file then you //must// set {{{manageFile=''false''}}}.
!!DNS diagnostics
Provided that the {{{hosts}}} file on the head node is correct it is possible to define a diagnostic test to dump the contents of this file on reachable nodes:
{{{
type C:\Windows\System32\drivers\etc\hosts
}}}
This can then be conveniently reviewed in the Cluster Manager.
!Adding SMTP for email notifications
SMTP is a server //feature// not role. SMTP depends on IIS, though it is not available as an option if the IIS role is added. Once enabled SMTP is managed through the IIS administration console.
!PXE boot
The default setting is to respond to PXE boot requests from known nodes. Obviously as new physical nodes are added their PXE boot requests are ignored. Change the setting to respond to all PXE boot requests.
See also [[Setting DHCP option 60, PXEClient]]
!Credential problems
Reset the credentials on the cluster:
{{{
$ cluscfg delcreds
}}}
Next time anyone's job is started they'll need to submit their credentials which can be problematic if it tries to start outside working hours.
!Network shares
Jobs with lots of file I/O working from a shared area on the head node may lose their handles to network shares during operation. This can cause processes to terminate uncleanly, and may result in files on the compute nodes that cannot be deleted. The symptoms are 'permissions problems', though when inspected the permissions will be correct. //pslist// will not show the processes running. To resolve the issue it has been found necessary to take the affected compute node offline, then delete the files/folders.
This is another reason not to put the head node into the compute nodes group.
Disable TCP IP chimney offload and Receive Side Scaling [http://support.microsoft.com/kb/951037]
Check whether your users are using a flat file structure or a directory hierarchy. If they are using a flat file structure watch out for the numner of files in a folder.
The HPC job and cluster manager only shows data for three weeks.
{{{
SELECT [JobId], [SubmitTime]
FROM [HPCReporting].[dbo].[JobHistory]
WHERE JobId = {#}
}}}
By defining a [[node template|HPC node templates]] that only includes ''post-install'' activities it is possible to carry out maintenance tasks on nodes.
* Define the maintenance tasks to be carried out.
* Assign the template to the nodes where the task is to be perfomed.
* Select the node(s) then the ''Maintain'' command.
* Reassign the day-to-day template.
One-off maintenance templates can be created to install third party software applications. Just invoke the application installer with the silent-install options.
!Naming conventions
Differentiate between templates that are intended to be deployed to nodes that do/do not have an OS installed. It is recommended to name the template "//Blank//... " if it is intended to be deployed to nodes that already have an OS installed.
!Template definition
There is an //Excel// tool for editing node template XML files included in the HPC Server 2008 R2 Tool Pack.
Running a parametric sweep job generates lots of output files. It can be useful to run a subsequent parametric sweep job on these outputs to generate consolidated results.
Use {{{sweep-output-*}}} as the input to the new task.
The analysis task scan use redirection on the task command line to concatenate the results of the analysis into a single file, e.g.
{{{
analyse-output.exe >> consolidated-results.txt
}}}
Analysis of test results is made easier if the earlier tasks generate [[Test Anything Protocol|TAP]], because:
* it's trivially human readable
* it's machine readable so appropriate for bulk processing
* it can include data (using YAML)
Suggest the following user groups in the HPC domain, with increasing privilege:
* ~ClusterUsers - basic user privileges
* ~ClusterDevelopers - users who need access to the HPC cluster manager in order to develop and debug applications to take advantage of parallel processing. ~ClusterDevelopers should have the same power as ~ClusterManagers on a limited set of development compute nodes. They should be able to run performance and tracing tools on these nodes.
* ~ClusterManagers - Local Administrator privileges on the HPC Head Node and compute nodes, but no Domain Administrator privileges. ~ClusterManagers must have the necessary privileges to:
** install third party applications onto the Compute Nodes.
** performance tune the cluster, including starting/stopping services
** manage //flexlm// licenses for applications that require them
* ~ClusterAdministrators - full server administrator powers, i.e. the ability to add server roles, features, set local security policy etc.
All users day to day accounts should only have ~ClusterUser privileges. A second account should be used for elevated privileges. You want Developers to run under the same restrictions as the users they are developing for; it's no good them developing applications that only work with elevated privileges.
''This article still to be completed''
!Scope
Proposed training course for HPC users.
!!Users
There are five classes of HPC Users to consider:
* Matlab users; submit jobs to the cluster through the Matlab user interface.
** Take exising apps and rewrite to take advantage of parallel processing.
* Application users; submit jobs to the cluster through the Job Manager interface.
** Need to know how to define job templates including node preparation and release tasks.
* Application developers; as users, but need slightly more control for application debugging. May be provided with the HPC Cluster Manager interface. Also need to know how to:
** Develop apps to take best advantage of parallelisation (don't forget that better speedups can be achieved by better algorithms rather than raw power).
** Debug apps on the cluster.
** Define node-preparation tasks for users to deploy apps to the compute nodes as part of jobs, especially when deploying client/servef style applications.
* Cluster Managers; configure the cluster to make best use of it.
** Oversight of jobs.
** Assistance to users who have failed jobs, etc.
** Provide Matlab configurations to Matlab users.
** Manage user groups in the domain to ensure job output is stored correctly and can't be accessed only by those who need to know.
** Specify software to be installed on the cluster.
** //flexlm// license managament.
* Cluster Administrators
** Cluster setup
** Sysadmin tasks.
** Installation of third party applications on the cluster nodes.
Cluster Administrators are outwith the scope of this training.
It is proposed that the course is one day for users, and two days for developers and managers, with day two targetted appropriately.
!!Expected use
It is expected that the cluster will be used for the following types of jobs:
* MatLab model running, through the MatLab tool, ~ 70%
* Parametric sweep jobs using bespoke applications, ~ 25%
* other still TBD, ~ 5%
!Proposed course outline
!!Day 1 - all users
* Introduction
** Welcome; introductions, who does what, what they want out of the course, student background
** Overview; timings, lunch, breaks, labs formats...
** Housekeeping briefing; fire exits, safety...
* HPC Overview
** Purpose of HPC, place in parallel computing space, examples
** Architecture; Client, Agent, Controller (cf. //[[The Grinder|grinder]]//).
** Benefits;
** Pitfalls; raw power is no substitute for intelligence
* Basic HPC Usage (Application Users)
Although targeted at Application Users who are not the biggest clientele recommend doing this before Matlab use as it follows on from Introduction, and helps Matlab users understand what is going on behind the scenes.
** Submitting jobs through the job manager; speedup demo
** Reading results on the attached storage
** Submitting jobs through the command line
** Task Sequencing
** Node preparation & Node release tasks
** Fetching results back to the local workstation
** Parametric sweep tasks; including [[meta-sweep to analyse results|HPC parametric sweep post-processing]].
* Matlab HPC usage (Matlab Users)
** Selecting parallel configuration
** Submitting job through Matlab command line
** Getting results back to Matlab; //load//, //diary//
** Modifying models to make use of //parfor//
** Managing parallel configurations
!!Day 2 - cluster managers
*Configuration
** Performance tuning
*Monitoring
** Troubleshooting
* Node management
** Adding Nodes
** Maintenance tasks
** Installing Applications
** Deploying developed applications
* Job management
** Queueing
** Scheduling
** Backfilling
** Pre-emption
* Managing the HPC cluster
* Reports
** custom reports
* Diagnostics
** custom diagnostics programming the API
!!Day 2 - cluster developers
* Cut down version of day2 for Cluster Managers:
** Installing applications
** Deploying applications
** Troubleshooting
* Understanding parallel apps
** parametric sweep
** multi-threading
** MPI
** SOA
** MPI
** client server
** Service Oriented Architecture
** SOA Web Service
* HPC API
* Developing HPC Applications (Application Developers). Old devs who are used to developing command-line apps that work with {{{stdin}}}, {{{stdout}}}, and {{{stderr}}} are at an advantage here.
** Analysing apps to make best use of parallel computing; looking for //embarrassingly parallel//
** SDSP; just using raw power
** MDSP; //parfor//
** SDMP; rare
** MDMP
* Demonstrate comparative speedup of:
** paralellisation
** better algorithm
* Best practices
** Sensible return values (Kernighan & Pike, //The Unix Programming Environment//)
** Human //and// machine readable output. Yes, it's [[TAP|Test Anything Protocol]] again.
* Job submission
** Introduce the command line, Powershell, and //mpiexec//.
* Debugging
** Local debugging
** Debugging on the node
** Debugging MPI apps
** Tracing tools
* Performance measuring & improvements
** Profiling tools
{{logo{Akroyd{{blue{|}}}Wallis}}} have had performance issues with the Serena Dimensions plugins for [[Visual Studio]] and [[Rational Rhapsody]], but even we didn't expect that the Explorer plugin would be the cause of poor performance when accessing network shares using Windows Explorer.
If you use Explorer for file navigation (frequently) and the Dimensions client for change control (infrequently) you'll see a big speed up in the performance of your PC if you ditch the integration.
To do so unregister the Dimensions plugin:
{{{
$ regsvr32 /u CMShellExt10m.dll
}}}
Allow the IBM Rational Rhapsody //diffMerge// tool to be invoked from Serena Dimensions.
When Serena Dimensions (2009 CM R1) is invoked in diff mode the %d* parameter in the client configuration file (//%USERPROFILE%\.dmwebtools\native.properties//) expands to %d1, %d2, %d3...
However, when Dimensions is invoked in merge mode the %d* parameter in the client configuration file expands with one more parameter, such that %d1 = %a, and %d//n// actually reflects %d//n-1//.
|!Invoke Mode|!%d expansion|
|diff, two files|%d1|
|diff, three files|%d1, %d2|
|merge, two files|%a, %d1|
|merge, three files|%a, %d1,%d2|
Consequently there is no parameter combination that can be used for diff or merge modes of //diffMerge// that can take account of two- and three-file comparisons.
A merge of %a %d tries to merge %a with itself, which will obviously fail as there are no differences.
Our [[Dimensions to Rhapsody Bridge|./src/d2r/]] parses a //pvcsMerge// configuration file and invokes //diffMerge// appropriately, including determination of whether to perform a base aware comparison.
!Animating code using Rhapsody Designer
MinGW is not an officially supported compiler for Rhapsody 7.5. However the environment test is only against the //name// of the environment. So there's nothing to stop the //Cygwin// environment name being remapped to another actual environment, for instance MinGW. Just edit the appropriate properties files:
[img[Site C++ properties file|./images/sitecpp-properties.png]]
[img[Site C++ OXF MinGW properties file|./images/sitecpp_oxf_mingw-properties.png]]
With these changes MinGW can be selected using the Cygwin environment in the project configuration.
[img[Configuration|./images/configuration-cygwin.png]]
When generating code the output window will confirm ''Setting environment for MinGW''
Derived from [[this|http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.4]]
store.fetchTiddler("Test").revisionKey
time(f, n)
<html>
<div>
Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down,
<a accesskey="M" href="javascript:jsshell.go('scope(Math); mathHelp();');" title="Accesskey: M">Math</a>
</div>
<div>
Values and functions: ans, print(string),
<a accesskey="P" href="javascript:jsshell.go('props(ans)')" title="Accesskey: P">props(object)</a>,
<a accesskey="B" href="javascript:jsshell.go('blink(ans)')" title="Accesskey: B">blink(node)</a>,
<a href="javascript:jsshell.go('wikify(ans)')">wikify(text)</a>
<a href="javascript:jsshell.go('print(ans)')">print(text)</a>
<a accesskey="C" href="javascript:jsshell.go('clear()')" title="Accesskey: C">clear()</a>,
load(scriptURL),
scope(object)</div>
<div class="shell">
<div id="output"></div>
<div><textarea id="input" class="input" wrap="off" onkeydown="jsshell.inputKeydown(event)" rows="1"></textarea></div>
</div>
</html><script>
window.jsshell = {}; // Put our functions in the global namespace.
window.jsshell.refocus = function()
{
jsshell._in.blur(); // Needed for Mozilla to scroll correctly.
jsshell._in.focus();
}
window.jsshell.initTarget = function()
{
window.print = jsshell.shellCommands.print;
}
// Unless the user is selected something, refocus the textbox.
// (requested by caillon, brendan, asa)
window.jsshell.keepFocusInTextbox = function(e)
{
var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard
while (!g.tagName)
g = g.parentNode;
var t = g.tagName.toUpperCase();
if (t=="A" || t=="INPUT")
return;
if (window.getSelection) {
// Mozilla
if (String(window.getSelection()))
return;
}
else if (document.getSelection) {
// Opera? Netscape 4?
if (document.getSelection())
return;
}
else {
// IE
if ( document.selection.createRange().text )
return;
}
jsshell.refocus();
}
//function inputKeydown(e) {
window.jsshell.inputKeydown = function(e) {
// Use onkeydown because IE doesn't support onkeypress for arrow keys
//alert(e.keyCode + " ^ " + e.keycode);
if (e.shiftKey && e.keyCode == 13) { // shift-enter
// don't do anything; allow the shift-enter to insert a line break as normal
} else if (e.keyCode == 13) { // enter
// execute the input on enter
try { jsshell.go(); } catch(er) { alert(er); };
setTimeout(function() { jsshell._in.value = ""; }, 0); // can't preventDefault on input, so clear it later
} else if (e.keyCode == 38) { // up
// go up in history if at top or ctrl-up
if (e.ctrlKey || jsshell.caretInFirstLine(jsshell._in))
jsshell.hist(true);
} else if (e.keyCode == 40) { // down
// go down in history if at end or ctrl-down
if (e.ctrlKey || jsshell.caretInLastLine(jsshell._in))
jsshell.hist(false);
} else if (e.keyCode == 9) { // tab
jsshell.tabcomplete();
setTimeout(function() { jsshell.refocus(); }, 0); // refocus because tab was hit
} else { }
setTimeout(jsshell.recalculateInputHeight, 0);
//return true;
};
window.jsshell.caretInFirstLine = function(textbox)
{
// IE doesn't support selectionStart/selectionEnd
if (textbox.selectionStart == undefined)
return true;
var firstLineBreak = textbox.value.indexOf("\n");
return ((firstLineBreak == -1) || (textbox.selectionStart <= firstLineBreak));
}
window.jsshell.caretInLastLine = function(textbox)
{
// IE doesn't support selectionStart/selectionEnd
if (textbox.selectionEnd == undefined)
return true;
var lastLineBreak = textbox.value.lastIndexOf("\n");
return (textbox.selectionEnd > lastLineBreak);
}
window.jsshell.recalculateInputHeight = function()
{
var rows = jsshell._in.value.split(/\n/).length
+ 1 // prevent scrollbar flickering in Mozilla
+ (window.opera ? 1 : 0); // leave room for scrollbar in Opera
if (jsshell._in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.
jsshell._in.rows = rows;
}
window.jsshell.println = function(s, type)
{
if((s=String(s)))
{
var newdiv = document.createElement("div");
newdiv.appendChild(document.createTextNode(s));
newdiv.className = type;
jsshell._out.appendChild(newdiv);
return newdiv;
}
}
window.jsshell.printWithRunin = function(h, s, type)
{
var div = jsshell.println(s, type);
var head = document.createElement("strong");
head.appendChild(document.createTextNode(h + ": "));
div.insertBefore(head, div.firstChild);
}
window.jsshell.shellCommands =
{
load : function load(url)
{
var s = document.createElement("script");
s.type = "text/javascript";
s.src = url;
document.getElementsByTagName("head")[0].appendChild(s);
jsshell.println("Loading " + url + "...", "message");
},
clear : function clear()
{
jsshell._out.innerHTML = "";
},
wikify : function wikify(text)
{
window.wikify(text, jsshell._out);
},
print : function print(s) { jsshell.println(s, "print"); },
// the normal function, "print", shouldn't return a value
// (suggested by brendan; later noticed it was a problem when showing others)
pr : function pr(s)
{
jsshell.shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!
return s;
},
props : function props(e, onePerLine)
{
if (e === null) {
jsshell.println("props called with null argument", "error");
return;
}
if (e === undefined) {
jsshell.println("props called with undefined argument", "error");
return;
}
var ns = ["Methods", "Fields", "Unreachables"];
var as = [[], [], []]; // array of (empty) arrays of arrays!
var p, j, i; // loop variables, several used multiple times
var protoLevels = 0;
for (p = e; p; p = p.__proto__)
{
for (i=0; i<ns.length; ++i)
as[i][protoLevels] = [];
++protoLevels;
}
for(var a in e)
{
// Shortcoming: doesn't check that VALUES are the same in object and prototype.
var protoLevel = -1;
try
{
for (p = e; p && (a in p); p = p.__proto__)
++protoLevel;
}
catch(er) { protoLevel = 0; } // "in" operator throws when param to props() is a string
var type = 1;
try
{
if ((typeof e[a]) == "function")
type = 0;
}
catch (er) { type = 2; }
as[type][protoLevel].push(a);
}
function times(s, n) { return n ? s + times(s, n-1) : ""; }
for (j=0; j<protoLevels; ++j)
for (i=0;i<ns.length;++i)
if (as[i][j].length)
jsshell.printWithRunin(
ns[i] + times(" of prototype", j),
(onePerLine ? "\n\n" : "") + as[i][j].sort().join(onePerLine ? "\n" : ", ") + (onePerLine ? "\n\n" : ""),
"propList"
);
},
blink : function blink(node)
{
if (!node) throw("blink: argument is null or undefined.");
if (node.nodeType == null) throw("blink: argument must be a node.");
if (node.nodeType == 3) throw("blink: argument must not be a text node");
if (node.documentElement) throw("blink: argument must not be the document object");
function setOutline(o) {
return function() {
if (node.style.outline != node.style.bogusProperty) {
// browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).
node.style.outline = o;
}
else if (node.style.MozOutline != node.style.bogusProperty) {
// browser supports MozOutline (Firefox 1.0.x and older)
node.style.MozOutline = o;
}
else {
// browser only supports border (IE). border is a fallback because it moves things around.
node.style.border = o;
}
}
}
function focusIt(a) {
return function() {
a.focus();
}
}
if (node.ownerDocument) {
var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE
if (windowToFocusNow)
setTimeout(focusIt(windowToFocusNow.top), 0);
}
for(var i=1;i<7;++i)
setTimeout(setOutline((i%2)?'3px solid red':'none'), i*100);
setTimeout(focusIt(window), 800);
setTimeout(focusIt(jsshell._in), 810);
},
time: function (f, n) {
var start = new Date();
if (typeof n != typeof undefined) {
for (var i = 0; i < n; i++) { f(); } }
else { f(); }
var stop = new Date();
return stop - start;
},
scope : function scope(sc)
{
if (!sc) sc = {};
jsshell._scope = sc;
jsshell.println("Scope is now " + sc + ". If a variable is not found in this scope, window will also be searched. New variables will still go on window.", "message");
},
mathHelp : function mathHelp()
{
jsshell.printWithRunin("Math constants", "E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2", "propList");
jsshell.printWithRunin("Math methods", "abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan", "propList");
},
ans : undefined
};
window.jsshell.hist = function(up)
{
// histList[0] = first command entered, [1] = second, etc.
// type something, press up --> thing typed is now in "limbo"
// (last item in histList) and should be reachable by pressing
// down again.
var L = jsshell.histList.length;
if (L == 1)
return;
if (up)
{
if (jsshell.histPos == L-1)
{
// Save this entry in case the user hits the down key.
jsshell.histList[jsshell.histPos] = jsshell._in.value;
}
if (jsshell.histPos > 0)
{
jsshell.histPos--;
// Use a timeout to prevent up from moving cursor within new text
// Set to nothing first for the same reason
setTimeout(
function() {
jsshell._in.value = '';
jsshell._in.value = jsshell.histList[jsshell.histPos];
var caretPos = jsshell._in.value.length;
if (jsshell._in.setSelectionRange)
jsshell._in.setSelectionRange(caretPos, caretPos);
},
0
);
}
}
else // down
{
if (jsshell.histPos < L-1)
{
jsshell.histPos++;
jsshell._in.value = jsshell.histList[jsshell.histPos];
}
else if (jsshell.histPos == L-1)
{
// Already on the current entry: clear but save
if (jsshell._in.value)
{
jsshell.histList[jsshell.histPos] = jsshell._in.value;
++jsshell.histPos;
jsshell._in.value = "";
}
}
}
}
window.jsshell.tabcomplete = function()
{
/*
* Working backwards from s[from], find the spot
* where this expression starts. It will scan
* until it hits a mismatched ( or a space,
* but it skips over quoted strings.
* If stopAtDot is true, stop at a '.'
*/
function findbeginning(s, from, stopAtDot)
{
/*
* Complicated function.
*
* Return true if s[i] == q BUT ONLY IF
* s[i-1] is not a backslash.
*/
function equalButNotEscaped(s,i,q)
{
if(s.charAt(i) != q) // not equal go no further
return false;
if(i==0) // beginning of string
return true;
if(s.charAt(i-1) == '\\') // escaped?
return false;
return true;
}
var nparens = 0;
var i;
for(i=from; i>=0; i--)
{
if(s.charAt(i) == ' ')
break;
if(stopAtDot && s.charAt(i) == '.')
break;
if(s.charAt(i) == ')')
nparens++;
else if(s.charAt(i) == '(')
nparens--;
if(nparens < 0)
break;
// skip quoted strings
if(s.charAt(i) == '\'' || s.charAt(i) == '\"')
{
//dump("skipping quoted chars: ");
var quot = s.charAt(i);
i--;
while(i >= 0 && !equalButNotEscaped(s,i,quot)) {
//dump(s.charAt(i));
i--;
}
//dump("\n");
}
}
return i;
}
// XXX should be used more consistently (instead of using selectionStart/selectionEnd throughout code)
// XXX doesn't work in IE, even though it contains IE-specific code
function getcaretpos(inp)
{
if(inp.selectionEnd != null)
return inp.selectionEnd;
if(inp.createTextRange)
{
var docrange = document.selection.createRange();
var inprange = inp.createTextRange();
if (inprange.setEndPoint)
{
inprange.setEndPoint('EndToStart', docrange);
return inprange.text.length;
}
}
return inp.value.length; // sucks, punt
}
function setselectionto(inp,pos)
{
if(inp.selectionStart) {
inp.selectionStart = inp.selectionEnd = pos;
}
else if(inp.createTextRange) {
var docrange = document.selection.createRange();
var inprange = inp.createTextRange();
inprange.move('character',pos);
inprange.select();
}
else { // err...
/*
inp.select();
if(document.getSelection())
document.getSelection() = "";
*/
}
}
// get position of cursor within the input box
var caret = getcaretpos(jsshell._in);
if(caret) {
//dump("----\n");
var dotpos, spacepos, complete, obj;
//dump("caret pos: " + caret + "\n");
// see if there's a dot before here
dotpos = findbeginning(jsshell._in.value, caret-1, true);
//dump("dot pos: " + dotpos + "\n");
if(dotpos == -1 || jsshell._in.value.charAt(dotpos) != '.') {
dotpos = caret;
//dump("changed dot pos: " + dotpos + "\n");
}
// look backwards for a non-variable-name character
spacepos = findbeginning(jsshell._in.value, dotpos-1, false);
//dump("space pos: " + spacepos + "\n");
// get the object we're trying to complete on
if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)
{
// try completing function args
if(jsshell._in.value.charAt(dotpos) == '(' ||
(jsshell._in.value.charAt(spacepos) == '(' && (spacepos+1) == dotpos))
{
var fn,fname;
var from = (jsshell._in.value.charAt(dotpos) == '(') ? dotpos : spacepos;
spacepos = findbeginning(jsshell._in.value, from-1, false);
fname = jsshell._in.value.substr(spacepos+1,from-(spacepos+1));
//dump("fname: " + fname + "\n");
try {
with(window)
with(jsshell._scope)
with(jsshell.shellCommands)
fn = eval(fname);
}
catch(er) {
//dump('fn is not a valid object\n');
return;
}
if(fn == undefined) {
//dump('fn is undefined');
return;
}
if(fn instanceof Function)
{
// Print function definition, including argument names, but not function body
if(!fn.toString().match(/function .+?\(\) +\{\n +\[native code\]\n\}/))
jsshell.println(fn.toString().match(/function .+?\(.*?\)/), "tabcomplete");
}
return;
}
else
obj = window;
}
else
{
var objname = jsshell._in.value.substr(spacepos+1,dotpos-(spacepos+1));
//dump("objname: |" + objname + "|\n");
try {
with(jsshell._scope)
with(window)
obj = eval(objname);
}
catch(er) {
jsshell.printError(er);
return;
}
if(obj == undefined) {
// sometimes this is tabcomplete's fault, so don't print it :(
// e.g. completing from "print(document.getElements"
// jsshell.println("Can't complete from null or undefined expression " + objname, "error");
return;
}
}
//dump("obj: " + obj + "\n");
// get the thing we're trying to complete
if(dotpos == caret)
{
if(spacepos+1 == dotpos || spacepos == dotpos)
{
// nothing to complete
//dump("nothing to complete\n");
return;
}
complete = jsshell._in.value.substr(spacepos+1,dotpos-(spacepos+1));
}
else {
complete = jsshell._in.value.substr(dotpos+1,caret-(dotpos+1));
}
//dump("complete: " + complete + "\n");
// ok, now look at all the props/methods of this obj
// and find ones starting with 'complete'
var matches = [];
var bestmatch = null;
for(var a in obj)
{
//a = a.toString();
//XXX: making it lowercase could help some cases,
// but screws up my general logic.
if(a.substr(0,complete.length) == complete) {
matches.push(a);
////dump("match: " + a + "\n");
// if no best match, this is the best match
if(bestmatch == null)
{
bestmatch = a;
}
else {
// the best match is the longest common string
function min(a,b){ return ((a<b)?a:b); }
var i;
for(i=0; i< min(bestmatch.length, a.length); i++)
{
if(bestmatch.charAt(i) != a.charAt(i))
break;
}
bestmatch = bestmatch.substr(0,i);
////dump("bestmatch len: " + i + "\n");
}
////dump("bestmatch: " + bestmatch + "\n");
}
}
bestmatch = (bestmatch || "");
////dump("matches: " + matches + "\n");
var objAndComplete = (objname || obj) + "." + bestmatch;
//dump("matches.length: " + matches.length + ", jsshell.tooManyMatches: " + jsshell.tooManyMatches + ", objAndComplete: " + objAndComplete + "\n");
if(matches.length > 1 && (jsshell.tooManyMatches == objAndComplete || matches.length <= 10)) {
jsshell.printWithRunin("Matches: ", matches.join(', '), "tabcomplete");
jsshell.tooManyMatches = null;
}
else if(matches.length > 10)
{
jsshell.println(matches.length + " matches. Press tab again to see them all", "tabcomplete");
jsshell.tooManyMatches = objAndComplete;
}
else {
jsshell.tooManyMatches = null;
}
if(bestmatch != "")
{
var sstart;
if(dotpos == caret) {
sstart = spacepos+1;
}
else {
sstart = dotpos+1;
}
jsshell._in.value = jsshell._in.value.substr(0, sstart)
+ bestmatch
+ jsshell._in.value.substr(caret);
setselectionto(jsshell._in,caret + (bestmatch.length - complete.length));
}
}
}
window.jsshell.printQuestion = function(q)
{
jsshell.println(q, "input");
}
window.jsshell.printAnswer = function(a)
{
if (a !== undefined) {
jsshell.println(a, "normalOutput");
jsshell.shellCommands.ans = a;
}
}
window.jsshell.printError = function(er)
{
var lineNumberString;
lastError = er; // for debugging the shell
if (er.name)
{
// lineNumberString should not be "", to avoid a very wacky bug in IE 6.
lineNumberString = (er.lineNumber != undefined) ? (" on line " + er.lineNumber + ": ") : ": ";
jsshell.println(er.name + lineNumberString + er.message, "error"); // Because IE doesn't have error.toString.
}
else
jsshell.println(er, "error"); // Because security errors in Moz /only/ have toString.
}
window.jsshell.go = function(s)
{
jsshell._in.value = jsshell.question = s ? s : jsshell._in.value;
if (jsshell.question == "")
return;
jsshell.histList[jsshell.histList.length-1] = jsshell.question;
jsshell.histList[jsshell.histList.length] = "";
jsshell.histPos = jsshell.histList.length - 1;
// Unfortunately, this has to happen *before* the JavaScript is run, so that
// print() output will go in the right place.
jsshell._in.value='';
jsshell.recalculateInputHeight();
jsshell.printQuestion(jsshell.question);
if (window.closed) {
jsshell.printError("Target window has been closed.");
return;
}
try { ("jsshell" in window) }
catch(er) {
jsshell.printError("The JavaScript Shell cannot access variables in the target window. The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.");
return;
}
if (!("jsshell" in window))
initTarget(); // silent
// Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).
// window.location.href = "javascript:try{ jsshell.printAnswer(eval('with(jsshell._scope) with(jsshell.shellCommands) {' + jsshell.question + String.fromCharCode(10) + '}')); } catch(er) { jsshell.printError(er); }; setTimeout(jsshell.refocus, 0); void 0";
try {
jsshell.printAnswer(eval(
'with(jsshell._scope) with(jsshell.shellCommands) {'
+ jsshell.question + String.fromCharCode(10) +
'}'));
} catch(er) {
jsshell.printError(er);
};
setTimeout(jsshell.refocus, 0);
}
window.jsshell.histList = [""];
window.jsshell.histPos = 0;
window.jsshell._scope = {};
window.jsshell.question;
window.jsshell._in;
window.jsshell._out;
window.jsshell.tooManyMatches = null;
window.jsshell.lastError = null;
jsshell._in = document.getElementById("input");
jsshell._out = document.getElementById("output");
jsshell.initTarget();
jsshell.recalculateInputHeight();
jsshell.refocus();
</script>
If you have more ingredients than this you've gone all fancy and posh and missed the point. The taste comes from good quality local lamb.
Serves 4
!Ingredients
* 1 kilo neck and shin of lamb, preferably [[Lonk|http://www.heritagesheep.eu/lonk.htm]], failing that at least something raised in Bowland.
* 700g thickly sliced onions
* 1 kilo peeled potatoes. King Edwards for preference. Sliced to about the thickness of pound coins.
* flour
* about 50g salted butter
* 150ml chicken stock
* salt and ''white'' pepper seasoning
!Method
# Season the lamb and dust with flour. Place in the base of a hotpot dish.
# Sweat off the onions in about 15g of butter and place on the lamb.
# Melt the rest of the butter and stir the sliced potatoes in the pan.
# Layer the buttery potatoes over the onions. Pour over the butter from the bottom of the pan, and the chicken stock. Cover with a lid.
# Cook for 30 minutes at 180°C, then one and a half to two hours at 130°C. Remove the lid and cook for a final 30 minutes at 180°C to brown.
Standard command line options (version 3.0 or later): http://msdn.microsoft.com/en-us/library/windows/desktop/aa372024%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa367988%28v=vs.85%29.aspx
http://technet.microsoft.com/en-us/library/cc759262%28WS.10%29.aspx
Minimal ~SYStem: http://www.mingw.org/wiki/MSYS
!Useful links
* macports: http://www.macports.org/
!Tags
<<cloud limit:20>>
!Menu
[[Home|./index.html]]
[[RSS Feed|http://www.akroyd-wallis.co.uk/akwiki.xml]]
[[Welcome]]
Sidebar <<tiddler ToggleRightSidebar>>
!Operating Systems
[[Red Hat Enterprise Linux]]
[[Mac OS X]]
[[Solaris]]
[[Ubuntu]]
[[VMS]]
[[Windows]]
!Applications & Software
[[apache]], [[LAMP]] and [[XAMP]]
[[Active Directory]]
[[bbpress]]
[[Dimensions]]
[[DOORS]]
[[Excel]]
[[Gallery]]
[[The Grinder]]
[[HPC]]
[[IIS]]
[[LDAP]] – [[Sun One Directory Server]]
[[MySQL]]
[[OpenSSL]]
[[phorum]]
[[Rational Rose]]
[[Rhapsody]]
[[SQL Server]]
[[subversion]]
[[trac]]
[[Vanilla]]
[[VAPS]]
[[vi]]
[[Visual Studio]]
[[Word]]
[[WordPress]]
!Languages
[[Ada]]
[[ASP]]
[[awk]]
[[C]]
[[C++]]
[[C#]]
[[CSS]]
[[DOS]]
[[dot]]
[[HTML]]
[[Java]]
[[Javascript]]
[[Objective-C]]
[[perl]]
[[Python]]
[[sed]]
[[sh]]
[[SQL]]
[[Test Anything Protocol]]
[[UML]]
[[WatiN]]
[[TiddlyWiki]]
Minimal GNU for Windows: http://www.mingw.org/
!See also
[[MSYS]]
Sometimes you //really// need to work around corporate lockdowns of registry editing, which usually consists of restricting access to //regedit//. The following javascript, when invoked using Windows Script Host has allowed us to edit the registry in such cases. At the more security savvy companies we got a (not unexpected) phone call from the admins who spotted that we'd been updating settings. We ''like'' admins who do that. We had our excuses ready. If you use this script yourself, be sure you have yours.
!Usage
{{{modify-registry: key [value [type]]}}}
!Source
[[modify-registry.js|./src/dos/modify-registry.js]]
[[gennames.pl|./src/Names/gennames.pl]] generates random names, for instance to populate an LDAP or database with lots of fake IDs.
Generates the specified number of random names. There's a 50:50 chance of male or female. It uses US census data not British and makes no attempt to match ethnicity. Can produces humourous results. Hopefully in a few years the results will seem normal.
[[NetworkDrive.cs|./src/NetworkDrive/NetworkDrive.cs]]
!Read more
GetDiskFreeSpaceEx function: http://msdn.microsoft.com/en-us/library/aa364937(VS.85).aspx
Visit the [[contact page|http://www.akroyd-wallis.co.uk/contact.html]] to read more about Nick.
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser
Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])
<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]
----
Also see [[AdvancedOptions]]
PXE error codes: http://h18000.www1.hp.com/cpq-products/servers/management/rdp/knowledgebase/00000138.html
<div class='header'>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='macro' force='true' macro='slider chkSideBarTabs SideBarTabs "index »" "display lists of tiddlers"'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
Cursing the lack of perl on most Windows boxes, and needing to be able to generate strong passwords, we took the perl [[Crypt::GeneratePassword|http://search.cpan.org/~jwalt/Crypt-GeneratePassword-0.03]] module by Jörg Walter.and used it to write a C# FIPS-181 compliant [[password generation tool|./src/Password/PasswordGenerator/]] that should generate easy to remember passwords.
nick3216.Library.Crypt.Password.Generate generates random passwords that are (more or less) pronounceable. It doesn't use the FIPS-181 NIST standard, which is proven to be insecure.
nick3216.Library.Crypt.Password.Generate supports English and German.
This library improves on FIPS-181 using a true random selection with the word generator as mere filter. Other improvements are better pronounceability using third order approximation instead of second order and multi-language support. The drawback of this method is that it is usually slower.
For details on why FIPS-181 is insecure and why the solution used in this module is reasonably secure, see "A New Attack on Random Pronounceable Password Generators" by Ravi Ganesan and Chris Davies, available online in may places - use your favourite search engine.
/***
|''Name:''|Plugin: Syntaxify|
|''Description:''|Performs syntax highlighting on CSS, JavaScript, and HTML/XML|
|''Version:''|1.2|
|''Date:''|January 29, 2007|
|''Source:''|http://bob.mcelrath.org/syntaxify.html|
|''Author:''|BobMcElrath|
|''Email:''|my first name at my last name dot org|
|''License:''|[[GPL open source license|http://www.gnu.org/licenses/gpl.html]]|
|''~CoreVersion:''|2.0.0|
!Description
This plugin will syntax highlight ("pretty-print") source code used by TiddlyWiki. To activate CSS markup, enclose the code in the CSS code in the delimiters
<html><code>
/*{{{*/<br/>
/* CSS code here */<br/>
/*}}}*/<br/>
</code></html>
To activate XML markup, enclose your HTML/XML in the delimiters
<html><code>
<!--{{{--><br/>
<!-- XML/HTML code here --><br/>
<!--}}}--><br/>
</code></html>
And to activate JavaScript markup, enclose your code in the delimiters
<html><code>
//{{{<br/>
// JavaScript code here.<br/>
//}}}<br/>
</code></html>
In addition, all of the above languages can be syntaxified by using the custom class formatter
<html><code>
{{foo{<br/>
code for language "foo" here<br/>
}}}<br/>
</code></html>
where {{{foo}}} is the name of the language: {{{css}}}, {{{javascript}}}, or {{{xml}}}. This plugin can be extended with new languages by creating a data structure like those below (in {{{syntaxify.languages}}} and then calling {{{syntaxify.addLanguages}}}.
!History
* 1.2 Release
** Now syntaxifies in-line style code (thanks [[Conal Elliott|http://conal.net]]).
** Fix multi-line comments in CSS.
** Consolidate customClassesHelper and monospacedByLineHelper which had lots of duplicated code.
** Fix autoLinkWikiWords bug when using custom classes and the tag formatter.
** Fix compatibility problems between 2.1 and 2.0 (termRegExp vs. terminator)
* 1.1 Release
** Rewrite things to make it easier to add new languages.
** Override customClasses to syntaxify when the class corresponds to a known language.
** TiddlyWiki 2.1 beta compatibility
* 1.0.2 Release
** Don't use {{{class}}} as a variable name, dummy.
* 1.0.1 Release
** Simplified stylesheet and removed line numbering.
** Fixed highlighting when <html><code>*/</code></html> appeared at the beginning of a line.
** Fixed blank lines not being shown if {{{list-style-type: none}}} was turned on.
** Small speedups
* 1.0.0 Initial Release
!Code
***/
//{{{
version.extensions.Syntaxify = { major: 1, minor: 2, revision: 0, date: new Date("2007","01","29"),
source: "http://bob.mcelrath.org/syntaxify.html"
};
var syntaxify = {};
syntaxify.regexpSpace = new RegExp(" ", "mg");
syntaxify.regexpTab = new RegExp("\t", "mg");
syntaxify.regexpAmp = new RegExp("&","mg");
syntaxify.regexpLessThan = new RegExp("<","mg");
syntaxify.regexpGreaterThan = new RegExp(">","mg");
syntaxify.regexpQuote = new RegExp("\"","mg");
syntaxify.regexpDoubleQuotedString = new RegExp("\"(?:\\\\.|[^\\\\\"])*?\"", "mg");
syntaxify.regexpSingleQuotedString = new RegExp("'(?:\\\\.|[^\\\\'])*?'", "mg");
syntaxify.regexpCSingleLineComment = new RegExp('//.*$', "g");
syntaxify.regexpCMultiLineComment
= new RegExp('/\\*(?:(?:.|(?:\\r)?\\n)(?!\\*/))*(?:.|(?:\\r)?\\n)?\\*/',"mg");
String.prototype.htmlListMono = function() {
return(this.replace(syntaxify.regexpAmp,"&")
.replace(syntaxify.regexpLessThan,"<")
.replace(syntaxify.regexpGreaterThan,">")
.replace(syntaxify.regexpQuote,""")
.replace(syntaxify.regexpSpace," ")
.replace(syntaxify.regexpTab," "));
}
syntaxify.handleSpanClass = function(w) {
var match, lastPos=0;
if(this.lookahead) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
createTiddlyText(w.output, lookaheadMatch[1]);
var e = createTiddlyElement(w.output, "span", null, this.name);
e.innerHTML = this.hasSpaces?lookaheadMatch[2].htmlListMono():lookaheadMatch[2];
}
} else {
while((match = regexpNewLine.exec(w.matchText)) != null) { // multi-line
var alt = "";
var e = createTiddlyElement(w.output, "span", null, this.name);
e.innerHTML = this.hasSpaces?w.matchText.substr(lastPos,match.index-lastPos).htmlListMono()
:w.matchText.substr(lastPos,match.index-lastPos);
if(w.output.className != "alt") alt = "alt";
w.output = createTiddlyElement(w.output.parentNode, "li", null, alt);
lastPos = match.index;
}
var e = createTiddlyElement(w.output, "span", null, this.name);
e.innerHTML = this.hasSpaces?w.matchText.substr(lastPos, w.matchText.length-lastPos).htmlListMono()
:w.matchText.substr(lastPos, w.matchText.length-lastPos)
}
}
/* This is a shadow tiddler. Do not edit it here. Instead, open the tiddler StyleSheetSyntaxify
* and edit it instead. (go to the toolbar on the right and select "More"->"Shadowed") */
config.shadowTiddlers.StyleSheetSyntaxify = "/*{{{*/\n"
+".viewer .syntaxify {\n"
+" font-family: monospace;\n"
+"}\n"
+".viewer div.syntaxify {\n"
+" background-color: #ffc;\n"
+" border: 1px solid #fe8;\n"
+" padding: 0.5em;\n"
+" margin: 0 0 1em 0.5em;\n"
+" font-size: 1.2em;\n"
+" overflow: auto;\n"
+"}\n\n"
+".syntaxify ol {\n"
+" margin: 0;\n"
+" padding: 1px;\n"
+" color: #2B91AF;\n"
+"}\n\n"
+".syntaxify ol li {\n"
+" background-color: #ffc;\n"
+" color: black;\n"
+" list-style-type: none;\n"
+"/* An alternate style to enable line numbering -- remove the line above and uncomment below if desired */\n"
+"/*\n"
+" list-style-type: 1;\n"
+" border-left: 3px solid #fe8;\n"
+" margin-left: 3.5em;\n"
+"*/\n"
+"}\n\n"
+"/* To disable alternating lines having a different colors, comment out the following line. */\n"
+".syntaxify ol li.alt { background-color: #ffe; }\n\n"
+".syntaxify ol li span { color: black; }\n"
+".syntaxify .singleLineComments { color: green; }\n"
+".syntaxify .multiLineComments { color: green; }\n"
+".syntaxify .multiLineComments1 { color: red; }\n"
+".syntaxify .tag { font-weight: bold; color: blue; }\n"
+".syntaxify .tagname { font-weight: bold; color: black; }\n"
+".syntaxify .attribute { color: rgb(127,0,85); }\n"
+".syntaxify .value { color: rgb(42,0,255); }\n"
+".syntaxify .keywords { color: #006699; }\n"
+".syntaxify .keywords1 { color: red; }\n"
+".syntaxify .delimiters { color: maroon; }\n"
+".syntaxify .delimiters1 { color: olive; }\n"
+".syntaxify .literals { color: maroon; }\n"
+".syntaxify .literals1 { color: blue; }\n"
+".syntaxify .literals2 { color: blue; }\n"
+".syntaxify .literals3 { color: #129; }\n"
+".syntaxify .identifiers { font-weight: bold; color: blue; }\n"
+".syntaxify .identifiers1 { font-weight: bold; color: black; }\n"
+"/*}}}*/";
store.addNotification("StyleSheetSyntaxify",refreshStyles);
config.shadowTiddlers.ViewTemplate = "<!--{{{-->\n"+config.shadowTiddlers.ViewTemplate+"\n<!--}}}-->";
config.shadowTiddlers.EditTemplate = "<!--{{{-->\n"+config.shadowTiddlers.EditTemplate+"\n<!--}}}-->";
config.shadowTiddlers.PageTemplate = "<!--{{{-->\n"+config.shadowTiddlers.PageTemplate+"\n<!--}}}-->";
config.shadowTiddlers.StyleSheetPrint = "/*{{{*/\n"+config.shadowTiddlers.StyleSheetPrint+"\n/*}}}*/";
syntaxify.commonFormatters = [
{ name: "spaces",
match: "[ \\t]+",
handler: function(w) {
w.output.innerHTML += w.matchText.htmlListMono();
}
},{ name: "newline",
match: "\\n",
handler: function(w) {
var alt = ""
if(w.output.className != "alt") alt = "alt";
if(!w.output.hasChildNodes()) w.output.innerHTML = " ";
w.output = createTiddlyElement(w.output.parentNode, "li", null, alt);
}
}];
syntaxify.xmlTagFormatters = syntaxify.commonFormatters;
syntaxify.xmlTagFormatters = syntaxify.xmlTagFormatters.concat([
{ name: "tagname",
match: '<[/\\?]?\\s*(?:[\\w-\\.]+)',
lookahead: '(<[/\\?]?\\s*)([\\w-\\.]+)',
handler: syntaxify.handleSpanClass
},{
name: "attribute-value",
match: '[\\w-\.]+(?:\\s*=\\s*"[^"]*?"|\'[^\']*?\'|\\w+)?',
lookahead: '([\\w-\.]+)(?:(\\s*=\\s*)("[^"]*?"|\'[^\']*?\'|\\w+))?',
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var e = createTiddlyElement(w.output, "span", null, "attribute");
e.innerHTML = lookaheadMatch[1];
if(lookaheadMatch[2]) {
var e = createTiddlyElement(w.output, "span");
e.innerHTML = lookaheadMatch[2].htmlListMono();
e = createTiddlyElement(w.output, "span", null, "value");
e.innerHTML = lookaheadMatch[3].htmlListMono();
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}]);
// A rather huge data structure to store languages. Add to it!
syntaxify.languages = {
javascript: {
singleLineComments: [[syntaxify.regexpCSingleLineComment.source]],
multiLineComments: [[syntaxify.regexpCMultiLineComment.source]],
keywords: [['abstract', 'boolean', 'break', 'byte', 'case', 'catch', 'char',
'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do',
'double', 'else', 'enum', 'export', 'extends', 'false', 'final',
'finally', 'float', 'for', 'function', 'goto', 'if', 'implements',
'import', 'in', 'instanceof', 'int', 'interface', 'long', 'native',
'new', 'null', 'package', 'private', 'protected', 'public', 'return',
'short', 'static', 'super', 'switch', 'synchronized', 'this', 'throw',
'throws', 'transient', 'true', 'try', 'typeof', 'var', 'void',
'volatile', 'while', 'with']
],
literals: [
[syntaxify.regexpSingleQuotedString.source],
[syntaxify.regexpDoubleQuotedString.source],
["\\b\\d+(?:\\.\\d+(?:[eE][\\+-]\\d+)?)?\\b"] // Numbers
],
delimiters: [["[\\{\\}]"],["[\\(\\)]"],["[\\[\\]]"]]
},
css: {
multiLineComments: [[syntaxify.regexpCMultiLineComment.source]],
keywords: [
// Keywords appearing on the LHS of expressions
['ascent', 'azimuth', 'background-attachment', 'background-color',
'background-image', 'background-position', 'background-repeat',
'background', 'baseline', 'bbox', 'border-collapse', 'border-color',
'border-spacing', 'border-style', 'border-top', 'border-right',
'border-bottom', 'border-left', 'border-top-color',
'border-right-color', 'border-bottom-color', 'border-left-color',
'border-top-style', 'border-right-style', 'border-bottom-style',
'border-left-style', 'border-top-width', 'border-right-width',
'border-bottom-width', 'border-left-width', 'border-width', 'border',
'bottom', 'cap-height', 'caption-side', 'centerline', 'clear', 'clip',
'color', 'content', 'counter-increment', 'counter-reset', 'cue-after',
'cue-before', 'cue', 'cursor', 'definition-src', 'descent',
'direction', 'display', 'elevation', 'empty-cells', 'float',
'font-size-adjust', 'font-family', 'font-size', 'font-stretch',
'font-style', 'font-variant', 'font-weight', 'font', 'height', 'left',
'letter-spacing', 'line-height', 'list-style-image',
'list-style-position', 'list-style-type', 'list-style', 'margin-top',
'margin-right', 'margin-bottom', 'margin-left', 'margin',
'marker-offset', 'marks', 'mathline', 'max-height', 'max-width',
'min-height', 'min-width', 'orphans', 'outline-color',
'outline-style', 'outline-width', 'outline', 'overflow', 'padding-top',
'padding-right', 'padding-bottom', 'padding-left', 'padding', 'page',
'page-break-after', 'page-break-before', 'page-break-inside', 'pause',
'pause-after', 'pause-before', 'pitch', 'pitch-range', 'play-during',
'position', 'quotes', 'richness', 'right', 'size', 'slope', 'src',
'speak-header', 'speak-numeral', 'speak-punctuation', 'speak',
'speech-rate', 'stemh', 'stemv', 'stress', 'table-layout',
'text-align', 'text-decoration', 'text-indent', 'text-shadow',
'text-transform', 'unicode-bidi', 'unicode-range', 'units-per-em',
'vertical-align', 'visibility', 'voice-family', 'volume',
'white-space', 'widows', 'width', 'widths', 'word-spacing', 'x-height',
'z-index'],
// Treat !important as a different kind of keyword
["important"]
],
literals: [
// Literals appearing on the RHS of expressions
['above', 'absolute', 'all', 'always', 'aqua', 'armenian', 'attr',
'aural', 'auto', 'avoid', 'baseline', 'behind', 'below',
'bidi-override', 'black', 'blink', 'block', 'blue', 'bold', 'bolder',
'both', 'bottom', 'braille', 'capitalize', 'caption', 'center',
'center-left', 'center-right', 'circle', 'close-quote', 'code',
'collapse', 'compact', 'condensed', 'continuous', 'counter',
'counters', 'crop', 'cross', 'crosshair', 'cursive', 'dashed',
'decimal', 'decimal-leading-zero', 'default', 'digits', 'disc',
'dotted', 'double', 'embed', 'embossed', 'e-resize', 'expanded',
'extra-condensed', 'extra-expanded', 'fantasy', 'far-left',
'far-right', 'fast', 'faster', 'fixed', 'format', 'fuchsia', 'gray',
'green', 'groove', 'handheld', 'hebrew', 'help', 'hidden', 'hide',
'high', 'higher', 'icon', 'inline-table', 'inline', 'inset', 'inside',
'invert', 'italic', 'justify', 'landscape', 'large', 'larger',
'left-side', 'left', 'leftwards', 'level', 'lighter', 'lime',
'line-through', 'list-item', 'local', 'loud', 'lower-alpha',
'lowercase', 'lower-greek', 'lower-latin', 'lower-roman', 'lower',
'low', 'ltr', 'marker', 'maroon', 'medium', 'message-box', 'middle',
'mix', 'move', 'narrower', 'navy', 'ne-resize', 'no-close-quote',
'none', 'no-open-quote', 'no-repeat', 'normal', 'nowrap', 'n-resize',
'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
'outside', 'overline', 'pointer', 'portrait', 'pre', 'print',
'projection', 'purple', 'red', 'relative', 'repeat', 'repeat-x',
'repeat-y', 'ridge', 'right', 'right-side', 'rightwards', 'rtl',
'run-in', 'screen', 'scroll', 'semi-condensed', 'semi-expanded',
'separate', 'se-resize', 'show', 'silent', 'silver', 'slower', 'slow',
'small', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
'speech', 'spell-out', 'square', 's-resize', 'static', 'status-bar',
'sub', 'super', 'sw-resize', 'table-caption', 'table-cell',
'table-column', 'table-column-group', 'table-footer-group',
'table-header-group', 'table-row', 'table-row-group', 'teal',
'text-bottom', 'text-top', 'thick', 'thin', 'top', 'transparent',
'tty', 'tv', 'ultra-condensed', 'ultra-expanded', 'underline',
'upper-alpha', 'uppercase', 'upper-latin', 'upper-roman', 'url',
'visible', 'wait', 'white', 'wider', 'w-resize', 'x-fast', 'x-high',
'x-large', 'x-loud', 'x-low', 'x-slow', 'x-small', 'x-soft',
'xx-large', 'xx-small', 'yellow'],
// Font literals
['[mM]ono(?:space)?', '[tT]ahoma', '[vV]erdana', '[aA]rial',
'[hH]elvetica', '[sS]ans(?:-serif)?', '[sS]erif', '[Cc]ourier'],
// Measurement literals
["\\b\\d+(?:\\.\\d+)?(?:em|pt|px|cm|in|pc|mm)\\b"],
// Color literals
['(?:\\#[a-fA-F0-9]{6}\\b|\\#[a-fA-F0-9]{3}\\b|rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\))']
],
identifiers: [["\\.[a-zA-Z_]\\w*"],["\\#[a-zA-Z_]\\w*"]],
delimiters: [["[\\{\\}]"]]
},
xml: {
multiLineComments: [
["<[^!>]*!--\\s*(?:(?:.|(?:\\r)?\\n)(?!--))*?(?:(?:.|(?:\\r)?\\n)(?=--))?\\s*--[^>]*?>"],
['<\\!\\[[\\w\\s]*?\\[(?:(?:.|(?:\\r)?\\n)(?!\\]\\]>))*?(?:(?:.|(?:\\r)?\\n)(?=\\]\\]>))?\\]\\]>']
],
customFormatters: [{
name: "tag",
match: "<[/\\?]?[^>]*?>",
handler: function(w) {
var formatter = new Formatter(syntaxify.xmlTagFormatters);
var wikifier = new Wikifier(w.matchText, formatter, w.highlightRegExp, w.tiddler);
wikifier.subWikify(w.output, null);
}
}]
}};
config.formatterHelpers.customClassesHelper = function(w) {
var lookaheadRegExp = (typeof(this.lookaheadRegExp) == "undefined")?(new RegExp(this.lookahead,"mg")):this.lookaheadRegExp;
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
var language = (typeof(this.language) == "undefined")?lookaheadMatch[1]:this.language;
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
var isByLine = (typeof(this.byLine) == "undefined")?(lookaheadMatch[2] == "\n"):this.byLine;
var p = createTiddlyElement(w.output,isByLine ? "div" : "span",null,language);
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if(typeof(syntaxify.formatters[language]) != "undefined") {
var d = createTiddlyElement(w.output,isByLine?"div":"span",
null,"syntaxify "+language);
var formatter = new Formatter(syntaxify.formatters[language]);
if(typeof(this.termRegExp) == "undefined") {
var text = lookaheadMatch[1];
} else {
this.termRegExp.lastIndex = w.nextMatch;
var terminatorMatch = this.termRegExp.exec(w.source);
var text = w.source.substr(w.nextMatch, terminatorMatch.index-w.nextMatch);
}
if(config.browser.isIE) text = text.replace(/\n/g,"\r");
if (isByLine) {
var l = createTiddlyElement(d,"ol");
var li = createTiddlyElement(l,"li");
var wikifier = new Wikifier(text, formatter, w.highlightRegExp, w.tiddler);
wikifier.subWikify(li, null);
if(!l.childNodes[l.childNodes.length-1].hasChildNodes())
l.removeChild(l.childNodes[l.childNodes.length-1]);
} else {
var wikifier = new Wikifier(text,formatter,w.highlightRegExp,w.tiddler);
wikifier.subWikify(d, null);
}
if(typeof(this.termRegExp) != "undefined")
w.nextMatch = terminatorMatch.index + terminatorMatch[0].length;
else
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
} else {
if(isByLine)
var e = createTiddlyElement(w.output,"code",null,null,text);
else
var e = createTiddlyElement(w.output,"pre",null,null,text);
}
}
}
syntaxify.formatters = {};
syntaxify.addLanguages = function(languages) {
for(lang in languages) {
syntaxify.formatters[lang] = new Array();
for(var i=0;i<syntaxify.commonFormatters.length;i++)
syntaxify.formatters[lang].push(syntaxify.commonFormatters[i]);
var addSpanClass = function(rule, spaces, wordbreak) {
if(typeof(languages[lang][rule]) != "undefined") {
for(var j=0;j<languages[lang][rule].length;j++) {
syntaxify.formatters[lang].push({
name: rule+((j==0)?"":j),
match: wordbreak?("(?:\\b"+languages[lang][rule][j].join("\\b|\\b")+"\\b)")
:("(?:"+languages[lang][rule][j].join("|")+")"),
hasSpaces: spaces,
handler: syntaxify.handleSpanClass
});
}
}
};
addSpanClass("singleLineComments", true, false);
addSpanClass("multiLineComments", true, false);
addSpanClass("keywords", false, true);
addSpanClass("literals", true, false);
addSpanClass("delimiters", false, false);
addSpanClass("identifiers", false, false);
if(typeof(languages[lang].customFormatters) != "undefined")
syntaxify.formatters[lang] = syntaxify.formatters[lang].concat(languages[lang].customFormatters);
}
}
syntaxify.addLanguages(syntaxify.languages);
// Override the several built-in TiddlyWiki language-specific <pre> formatters
for(var i=0;i<config.formatters.length;i++) {
if(config.formatters[i].name == "monospacedByLineForPlugin") {
config.formatters[i].language = "javascript";
config.formatters[i].byLine = true;
config.formatters[i].handler = config.formatterHelpers.customClassesHelper;
}
if(config.formatters[i].name == "monospacedByLineForCSS") {
config.formatters[i].language = "css";
config.formatters[i].byLine = true;
config.formatters[i].handler = config.formatterHelpers.customClassesHelper;
}
if(config.formatters[i].name == "monospacedByLineForTemplate") {
config.formatters[i].language = "xml";
config.formatters[i].byLine = true;
config.formatters[i].handler = config.formatterHelpers.customClassesHelper;
}
if(config.formatters[i].name == "customClasses") {
config.formatters[i].handler = config.formatterHelpers.customClassesHelper;
if(typeof(config.formatters[i].termRegExp) == "undefined")
config.formatters[i].termRegExp = new RegExp(config.formatters[i].terminator, "mg");
}
}
// make syntaxify reliably accessible from dependent plugins even under IE.
config.macros.syntaxify = syntaxify;
//}}}
/***
|Author|[[Conal Elliott|http://conal.net]]|
|Date|2007-01-28|
|Version|1.1|
|LoadDependencies|SyntaxifyPlugin|
|''Source:''|http://journal.conal.net/#%5B%5BSyntaxifyPlugin%3A%20Haskell%5D%5D|
!Description
Add support for [[Haskell| http://haskell.org]] syntax highlighting, as an extension to SyntaxifyPlugin.
!Use
{{{
{{haskell{
<haskell code goes here>
}}}
}}}
or <html><code>{{haskell{inline code}}}</code></html>.
!Example
{{haskell{
-- Define the data types and conversion:
type Line = String
silly :: Line -> Line
silly src = src ++ toU " oho " ++ reverse src
where
toU = map toUpper
}}}
or {{haskell{if foo then "bar" else "baz"}}}.
!History
* Version 1.1
** Smarter {{haskell{identifiers}}} pattern, to avoid false hits for expressions (especially in-line).
** {{haskell{{- Multi-line comments -} }}}
!To Do
* Type coloring.
!See Also
* SyntaxifyPlugin
* [[RewritePlugin: Haskell]] for a more convenient notation (especially with literate Haskell programming).
!Code
***/
//{{{
version.extensions.syntaxifyHaskell =
{major: 1, minor: 1, revision: 0, date: new Date(2007,1,28)};
config.macros.syntaxify.addLanguages({
haskell:
{ singleLineComments: [[new RegExp('-- .*$', "g").source]]
, keywords:
[ [ 'as', 'case', 'class', 'data', 'default'
, 'deriving', 'do', 'else', 'forall', 'hiding', 'if'
, 'import', 'in', 'infix', 'infixl', 'infixr'
, 'instance', 'let', 'module', 'newtype', 'of'
, 'qualified', 'then', 'type', 'where', '_'
]
, ["\\b[A-Z][a-zA-Z0-9]*\\b"]
]
, literals:
[ ["'(?:\\\\.|[^\\\\'])'"] // char literals
, [config.macros.syntaxify.regexpDoubleQuotedString.source]
, ["\\b\\d+(?:\\.\\d+(?:[eE][\\+-]\\d+)?)?\\b"] // Numbers
]
// def or decl. id in "id ... = ..." or "id :: ...". Ids can have tick marks.
// The "..." must not contain symbols. (Not strictly true in Haskell, but too hard
// to describe fully with regexps.)
, identifiers: [["^[a-z][a-zA-Z0-9']*\\b'*(?=(?:[^=<>:+-]*=|\\s*::)[^=<>:+-])"]]
, delimiters: [/*["[\\{\\}]"],*/["[\\(\\)]"],["[\\[\\]]"]]
, multiLineComments: [["{-(?:.|\n)*?-}"]]
}
});
//}}}
Serve with rice and possibly coleslaw.
Serves 6
!Ingredients
* 12 pork sausages, skin removed and roughly broken up
* 1 onion, chopped
* chili powder
* garlic clove, chopped
* dried oregano
* cumin seeds
* 2 cans kidney beans
* can tomato juice
* 250 ml stock
!Method
# Cook the sausagemeat until it is browning.
# Add onion, chilli powder, garlic clove, oregano and cumin.
# Cook until the onions are soft.
# Add kidney beans and tomato juice.
# Simmer until reduced.
Sometimes it’s handy to write [[Test Anything Protocol]] from a batch script.
!General file template
The file should pretty much follow this template:
{{{
:: Test Description
@echo off
if defined DEBUG echo on
:: see Debugging
:INITIALISE
setlocal
set _me=%0
set _tmpfile=%_me:.bat=%.tmp
:: or
set _tmpfile=%tmp%\%_me:.bat%.tmp
set /A _test_number=0
:TAP_PLAN
@echo TAP version13
@echo # Test {test-number}
@echo # {test-description}
@echo # Test run at %date% %time%
@echo 1 .. {n}
:TESTS
:: do some tests of the general form
set /A _test_number=_test_number+1
:: do some action and check the result
if ERRORLEVEL 1 (
echo not ok %_test_number% – {test-point-description}
set error={meaningful-test-message}
goto BAIL_OUT!
) else (
echo ok %_test_number% – {test-point-description}
)
…
:: more tests
…
:END_OF_TESTS
endlocal
exit /B 0
:BAIL_OUT!
echo Bail Out! %_error%. See %_tmpfile% for details.
:: restart any services that were stopped
endlocal
exit /B 1
}}}
!Sample template
It doesn’t stop services, but here’s a simple {{{[[test-template.bat|./src/TAP/test-template.bat]]}}}
!Test Logic
When checking ERRORLEVEL, e.g. in statements of the form “if ERRORLEVEL n” the test returns true if the ERRORLEVEL is equal to or greater than the number specified. As the de-facto standard is for scripts to return 0 on success and 1 or greater for failure then it isn't possible to test for failure in the following manner:
{{{
if ERRORLEVEL 0 (
:: will always run as ERRORLEVEL is always 0 or greater
echo ok
) else (
:: will never reach here
echo not ok
)
}}}
It isn’t necessary to test for failure when checking for the existence of files or environment variables. For instance the following will work:
{{{
if defined ENVIRONMENT_VARIABLE (
echo ok
) else (
echo not ok
)
if exist {filename} {
echo ok
} else {
echo not ok
}
}}}
Because of the inconsistency with the ERRORLEVEL tests it helps to test for failure first:
{{{
if not defined ENVIRONMENT_VARIABLE (
echo not ok
) else (
echo ok
)
if not exist {filename} (
echo not ok
) else (
echo ok
)
}}}
!!Capturing command output
Output of commands that may be of assistance in post-test analysis can be directed to a temporary file named for the script:
{{{
mkdir foo> %_tmpfile% 2>&1
}}}
!!Starting and stopping services
If any services are required to be stopped by the test then the service should be restarted before the test exist.
{{{
net stop “{service-name}” >%_tmpfile% 2>&1
:: ERRORLEVEL is stored in a temporary variable so
:: service can be restarted if necessary
set _restart_web=%ERRORLEVEL%
if %_restart_{service}% EQU 0 (
echo # {service} stopped – will restart once test complete
) else (
echo # {service} already stopped
)
:: do the tests
…
:: restart service if stopped
if %_restart_{service}% EQU 0 (
echo # restarting {service}
net start “{service-name}” >%_tmpfile% 2>&1
)
:: restart service at Bail Out if stopped
:BAIL_OUT!
echo Bail Out! %_error%. See %_tmpfile% for details.
:: restart any services that were stopped
if defined _restart_web (
if %_restart_{service}% EQU 0 (
echo # restarting {service}
net start “{service-name}” >%_tmpfile% 2>&1
)
)
endlocal
exit /B 1
}}}
!Debugging
If the {{{%DEBUG%}}} environment variable is defined the script will intermingle TAP output and command flow, which may assist in debugging.
!Invocation
Direct invocation is nice to run on demand, and it's easy to create a desktop shortcut. So if you have a test case for the build step (which I've seen before now), running the build test is an easy way for anyone to rebuild the software on demand. Be careful - the readability of the TAP output could convert people! Of course the build test can also be scheduled to be your daily build.
!!Direct
{{{
$ test.bat
TAP version 13
# Test {n}
# {test-description}
# Test run at: {date} {time}
1..{n}
ok 1
…
ok {n}
$
}}}
!!Scheduled
Wrap the test(s) in a {{{[[run-tests.bat|./src/TAP/run-tests.bat]]}}} script. This example assumes that the test scripts are located in {{{\Testdata\Scripts}}} and the results are going into {{{\Testdata\Results}}}:
{{{
:: Wrapper script for running tests
@echo off
:: Use full path to tests so that tests can be scheduled
:: and the results don’t disappear into the ether
if not exist \TestData\Results\ (
mkdir \TestData\Results\
)
cd \Testdata\Scripts
call \Testdata\Scripts\test-{x}.{y}.bat > \TestData\Results\test-{x}.{y}.tap
call \Testdata\Scripts\test-{x}.{z}.bat > \TestData\Results\test-{x}.{z}.tap
move /Y \Testdata\Scripts\*.tmp \TestData\Results\
@echo on
}}}
Note the use of //call// so that exit from a test script doesn’t exit from the wrapper.
Then to schedule the tests the {{{[[run-tests.bat|./src/TAP/run-tests.bat]]}}} script is further wrapped by a {{{[[schedule-tests.bat|./src/TAP/schedule-tests.bat]]}}} script that contains the schedule details:
{{{
:: Schedule tests to run in the future, e.g. overnight
net start “task scheduler”
at 20:00 /every:M,T,W,Th,F %cd%\run-tests.bat
}}}
Note that the task scheduler must be provided with the full path to the {{{run-tests.bat}}} script.
!!Analysis
TAP output can then be analysed as per TAP data from any other producer.
Insead of worrying about potentially changing indices or names as displayed to the workbook user use the {{{CodeName}}}. This doesn’t change even when the sheet is renamed or moved.
* Select the worksheet in the VBA Project:
[img[VBA project in Excel|./wiki-images/worksheet-name.png]]
* Then rename it in the properties:
[img[Properties for a Worksheet|./wiki-images/worksheet-properties.png]]
* The worksheet can now be referred to by name programatically, for example:
{{{
Public SubToggleConstantsWorksheet()
On Error Resume Next
CONSTANTS.Visible = Not CONSTANTS.Visisble
End Sub
}}}
!Building managed security services using AppScan
Colin Bell, (IBM, Ireland)
* Need to consider how AppScan compares to use of a multi-toolset approach, such as BurpSuite, Nessus, nmap, MetaSploit.
* Is AppScan and reports it generates accepted by CESG and accreditors in government and defence industry networks and web-apps?
Three phase approach to application vulnerability analysis follows expected pattern.
!!Phase1: Host Discovery
* establish target
* ''secure approval to test application''
* scope map and review application
!!Phase 2: Conduct Test
This phase iterates between
* detect - identify risks
* attack - verify risks
!!Phase 3: Report Findings
* collate
* risk analysis (in a manner comparable with INFOSEC RRI calculations).
* report
"We don't serve faster than light particles in here", says the barman.
A neutrino walks into a bar.
{{{
$ $d0 || !$do; try
try: command not found
}}}
/Everybody stand back/
I know regular expressions
Think globally. Act within local variable scope.
There are 10 types of people. Those that can understand binary, and those that can't.
11 cheers for binary.
If you, me, and dead people can read hex, then how many people can read hex?
> I though of it whilst riding my bicycle
Albert Einstein
> To invent you need a good imagination and a pile of junk
Thomas Edison
01101110 01101111
01101101 01100101 01101000
{{{
\(-
}}}
> 10001110 11011100 00101111 01110000 10010101 0010. Makes you think huh?
Kryten
If at first you don't succeed, call it version 1.0
I'm not anti-social, I'm just not user friendly.
Passwords are like underwear.
Failure is not an option, it comes bundled with Windows.
Enter any 11-digit prime number to continue.
Alcohol and calculus don't mix. Never drink and derive.
{{{
SELECT * FROM users WHERE clue > 0
- returned 0 results
}}}
The truth is out there. Anybody got the URL?
LISP = Lots of Irritating Silly Parentheses
There's no place like 127.0.0.1
I take my coffee #000000
My resolution for this year? 1920 * 1080
My name is URL
"A booming voice says "Wrong, cretin!" and you notice that you have turned into a pile of dust"
"It is pitch black. You are likely to be eaten by a grue."
>Don't communicate by sharing memory; share memory by communicating.
Rob Pike
A null character terminated string value in the Windows registry.
Serves //x//
!Ingredients
* ...
!Method
# ...
!Support
* https://www.ibm.com/developerworks/rational/
!Forum
* http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1501
!Integration
* [[Integrating Rhapsody & Dimensions]]
* [[Integrating Rhapsody & MinGW]]
* [[Rhapsody & GNAT]]
Some versions of GNAT, for instance 3.15p, do not support spaces in path names on Windows platforms.
This causes problems when trying to compile the Rhapsody in Ada frameworks:
{{{
gcc -c -g "-IC:\Program Files\IBM\Rational\Rhapsody\7.5.2\Share\LangAda95\aom_new_95\" -I- .\default\<component>.adb
...
gcc.exe: "-IC:\Program: Invalid argument
gcc.exe: Files\IBM\Rational\Rhapsody\7.5.2\Share\LangAda95\aom_new_95\" -I- .\default\<component>.adb: Invalid file or directory
}}}
To work around this:
* define {{{%OMROOT%}}} in //rhapsody.ini// using 8.3 filenames.
{{{
gcc -c -g "-IC:\Progra~1\IBM\Rational\Rhapsody\7.5.2\Share\LangAda95\aom_new_95\" -I- .\default\<component>.adb
...
}}}
* only use directories with a pathname containing no spaces to develop Rhapsody in Ada models.
!Description
Trying to build and run a model using Java
!Symptoms
Error message is:
{{{
Building ------------ MainDefaultComponent.class ------------
Executing: "C:\Program Files\IBM\Rational\Rhapsody\7.5.3\Share\etc\jdkmake.bat" DefaultComponent.bat build
Unable to compile
Build Done
}}}
!Solution
The error is because Rhapsody can't find a java compiler, //javac//. If you want to generate Java code using Rhapsody you need a JDK installed before you install Rhapsody, not just the JRE.
The {{{rhapsody.ini}}} file will contain a line starting ''JavaLocation=''. This needs to match your JDK directory, e.g. {{{C:\Program Files\Java\jdk1.6.0_24}}}
This value is also hard-coded into {{{jdkmake.bat}}}; you can see this if you open it up in a text editor. So if you update your JDK after installing Rhapsody the build script doesn't pick up the path to the newly installed java compiler, //javac//.
Putting the path to your /javac// into {{{jdkmake.bat}}} lines 2 and 3 will fix the issue. Note that you'll need to use 8.3 filename style if there are spaces in the path to your //javac//.
!Can agile SCM scale?
Round table discussion
* I don't believe that you can scale any methodology without SCM
* I'd drop the 'S' in SCM - Configuration Management is bigger than just //Software// Configuration Management
* I believe processes can scale, the barrier is the infrastructure? Integrated toolchains have more chance of scaling than small tools integrated in-house.
* Rational Team Concert already breaks down these barriers with it's ability to follow a changeset from requirement to verification.
* Can business afford for agile not to scale? The existing lifecycles and methodologies in companies such as BAE Systems will drag them down if they can't adopt leaner and faster processes. Whether they'll realise they need to adopt an agile development environment remains to be seen?
And //development environment// means much, so very much, more than an IDE or event toolchain. It encompasses processes, infrastructure, and process improvement.
> Rufus: This is so much more than a box sir
> Love Actually, 2003
http://www.upmentors.com
A winter warmer.
Serves 2-3
!Ingredients
* glug olive oil
* 2 onions, sliced
* 150g pasta
* 4-6 good quality sausages, skinned and chopped or roughly broken up
* handful flat leaf parsley
* dollop smooth mustard
* dollop grainy mustard
* small pot double cream
* salt and black pepper
!Method
# Fry the onions until sweet and soft.
# Add the sausagemeat and cook through.
# Cook the pasta til //al dente//, about 9 minutes
# When the pasta is done drain and toss into the sausage and onions. Add cream, parsley, and mustard and stir through.
!Ingredients
* A mix of seafood for instance squid, mussels, clams, shrimp, monkfish, salmon
* Sake
* Dashi
* Water
* Kombu seaweed or pak choi
* miso paste
* green onions
* ginger
* noodles
!Method
# Gently fry green onions with ginger until the onions are bright.
# Add, along with everything else to gently simmering dashi.
We like having Visual Studio guides at 80, 110, and 132 columns. So we wrote a little bit of [[VBS|./src/dos/set-visual-studio-guides.vbs]] that uses the Windows Script Host to make the appropriate registry key settings.
''Key:'' {{{\\[HKCU]\Software\Microsoft\VisualStudio\{version}\Text Editor\Guides}}}
''Value:'' <REG_SZ> "RGB(192,192,192) 80,110,132"
!Usage
{{{
$ cscript //NoLogo set-vs-guides.vbs
}}}
On Windows 2008 servers the DHCP administration tool does not initially allow option 60 to be configured via the GUI. It can be configured using {{{netsh}}}:
{{{
$ netsh
netsh> dhcp server {server-name}
netsh dhcp server> add optiondef 60 PXEClient STRING 0 comment=option added for PXE support
netsh dhcp server> set optionvalue 60 STRINGPXEClient
netsh dhcp server> show optionvalue all
...
OptionId : 60
Option Value:
Number of Option Elements = 1
Option Element Type = STRING
Option Element Value = PXEClient
Command completed succesfully.
}}}
Now that the option has been added it can be modified via the DHCP administration GUI.
!Read more
* {{{netsh}}}: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx
Define a command sequence which sets the title of the window before changing directory:
{{{
@%*
@set pwd=%CD%
@title %CD%
}}}
Call the file something sensible, such as //set-terminal-title.cmd//; verbosity is unimportant as you’re not going to end up typing it yourself.
And a title?
Define the environment variable {{{%TITLE%}}} and set that when setting the title:
{{{
@%*
@set pwd=%CD%
@title %TITLE% – %CD%
}}}
Make sure the script is saved somewhere in your path.
Now in {{{macros.mac}}} define the following:
{{{
cd..=set-terminal-title cd ..
cd=set-terminal-title cd /D $*
popd=set-terminal-title popd $*
pushd=set-terminal-title pushd $*
a:=set-terminal-title a:
b:=set-terminal-title b:
c:=set-terminal-title c:
d:=set-terminal-title d:
e:=set-terminal-title e:
f:=set-terminal-title f:
g:=set-terminal-title g:
h:=set-terminal-title h:
i:=set-terminal-title i:
j:=set-terminal-title j:
k:=set-terminal-title k:
l:=set-terminal-title l:
m:=set-terminal-title m:
n:=set-terminal-title n:
o:=set-terminal-title o:
p:=set-terminal-title p:
q:=set-terminal-title q:
r:=set-terminal-title r:
s:=set-terminal-title s:
t:=set-terminal-title t:
u:=set-terminal-title u:
v:=set-terminal-title v:
w:=set-terminal-title w:
x:=set-terminal-title x:
y:=set-terminal-title y:
z:=set-terminal-title z:
}}}
<<search>><<closeAll>><<newTiddler>><<permaview>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
!Scenario
You need to do a command line uninstall, and can't figure out or find relevant the options for 1.6.21
Oracle states that the Java SE installer is built using [[MSI| MSI options]], but the help page, rather unhelpfully doesn't list uninstall options.
Running the installer with the {{{/s /x}}} options just hangs.
You can find the correct product code to pass to //msiexec /x// by checking the registry key for the version of Java you want to uninstall.
* Open //regedit// and navigate to the following key:
**{{[HKLM]\SOFTWARE\Microsoft\Windows\~CurrentVersion\Uninstall}}}
* Select this key and use ''Edit > Find'' to search for "Java" This should show which subkey(s) the Java version(s) is located under.
* Select the GUID for the version of Java you need to uninstall. One of the keys is {{{UninstallString}}} and should contain a command line to uninstall Java. Note however, this will only work on other machines if the exact same version of Java is installed.
For instance
{{{
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{32A3A4F4-B792-11D6-A78A-00B0D0160210} /v uninstallString
}}}
!Read more
* How to uninstall Java SE from the command line: http://www.oracle.com/technetwork/java/javase/silent-136552.html
Systems & Software Engineering Wiki <<search>>
Not necessarily authentic
Serves 2
!Ingredients
* 150g pasta
* 75g pancetta
* 2 large eggs
* 2 garlic cloves, finely chopped
* flat leaf parsley
* black pepper
* pecorino or parmesan
!Method
# Cook the pasta til //al dente//, about 9 minutes
# Fry the pancetta.
# Just before the pancetta is finished add the garlic.
# When the pasta is done drain and toss into the pancetta. Add half the cheese, salt and black pepper. Break the eggs over the pasta then stir until the eggs are cooked.
# Serve with salad and the rest of the cheese.
These are nice served with flatbread or rice and pistachios.
Serves 2-3
!Ingredients
* 1 tablespoon black peppercorns, crushed
* juice of 2 lemons
* runny honey
* 1 dollop grain mustard
* 2 crushed garlic cloves
* 4-6 chicken thighs. From good quality chicken.
* 2-3 preserved lemons
* flat leaf parsley
* green onions
!Method
# Mix peppercorns, honey, lemon juice, mustard and garlic.
# Marinade the chicken thighs for as long as possible.
# Cook for 45 minutes at 200°C
# Garnish with parsley, preserved lemon skin and olives.
/***
Akroyd Wallis Customisation. See also the ColorPalette, PageTemplate, and the [[style guide|http://www.akroyd-wallis.co.uk/style-guide.html]].
***/
/*{{{*/
body {
font-family: 'Frutiger Linotype', Segoe, Corbel, Calibri, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size:90%;
margin:0;
padding:0;
}
.header {
background:[[ColorPalette::Background]];
width:100%;
height:9em;
padding:0.5em;
}
.headerForeground {
padding:1.5em 0 0 0;
}
.siteTitle, .siteSubtitle{
width:100%;
margin:auto 0;
font-weight:normal;
float:left;
}
.siteTitle {
background:[[ColorPalette::Background]];
color:[[ColorPalette::Foreground]];
font-size:3em;
font-family:Garamond, Georgia;
padding: 0.5em 0.25em 0 0.25em;
}
.siteSubtitle {
background:[[ColorPalette::PrimaryLight]];
color:white;
text-align:center;
min-width:1024px;
padding:0.25em;
}
#mainMenu {
float:left;
padding:0.25em 0.5em 0.25em;
font-size:0.875em;
text-align:left;
width:15em;
}
#sidebar {
float:right;
padding:0.25em;
}
.logo {
font-family:Garamond, Georgia;
}
.blue {
color:#78b3e0;
}
.file {
font-family:"Lucida Console", monospace;
}
/*
** Borders per the Style Guide
*/
.title {
font-size:1.6em;
font-weight:bold;
border-bottom:2px solid #78b3e0;
margin-bottom:0.5em;
}
h1, h2 {
border:none;
}
/* separate tiddlers */
.tiddler {
padding-bottom:0.5em;
margin-bottom:0.5em;
}
.subtitle {
text-align:right;
font-size:0.875em;
font-weight:normal;
color:[[ColorPalette::SecondaryMid]];
}
.viewer th {
background:[[ColorPalette::PrimaryLight]];
color:white;
}
.viewer pre {
font-size: 1em;
}
#contentFooter {
background:[[ColorPalette::PrimaryLight]];
color:white;
text-align:center;
margin-left:15em;
margin-right:18em;
}
/*}}}*/
/***
Centered Tables, i.e. text centred in columns, not table centered in page.
***/
/*{{{*/
.viewer div.centeredTable {
text-align:center;
}
/*}}}*/
/***
This fixes a problem with the tabs slider
***/
/*{{{*/
#sidebarTabs .button {
margin:0em 0.2em;
padding:0.2em 0.3em;
display:block;
}
/*}}}*/
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}
h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
.header {background:[[ColorPalette::Background]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
.tabSelected{color:[[ColorPalette::PrimaryDark]];
background:[[ColorPalette::TertiaryPale]];
border-left:1px solid [[ColorPalette::TertiaryLight]];
border-top:1px solid [[ColorPalette::TertiaryLight]];
border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}
#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}
#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.tiddler .defaultCommand {font-weight:bold;}
.shadow .title {color:[[ColorPalette::TertiaryDark]];}
.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::SecondaryMid]];}
.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}
.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}
.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}
.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}
.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
.imageLink, #displayArea .imageLink {background:transparent;}
.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}
#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/***
StyleSheet for ~SyntaxHighlighter
***/
/*{{{*/
.dp-highlighter
{
font-family: "Consolas", "Courier New", Courier, mono, serif;
font-size: 12px;
background-color: #E7E5DC;
width: 99%;
overflow: auto;
margin: 18px 0 18px 0 !important;
padding-top: 1px; /* adds a little border on top when controls are hidden */
}
/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span
{
margin: 0;
padding: 0;
border: none;
}
.dp-highlighter a,
.dp-highlighter a:hover
{
background: none;
border: none;
padding: 0;
margin: 0;
}
.dp-highlighter .bar
{
padding-left: 45px;
}
.dp-highlighter.collapsed .bar,
.dp-highlighter.nogutter .bar
{
padding-left: 0px;
}
.dp-highlighter ol
{
list-style: decimal; /* for ie */
background-color: #fff;
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
padding: 0px;
color: #5C5C5C;
}
.dp-highlighter.nogutter ol,
.dp-highlighter.nogutter ol li
{
list-style: none !important;
margin-left: 0px !important;
}
.dp-highlighter ol li,
.dp-highlighter .columns div
{
list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
list-style-position: outside !important;
border-left: 3px solid #6CE26C;
background-color: #F8F8F8;
color: #5C5C5C;
padding: 0 3px 0 10px !important;
margin: 0 !important;
line-height: 14px;
}
.dp-highlighter.nogutter ol li,
.dp-highlighter.nogutter .columns div
{
border: 0;
}
.dp-highlighter .columns
{
background-color: #F8F8F8;
color: gray;
overflow: hidden;
width: 100%;
}
.dp-highlighter .columns div
{
padding-bottom: 5px;
}
.dp-highlighter ol li.alt
{
background-color: #FFF;
color: inherit;
}
.dp-highlighter ol li span
{
color: black;
background-color: inherit;
}
/* Adjust some properties when collapsed */
.dp-highlighter.collapsed ol
{
margin: 0px;
}
.dp-highlighter.collapsed ol li
{
display: none;
}
/* Additional modifications when in print-view */
.dp-highlighter.printing
{
border: none;
}
.dp-highlighter.printing .tools
{
display: none !important;
}
.dp-highlighter.printing li
{
display: list-item !important;
}
/* Styles for the tools */
.dp-highlighter .tools
{
padding: 3px 8px 3px 10px;
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: silver;
background-color: #f8f8f8;
padding-bottom: 10px;
border-left: 3px solid #6CE26C;
}
.dp-highlighter.nogutter .tools
{
border-left: 0;
}
.dp-highlighter.collapsed .tools
{
border-bottom: 0;
}
.dp-highlighter .tools a
{
font-size: 9px;
color: #a0a0a0;
background-color: inherit;
text-decoration: none;
margin-right: 10px;
}
.dp-highlighter .tools a:hover
{
color: red;
background-color: inherit;
text-decoration: underline;
}
/* About dialog styles */
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
.dp-about td { padding: 10px; vertical-align: top; }
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
.dp-about .para { margin: 0 0 4px 0; }
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
/* Language specific styles */
.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
.dp-highlighter .string { color: blue; background-color: inherit; }
.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
/*}}}*/
/*{{{*/
.viewer .syntaxify {
font-family: "Lucida Console", "Courier New", Courier, monospace;
/* font-size: 1.1em; */
}
.viewer div.syntaxify {
background-color: #ffc;
border: 1px solid #fe8;
/*
margin: 0 0 1em 0.5em;
font-size: 1.2em;
*/
padding: 0.2em 0.5em 0.2em 0.5em;
margin: 0.5em 1.5em 0.5em 1.5em;
line-height: 1.4em;
-moz-border-radius: 0.75em;
overflow: auto;
}
.syntaxify ol {
margin: 0;
padding: 1px;
color: #2B91AF;
}
.syntaxify ol li {
background-color: #ffc;
color: black;
list-style-type: none;
/* An alternate style to enable line numbering -- remove the line above and uncomment below if desired */
/*
list-style-type: 1;
border-left: 3px solid #fe8;
margin-left: 3.5em;
*/
}
/* To disable alternating lines having a different colors, comment out the following line. */
/* .syntaxify ol li.alt { background-color: #ffe; } */
.syntaxify ol li span { color: black; }
.syntaxify .singleLineComments { color: green; }
.syntaxify .multiLineComments { color: green; }
.syntaxify .multiLineComments1 { color: red; }
.syntaxify .tag { font-weight: bold; color: blue; }
.syntaxify .tagname { font-weight: bold; color: black; }
.syntaxify .attribute { color: rgb(127,0,85); }
.syntaxify .value { color: rgb(42,0,255); }
.syntaxify .keywords { color: #006699; }
.syntaxify .keywords1 { color: red; }
.syntaxify .delimiters { color: maroon; }
.syntaxify .delimiters1 { color: olive; }
.syntaxify .literals { color: maroon; }
.syntaxify .literals1 { color: blue; }
.syntaxify .literals2 { color: blue; }
.syntaxify .literals3 { color: #129; }
.syntaxify .identifiers { /* font-weight: bold; */ color: blue; }
.syntaxify .identifiers1 { font-weight: bold; color: black; }
/*}}}*/
/***
!Metadata:
|''Name:''|SyntaxHighlighterPlugin|
|''Description:''|Code Syntax Highlighter Plugin for TiddlyWiki.|
|''Version:''|1.1.3|
|''Date:''|Oct 24, 2008|
|''Source:''|http://www.coolcode.cn/show-310-1.html|
|''Author:''|Ma Bingyao (andot (at) ujn (dot) edu (dot) cn)|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licenses/lgpl.txt]]|
|''~CoreVersion:''|2.4.1|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0; Safari; Opera; Chrome; etc.|
!Syntax:
{{{
<code options>
codes
</code>
}}}
!Examples:
{{{
<code java>
public class HelloWorld {
public static void main(String args[]) {
System.out.println("HelloWorld!");
}
}
</code>
}}}
!Revision History:
|''Version''|''Date''|''Note''|
|1.1.2|Oct 15, 2008|Optimize Highlight|
|1.0.0|Oct 13, 2008|Initial release|
!Code section:
***/
//{{{
var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:"<html><head><title>About...</title></head><body class=\"dp-about\"><table cellspacing=\"0\"><tr><td class=\"copy\"><p class=\"title\">dp.SyntaxHighlighter</div><div class=\"para\">Version: {V}</p><p><a href=\"http://www.dreamprojections.com/syntaxhighlighter/?ref=about\" target=\"_blank\">http://www.dreamprojections.com/syntaxhighlighter</a></p>©2004-2007 Alex Gorbatchev.</td></tr><tr><td class=\"footer\"><input type=\"button\" class=\"close\" value=\"OK\" onClick=\"window.close()\"/></td></tr></table></body></html>"},ClipboardSwf:null,Version:"1.5.1"}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:"+ expand source",check:function($){return $.collapse},func:function($,_){$.parentNode.removeChild($);_.div.className=_.div.className.replace("collapsed","")}},ViewSource:{label:"view plain",func:function($,_){var A=dp.sh.Utils.FixForBlogger(_.originalCode).replace(/</g,"<"),B=window.open("","_blank","width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0");B.document.write("<textarea style=\"width:99%;height:99%\">"+A+"</textarea>");B.document.close()}},CopyToClipboard:{label:"copy to clipboard",check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null},func:function($,A){var B=dp.sh.Utils.FixForBlogger(A.originalCode).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");if(window.clipboardData)window.clipboardData.setData("text",B);else if(dp.sh.ClipboardSwf!=null){var _=A.flashCopier;if(_==null){_=document.createElement("div");A.flashCopier=_;A.div.appendChild(_)}_.innerHTML="<embed src=\""+dp.sh.ClipboardSwf+"\" FlashVars=\"clipboard="+encodeURIComponent(B)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>"}alert("The code is in your clipboard now")}},PrintSource:{label:"print",func:function($,B){var _=document.createElement("IFRAME"),A=null;_.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(_);A=_.contentWindow.document;dp.sh.Utils.CopyStyles(A,window.document);A.write("<div class=\""+B.div.className.replace("collapsed","")+" printing\">"+B.div.innerHTML+"</div>");A.close();_.contentWindow.focus();_.contentWindow.print();alert("Printing...");document.body.removeChild(_)}},About:{label:"?",func:function(_){var A=window.open("","_blank","dialog,width=300,height=150,scrollbars=0"),$=A.document;dp.sh.Utils.CopyStyles($,window.document);$.write(dp.sh.Strings.AboutDialog.replace("{V}",dp.sh.Version));$.close();A.focus()}}};dp.sh.Toolbar.Create=function(B){var A=document.createElement("DIV");A.className="tools";for(var _ in dp.sh.Toolbar.Commands){var $=dp.sh.Toolbar.Commands[_];if($.check!=null&&!$.check(B))continue;A.innerHTML+="<a href=\"#\" onclick=\"dp.sh.Toolbar.Command('"+_+"',this);return false;\">"+$.label+"</a>"}return A};dp.sh.Toolbar.Command=function(_,$){var A=$;while(A!=null&&A.className.indexOf("dp-highlighter")==-1)A=A.parentNode;if(A!=null)dp.sh.Toolbar.Commands[_].func($,A.highlighter)};dp.sh.Utils.CopyStyles=function(A,_){var $=_.getElementsByTagName("link");for(var B=0;B<$.length;B++)if($[B].rel.toLowerCase()=="stylesheet")A.write("<link type=\"text/css\" rel=\"stylesheet\" href=\""+$[B].href+"\"></link>")};dp.sh.Utils.FixForBlogger=function($){return(dp.sh.isBloggerMode==true)?$.replace(/<br\s*\/?>|<br\s*\/?>/gi,"\n"):$};dp.sh.RegexLib={MultiLineCComments:new RegExp("/\\*[\\s\\S]*?\\*/","gm"),SingleLineCComments:new RegExp("//.*$","gm"),SingleLinePerlComments:new RegExp("#.*$","gm"),DoubleQuotedString:new RegExp("\"(?:\\.|(\\\\\\\")|[^\\\"\"\\n])*\"","g"),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'","g")};dp.sh.Match=function(_,$,A){this.value=_;this.index=$;this.length=_.length;this.css=A};dp.sh.Highlighter=function(){this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true};dp.sh.Highlighter.SortCallback=function($,_){if($.index<_.index)return-1;else if($.index>_.index)return 1;else if($.length<_.length)return-1;else if($.length>_.length)return 1;return 0};dp.sh.Highlighter.prototype.CreateElement=function(_){var $=document.createElement(_);$.highlighter=this;return $};dp.sh.Highlighter.prototype.GetMatches=function(_,B){var $=0,A=null;while((A=_.exec(this.code))!=null)this.matches[this.matches.length]=new dp.sh.Match(A[0],A.index,B)};dp.sh.Highlighter.prototype.AddBit=function($,A){if($==null||$.length==0)return;var C=this.CreateElement("SPAN");$=$.replace(/ /g," ");$=$.replace(/</g,"<");$=$.replace(/\n/gm," <br>");if(A!=null){if((/br/gi).test($)){var _=$.split(" <br>");for(var B=0;B<_.length;B++){C=this.CreateElement("SPAN");C.className=A;C.innerHTML=_[B];this.div.appendChild(C);if(B+1<_.length)this.div.appendChild(this.CreateElement("BR"))}}else{C.className=A;C.innerHTML=$;this.div.appendChild(C)}}else{C.innerHTML=$;this.div.appendChild(C)}};dp.sh.Highlighter.prototype.IsInside=function(_){if(_==null||_.length==0)return false;for(var A=0;A<this.matches.length;A++){var $=this.matches[A];if($==null)continue;if((_.index>$.index)&&(_.index<$.index+$.length))return true}return false};dp.sh.Highlighter.prototype.ProcessRegexList=function(){for(var $=0;$<this.regexList.length;$++)this.GetMatches(this.regexList[$].regex,this.regexList[$].css)};dp.sh.Highlighter.prototype.ProcessSmartTabs=function(E){var B=E.split("\n"),$="",D=4,A="\t";function _(A,E,_){var B=A.substr(0,E),C=A.substr(E+1,A.length),$="";for(var D=0;D<_;D++)$+=" ";return B+$+C}function C(B,C){if(B.indexOf(A)==-1)return B;var D=0;while((D=B.indexOf(A))!=-1){var $=C-D%C;B=_(B,D,$)}return B}for(var F=0;F<B.length;F++)$+=C(B[F],D)+"\n";return $};dp.sh.Highlighter.prototype.SwitchToList=function(){var C=this.div.innerHTML.replace(/<(br)\/?>/gi,"\n"),B=C.split("\n");if(this.addControls==true)this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns){var A=this.CreateElement("div"),_=this.CreateElement("div"),E=10,G=1;while(G<=150)if(G%E==0){A.innerHTML+=G;G+=(G+"").length}else{A.innerHTML+="·";G++}_.className="columns";_.appendChild(A);this.bar.appendChild(_)}for(var G=0,D=this.firstLine;G<B.length-1;G++,D++){var $=this.CreateElement("LI"),F=this.CreateElement("SPAN");$.className=(G%2==0)?"alt":"";F.innerHTML=B[G]+" ";$.appendChild(F);this.ol.appendChild($)}this.div.innerHTML=""};dp.sh.Highlighter.prototype.Highlight=function(C){function A($){return $.replace(/^\s*(.*?)[\s\n]*$/g,"$1")}function $($){return $.replace(/\n*$/,"").replace(/^\n*/,"")}function _(B){var E=dp.sh.Utils.FixForBlogger(B).split("\n"),C=new Array(),D=new RegExp("^\\s*","g"),$=1000;for(var F=0;F<E.length&&$>0;F++){if(A(E[F]).length==0)continue;var _=D.exec(E[F]);if(_!=null&&_.length>0)$=Math.min(_[0].length,$)}if($>0)for(F=0;F<E.length;F++)E[F]=E[F].substr($);return E.join("\n")}function D(A,$,_){return A.substr($,_-$)}var F=0;if(C==null)C="";this.originalCode=C;this.code=$(_(C));this.div=this.CreateElement("DIV");this.bar=this.CreateElement("DIV");this.ol=this.CreateElement("OL");this.matches=new Array();this.div.className="dp-highlighter";this.div.highlighter=this;this.bar.className="bar";this.ol.start=this.firstLine;if(this.CssClass!=null)this.ol.className=this.CssClass;if(this.collapse)this.div.className+=" collapsed";if(this.noGutter)this.div.className+=" nogutter";if(this.tabsToSpaces==true)this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0){this.AddBit(this.code,null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);return}this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var E=0;E<this.matches.length;E++)if(this.IsInside(this.matches[E]))this.matches[E]=null;for(E=0;E<this.matches.length;E++){var B=this.matches[E];if(B==null||B.length==0)continue;this.AddBit(D(this.code,F,B.index),null);this.AddBit(B.value,B.css);F=B.index+B.length}this.AddBit(this.code.substr(F),null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol)};dp.sh.Highlighter.prototype.GetKeywords=function($){return"\\b"+$.replace(/ /g,"\\b|\\b")+"\\b"};dp.sh.BloggerMode=function(){dp.sh.isBloggerMode=true};dp.sh.HighlightAll=function(N,B,K,I,O,E){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function J($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function L(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}function C(B,A,_){var $=document.getElementsByTagName(_);for(var C=0;C<$.length;C++)if($[C].getAttribute("name")==A)B.push($[C])}var T=[],P=null,M={},$="innerHTML";C(T,N,"pre");C(T,N,"textarea");if(T.length==0)return;for(var R in dp.sh.Brushes){var F=dp.sh.Brushes[R].Aliases;if(F==null)continue;for(var G=0;G<F.length;G++)M[F[G]]=R}for(G=0;G<T.length;G++){var _=T[G],U=A(_.attributes["class"],_.className,_.attributes["language"],_.language),Q="";if(U==null)continue;U=U.split(":");Q=U[0].toLowerCase();if(M[Q]==null)continue;P=new dp.sh.Brushes[M[Q]]();_.style.display="none";P.noGutter=(B==null)?J("nogutter",U):!B;P.addControls=(K==null)?!J("nocontrols",U):K;P.collapse=(I==null)?J("collapse",U):I;P.showColumns=(E==null)?J("showcolumns",U):E;var D=document.getElementsByTagName("head")[0];if(P.Style&&D){var S=document.createElement("style");S.setAttribute("type","text/css");if(S.styleSheet)S.styleSheet.cssText=P.Style;else{var H=document.createTextNode(P.Style);S.appendChild(H)}D.appendChild(S)}P.firstLine=(O==null)?parseInt(L("firstline",U,1)):O;P.Highlight(_[$]);P.source=_;_.parentNode.insertBefore(P.div,_)}};version.extensions.SyntaxHighLighterPlugin={major:1,minor:1,revision:3,date:new Date(2008,10,24)};dp.sh.ClipboardSwf="clipboard.swf";dp.sh.Highlight=function(_,Q,B,J,H,M,D){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function I($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function K(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}var N=null,$="innerHTML";if(this.registered==undefined){var L={};for(var O in dp.sh.Brushes){var E=dp.sh.Brushes[O].Aliases;if(E==null)continue;for(var F=0;F<E.length;F++)L[E[F]]=O}this.registered=L}Q=Q.split(":");language=Q[0].toLowerCase();if(this.registered[language]==null)return;N=new dp.sh.Brushes[this.registered[language]]();_.style.display="none";N.noGutter=(B==null)?I("nogutter",Q):!B;N.addControls=(J==null)?!I("nocontrols",Q):J;N.collapse=(H==null)?I("collapse",Q):H;N.showColumns=(D==null)?I("showcolumns",Q):D;var C=document.getElementsByTagName("head")[0],P=document.getElementById(N.CssClass);if(N.Style&&C&&!P){P=document.createElement("style");P.setAttribute("id",N.CssClass);P.setAttribute("type","text/css");if(P.styleSheet)P.styleSheet.cssText=N.Style;else{var G=document.createTextNode(N.Style);P.appendChild(G)}C.appendChild(P)}N.firstLine=(M==null)?parseInt(K("firstline",Q,1)):M;N.Highlight(_[$]);N.source=_;_.parentNode.insertBefore(N.div,_)};config.formatters.push({name:"SyntaxHighlighter",match:"^<code[\\s]+[^>]+>\\n",element:"pre",handler:function(_){this.lookaheadRegExp=/<code[\s]+([^>]+)>\n((?:^[^\n]*\n)+?)(^<\/code>$\n?)/mg;this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var C=$[1],B=$[2];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);dp.sh.Highlight(A,C);_.nextMatch=$.index+$[0].length}}});config.formatterHelpers.enclosedTextHelper=function(_){this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var B=$[1];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);switch(_.matchText){case"/*{{{*/\n":dp.sh.Highlight(A,"css");break;case"//{{{\n":dp.sh.Highlight(A,"js");break;case"<!--{{{-->\n":dp.sh.Highlight(A,"xml");break}_.nextMatch=$.index+$[0].length}};dp.sh.Brushes.AS3=function(){var _="class interface package",$="Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent escape "+"int isFinite isNaN isXMLName Number Object parseFloat parseInt "+"String trace uint unescape XML XMLList "+"Infinity -Infinity NaN undefined "+"as delete instanceof is new typeof "+"break case catch continue default do each else finally for if in "+"label return super switch throw try while with "+"dynamic final internal native override private protected public static "+"...rest const extends function get implements namespace set "+"import include use "+"AS3 flash_proxy object_proxy "+"false null this true "+"void Null";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"blockcomment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"definition"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp("var","gm"),css:"variable"}];this.CssClass="dp-as";this.Style=".dp-as .comment { color: #009900; font-style: italic; }"+".dp-as .blockcomment { color: #3f5fbf; }"+".dp-as .string { color: #990000; }"+".dp-as .preprocessor { color: #0033ff; }"+".dp-as .definition { color: #9900cc; font-weight: bold; }"+".dp-as .keyword { color: #0033ff; }"+".dp-as .variable { color: #6699cc; font-weight: bold; }"};dp.sh.Brushes.AS3.prototype=new dp.sh.Highlighter();dp.sh.Brushes.AS3.Aliases=["as","actionscript","ActionScript","as3","AS3"];dp.sh.Brushes.Bash=function(){var _="alias bg bind break builtin cd command compgen complete continue "+"declare dirs disown echo enable eval exec exit export fc fg "+"getopts hash help history jobs kill let local logout popd printf "+"pushd pwd read readonly return set shift shopt source "+"suspend test times trap type typeset ulimit umask unalias unset wait",$="case do done elif else esac fi for function if in select then "+"time until while";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("\\s-\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-bash";this.Style=".dp-bash .builtin {color: maroon; font-weight: bold;}"+".dp-bash .comment {color: gray;}"+".dp-bash .delim {font-weight: bold;}"+".dp-bash .flag {color: green;}"+".dp-bash .string {color: red;}"+".dp-bash .vars {color: blue;}"};dp.sh.Brushes.Bash.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Bash.Aliases=["bash","sh"];dp.sh.Brushes.Batch=function(){var _="APPEND ATTRIB CD CHDIR CHKDSK CHOICE CLS COPY DEL ERASE DELTREE "+"DIR EXIT FC COMP FDISK FIND FORMAT FSUTIL HELP JOIN "+"LABEL LOADFIX MK MKDIR MEM MEMMAKER MORE MOVE MSD PCPARK "+"PRINT RD RMDIR REN SCANDISK SHARE SORT SUBST SYS "+"TIME DATE TREE TRUENAME TYPE UNDELETE VER XCOPY",$="DO ELSE FOR IN CALL CHOICE GOTO SHIFT PAUSE ERRORLEVEL "+"IF NOT EXIST LFNFOR START SETLOCAL ENDLOCAL ECHO SET";this.regexList=[{regex:new RegExp("REM.*$","gm"),css:"comment"},{regex:new RegExp("::.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("%\\w+%","g"),css:"vars"},{regex:new RegExp("%%\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("@\\w+","g"),css:"keyword"},{regex:new RegExp(":\\w+","g"),css:"keyword"},{regex:new RegExp("\\s/\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-batch";this.Style=".dp-batch .builtin {color: maroon; font-weight: bold;}"+".dp-batch .comment {color: gray;}"+".dp-batch .delim {font-weight: bold;}"+".dp-batch .flag {color: green;}"+".dp-batch .string {color: red;}"+".dp-batch .vars {color: blue;font-weight: bold;}"};dp.sh.Brushes.Batch.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Batch.Aliases=["batch","dos"];dp.sh.Brushes.ColdFusion=function(){this.CssClass="dp-coldfusion";this.Style=".dp-coldfusion { font: 13px \"Courier New\", Courier, monospace; }"+".dp-coldfusion .tag, .dp-coldfusion .tag-name { color: #990033; }"+".dp-coldfusion .attribute { color: #990033; }"+".dp-coldfusion .attribute-value { color: #0000FF; }"+".dp-coldfusion .cfcomments { background-color: #FFFF99; color: #000000; }"+".dp-coldfusion .cfscriptcomments { color: #999999; }"+".dp-coldfusion .keywords { color: #0000FF; }"+".dp-coldfusion .mgkeywords { color: #CC9900; }"+".dp-coldfusion .numbers { color: #ff0000; }"+".dp-coldfusion .strings { color: green; }";this.mgKeywords="setvalue getvalue addresult viewcollection viewstate";this.keywords="var eq neq gt gte lt lte not and or true false "+"abs acos addsoaprequestheader addsoapresponseheader "+"arrayappend arrayavg arrayclear arraydeleteat arrayinsertat "+"arrayisempty arraylen arraymax arraymin arraynew "+"arrayprepend arrayresize arrayset arraysort arraysum "+"arrayswap arraytolist asc asin atn binarydecode binaryencode "+"bitand bitmaskclear bitmaskread bitmaskset bitnot bitor bitshln "+"bitshrn bitxor ceiling charsetdecode charsetencode chr cjustify "+"compare comparenocase cos createdate createdatetime createobject "+"createobject createobject createobject createobject createodbcdate "+"createodbcdatetime createodbctime createtime createtimespan "+"createuuid dateadd datecompare dateconvert datediff dateformat "+"datepart day dayofweek dayofweekasstring dayofyear daysinmonth "+"daysinyear de decimalformat decrementvalue decrypt decryptbinary "+"deleteclientvariable directoryexists dollarformat duplicate encrypt "+"encryptbinary evaluate exp expandpath fileexists find findnocase "+"findoneof firstdayofmonth fix formatbasen generatesecretkey "+"getauthuser getbasetagdata getbasetaglist getbasetemplatepath "+"getclientvariableslist getcontextroot getcurrenttemplatepath "+"getdirectoryfrompath getencoding getexception getfilefrompath "+"getfunctionlist getgatewayhelper gethttprequestdata gethttptimestring "+"getk2serverdoccount getk2serverdoccountlimit getlocale "+"getlocaledisplayname getlocalhostip getmetadata getmetricdata "+"getpagecontext getprofilesections getprofilestring getsoaprequest "+"getsoaprequestheader getsoapresponse getsoapresponseheader "+"gettempdirectory gettempfile gettemplatepath gettickcount "+"gettimezoneinfo gettoken hash hour htmlcodeformat htmleditformat "+"iif incrementvalue inputbasen insert int isarray isbinary isboolean "+"iscustomfunction isdate isdebugmode isdefined isk2serverabroker "+"isk2serverdoccountexceeded isk2serveronline isleapyear islocalhost "+"isnumeric isnumericdate isobject isquery issimplevalue issoaprequest "+"isstruct isuserinrole isvalid isvalid isvalid iswddx isxml "+"isxmlattribute isxmldoc isxmlelem isxmlnode isxmlroot javacast "+"jsstringformat lcase left len listappend listchangedelims listcontains "+"listcontainsnocase listdeleteat listfind listfindnocase listfirst "+"listgetat listinsertat listlast listlen listprepend listqualify "+"listrest listsetat listsort listtoarray listvaluecount "+"listvaluecountnocase ljustify log log10 lscurrencyformat lsdateformat "+"lseurocurrencyformat lsiscurrency lsisdate lsisnumeric lsnumberformat "+"lsparsecurrency lsparsedatetime lsparseeurocurrency lsparsenumber "+"lstimeformat ltrim max mid min minute month monthasstring now "+"numberformat paragraphformat parameterexists parsedatetime pi "+"preservesinglequotes quarter queryaddcolumn queryaddrow querynew "+"querysetcell quotedvaluelist rand randomize randrange refind "+"refindnocase releasecomobject removechars repeatstring replace "+"replacelist replacenocase rereplace rereplacenocase reverse right "+"rjustify round rtrim second sendgatewaymessage setencoding "+"setlocale setprofilestring setvariable sgn sin spanexcluding "+"spanincluding sqr stripcr structappend structclear structcopy "+"structcount structdelete structfind structfindkey structfindvalue "+"structget structinsert structisempty structkeyarray structkeyexists "+"structkeylist structnew structsort structupdate tan timeformat "+"tobase64 tobinary toscript tostring trim ucase urldecode urlencodedformat "+"urlsessionformat val valuelist week wrap writeoutput xmlchildpos "+"xmlelemnew xmlformat xmlgetnodetype xmlnew xmlparse xmlsearch xmltransform "+"xmlvalidate year yesnoformat";this.stringMatches=new Array();this.attributeMatches=new Array()};dp.sh.Brushes.ColdFusion.prototype=new dp.sh.Highlighter();dp.sh.Brushes.ColdFusion.Aliases=["coldfusion","cf"];dp.sh.Brushes.ColdFusion.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}function A(A,$){for(var _=0;_<A.length;_++)if(A[_]==$)return _;return-1}var _=null,$=null;this.GetMatches(new RegExp("\\b(\\d+)","gm"),"numbers");this.GetMatches(new RegExp(this.GetKeywords(this.mgKeywords),"igm"),"mgkeywords");this.GetMatches(dp.sh.RegexLib.SingleLineCComments,"cfscriptcomments");this.GetMatches(dp.sh.RegexLib.MultiLineCComments,"cfscriptcomments");this.GetMatches(new RegExp("(<|<)!---[\\s\\S]*?---(>|>)","gm"),"cfcomments");$=new RegExp("(cfset\\s*)?([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?')*","gm");while((_=$.exec(this.code))!=null){if(_[1]!=undefined&&_[1]!="")continue;if(_[3]!=undefined&&_[3]!=""&&_[3]!="\"\""&&_[3]!="''"){B(this.matches,new dp.sh.Match(_[2],_.index,"attribute"));B(this.matches,new dp.sh.Match(_[3],_.index+_[0].indexOf(_[3]),"attribute-value"));B(this.stringMatches,_[3]);B(this.attributeMatches,_[2])}}this.GetMatches(new RegExp("(<|<)/*\\?*(?!\\!)|/*\\?*(>|>)","gm"),"tag");$=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((_=$.exec(this.code))!=null)B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"tag-name"));$=new RegExp(this.GetKeywords(this.keywords),"igm");while((_=$.exec(this.code))!=null)if(A(this.attributeMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"keywords"));$=new RegExp("cfset\\s*.*(\".*?\"|'.*?')","gm");while((_=$.exec(this.code))!=null)if(_[1]!=undefined&&_[1]!=""){B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"strings"));B(this.stringMatches,_[1])}while((_=dp.sh.RegexLib.DoubleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"));while((_=dp.sh.RegexLib.SingleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"))};dp.sh.Brushes.Cpp=function(){var _="ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR "+"DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH "+"HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP "+"HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY "+"HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT "+"HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE "+"LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF "+"LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR "+"LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR "+"PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT "+"PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 "+"POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR "+"PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 "+"PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT "+"SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG "+"ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM "+"char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t "+"clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS "+"FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t "+"__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t "+"jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler "+"sig_atomic_t size_t _stat __stat64 _stati64 terminate_function "+"time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf "+"va_list wchar_t wctrans_t wctype_t wint_t signed",$="break case catch class const __finally __exception __try "+"const_cast continue private public protected __declspec "+"default delete deprecated dllexport dllimport do dynamic_cast "+"else enum explicit extern if for friend goto inline "+"mutable naked namespace new noinline noreturn nothrow "+"register reinterpret_cast return selectany "+"sizeof static static_cast struct switch template this "+"thread throw true false try typedef typeid typename union "+"using uuid virtual void volatile whcar_t while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^ *#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"datatypes"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-cpp";this.Style=".dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }"};dp.sh.Brushes.Cpp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Cpp.Aliases=["cpp","c","c++"];dp.sh.Brushes.CSharp=function(){var $="abstract as base bool break byte case catch char checked class const "+"continue decimal default delegate do double else enum event explicit "+"extern false finally fixed float for foreach get goto if implicit in int "+"interface internal is lock long namespace new null object operator out "+"override params private protected public readonly ref return sbyte sealed set "+"short sizeof stackalloc static string struct switch this throw true try "+"typeof uint ulong unchecked unsafe ushort using virtual void while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c";this.Style=".dp-c .vars { color: #d00; }"};dp.sh.Brushes.CSharp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSharp.Aliases=["c#","c-sharp","csharp"];dp.sh.Brushes.CSS=function(){var _="ascent azimuth background-attachment background-color background-image background-position "+"background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top "+"border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color "+"border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width "+"border-bottom-width border-left-width border-width border cap-height caption-side centerline clear clip color "+"content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display "+"elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font "+"height letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top "+"margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans "+"outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page "+"page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position "+"quotes richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress "+"table-layout text-align text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em "+"vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index",$="above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder "+"both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed "+"continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double "+"embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia "+"gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic "+"justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha "+"lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower "+"navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset "+"outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side "+"rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow "+"small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize "+"table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal "+"text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin "+"upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow",A="[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif";this.regexList=[{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\#[a-zA-Z0-9]{3,6}","g"),css:"value"},{regex:new RegExp("(-?\\d+)(.\\d+)?(px|em|pt|:|%|)","g"),css:"value"},{regex:new RegExp("!important","g"),css:"important"},{regex:new RegExp(this.GetKeywordsCSS(_),"gm"),css:"keyword"},{regex:new RegExp(this.GetValuesCSS($),"g"),css:"value"},{regex:new RegExp(this.GetValuesCSS(A),"g"),css:"value"}];this.CssClass="dp-css";this.Style=".dp-css .value { color: black; }"+".dp-css .important { color: red; }"};dp.sh.Highlighter.prototype.GetKeywordsCSS=function($){return"\\b([a-z_]|)"+$.replace(/ /g,"(?=:)\\b|\\b([a-z_\\*]|\\*|)")+"(?=:)\\b"};dp.sh.Highlighter.prototype.GetValuesCSS=function($){return"\\b"+$.replace(/ /g,"(?!-)(?!:)\\b|\\b()")+":\\b"};dp.sh.Brushes.CSS.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSS.Aliases=["css"];dp.sh.Brushes.Delphi=function(){var $="abs addr and ansichar ansistring array as asm begin boolean byte cardinal "+"case char class comp const constructor currency destructor div do double "+"downto else end except exports extended false file finalization finally "+"for function goto if implementation in inherited int64 initialization "+"integer interface is label library longint longword mod nil not object "+"of on or packed pansichar pansistring pchar pcurrency pdatetime pextended "+"pint64 pointer private procedure program property pshortstring pstring "+"pvariant pwidechar pwidestring protected public published raise real real48 "+"record repeat set shl shortint shortstring shr single smallint string then "+"threadvar to true try type unit until uses val var varirnt while widechar "+"widestring with word write writeln xor";this.regexList=[{regex:new RegExp("\\(\\*[\\s\\S]*?\\*\\)","gm"),css:"comment"},{regex:new RegExp("{(?!\\$)[\\s\\S]*?}","gm"),css:"comment"},{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\{\\$[a-zA-Z]+ .+\\}","g"),css:"directive"},{regex:new RegExp("\\b[\\d\\.]+\\b","g"),css:"number"},{regex:new RegExp("\\$[a-zA-Z0-9]+\\b","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-delphi";this.Style=".dp-delphi .number { color: blue; }"+".dp-delphi .directive { color: #008284; }"+".dp-delphi .vars { color: #000; }"};dp.sh.Brushes.Delphi.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Delphi.Aliases=["delphi","pascal"];dp.sh.Brushes.Java=function(){var $="abstract assert boolean break byte case catch char class const "+"continue default do double else enum extends "+"false final finally float for goto if implements import "+"instanceof int interface long native new null "+"package private protected public return "+"short static strictfp super switch synchronized this throw throws true "+"transient try void volatile while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b","gi"),css:"number"},{regex:new RegExp("(?!\\@interface\\b)\\@[\\$\\w]+\\b","g"),css:"annotation"},{regex:new RegExp("\\@interface\\b","g"),css:"keyword"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-j";this.Style=".dp-j .annotation { color: #646464; }"+".dp-j .number { color: #C00000; }"};dp.sh.Brushes.Java.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Java.Aliases=["java"];dp.sh.Brushes.JScript=function(){var $="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.JScript.prototype=new dp.sh.Highlighter();dp.sh.Brushes.JScript.Aliases=["js","jscript","javascript"];dp.sh.Brushes.Lua=function(){var $="break do end else elseif function if local nil not or repeat return and then until while this",_="math\\.\\w+ string\\.\\w+ os\\.\\w+ debug\\.\\w+ io\\.\\w+ error fopen dofile coroutine\\.\\w+ arg getmetatable ipairs loadfile loadlib loadstring longjmp print rawget rawset seek setmetatable assert tonumber tostring";this.regexList=[{regex:new RegExp("--\\[\\[[\\s\\S]*\\]\\]--","gm"),css:"comment"},{regex:new RegExp("--[^\\[]{2}.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"func"},];this.CssClass="dp-lua"};dp.sh.Brushes.Lua.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Lua.Aliases=["lua"];dp.sh.Brushes.Mxml=function(){this.CssClass="dp-mxml";this.Style=".dp-mxml .cdata { color: #000000; }"+".dp-mxml .tag { color : #0000ff; }"+".dp-mxml .tag-name { color: #0000ff; }"+".dp-mxml .script { color: green; }"+".dp-mxml .metadata { color: green; }"+".dp-mxml .attribute { color: #000000; }"+".dp-mxml .attribute-value { color: #990000; }"+".dp-mxml .trace { color: #cc6666; }"+".dp-mxml .var { color: #6699cc; }"+".dp-mxml .comment { color: #009900; }"+".dp-mxml .string { color: #990000; }"+".dp-mxml .keyword { color: blue; }"};dp.sh.Brushes.Mxml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Mxml.Aliases=["mxml"];dp.sh.Brushes.Mxml.prototype.ProcessRegexList=function(){function H(_,$){_[_.length]=$}function B(B,_){var A=0,$=false;for(A=0;A<B.length;A++)if(_.index>B[A].firstIndex&&_.index<B[A].lastIndex)$=true;return $}var $=0,F=null,D=null,A=null,C="",E=new Array(),_="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with",G=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords("trace"),"gm"),css:"trace"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"keyword"}];A=new RegExp("<\\!\\[CDATA\\[(.|\\s)*?\\]\\]>","gm");while((F=A.exec(this.code))!=null){C=F[0].substr(0,12);H(this.matches,new dp.sh.Match(C,F.index,"cdata"));C=F[0].substr(12,F[0].length-12-6);for(var I=0;I<G.length;I++)while((D=G[I].regex.exec(C))!=null)H(this.matches,new dp.sh.Match(D[0],F.index+12+D.index,G[I].css));C=F[0].substr(F[0].length-6,6);H(this.matches,new dp.sh.Match(C,F.index+F[0].length-6,"cdata"));E.push({firstIndex:F.index,lastIndex:F.index+F[0].length-1})}this.GetMatches(new RegExp("(<|<)!--\\s*.*?\\s*--(>|>)","gm"),"comments");A=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((F=A.exec(this.code))!=null){if(F[1]==null)continue;if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[1],F.index,"attribute"));if(F[2]!=undefined)H(this.matches,new dp.sh.Match(F[2],F.index+F[0].indexOf(F[2]),"attribute-value"))}A=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;C=F[0].substr(4,F[0].length-4);switch(C){case"mx:Script":case"/mx:Script":H(this.matches,new dp.sh.Match(F[0]+">",F.index,"script"));break;case"mx:Metadata":case"/mx:Metadata":H(this.matches,new dp.sh.Match(F[0]+">",F.index,"metadata"));break;default:H(this.matches,new dp.sh.Match(F[0],F.index,"tag-name"));break}}A=new RegExp("\\?>|>|/>","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[0],F.index,"tag"))}};dp.sh.Brushes.Perl=function(){var _="abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect cos crypt dbmclose dbmopen defined delete dump each endgrent endhostent endnetent endprotoent endpwent endservent eof exec exists exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime grep hex import index int ioctl join keys kill lc lcfirst length link listen localtime lock log lstat m map mkdir msgctl msgget msgrcv msgsnd no oct open opendir ord pack pipe pop pos print printf prototype push q qq quotemeta qw qx rand read readdir readline readlink readpipe recv ref rename reset reverse rewinddir rindex rmdir scalar seek seekdir semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie utime values vec waitpid wantarray warn write qr",$="s select goto die do package redo require return continue for foreach last next wait while use if else elsif eval exit unless switch case",A="my our local";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("(\\$|@|%)\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(A),"gm"),css:"declarations"}];this.CssClass="dp-perl"};dp.sh.Brushes.Perl.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Perl.Aliases=["perl"];dp.sh.Brushes.Php=function(){var _="abs acos acosh addcslashes addslashes "+"array_change_key_case array_chunk array_combine array_count_values array_diff "+"array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill "+"array_filter array_flip array_intersect array_intersect_assoc array_intersect_key "+"array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map "+"array_merge array_merge_recursive array_multisort array_pad array_pop array_product "+"array_push array_rand array_reduce array_reverse array_search array_shift "+"array_slice array_splice array_sum array_udiff array_udiff_assoc "+"array_udiff_uassoc array_uintersect array_uintersect_assoc "+"array_uintersect_uassoc array_unique array_unshift array_values array_walk "+"array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert "+"basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress "+"bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir "+"checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists "+"closedir closelog copy cos cosh count count_chars date decbin dechex decoct "+"deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log "+"error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded "+"feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents "+"fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype "+"floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf "+"fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname "+"gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt "+"getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext "+"gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set "+"interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double "+"is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long "+"is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault "+"is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br "+"parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir "+"round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split "+"str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes "+"stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk "+"strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime "+"strtoupper strtr strval substr substr_compare",$="and or xor __FILE__ __LINE__ array as break case "+"cfunction class const continue declare default die do else "+"elseif empty enddeclare endfor endforeach endif endswitch endwhile "+"extends for foreach function include include_once global if "+"new old_function return static switch use require require_once "+"var while __FUNCTION__ __CLASS__ "+"__METHOD__ abstract interface public implements extends private protected throw";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.Php.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Php.Aliases=["php"];dp.sh.Brushes.Python=function(){var $="and assert break class continue def del elif else "+"except exec finally for from global if import in is "+"lambda not or pass print raise return try yield while",_="None True False self cls class_";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:new RegExp("^\\s*@\\w+","gm"),css:"decorator"},{regex:new RegExp("(['\"]{3})([^\\1])*?\\1","gm"),css:"comment"},{regex:new RegExp("\"(?!\")(?:\\.|\\\\\\\"|[^\\\"\"\\n\\r])*\"","gm"),css:"string"},{regex:new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'","gm"),css:"string"},{regex:new RegExp("\\b\\d+\\.?\\w*","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"special"}];this.CssClass="dp-py";this.Style=".dp-py .builtins { color: #ff1493; }"+".dp-py .magicmethods { color: #808080; }"+".dp-py .exceptions { color: brown; }"+".dp-py .types { color: brown; font-style: italic; }"+".dp-py .commonlibs { color: #8A2BE2; font-style: italic; }"};dp.sh.Brushes.Python.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Python.Aliases=["py","python"];dp.sh.Brushes.Ruby=function(){var $="alias and BEGIN begin break case class def define_method defined do each else elsif "+"END end ensure false for if in module new next nil not or raise redo rescue retry return "+"self super then throw true undef unless until when while yield",_="Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload "+"Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol "+"ThreadGroup Thread Time TrueClass";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(":[a-z][A-Za-z0-9_]*","g"),css:"symbol"},{regex:new RegExp("(\\$|@@|@)\\w+","g"),css:"variable"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"}];this.CssClass="dp-rb";this.Style=".dp-rb .symbol { color: #a70; }"+".dp-rb .variable { color: #a70; font-weight: bold; }"};dp.sh.Brushes.Ruby.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Ruby.Aliases=["ruby","rails","ror"];dp.sh.Brushes.Sql=function(){var _="abs avg case cast coalesce convert count current_timestamp "+"current_user day isnull left lower month nullif replace right "+"session_user space substring sum system_user upper user year",$="absolute action add after alter as asc at authorization begin bigint "+"binary bit by cascade char character check checkpoint close collate "+"column commit committed connect connection constraint contains continue "+"create cube current current_date current_time cursor database date "+"deallocate dec decimal declare default delete desc distinct double drop "+"dynamic else end end-exec escape except exec execute false fetch first "+"float for force foreign forward free from full function global goto grant "+"group grouping having hour ignore index inner insensitive insert instead "+"int integer intersect into is isolation key last level load local max min "+"minute modify move name national nchar next no numeric of off on only "+"open option order out output partial password precision prepare primary "+"prior privileges procedure public read real references relative repeatable "+"restrict return returns revoke rollback rollup rows rule schema scroll "+"second section select sequence serializable set size smallint static "+"statistics table temp temporary then time timestamp to top transaction "+"translation trigger true truncate uncommitted union unique update values "+"varchar varying view when where with work",A="all and any between cross in join like not null or outer some";this.regexList=[{regex:new RegExp("--(.*)$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords(A),"gmi"),css:"op"},{regex:new RegExp(this.GetKeywords($),"gmi"),css:"keyword"}];this.CssClass="dp-sql";this.Style=".dp-sql .func { color: #ff1493; }"+".dp-sql .op { color: #808080; }"};dp.sh.Brushes.Sql.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Sql.Aliases=["sql"];dp.sh.Brushes.Vb=function(){var $="AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto "+"Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate "+"CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType "+"Date Decimal Declare Default Delegate Dim DirectCast Do Double Each "+"Else ElseIf End Enum Erase Error Event Exit False Finally For Friend "+"Function Get GetType GoSub GoTo Handles If Implements Imports In "+"Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module "+"MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing "+"NotInheritable NotOverridable Object On Option Optional Or OrElse "+"Overloads Overridable Overrides ParamArray Preserve Private Property "+"Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume "+"Return Select Set Shadows Shared Short Single Static Step Stop String "+"Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until "+"Variant When While With WithEvents WriteOnly Xor";this.regexList=[{regex:new RegExp("'.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-vb"};dp.sh.Brushes.Vb.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Vb.Aliases=["vb","vb.net"];dp.sh.Brushes.Xml=function(){this.CssClass="dp-xml";this.Style=".dp-xml .cdata { color: #ff1493; }"+".dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }"+".dp-xml .attribute { color: red; }"+".dp-xml .attribute-value { color: blue; }"};dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=["xml","xhtml","xslt","html","xhtml"];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}var $=0,A=null,_=null;this.GetMatches(new RegExp("(<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](>|>)","gm"),"cdata");this.GetMatches(new RegExp("(<|<)!--\\s*.*?\\s*--(>|>)","gm"),"comments");_=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((A=_.exec(this.code))!=null){if(A[1]==null)continue;B(this.matches,new dp.sh.Match(A[1],A.index,"attribute"));if(A[2]!=undefined)B(this.matches,new dp.sh.Match(A[2],A.index+A[0].indexOf(A[2]),"attribute-value"))}this.GetMatches(new RegExp("(<|<)/*\\?*(?!\\!)|/*\\?*(>|>)","gm"),"tag");_=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((A=_.exec(this.code))!=null)B(this.matches,new dp.sh.Match(A[1],A.index+A[0].indexOf(A[1]),"tag-name"))}
//}}}
[[Plugin: Syntaxify]] syntax-highlights CSS, XML, and Javascript in your tiddlywiki, using the tiddlywiki Wikifier. Take a look at the tiddlers below. Then see [[Plugin: Syntaxify]] for the code to install. It can be easily extended for new languages by just specifying your favorite language's keywords, literals, etc. See [[Plugin: Syntaxify Haskell]] for an example (thanks to Conal Elliott).
!CSS markup:
# StyleSheetColors
# StyleSheetLayout
# StyleSheetPrint
# StyleSheetSyntaxify
{{css{
#foo .bar { color: red; margin-left: 1em; }
}}}
!XML markup:
# EditTemplate
# PageTemplate
# ViewTemplate
{{xml{
<tag foo="bar" />
}}}
!Javascript markup:
# [[Plugin: Syntaxify]]
{{javascript{
var mangle = function(x) { return x.replace("foo","bar"); };
}}}
Because we like the TAP format for all sorts of purposes, including logs, we wrote a TAP writer class in C# based on this article on //Testing C with libtap//: http://onlamp.com/pub/a/onlamp/2006/01/19/libtap.html
It's available for download as
* a DLL: [[TAP.Writer.dll|./src/TAP/Tap.Writer.dll]]
* in source form: [[Tap.Writer.cs|./src/TAP/TAP/Tap.Writer.cs]]
!Disclaimer
Because we've made this software available in DLL form please be aware that the standard {{logo{Akroyd{{blue{|}}}Wallis}}} [[copyright|./src/TAP/COPYRIGHT]] applies, which means we accept no liability for use of this software.
/***
|Name|TagCloudPlugin|
|Source|http://www.TiddlyTools.com/#TagCloudPlugin|
|Version|1.7.0|
|Author|Eric Shulman|
|Original Author|Clint Checketts|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|present a 'cloud' of tags (or links) using proportional font display|
!Usage
<<<
{{{
<<cloud type action:... limit:... tag tag tag ...>>
<<cloud type action:... limit:... +TiddlerName>>
<<cloud type action:... limit:... -TiddlerName>>
<<cloud type action:... limit:... =tagvalue>>
}}}
where:
* //type// is a keyword, one of:
** ''tags'' (default) - displays a cloud of tags, based on frequency of use
** ''links'' - displays a cloud of tiddlers, based on number of links //from// each tiddler
** ''references'' - displays a cloud of tiddlers, based on number of links //to// each tiddler
* ''action:popup'' (default) - clicking a cloud item shows a popup with links to related tiddlers<br>//or//<br> ''action:goto'' - clicking a cloud item immediately opens the tiddler corresponding to that item
* ''limit:N'' (optional) - restricts the cloud display to only show the N most popular tags/links
* ''tag tag tag...'' (or ''title title title'' if ''links''/''references'' is used)<br>shows all tags/links in the document //except// for those listed as macro parameters
* ''+TiddlerName''<br>show only tags/links read from a space-separated, bracketed list stored in a separate tiddler.
* ''-TiddlerName''<br>show all tags/links //except// those read from a space-separated, bracketed list stored in a separate tiddler.
* ''=tagvalue'' (//only if type=''tags''//)<br>shows only tags that are themselves tagged with the indicated tag value (i.e., ~TagglyTagging usage)
//note: for backward-compatibility, you can also use the macro {{{<<tagCloud ...>>}}} in place of {{{<<cloud ...>>}}}//
<<<
!Examples
<<<
//all tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud systemConfig excludeMissing script>>}}}
//top 10 tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud limit:10 systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud limit:10 systemConfig excludeMissing script>>}}}
//tags listed in// [[FavoriteTags]]
{{{<<cloud +FavoriteTags>>}}}
{{groupbox{<<cloud +FavoriteTags>>}}}
//tags NOT listed in// [[FavoriteTags]]
{{{<<cloud -FavoriteTags>>}}}
{{groupbox{<<cloud -FavoriteTags>>}}}
//links to tiddlers tagged with 'package'//
{{{<<cloud action:goto =package>>}}}
{{groupbox{<<cloud action:goto =package>>}}}
//top 20 most referenced tiddlers//
{{{<<cloud references limit:20>>}}}
{{groupbox{<<cloud references limit:20>>}}}
//top 20 tiddlers that contain the most links//
{{{<<cloud links limit:20>>}}}
{{groupbox{<<cloud links limit:20>>}}}
<<<
!Revisions
<<<
2009.07.17 [1.7.0] added {{{-TiddlerName}}} parameter to exclude tags that are listed in the indicated tiddler
2009.02.26 [1.6.0] added {{{action:...}}} parameter to apply popup vs. goto action when clicking cloud items
2009.02.05 [1.5.0] added ability to show links or back-links (references) instead of tags and renamed macro to {{{<<cloud>>}}} to reflect more generalized usage.
2008.12.16 [1.4.2] corrected group calculation to prevent 'group=0' error
2008.12.16 [1.4.1] revised tag filtering so excluded tags don't affect calculations
2008.12.15 [1.4.0] added {{{limit:...}}} parameter to restrict the number of tags displayed to the top N most popular
2008.11.15 [1.3.0] added {{{+TiddlerName}}} parameter to include only tags that are listed in the indicated tiddler
2008.09.05 [1.2.0] added '=tagname' parameter to include only tags that are themselves tagged with the specified value (i.e., ~TagglyTagging usage)
2008.07.03 [1.1.0] added 'segments' property to macro object. Extensive code cleanup
<<<
!Code
***/
//{{{
version.extensions.TagCloudPlugin= {major: 1, minor: 7 , revision: 0, date: new Date(2009,7,17)};
//Originally created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
//Currently maintained and enhanced by Eric Shulman
//}}}
//{{{
config.macros.cloud = {
tagstip: "%1 tiddlers tagged with '%0'",
refslabel: " (%0 references)",
refstip: "%1 tiddlers have links to '%0'",
linkslabel: " (%0 links)",
linkstip: "'%0' has links to %1 other tiddlers",
groups: 9,
init: function() {
config.macros.tagCloud=config.macros.cloud; // for backward-compatibility
config.shadowTiddlers.TagCloud='<<cloud>>';
config.shadowTiddlers.StyleSheetTagCloud=
'/*{{{*/\n'
+'.tagCloud span {line-height: 3.5em; margin:3px;}\n'
+'.tagCloud1{font-size: 80%;}\n'
+'.tagCloud2{font-size: 100%;}\n'
+'.tagCloud3{font-size: 120%;}\n'
+'.tagCloud4{font-size: 140%;}\n'
+'.tagCloud5{font-size: 160%;}\n'
+'.tagCloud6{font-size: 180%;}\n'
+'.tagCloud7{font-size: 200%;}\n'
+'.tagCloud8{font-size: 220%;}\n'
+'.tagCloud9{font-size: 240%;}\n'
+'/*}}}*/\n';
setStylesheet(store.getTiddlerText('StyleSheetTagCloud'),'tagCloudsStyles');
},
getLinks: function(tiddler) { // get list of links to existing tiddlers and shadows
if (!tiddler.linksUpdated) tiddler.changed();
var list=[]; for (var i=0; i<tiddler.links.length; i++) {
var title=tiddler.links[i];
if (store.isShadowTiddler(title)||store.tiddlerExists(title))
list.push(title);
}
return list;
},
handler: function(place,macroName,params) {
// unpack params
var inc=[]; var ex=[]; var limit=0; var action='popup';
var links=(params[0]&¶ms[0].toLowerCase()=='links'); if (links) params.shift();
var refs=(params[0]&¶ms[0].toLowerCase()=='references'); if (refs) params.shift();
if (params[0]&¶ms[0].substr(0,7).toLowerCase()=='action:')
action=params.shift().substr(7).toLowerCase();
if (params[0]&¶ms[0].substr(0,6).toLowerCase()=='limit:')
limit=parseInt(params.shift().substr(6));
while (params.length) {
if (params[0].substr(0,1)=='+') { // read taglist from tiddler
inc=inc.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
} else if (params[0].substr(0,1)=='-') { // exclude taglist from tiddler
ex=ex.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
} else if (params[0].substr(0,1)=='=') { // get tag list using tagged tags
var tagged=store.getTaggedTiddlers(params[0].substr(1));
for (var t=0; t<tagged.length; t++) inc.push(tagged[t].title);
} else ex.push(params[0]); // exclude params
params.shift();
}
// get all items, include/exclude specific items
var items=[];
var list=(links||refs)?store.getTiddlers('title','excludeLists'):store.getTags();
for (var t=0; t<list.length; t++) {
var title=(links||refs)?list[t].title:list[t][0];
if (links) var count=this.getLinks(list[t]).length;
else if (refs) var count=store.getReferringTiddlers(title).length;
else var count=list[t][1];
if ((!inc.length||inc.contains(title))&&(!ex.length||!ex.contains(title)))
items.push({ title:title, count:count });
}
if(!items.length) return;
// sort by decending count, limit results (optional)
items=items.sort(function(a,b){return(a.count==b.count)?0:(a.count>b.count?-1:1);});
while (limit && items.length>limit) items.pop();
// find min/max and group size
var most=items[0].count;
var least=items[items.length-1].count;
var groupSize=(most-least+1)/this.groups;
// sort by title and draw the cloud of items
items=items.sort(function(a,b){return(a.title==b.title)?0:(a.title>b.title?1:-1);});
var cloudWrapper = createTiddlyElement(place,'div',null,'tagCloud',null);
for (var t=0; t<items.length; t++) {
cloudWrapper.appendChild(document.createTextNode(' '));
var group=Math.ceil((items[t].count-least)/groupSize)||1;
var className='tagCloudtag tagCloud'+group;
var tip=refs?this.refstip:links?this.linkstip:this.tagstip;
tip=tip.format([items[t].title,items[t].count]);
if (action=='goto') { // TAG/LINK/REFERENCES GOTO
var btn=createTiddlyLink(cloudWrapper,items[t].title,true,className);
btn.title=tip;
btn.style.fontWeight='normal';
} else if (!links&&!refs) { // TAG POPUP
var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,onClickTag,className);
btn.setAttribute('tag',items[t].title);
} else { // LINK/REFERENCES POPUP
var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,
function(ev) { var e=ev||window.event; var cmt=config.macros.cloud;
var popup = Popup.create(this);
var title = this.getAttribute('tiddler');
var count = this.getAttribute('count');
var refs = this.getAttribute('refs')=='T';
var links = this.getAttribute('links')=='T';
var label = (refs?cmt.refslabel:cmt.linkslabel).format([count]);
createTiddlyLink(popup,title,true);
createTiddlyText(popup,label);
createTiddlyElement(popup,'hr');
if (refs) {
popup.setAttribute('tiddler',title);
config.commands.references.handlePopup(popup,title);
}
if (links) {
var tiddler = store.fetchTiddler(title);
var links=config.macros.cloud.getLinks(tiddler);
for(var i=0;i<links.length;i++)
createTiddlyLink(createTiddlyElement(popup,'li'),
links[i],true);
}
Popup.show();
e.cancelBubble=true; if(e.stopPropagation) e.stopPropagation();
return false;
}, className);
btn.setAttribute('tiddler',items[t].title);
btn.setAttribute('count',items[t].count);
btn.setAttribute('refs',refs?'T':'F');
btn.setAttribute('links',links?'T':'F');
btn.title=tip;
}
}
}
};
//}}}
!Reference
* http://www.testanything.org/
* http://testanything.org/wiki/index.php/TAP_at_IETF:_Draft_Standard
!~In-House
* [[Producing TAP from DOS scripts]]
* [[Bulk analysis of TAP results]]
* [[TAP.Writer]]
This can be served up on it's own in deep bowls, or with sticky Thai rice if there are people who are extra hungry.
Serves 6
!Ingredients
* 4 tablespoons [[Thai green curry paste]]
* 400ml coconut milk. Get a good creamy one not a cheap watery one.
* 400ml vegetable stock
* 1 tablespoon nam pla
* 1 tablespoon bottled green peppercorns
* handful basil leaves
* handful coriander leaves
* 7 oz chestnut mushrooms, quartered
* 8 kaffir lime leaves
* 6 good quality chicken breast, cut into strips and bite sized cubes
!Method
# Fry the chicken and put to one side.
# Fry the mushrooms.
# Add coconut milk, stock, nam pla, green peppercorns and green curry paste.
# Bring to the boil and simmer for twenty minutes.
# Add the chicken pieces and half the herbs. Cook for another six minutes.
# Add the remaining herbs.
Serve in deep bowls.
Keeps for a week in a jar. Uually used straight away to make fresh tasting [[Thai green curry]]
!Ingredients
* 4 lemongrass stalks, sliced
* 6 green chillies
* 3 cloves garlic
* 2 inch piece of galangal or ginger, chopped
* 2 shallots
* 4 tablespoons chopped coriander leaf
* 1 teaspoon ground cumin
* 1 tablespoon nam pla
* 1/2 teaspoon ground black pepper
!Method
# Whiz it all together in a food processor.
!Markup
* ~TidlyWiki markup is slighty different. See [[tiddlywiki.org|http://tiddlywiki.org/wiki/TiddlyWiki_Markup]]
!Images
Copy this code and replace //title//, //filename//, and //link// with appropriate text.
{{{
[img[title|filename]]
[img[title|filename][link]]
}}}
!Suppressing ~CamelCase links
To prevent a ~CamelCase word being automatically assigned a link by the wiki prefix the word with a tilde, '~':
{{{
~CamelCase cf. Camelcase
}}}
~CamelCase cf. CamelCase
/%
!info
|Name|ToggleRightSidebar|
|Source|http://www.TiddlyTools.com/#ToggleRightSidebar|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|transclusion|
|Description|show/hide right sidebar (SideBarOptions)|
Usage
<<<
{{{
<<tiddler ToggleRightSidebar>>
<<tiddler ToggleRightSidebar with: label tooltip>>
}}}
Try it: <<tiddler ToggleRightSidebar##show
with: {{config.options.chkShowRightSidebar?'◄':'►'}}>>
<<<
Configuration:
<<<
copy/paste the following settings into a tiddler tagged with <<tag systemConfig>> and then modify the values to suit your preferences:
{{{
config.options.chkShowRightSidebar=true;
config.options.txtToggleRightSideBarLabelShow="►";
config.options.txtToggleRightSideBarLabelHide="◄";
}}}
<<<
!end
!show
<<tiddler {{
var co=config.options;
if (co.chkShowRightSidebar===undefined) co.chkShowRightSidebar=true;
var sb=document.getElementById('sidebar');
var da=document.getElementById('displayArea');
if (sb) {
sb.style.display=co.chkShowRightSidebar?'block':'none';
da.style.marginRight=co.chkShowRightSidebar?'':'1em';
}
'';}}>><html><nowiki><a href='javascript:;' title="$2"
onmouseover="
this.href='javascript:void(eval(decodeURIComponent(%22(function(){try{('
+encodeURIComponent(encodeURIComponent(this.onclick))
+')()}catch(e){alert(e.description?e.description:e.toString())}})()%22)))';"
onclick="
var co=config.options;
var opt='chkShowRightSidebar';
var show=co[opt]=!co[opt];
var sb=document.getElementById('sidebar');
var da=document.getElementById('displayArea');
if (sb) {
sb.style.display=show?'block':'none';
da.style.marginRight=show?'':'1em';
}
saveOptionCookie(opt);
var labelShow=co.txtToggleRightSideBarLabelShow||'►';
var labelHide=co.txtToggleRightSideBarLabelHide||'◄';
if (this.innerHTML==labelShow||this.innerHTML==labelHide)
this.innerHTML=show?labelHide:labelShow;
this.title=(show?'hide':'show')+' right sidebar';
var sm=document.getElementById('storyMenu');
if (sm) config.refreshers.content(sm);
return false;
">$1</a></html>
!end
%/<<tiddler {{
var src='ToggleRightSidebar';
src+(tiddler&&tiddler.title==src?'##info':'##show');
}} with: {{
var co=config.options;
var labelShow=co.txtToggleRightSideBarLabelShow||'►';
var labelHide=co.txtToggleRightSideBarLabelHide||'◄';
'$1'!='$'+'1'?'$1':(co.chkShowRightSidebar?labelHide:labelShow);
}} {{
var tip=(config.options.chkShowRightSidebar?'hide':'show')+' right sidebar';
'$2'!='$'+'2'?'$2':tip;
}}>>
We keep seeing this problem, in one form or another, on here and having been through the pain the answer, while obvious once you see it, isn’t that obvious.
''Scenario:'' You’ve installed the [[Bitnami Trac stack|http://bitnami.org/stack/trac]] onto a Windows box, accepting all the defaults, but can't work out the URL to your //svn// repository.
Here are the variables that will make a difference in this example - replace them with the actual variables in your case.
* ''Machine name:'' BITNAMI
* ''Account name:'' Administrator
* ''Project name:'' Foo
You can see the project in “{{{C:\Documents and Settings\Administrator\BitNami Trac Stack projects\Foo}}}”
The repository, according to {{{C:\Documents and Settings\Administrator\BitNami Trac Stack projects\Foo\conf\trac.ini}}}
and confirmed by inspection, is in “{{{C:\Documents and Settings\Administrator\BitNami Trac Stack repository}}}”
Your source browser can see the SVN repository through the web interface at {{{http://BITNAMI/trac/Foo/browser}}}
You now want to conect to the svn repository from either the command line or a tool such as Tortoise.
''But what is the URL?''
Now on Linux and Mac OSes the URL for the default Trac Stack svn repository would be your choice of either
* {{{svn://BITNAMI/Users/Administrator/Trac/repository}}}
* {{{svn://localhost/Users/Administrator/Trac/repository}}}
* {{{svn://127.0.0.1/Users/Administrator/Trac/repository}}}
And other answers on here tell Windows users to point their SVN repository browser to:
* {{{svn://IP_address_of_the_repository_computer/repository_name}}}
What does {{{repository_name}}} mean in a Windows context, given drive letters, directory separators in the “wrong” direction, and Windows inability to neatly handle spaces in directory names?
It means:
* drop the drive letter
* swap ‘\’ for ‘/’
* wrap the ''whole'' URL. not just {{{repository_name}}} in quotes
So, for example, in the scenario above the URL is:
{{{“svn://BITNAMI/Documents and Settings/Administrator/BitNami Trac Stack Repository”}}}
You can verify this if you’ve run the very helpful “{{{C:\Program Files\BitNami Trac Stack\scripts\setenv.bat}}}” file which allows you to run //svn// from the command line:
{{{
$ svn co “svn://BITNAMI/Documents and Settings/Administrator/BitNami Trac Stack Repository” ./working
Checked out revision 0.
}}}
!Useful links
* VAX systems: http://www.compaq.com/alphaserver/vax/
Got a static file in your project, for instance a CSV spreadsheet, that should be published amongst the pages, but can't find how to force Visual Studio to publish it? In the Properties of the file make sure that {{{Build Action=Content}}}.
[img[Build Action properties in Visual Studio|./wiki-images/asp-build-action-properties.png]]
The following module provides a handler for the Certificate Choice dialog: [[CertificateChoiceDialogHandler.cs|src/WatiN/CertificateChoiceDialogHandler.cs]]
[[Handling Certificates]]
Welcome to the {{logo{Akroyd{{blue{|}}}Wallis}}} [[Wiki|TiddlyWiki]]. This is principally a place for us to record useful snippets of information that we keep coming back to, or have had trouble tracking down an answer to on the internet.
[[XKCD|http://www.xkcd.com]] got it right ''again'' just recently:
[img[Wisdom of the ancients|http://imgs.xkcd.com/comics/wisdom_of_the_ancients.png]]
Use the menu on the left or the search and index features on the right to drill down to relevant topics.
If you arrived at this page through a search engine please note that the terms highlighted in your results are not shown by default when landing on this page. Please use the //search// box in the right-hand sidebar to search within this page.
''Note: the wiki is read-only when accessed via the internet''
Type the text for 'Windows'
Hooks are written in the usual way, but as batch files.
!Stopping an empy log message
[[pre-commit.bat|./src/svn/hooks/pre-commit.bat]]
{{{
@echo off
setlocal
set _repository=%1
set _transaction=%2
svnlook log %_repository% -t %_transaction% | findstr . > nul
if %errorlevel% gtr 0 (goto NOLOG) else exit 0
:NOLOG
echo. 1>&2
echo Your commit has been blocked because you didn’t provide a log message. 1>&2
echo Please write a log message describing the purpose of your change and 1>&2
echo then try committing again. 1>&2
exit 1
}}}
!Return values and use of standard streams
Writing HPC applications that use the standard streams correctly and return appropriate error values is not going to be an issue for developers used to writing console applications.
For developers who aren't used to writing console applications it is worth remembering some long established conventions.
!!Return Values
Return zero for success, non-zero otherwise. You may use different non-zero values to indicate different error conditions. This behaviour is a de-facto standard.
>"Typically a return value of zero implies normal termination; non-zero values signal unusual or erroneous termination conditions."
>//The C Programming Language//, Kernighan & Ritchie
>"Every command returns an exit status - a value returned to the shell to indicate what happened. The exit status is a small integer; by convention 0 means "true" (the command ran successfully) and non-zero means "false" (the command ran unsuccessfully)."
>//The Unix Programming Environment//, Kernighan & Pike
>"It is conventional that C programs return 0 for success and non-zero values for various failures."
>//The Practice of Programming//, Kernighan & Pike
!!Error output
>"Standard error was invented somewhat after pipes, to solve the problem of error messages disappearing into pipelines."
>//The Unix Programming Environment//, Kernighan & Pike
Don't ignore the work of these early computing pioneers. Use {{{stderr}}} to report error messages to the user.
[img[standard streams|./graphs/streams.png]]
!!Invocation errors
If the application is invoked correctly, by passing the wrong or invalid command line arguments then this must be considered an error. So the application must:
* return a non-zero value.
* write any usage message to {{{stderr}}} //not// {{{stdout}}}.
If the user asks on the command line for usage options, then reporting back the usage message is //not// an error. In this case the application must:
* return zero.
* write any usage message to {{{stdout}}} //not// {{{stderr}}}.
!Description
With a cluster of HP Z600 workstations the PXE attempt just times out.
!Symptoms
When the cluster node boots up the head node reports that it is 'sending PXE command to boot node to WINPE (expected boot time: 5-15 minutes)'.
Meanwhile the cluster node goes into PXE, but sits twiddling it's timer before reporting a PXE-M0f then finally a non-system disk error.
HP UNDI PXE-2.1 V11.4.0 HP Base Code PXE-2.1 v1.1.0
Intermittently you may see PXE-E52 error codes reported.
!Solution
One way we've been able to resolve this has been to double check the DHCP settings so that the Z600 picks up an IP address PXE is working.
The other way is to create a generic Z600 node template, then
* copy this for the new node
* insert the MAC address of the new z600 network adapter
* add the node using a node XML file.
[[awk|http://cm.bell-labs.com/cm/cs/awkbook/]] is the {{logo{Akroyd{{blue{|}}}Wallis}}} Golden Hammer.
Not just because sometimes perl is too smart for it’s own good, but we find that awk is more powerful than people at first think...
>"Henry Spencer, who did some amazing things with Awk, claimed that after demoing some awk stuff to Larry Wall, Larry said he wouldn't have bothered with Perl if he'd known."
>Paul Tomblin
* preferred implementation - [[the one true awk|http://cm.bell-labs.com/cm/cs/awkbook/]]
* alternative implementation [[gawk|http://www.gnu.org/software/gawk/]]
* [[awk one liners|http://www.pement.org/awk/awk1line.txt]]
{{{
@echo off
%~d0
cd %~dp0
if exist readme.txt type readme.txt
cmd /K
}}}
Copyright © 2010-2011 Akroyd Wallis Limited. All Rights Reserved.
Add //flexlm// monitoring to your desktop. Just run the following script every 5 minutes, passing it a configuration file in the form of
{{{
port@server
}}}
It's what I use to monitor my license servers and means I often call the server support team before I start getting calls from users.
s2h.awk:
{{{
# Queries each server in the provided file and generates an HTML table showing
# the status of each
# input file should be of form:
# port@server
# Requires gawk not awk due to use of strftime
BEGIN {
tmpfile = "s2h.tmp";
# title and auto refresh
print("<html><head><title>License Server Status</title><link rel='stylesheet' href='./s2h.css' /><meta HTTP-EQUIV='Refresh' Content='300' /></head><body>")
# strftime requires gawk not awk
print("<h1>License server status @ " strftime() "</h1>");
print("<table><tr><th>Server</th><th>Daemons</th></tr>");
}
# All ports are in range >= 1000
!/servers/ && /[0-9][0-9][0-9][0-9]/ {
sub(";.*", "");
daemons = "";
server = $1; # must be set now in case of nil response
split(server,s,"@"); port = s[1];
system("lmutil lmstat -c "server" > " tmpfile);
while(getline < tmpfile) {
# License server Status
if (index($0,"License server status")) {
sub("\r","");
server = $4; # Get actual value, catches triads
n = gsub(",", "<br/>", server); # n is one less than expected number of server status lines
getline < tmpfile; # License file - not of interest
getline < tmpfile; # blank line
# May be more than one status line
server = "";
while (n >= 0) {
getline < tmpfile; # Status
gsub(":","");
($4 == "UP") ? status = "UP" : status = "ERROR";
server = server "[<span class='"status"'>"status"</span>] "port"@"$1"<br/>";
n--;
}
} else if (index($0,"Error getting status")) {
status = "ERROR"; daemons=" ";
} else if (index($0,"Vendor daemon status")) {
getline < tmpfile; #blank
# Remaining lines are for the license daemons
while (getline < tmpfile) {
gsub(":", ""); sub("\r","");
# Last line has 1 field, a good daemon has 3 fields, a dead daemon has more than 3 fields
if (NF == 3) {
daemons = daemons "<br/>[<span class='UP'>" $2 "</span>] " $1 " " $3;
} else if (NF > 3){
daemons = daemons "<br/>[<span class='ERROR'>ERROR</span>] " $1;
status = "WARNING";
}
}
}
}
# Remove extraneous leading <br/>
sub ("^<br/>", "", daemons);
print("<tr><td class='"status"'>"server"</td><td>"daemons"</td></tr>");
close(tmpfile);
}
END {
print("</table><p>This table will auto-refresh every 5 minutes</p></body></html>");
}
}}}
s2h.css
{{{
/* Simple stylesheet for license server status report */
body {
background:black;
font-family:'Frutiger Linotype', sans-serif;
color:white;
}
p, h1, table {
font-size:9pt;
}
.UP {
background:green;
color:white;
}
.ERROR {
background:red;
color:white;
}
.WARNING {
background:yellow;
color:black;
}
th {
background:#333;
}
th,td {
border:1px solid #ccc;
padding:3px;
margin:0;
}
}}}
//mex// is normally configured to use a specific compiler using //mex -setup.//
This runs //mex// in interactive mode, and offers the option of detecting C/C++ compilers installed on the users computer.
On a MDCS cluster there is no such ability to configure //mex// interactively.
!Configuring mex programmatically
As an alternative to the above method mex can be configured programmatically by passing an option named for the intended compiler. For Visual Studio Express 2010 C++ this is msvc100free:
{{{
mex -setup:msvc100free
}}}
This command can be added to scripts that require the compiler during running:
!Confirming mex configuration
mex configuration can be confirmed using the //getmexext// command to confirm the file extension used for mex files, or the mex.getCompilerConfigurations to check specific compiler settings:
{{{
% getmexetup.m: Gets mex settings. Can be submitted to the cluster
extension = getmexext
cc = mex.getCompilerConfigurations
ccDetails=cc.Details
ccFlags=cc.Details.CompilerFlags
linkerFlags=cc.Details.LinkerFlags
}}}
!Putting it all together
Together these two commands can be used to setup //mex// and check that it is configured correctly before attempting to submit to the cluster any scripts that may require mex for compilation:
{{{
% example.m: Configuring and checking mex before using it for batch compilation
mex -setup:msvc100free
extension = getmexext
if extension ~= 'mexw64'
% can't continue
disp ('not ok - mex configuration on the cluster')
else
% can continue
disp ('ok - mex configuration on the cluster')
% rest of your code that uses mex here
...
end
}}}
!More information
More information on mex files is available on the Mathworks site:
http://www.mathworks.com/help/techdoc/matlab_external/f23674.html
{{{
$ nslookup {host}
}}}
[[Do not use?|http://cr.yp.to/djbdns/nslookup.html]]
As well as a technical wiki this page get's used by Nick to jot down his random recipes for busy blokes.
[[Creating a subversion service on Windows]]
[[Windows hooks in subversion]]
!Useful links
* Trac: http://trac.edgewall.org/
{{logo{Akroyd{{blue{|}}}Wallis}}} recommend assessing Trac using Bitnami Trac stacks. This greatly simplifies the deployment of Trac and its required dependencies. It can be deployed using a native installer, as a virtual machine or in the cloud. The virtual applicances are great for getting it up and running in under 20 minutes.
* Bitnami: http://bitnami.org/stack/trac
We miss the ability to run //which// from the [[DOS]] command prompt. So we put something together using Windows Script Host.
Save these two files somewhere in your {{{%path%}}}.
[[which.wsh|./src/dos/which.wsf]]
[[which.js|./src/dos/which.js]]
The //zypper// tool is not available on the Bitnami Ubuntu virtual machines. Instead use //sudo apt-get install//.