Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
An array is a list of data. Each piece of data in an array is identified by an index number representing its position in the array. Arrays are zero based, which means that the first element in the array is [0], the second element is [1], and so on. In this example, an array named "coswav" is created and filled with the cosine values. This data is displayed three separate ways on the screen.
<<Processing
size(200, 200);
float[] coswave = new float[width];
for(int i=0; i<width; i++) {
float ratio = (float)i/(float)width;
coswave[i] = abs( cos(ratio*PI) );
}
for(int i=0; i<width; i++) {
stroke(coswave[i]*255);
line(i, 0, i, width/3);
}
for(int i=0; i<width; i++) {
stroke(coswave[i]*255/4);
line(i, width/3, i, width/3*2);
}
for(int i=0; i<width; i++) {
stroke(255-coswave[i]*255);
line(i, width/3*2, i, height);
}
>>
Taken from [[basic/array.html|http://ejohn.org/apps/processing.js/examples/basic/array.html]]
<<tabs Assignments
Homework "Homework" [[Assignments/Homework]]
Tests "Tests" [[Assignments/Tests]]
>>
<part Homework hidden>
!To be turned in
**[[Homework 1 (pdf)|homework/mat-336-001-2011-spring-homework-1.pdf]] - due Thursday, January 20
**[[Homework 2 (pdf)|homework/mat-336-001-2011-spring-homework-2.pdf]] - due Thursday, January 27
**[[Homework 3 (pdf)|homework/mat-336-001-2011-spring-homework-3.pdf]] - due Thursday, February 3
**[[Homework 4 (pdf)|homework/mat-336-001-2011-spring-homework-4.pdf]] - due Thursday, February 24
**[[Homework 5 (pdf)|homework/mat-336-001-2011-spring-homework-5.pdf]] - due Thursday, March 3
**[[Homework 6 (pdf)|homework/mat-336-001-2011-spring-homework-6.pdf]] - due Thursday, March 31
!Suggested exercises
**Section 1.1: 1,2,3,4,5,6
**Section 1.2: 1,2,3,4,5
**Section 1.3: 1,2,3,4,5,6
**Section 1.4: 1,2,3,4,5,6,7,8,9
**Section 1.5: 1,2,3,4,5,6,7,8,9,10,11
**Section 1.6: 1,2,3,4,5
**Section 2.1: 1,2,3
**Section 2.2: 1
**Section 2.3: 1,2
**Section 2.4: 1,2,3
**Section 2.5: 1,2,3,4,5,6,7,8
**Section 3.1: 1,2,3,4
**Section 3.2: 1,2
**Section 3.3: 1,2,3,4,5,6,7,8
**Section 4.1: 1,2,3,4,5
**Section 4.2: 1,2,3,4,5,6,7,8,9,10
**Section 4.3: 1,2,3,4,5,6,7,8,9
**Section 4.4: 1,2,3
**Section 4.5: 1,2,3,4,5
**Section 5.1: 1,2,3,4,5,6
**Section 5.2: 1,2,3,4,5,6,7,8,9,10,11,12,13
**Section 5.3: 1,2,3,4
**Section 5.4: 1,2,3,4,5,6,7,8,9,10
**Section 5.5: 1,2,3
**Section 5.6: 1,2,3
**Section 6.1: 1,2,3,4,5,6,7,8,9
**Section 6.2: 1,2,3,4,5,6
</part>
<part Quizzes hidden>
/%
!Spring 2010
*[[Quiz 1|quizzes/mat-336-001-2010-spring-quiz-1.pdf]]
*[[Quiz 2|quizzes/mat-336-001-2010-spring-quiz-2.pdf]]
*[[Quiz 3|quizzes/mat-336-001-2010-spring-quiz-3.pdf]]
*[[Quiz 4|quizzes/mat-336-001-2010-spring-quiz-4.pdf]]
%/
</part>
<part Tests hidden>
!Spring 2011
*Test 1
**[[Sample (pdf)|tests/mat-336-001-2011-spring-test-1-sample.pdf]]
*Test 2
**[[Sample (pdf)|tests/mat-336-001-2011-spring-test-2-sample.pdf]]
**[[Supplement (pdf)|tests/mat-336-001-2011-spring-test-2-supplement.pdf]]
*Final
**[[Sample (pdf)|tests/mat-336-001-2011-spring-final-sample.pdf]]
**[[Sample brief solutions (pdf)|tests/mat-336-001-2011-spring-final-sample-brief-solutions.pdf]]
</part>
<<tabs Outline
Outline "Outline" ./outline
>>
<part outline hidden>
*Powers of the Binomial \( 1+x \)
*Pascal's Triangle
*Coefficients of the expansion of \( (1+x)^n \)
*Binomial Coefficients
*Combinatorial Identity
</part>
!Theorem
Every group \( G \) is isomorphic to a subgroup of some symmetric group.
!Theorem
Let \( G \) be a group, and let \( H \) be a subgroup of \( G \) having finite index \( n \) . Then there exists a homomorphism \( \phi: G \rightarrow S_{n} \) with \( \mbox{ker} \phi \le H \) .
!Proposition
Every group \( G \) of order 4 is isomorphic to either \( \mathbb{I}_{4} \) or the Klein four-group \( V \) .
!Proposition
If \( G \) is a group of order 6, then \( G \) is isomorphic to either \( \mathbb{I}_{6} \) or \( S_{3} \) .
!Proposition
If \( p \) is prime and \( G \) is a group of order \( 2p \) , then \( G \) is either cyclic or dihedral.
''Definition''
A common divisor of integers \( a \) and \( b \) is an integer \( c \) with \( c | a \) and \( c | b \).
''Theorem''
Let \( a \) and \( b \) be integers. A nonnegative common divisor \( d \) is their gcd if and only if \( c | d \) for every common divisor \( c \).
!Definition
A nonempty set $R$ with two operations, addition and multiplication, is a ring provided that:
# $(R,+)$ is an abelian group
# Multiplication is associative
# There exists an element $1 \in R$ called //one// with $1a = a = a1$ for all $a \in R$
# Multiplication distributes over addition from both left and right
If multiplication is commutative, we say that the ring $R$ is commutative.
!Examples
$\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$; $\mathbb{Z}[i]$, $\mathbb{Z}[\sqrt{-5}]$; $\mathbb{I}_{m}$; $M_{n}(\mathbb{R})$
!Proposition
Let $R$ be a commutative ring.
# $0a = 0$ for all $a \in R$
# $(-1)(-a) = a$ for all $a \in R$
# $(-1)a = -a$ for all $a \in R$
# $(-a)(-b)=ab$ for all $a,b \in R$
!Definition
$a - b := a + (-b)$
!Definition
Given $n \in \mathbb{N}$ with $n \ne 0$ and $a \in R$, we define $na$ as the sum of $n$ copies of a. We say $0a = 0$.
!Proposition
If $1 = 0$, then $R = \{ 0 \}$.
!Definition
An ''integral domain'' is a commutative ring $R$ with $1 \ne 0$ such that whenever $ca = cb$ with $c \ne 0$, it follows that $a=b$.
!Proposition
A nonzero commutative ring $R$ is an integral domain if and only if the product of any two nonzero elements of $R$ is nonzero.
!Definition
Given $a,b \in R$, $a | b$ in $R$ means that there exists $c \in R$ with $b = ca$.
!Definition
$u \in R$ is a unit if $u | 1$ in $R$.
!Example
Find the units of $\mathbb{Z}$ and $\mathbb{Z}[i]$.
!Proposition
Let $R$ be a domain and $a,b$ nonzero elements of $R$. Then $a | b$ and $b | a$ if and only if $b = ua$ for some unit $u \in R$.
!Example
Find the units in $\mathbb{I}_{m}$.
!Question
What is an example of a commutative ring which is not an integral domain?
!Question
Is every non-zero-divisor element of a ring necessarily a unit?
*Congruence modulo $m$
*Congruence is an equivalence relation
*Congruence is compatible with addition and multiplication
*Identifying non-square numbers via congruence
*Determining divisibility by 3
*Solution of linear congruences
*Instructor
**Dr. Michael Freeze
*Class meeting time
**Section 001: Tuesdays and Thursdays, 11:00a-12:15p in Leutze Hall 141
*Office Location
**Bear Hall 124
*Office Hours
**M,T,W,Th 2:00-3:00p or by appointment
*Phone
**910.795.1385
*Email
**freezem at uncw dot edu
All shapes drawn to the screen have a position that is specified as a coordinate. All coordinates are measured as the distance from the origin in units of pixels. The origin [0, 0] is the coordinate is in the upper left of the window and the coordinate in the lower right is [width-1, height-1].
<<Processing
// Sets the screen to be 200, 200, so the width of the window is 200 pixels
// and the height of the window is 200 pixels
size(200, 200);
background(0);
noFill();
stroke(255);
// The two parameters of the point() method each specify coordinates.
// This call to point() draws at the position [100, 100]
point(width/2, height/2);
// Draws to the position [100, 50]
point(width/2, height/4);
// It is also possible to specify a point with any parameter,
// but only coordinates on the screen are visible
point(60, 30);
point(60, 134);
point(160, 50);
point(280, -800);
point(201, 100);
// Coordinates are used for drawing all shapes, not just points.
// Parameters for different methods are used for different purposes.
// For example, the first two parameters to line() specify the coordinates of the
// first point and the second two parameters specify the second point
stroke(204);
line(0, 73, width, 73);
// The first two parameters to rect() are coordinates
// and the second two are the width and height
rect(110, 55, 40, 36);
>>
Taken from [[basic/coordinates.html|http://ejohn.org/apps/processing.js/examples/basic/coordinates.html]]
!Theorem
Let $H$ be a subgroup of a group $G.$ Then $a \sim b$ iff $b^{-1}a \in H$ defines an equivalence relation on $G.$
!Definition
Let $G$ be a group with subgroup $H$ and $a \in G.$ The set $aH = \{ ah : h \in H \}$ is a left coset of $H$ in $G$ with representative $a.$
!Observation
The distinct cosets of $H$ in $G$ partition $G.$
!Lemma
$aH = bH$ if and only if $b^{-1}a \in H$
!Lemma
If $aH \cap bH \neq \emptyset,$ then $aH = bH.$
!Lemma
Let $H$ be a subgroup of $G$ and $a,b \in G.$ The following are equivalent.
# $b^{-1}a \in H$
# $a = bh$ for some $h \in H$
# $a \in bH$
# $aH = bH$
!Example
Find the left cosets of $\langle s \rangle$ in $D_{8}.$
!Example
Find the left cosets of $3 \mathbb{Z}$ in $\mathbb{Z}.$
!Lemma
If $H$ is a subgroup of a group $G$ and $a \in G,$ then $|H| = |aH|.$
!Theorem (Lagrange)
If $H$ is a subgroup of a finite group $G,$ then $|H|$ is a divisor of $|G|.$
!Corollary
If $G$ is a finite group and $a \in G,$ then $|a|$ is a divisor of $|G|.$
!Corollary
If $G$ is a finite group and $a \in G,$ then $a^{|G|}=1.$
!Corollary
A group $G$ of prime order contains no subgroups other than $\{1\}$ and $G.$
!Corollary
Each group $G$ of prime order is cyclic.
!Basic Question
When is the product of left cosets well-defined?
!Proposition
Let \( H \le G \). If \( xHx^{-1} = H \) for all \( x \in G \), then \( (aH)(bH) := (ab)H \) is well-defined.
!Example
The product of left cosets of \( H = \langle s \rangle \) in \( G = D_{12} \) is not well-defined.
!Definition
Let \( H \) be a subgroup of a group \( G \). We say that \( H \) is a normal subgroup of \( G \) if \( xHx^{-1} = H \) for all \( x \in G \).
!Example
Every subgroup of an abelian group \( G \) is normal in \( G \).
!Proposition
If \( [G:H] = 2 \), then \( H \) is normal in \( G \).
!Example
Every subgroup of \( Q_{8} \) is normal, but \( Q_{8} \) is not abelian.
!Objectives
#To provide students knowledge of basic algebraic structures including groups, rings, and fields.
#To provide students practice with writing mathematical proofs.
#To provide students clear examples of applications of modern algebra.
!Text
//Groups, Rings and Fields//, D.A.R. Wallace, 1998.
!Course Content
This course introduces the elementary concepts of group and ring theory. Groups will be considered through their actions on mathematical objects; rings will be considered through their arithmetic properties.
/% !Computer Use
This course may make use of the Maple and GAP software packages in addition to Java applets as aids in understanding concrete representations of groups. %/
!Attendance
You are expected to attend class on time each day. Attendance will be recorded on a regular basis.
!Tests, Homework and Quizzes
Two tests and a final exam will be given. There will be no make-up tests without prior permission. Homework problems will be suggested for each section. Short, unannounced quizzes may also be given occasionally.
!Grading
Each of your two tests will contribute 25% toward your grade. Your combined homework and quiz grades will contribute an additional 25%, and your final exam will determine the remaining 25%.
!Academic Expectations
In choosing UNCW, you have become part of our community of scholars. We recognize that the UNCW learning experience is challenging and requires hard work. It also requires a commitment to make time available to do that hard work. The university expects you to make academics your highest priority by dedicating your time and energy to training your mind and acquiring knowledge.
You are expected to follow the academic Honor Code as covered in the UNCW Student Handbook. Please note that plagiarism, a form of academic dishonesty in which you take someone else's ideas and represent them as your own, is a specific violation of the Honor Code.
Academic success in critical thinking and problem solving prepares you for the changes and challenges you will encounter in the future. Our faculty and academic support resources are readily available as partners in this effort, but the primary responsibility for learning is yours.
!Federal Americans with Disabilities Act
Students with diagnosed disabilities should contact the Office of Disability Services. Please give me, within the first week of class or as soon as possible, a copy of the letter you receive from Office of Disability Services detailing class accommodations you may need. If you require accommodation for test-taking please make sure I have the referral letter no less than three days before the test.
!Violence and Harassment
UNCW practices a zero tolerance policy for any kind of violent or harassing behavior. If you are experiencing an emergency of this type contact the police at 911 or UNCW CARE at 962-2273. Resources for individuals concerned with a violent or harassing situation can be located at http://www.uncw.edu/wsrc/crisis.html.
!Campus Respect Compact
UNCW has recently instituted a Respect Compact to affirm our commitment to a civil community characterized by mutual respect. A copy of the Respect Compact is affixed to the wall of each classroom and can be accessed at http://www.uncw.edu/stuaff/pdc/documents/SeahawkRespectCompact.pdf . Individuals desiring more information about the Respect Compact should contact the Office of Institutional Diversity and Inclusion.
!Definition
Given $k$ a divisor of $n$, let $U_{k}(n) = \{ \overline{x} \in U(n) : x \equiv 1 (\mbox{mod} k) \}$.
!Proposition
If $\mbox{gcd}(m,n)=1$, then $\phi(mn) = \phi(m) \phi(n)$, where $\phi$ is the Euler $\phi$-function.
!Theorem
If $\mbox{gcd}(s,t)=1$, then $U(st) \cong U_{t}(st) \times U_{s}(st)$.
!Definition
If $H$ and $K$ are groups, then their direct product, denoted by $H \times K$, is the set of all ordered pairs $(h,k)$ with $h \in H$ and $k \in K$ equipped with the operation $(h,k)(h',k')=(hh',kk')$.
!Proposition
If $G$ is a group containing normal subgroups $H$ and $K$ with $H \cap K = \{1\}$ and $HK=G$, then $G \cong H \times K$.
!Theorem
If $\mbox{gcd}(m,n)=1$, then $\mathbb{I}_{mn} \cong \mathbb{I}_{m} \times \mathbb{I}_{n}$.
''Theorem''
Given integers \( a \) and \( b \) with \( a \ne 0 \), there exist unique integers \( q \) and \( r \) with \( b = qa + r \) and \( 0 \le r < |a| \).
''Definition''
An integer \( d \) is a divisor of an integer \( n \) if \( n = da \) for some integer \( a \).
A natural number \( n \) is called prime if \( n \ge 2 \) and its only divisors are \( \pm 1 \) and \( \pm n \).
''Theorem''
If \( p \) is a prime and \( p | ab \), then \( p | a \) or \( p | b \).
''Theorem''
Let \( a \) and \( b \) be positive integers. There is an algorithm that finds the gcd \( d = (a,b) \), and there is an algorithm that finds a pair of integers \( s \) and \( t \) with \( d = sa + tb \).
/***
|Name|ExternalTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#ExternalTiddlersPlugin|
|Documentation|http://www.TiddlyTools.com/#ExternalTiddlersPluginInfo|
|Version|1.3.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|TemporaryTiddlersPlugin (optional, recommended)|
|Overrides|config.macros.tiddler.handler|
|Options|##Configuration|
|Description|retrieve and wikify content from external files or remote URLs|
This plugin extends the {{{<<tiddler>>}}} macro syntax so you can retrieve and wikify content directly from external files or remote URLs. You can also define alternative "fallback" sources to provide basic "import on demand" handling by automatically creating/importing tiddler content from external sources when the specified ~TiddlerName does not already exist in your document.
!!!!!Documentation
>see [[ExternalTiddlersPluginInfo]]
!!!!!Configuration
<<<
<<option chkExternalTiddlersImport>> automatically create/import tiddlers when using external fallback references
{{{usage: <<option chkExternalTiddlersImport>>}}}
<<option chkExternalTiddlersQuiet>> don't display messages when adding tiddlers ("quiet mode")
{{{usage: <<option chkExternalTiddlersQuiet>>}}}
<<option chkExternalTiddlersTemporary>> tag retrieved tiddlers as 'temporary'(requires [[TemporaryTiddlersPlugin]])
{{{usage: <<option chkExternalTiddlersTemporary>>}}}
tag retrieved tiddlers with: <<option txtExternalTiddlersTags>>
{{{usage: <<option txtExternalTiddlersTags>>}}}
__password-protected server settings //(optional, if needed)//:__
>username: <<option txtRemoteUsername>> password: <<option txtRemotePassword>>
>{{{usage: <<option txtRemoteUsername>> <<option txtRemotePassword>>}}}
>''note: these settings are also used by [[LoadTiddlersPlugin]] and [[ImportTiddlersPlugin]]''
<<<
!!!!!Revisions
<<<
2008.10.27 [1.3.1] in insertTiddler(), fixed Safari bug by replacing static Array.concat(...) with new Array().concat(...)
|please see [[ExternalTiddlersPluginInfo]] for additional revision details|
2007.11.25 [1.0.0] initial release - moved from CoreTweaks
<<<
!!!!!Code
***/
//{{{
version.extensions.ExternalTiddlersPlugin= {major: 1, minor: 3, revision: 1, date: new Date(2008,10,27)};
// optional automatic import/create for missing tiddlers
if (config.options.chkExternalTiddlersImport==undefined) config.options.chkExternalTiddlersImport=true;
if (config.options.chkExternalTiddlersTemporary==undefined) config.options.chkExternalTiddlersTemporary=true;
if (config.options.chkExternalTiddlersQuiet==undefined) config.options.chkExternalTiddlersQuiet=false;
if (config.options.txtExternalTiddlersTags==undefined) config.options.txtExternalTiddlersTags="external";
if (config.options.txtRemoteUsername==undefined) config.options.txtRemoteUsername="";
if (config.options.txtRemotePassword==undefined) config.options.txtRemotePassword="";
config.macros.tiddler.externalTiddlers_handler = config.macros.tiddler.handler;
config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
params = paramString.parseParams("name",null,true,false,true);
var names = params[0]["name"];
var list = names[0];
var items = list.split("|");
var className = names[1] ? names[1] : null;
var args = params[0]["with"];
// UTILITY FUNCTIONS
function extract(text,tids) { // get tiddler source content from plain text or TW doc
if (!text || !tids || !tids.length) return text; // no text or no tiddler list... return text as-is
var remoteStore=new TiddlyWiki();
if (!remoteStore.importTiddlyWiki(text)) return text; // not a TW document... return text as-is
var out=[]; for (var t=0;t<tids.length;t++)
{ var txt=remoteStore.getTiddlerText(tids[t]); if (txt) out.push(txt); }
return out.join("\n");
}
function substitute(text,args) { // replace "substitution markers" ($1-$9) with macro param values (if any)
if (!text || !args || !args.length) return text;
var n=args.length; if (n>9) n=9;
for(var i=0; i<n; i++) { var re=new RegExp("\\$" + (i + 1),"mg"); text=text.replace(re,args[i]); }
return text;
}
function addTiddler(src,text,tids) { // extract tiddler(s) from text and create local copy
if (!config.options.chkExternalTiddlersImport) return; // not enabled... do nothing
if (!text || !tids || !tids.length) return; // no text or no tiddler list... do nothing
var remoteStore=new TiddlyWiki();
if (!remoteStore.importTiddlyWiki(text)) // not a TW document... create a single tiddler from text
makeTiddler(src,text,tids[0]);
else // TW document with "permaview-like" suffix... copy tiddler(s) from remote store
for (var t=0;t<tids.length;t++)
insertTiddler(src,remoteStore.getTiddler(tids[t]));
return;
}
function makeTiddler(src,text,title) { // create a new tiddler object from text
var who=config.options.txtUserName; var when=new Date();
var msg="/%\n\nThis tiddler was automatically created using ExternalTiddlersPlugin\n";
msg+="by %0 on %1\nsource: %2\n\n%/";
var tags=config.options.txtExternalTiddlersTags.readBracketedList();
if (config.options.chkExternalTiddlersTemporary) tags.pushUnique(config.options.txtTemporaryTag);
store.saveTiddler(null,title,msg.format([who,when,src])+text,who,when,tags,{});
if (!config.options.chkExternalTiddlersQuiet) displayMessage("Created new tiddler '"+title+"' from text file "+src);
}
function insertTiddler(src,t) { // import a single tiddler object into the current document store
if (!t) return;
var who=config.options.txtUserName; var when=new Date();
var msg="/%\n\nThis tiddler was automatically imported using ExternalTiddlersPlugin\n";
msg+="by %0 on %1\nsource: %2\n\n%/";
var newtags=new Array().concat(t.tags,config.options.txtExternalTiddlersTags.readBracketedList());
if (config.options.chkExternalTiddlersTemporary) newtags.push(config.options.txtTemporaryTag);
store.saveTiddler(null,t.title,msg.format([who,when,src])+t.text,t.modifier,t.modified,newtags,t.fields);
if (!config.options.chkExternalTiddlersQuiet) displayMessage("Imported tiddler '"+t.title+"' from "+src);
}
function getGUID() // create a Globally Unique ID (for async reference to DOM elements)
{ return new Date().getTime()+Math.random().toString(); }
// loop through "|"-separated list of alternative tiddler/file/URL references until successful
var fallback="";
for (var i=0; i<items.length; i++) { var src=items[i];
// if tiddler (or shadow) exists, replace reference list with current source name and apply core handler
if (store.getTiddlerText(src)) {
arguments[2][0]=src; // params[] array
var p=arguments[4].split(list); arguments[4]=p[0]+src+p[1]; // paramString
this.externalTiddlers_handler.apply(this,arguments);
break; // stop processing alternatives
}
// tiddler doesn't exist, and not an external file/URL reference... skip it
if (!config.formatterHelpers.isExternalLink(src)) {
if (!fallback.length) fallback=src; // title to use when importing external tiddler
continue;
}
// separate 'permaview' list of tiddlers (if any) from file/URL (i.e., '#name name name..." suffix)
var p=src.split("#"); src=p[0]; var tids=p[1]?p[1].readBracketedList(false):[];
// if reference is to a remotely hosted document or the current document is remotely hosted...
if (src.substr(0,4)=="http" || document.location.protocol.substr(0,4)=="http") {
if (src.substr(0,4)!="http") // fixup URL for relative remote references
{ var h=document.location.href; src=h.substr(0,h.lastIndexOf("/")+1)+src; }
var wrapper = createTiddlyElement(place,"span",getGUID(),className); // create placeholder for async rendering
var callback=function(success,params,text,src,xhr) { // ASYNC CALLBACK
if (!success) { displayMessage(xhr.status); return; } // couldn't read remote file... report the error
if (params.fallback.length)
addTiddler(params.url,text,params.tids.length?params.tids:[params.fallback]); // import tiddler
var wrapper=document.getElementById(params.id); if (!wrapper) return;
wikify(substitute(extract(text,params.tids),params.args),wrapper); // ASYNC RENDER
};
var callbackparams={ url:src, id:wrapper.id, args:args, tids:tids, fallback:fallback } // ASYNC PARAMS
var name=config.options.txtRemoteUsername; // optional value
var pass=config.options.txtRemotePassword; // optional value
var x=doHttp("GET",src,null,null,name,pass,callback,callbackparams,null)
if (typeof(x)=="string") // couldn't start XMLHttpRequest... report error
{ displayMessage("error: cannot access "+src); displayMessage(x); }
break; // can't tell if async read will succeed.... stop processing alternatives anyway.
}
else { // read file from local filesystem
var text=loadFile(getLocalPath(src));
if (!text) { // couldn't load file... fixup path for relative reference and retry...
var h=document.location.href;
var text=loadFile(getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf("/")+1)))+src);
}
if (text) { // test it again... if file was loaded OK, render it in a class wrapper
if (fallback.length) // create new tiddler using primary source name (if any)
addTiddler(src,text,tids.length?tids:[fallback]);
var wrapper=createTiddlyElement(place,"span",null,className);
wikify(substitute(extract(text,tids),args),wrapper); // render
break; // stop processing alternatives
}
}
}
};
//}}}
|Name|ExternalTiddlersPluginInfo|
|Source|http://www.TiddlyTools.com/#ExternalTiddlersPlugin|
|Documentation|http://www.TiddlyTools.com/#ExternalTiddlersPluginInfo|
|Version|1.3.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for ExternalTiddlersPlugin|
This plugin extends the {{{<<tiddler>>}}} macro syntax so you can retrieve and wikify content directly from external files or remote URLs. You can also define alternative "fallback" sources to provide basic "import on demand" handling by automatically creating/importing tiddler content from external sources when the specified ~TiddlerName does not already exist in your document.
!!!!!Configuration
>see ExternalTiddlersPlugin
!!!!!Usage
<<<
The standard TiddlyWiki core syntax for the {{{<<tiddler>>}}} macro is:
>{{{<<tiddler TiddlerName with: param param param ...>>}}}
where the optional {{{with: param param param...}}} values are used to replace any corresponding "substitution markers" ($1 to $9) that may be embedded in the referenced tiddler content.
This plugin allows the {{{<<tiddler>>}}} macro to ''use external file/URL references in place of the usual ~TiddlerName parameter'', so that you can render wiki-formatted source content retrieved from an external file/URL reference (as determined by the core's isExternalLink() test function), ''//as if// it had come from a tiddler in the current document''. The external file/URL can be either ''a relative or absolute reference'' and can contain ''"plain text" or a full TiddlyWiki document''. When using a TiddlyWiki document, you must specify which tiddlers should be included in the output by appending a permaview-like suffix to the file or URL reference, e.g.:
>{{{<<tiddler "myfile.txt" with: param param param...>>}}}
>or
>{{{<<tiddler "myfile.html#TiddlerName TiddlerName..." with: param param param...>>}}}
>or
>{{{<<tiddler "http://www.TiddlyWiki.com/index.html#HelloThere" with: param param param...>>}}}
If the plugin-enhanced {{{<<tiddler>>}}} macro is unable to retrieve the external content -- perhaps because the file doesn't exist or doesn't contain the requested tiddler(s), or cross-domain security blocked file access, or the network/server "timed out", etc., -- then it produces no output (i.e., just as when the standard {{{<<tiddler>>}}} macro is given a ~TiddlerName does not exist in the current document.)
<<<
!!!!!Using alternative "fallback" references
<<<
In addition to using external file/URL references in place of the usual ~TiddlerName, the plugin also allows you to use a ''fallback list'' consisting of a combination of alternative sources: tiddlers, local files, and/or URL references, each separated by "|". The first reference in a fallback list is the "primary source"; the remaining references are "fallback sources". The plugin will attempt to retrieve content from each fallback source until one is successfully retrieved or all alternatives have been tried.
For example, if you create a tiddler called [[HelloThere]], as well as a remotely-hosted TW document containing a published tiddler, also called [[HelloThere]], then you can write:
>{{{<<tiddler [[HelloThere|http://www.TiddlyWiki.com/#HelloThere]]>>}}}
When [[HelloThere]] is present in the local document, it is processed in the normal manner. However, if you delete the local [[HelloThere]] tiddler, the plugin will attempt to retrieve the [[HelloThere]] tiddler from the indicated remote URL.
Please note: although you can list any number of alternative sources, in whatever order you prefer, retrieval from a remote URL occurs asynchronously via XMLHttpRequest() processing. As a consequence, there can be ''no more than one remote URL reference in the fallback list'', and any alternatives that follow a remote URL reference will not be processed.
<<<
!!!!!Automatically import/create missing tiddlers
<<<
When content is retrieved from an external fallback source, the plugin can automatically import/create tiddler(s) containing that content into your document, allowing you to display, modify, save and/or search for text in that tiddler from within your own document, without needing to retrieve it again from the external source.
If no local ~TiddlerName(s) are specified in the fallback list (i.e., only direct file/URL references are present), then a tiddler will NOT be created, so that each time you render the tiddler display the external source will be re-read in order to render the most recently saved external file content. To illustrate using the example from above:
> {{{<<tiddler [[HelloThere|http://www.TiddlyWiki.com/#HelloThere]]>>}}}
will automatically create a locally-stored [[HelloThere]] tiddler, so that the external source is only accessed the first time the content is rendered, while:
> {{{<<tiddler [[http://www.TiddlyWiki.com/#HelloThere]]>>}}}
will re-load the content from the external source each time the display is rendered.
For easy identification, any tiddlers that are automatically created/imported are tagged with <<tag external>> (or other custom-defined tag values). These tiddlers can also be automatically tagged with <<tag temporary>> for use with [[TemporaryTiddlersPlugin]], which will skip over those tiddlers when saving changes to your document so that when you reload the document, the temporary tiddlers will no longer be present and will be retrieved anew from the external source, on demand, when (or if) they are needed. Important reminder: ''If you modify a temporary tiddler and want to retain it in your local document, be sure to remove the <<tag temporary>> tag from the tiddler before saving.''
<<<
!!!!!~XMLHttpRequest: performance and security issues
<<<
This plugin uses asynchronous XMLHttpRequest() processing to access external content directly from URLs hosted on remote web servers. This often creates delays ranging from mere moments to many minutes while waiting for the remote web server to transfer the requested file. This performance can vary greatly depending upon the size of the remote file, how the remote server responds to repeated requests for the same URL (e.g, with a //"304 - no change"// response code), as well as how your ''browser's cache mechanism'' has been configured (to avoid repeated downloads).
In addition to server-originated delays, ''cross-domain access from one remote domain to another using XMLHttpRequest() processing is generally restricted for security reasons''. As a result, if you publish your document to a remote web server, then external file/URL references contained in that document will not work if they are not located on the same server as the hosted document.
Fortunately, this security restriction does NOT usually apply when accessing remote URLs rendered into a locally-viewed document, since blocking such access would interfere with normal browser functions! As a "rule of thumb", in order to ensure that external content included in server-hosted documents will be displayed as intended, you should ''always use either a relative path/file reference or an http: reference located on the same domain as the published document.'' for any document you intend to publish.
Note: Some hosting providers, such as http://www.TiddlySpot.com/ offer ''"proxy" services that may allow you to bypass the security restrictions'' for certain designated remote web sites. Consult your hosting service for information regarding their proxy arrangments (if any).
<<<
!!!!!Revisions
<<<
2008.10.27 [1.3.1] in insertTiddler(), fixed Safari bug by replacing static Array.concat(...) with new Array().concat(...)
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ExternalTiddlersPluginInfo
2008.01.03 [1.3.0] use lower-level doHttp() instead loadRemoteFile() so that optional username/password values can be used in XMLHttpRequest
2007.12.22 [1.2.2] in handler(), when reading from local file with relative path fixup, use decodeURIComponent() instead of decodeURI
2007.11.30 [1.2.1] lots of code/docmentation cleanup. renamed option cookies. changed auto tag value to "external".
2007.11.27 [1.2.0] added support for automatically importing external tiddlers
2007.11.26 [1.1.1] improved XMLHttpRequest() error reporting for cross-domain security issues
2007.11.26 [1.1.0] added support for multiple alternative fallback references
2007.11.25 [1.0.0] initial release - moved from CoreTweaks
<<<
!Theorem
If \( p \) is prime, then \( a^p \equiv a (\mbox{mod }p) \) for every \( a \in \mathbb{Z} \).
!Definition
A field is a commutative ring with $1 \ne 0$ in which every nonzero element is a unit.
!Proposition
Every field is an integral domain.
!Proposition
$\mathbb{I}_{m}$ is a field if and only if $m$ is prime.
!Note
Every integral domain is isomorphic to a subring of a field, called the fraction field of the domain.
!Definition
The intersection of all subfields of a field $K$ is called the prime field of $K$.
!Question
What is an example of a finite field of order 4?
!Proposition
Every finite integral domain is a field.
!Question
What is a finite integral domain different from $\mathbb{I}_{p}$, where $p$ is prime?
!Definition
Let $G$ and $H$ be groups and $\phi : G \rightarrow H$ be a mapping such that $\phi(ab) = \phi(a) \phi(b)$ for all $a,b \in G.$ We say that such a mapping is a homomorphism of groups.
!Proposition
Let $\phi: G \rightarrow H$ be a homomorphism of groups.
# $\phi(1)=1$
# $\phi(a^{-1}) = (\phi(a))^{-1}$
# $\phi(a^{k}) = (\phi(a))^{k}$ for all $k \in \mathbb{Z}$
# $\phi(G)$ is a subgroup of $H$
!Example
$\phi: \mathbb{Z} \rightarrow \mathbb{Z}$ given by $\phi(a)=2a$ is a homomorphism of additive groups.
!Example
$\phi: \mathbb{R} \rightarrow S^{1}$ is a homomorphism from an additive group to a multiplicative group.
!Definition
Let $\phi : G \rightarrow H$ be a homomorphism of groups. The kernel of $\phi$ is the set $\mbox{ker} \phi = \{ x \in G : \phi(x) = 1_{H} \}.$
!Theorem
Let $\phi: G \rightarrow H$ be a homomorphism of groups. Then $\mbox{ker} \phi$ is a normal subgroup of $G.$
!Observation
Homomorphisms are useful in transferring problems in difficult groups to problems in easier groups. For example, we may sometimes simplify the problem of determining whether an integer is a perfect square by homomorphically mapping the integers onto the set of integers modulo 8.
!Definition
A homomorphism of groups which is both injective and surjective is called an isomorphism of groups.
!Theorem (First Isomorphism Theorem)
Let $\phi : G \rightarrow H$ be a homomorphism of groups. Then $G / \mbox{ker} \phi \cong \phi(G).$
!Observation
We can often recognize quotient groups using the first isomorphism theorem.
!Example
Recognize the quotient group $\mathbb{R}$ / $\mathbb{Z}.$
!Example
Recognize the quotient group $S_{n} / A_{n}.$
!Example
Let $p$ be prime. Determine the number of squares in $U(\mathbb{I}_{p}).$
*Every nonzero, nonunit integer is a prime or a product of primes, essentially uniquely.
*[[Division Algorithm]]
*Quotient and remainder
*Infinitude of the primes
*Divisors and multiples
*[[Common divisor]]
*[[Greatest common divisor]]
*[[Linear combinations of integers]]
*[[gcds are linear combinations]]
*[[Common divisors divide the gcd]]
*[[Euclid's Lemma]]
*Relatively prime
*[[Euclidean Algorithm]]
*[[Lame's Theorem]]
''Definition''
The greatest common divisor of integers \( a \) and \( b \), not both \( 0 \), is the largest common divisor of \( a \) and \( b \). It is denoted by \( \mbox{gcd}(a,b) \) or \( (a,b) \) when the context is clear.
We stipulate that \( \mbox{gcd}(0,0)=0 \).
!Definition
A group is a set $G$ equipped with a binary operation $*$ and a special element $e \in G,$ called the identity, such that
# $a*(b*c)=(a*b)*c$ for all $a,b,c \in G$
# $e*a = a = a*e$ for all $a \in G$
# for every $a \in G,$ there is $a' \in G$ with $a' * a = e = a * a'$
!Definition
A group $G$ is abelian if $a*b=b*a$ for all $a,b \in G.$
!Proposition
Let $G$ be a group with identity $e,$ and let $a,b,c \in G.$ Then
* $e$ is unique
* inverses are unique
* whenever $a*c=b*c,$ it follows that $a=b.$
* $(a*b)^{-1} = b^{-1}*a^{-1}$
* $(a^{-1})^{-1}=a$
!Examples
* $S_{n}$ is a group under composition
* $\mathbb{Z}$ is a group under addition
* $\mathbb{I}_{n}$ is a group under addition
* $\mathbb{C}^{\times}$ is a group under multiplication
* $S^{1} = \{ a+bi \in \mathbb{C} : a^2+b^2=1 \}$ is a group under multiplication
!Note
When using multiplicative notation, we write $a*b$ more simply as $ab,$ and denote the identity $e$ by 1.
!Definition
Given an element $a$ of a group $G$, define the powers $a^n$ for $n \ge 1$ inductively by taking $a^1 = a$ and $a^{n+1} = a*a^{n}$. Further define $a^{-n} = (a^{-1})^n$ and let $a^{0}=1.$
!Definition
We denote the set of integer powers of $a$, $\{ a^k : k \in \mathbb{Z} \},$ by $<a>.$
!Definition
Let $G$ be a group a let $a \in G.$ If $a^k = 1$ for some integer $k \ge 1,$ then the smallest such exponent $k$ is called the order of $a.$ If no such power exists, then we say that $a$ has infinite order. We denote the order of $a$ by $|a|.$
!Lemma
If $b^n=1$ then $|b|$ divides $n.$
!Proposition
Suppose $|a|=n$ and $k | n.$ Then $|a^k| = \frac{n}{k}.$
!Lemma
$<a^{m}>=<a^{d}>$ for some $d$ dividing $|a|.$
!Lemma
$|a^{m}| = |<a^{m}>|.$
!Theorem
Suppose $|a|=n.$ Then $|a^{k}| = \frac{n}{\mbox{gcd}(k,n)}.$
*Review $S_{n}$ and $\mathbb{I}_{n}$
*Introduce $\Gamma_{n},$ $U(\mathbb{I}_{n}),$ and $D_{2n}$
*Presentations versus representations of groups
**Presentations: abstract, implicit, action-oriented, synthetic
**Representations: concrete, explicit, result-oriented, coordinatized
*Representations arise from actions on object configurations
**elements of $S_{n}$ reorder list of n symbols
**elements of $\mathbb{I}_{n}$ cycle hand of n-hour clock
**isometries of plane permute vertex-labels of (regular) polygons
*When are two ostensibly different groups essentially the same?
<<tabs Outline
Outline "Outline" ./outline
>>
<part outline hidden>
*Integers and natural numbers
*[[Divisors and primes]]
*[[Least Integer Axiom]]
*[[Least Criminal]]
**Theorem: Every integer $n \ge 2$ is either a prime or a product of primes.
*Indirect Proof / Proof by Contradiction
**Proposition: If $m^2$ is odd, then $m$ is odd.
**Proposition: The square root of 2 is irrational.
**Proposition: There are infinitely many primes.
*[[Mathematical Induction]]
**Proposition: $2^n > n$ for all integers $n \ge 1.$
**Proposition: $2^n > n^2$ for all integers $n \ge 5.$
*[[Predecessors]] of natural numbers
*[[Second Form of Induction]]
**Explicit formula for the $n$th Fibonnaci number.
</part>
''Theorem''
Let \( b \ge a \) be positive integers, and let \( d(a) \) be the number of digits in the decimal expression of \( a \). If \( n \) is the number of steps in the Euclidean algorithm computing \( \mbox{gcd}(a,b) \), then \( n \le 5 d(a) \).
The University Learning Center, located on the first floor of Westside Hall, provides tutoring for basic studies mathematics and statistics courses. Math Services also provides course-specific review and problem sessions, and help with math study skills and math anxiety.
No appointment is needed during open lab hours.
Web: [[www.uncw.edu/stuaff/uls|http://www.uncw.edu/stuaff/uls]]
Phone: 962-7857
Email: ULC@uncw.edu
''Proposition''
Let \( k \) be a natural number, and let \( S(k), S(k+1), \ldots, S(n), \ldots \) be a list of statements. If some of these statements are false, then there is a first false statement.
''Axiom''
There is a smallest integer in every nonempty subset \( C \) of the natural numbers \( \mathbb{N} \).
''Definition''
A linear combination of integers \( a \) and \( b \) is an integer of the form \( sa + tb \), where \( s \) and \( t \) are integers.
[[Schedule]]
[[Assignments]]
[[NotableDates]]
[[CoursePolicies]]
[[ContactInformation]]
<<toggleSideBar '' '' hide>>
''Theorem''
Given statements \( S(n) \), one for each natural number \( n \ge 1 \), suppose that
# ''Base Step:'' \( S(1) \) is true
# ''Inductive Step:'' if \( S(n) \) is true, then \( S(n+1) \) is true.
Then \( S(n) \) is true for all integers \( n \ge 1 \).
(:graph({width:300}) axes(); plot("sin(x)"); :)
(:graph({width:300,height:200,scales:[-3,3,-2,2]})
axes();
grid({dx:0.5,dy:0.5});
plot("(x-2)*(x-1)*x*(x+1)*(x+2)/2",{min:-2.5,max:2.5});
:)
$$A = \left(\begin{array}{c c c}
1-x & 0 & 0 \\ 0 & 1-x & 0 \\ 0 & 0 & 1-x \end{array}\right)$$
\( \sum a_i + \sum_{i=0}^{+\infty} b_i \)
$$f(x) = \left\{\begin{array}{l l}
x^2 \sin \frac1x & \textrm{if } x \ne 0, \\
0 & \textrm{if } x = 0 .
\end{array}\right.$$
$$\displaystyle \lim_{x\to\infty} f(x) = k \choose r + \frac ab \sum_{n=1}^{+\infty} a_n + \left\{ \frac{1}{13} \sum_{n=1}^{+\infty} b_n \right\} $$
*Test 1: Thursday, February 10
*Test 2: Tuesday, April 5
*Final: Tuesday, May 10, 11:30a-2:30p
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div><!-- horizontal MainMenu -->
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
<!--original MainMenu menu
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
-->
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/***
|<html><a name="Top"/></html>''Name:''|PartTiddlerPlugin|
|''Version:''|1.0.9 (2007-07-14)|
|''Source:''|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.3|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Table of Content<html><a name="TOC"/></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Description',null, event)">Description, Syntax</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Applications',null, event)">Applications</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('LongTiddler',null, event)">Refering to Paragraphs of a Longer Tiddler</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Citation',null, event)">Citation Index</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('TableCells',null, event)">Creating "multi-line" Table Cells</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Tabs',null, event)">Creating Tabs</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Sliders',null, event)">Using Sliders</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Revisions',null, event)">Revision History</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Code',null, event)">Code</a></html>
!Description<html><a name="Description"/></html>
With the {{{<part aPartName> ... </part>}}} feature you can structure your tiddler text into separate (named) parts.
Each part can be referenced as a "normal" tiddler, using the "//tiddlerName//''/''//partName//" syntax (e.g. "About/Features"). E.g. you may create links to the parts (e.g. {{{[[Quotes/BAX95]]}}} or {{{[[Hobbies|AboutMe/Hobbies]]}}}), use it in {{{<<tiddler...>>}}} or {{{<<tabs...>>}}} macros etc.
''Syntax:''
|>|''<part'' //partName// [''hidden''] ''>'' //any tiddler content// ''</part>''|
|//partName//|The name of the part. You may reference a part tiddler with the combined tiddler name "//nameOfContainerTidder//''/''//partName//. <<br>>If you use a partName containing spaces you need to quote it (e.g. {{{"Major Overview"}}} or {{{[[Shortcut List]]}}}).|
|''hidden''|When defined the content of the part is not displayed in the container tiddler. But when the part is explicitly referenced (e.g. in a {{{<<tiddler...>>}}} macro or in a link) the part's content is displayed.|
|<html><i>any tiddler content</i></html>|<html>The content of the part.<br>A part can have any content that a "normal" tiddler may have, e.g. you may use all the formattings and macros defined.</html>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Applications<html><a name="Applications"/></html>
!!Refering to Paragraphs of a Longer Tiddler<html><a name="LongTiddler"/></html>
Assume you have written a long description in a tiddler and now you want to refer to the content of a certain paragraph in that tiddler (e.g. some definition.) Just wrap the text with a ''part'' block, give it a nice name, create a "pretty link" (like {{{[[Discussion Groups|Introduction/DiscussionGroups]]}}}) and you are done.
Notice this complements the approach to first writing a lot of small tiddlers and combine these tiddlers to one larger tiddler in a second step (e.g. using the {{{<<tiddler...>>}}} macro). Using the ''part'' feature you can first write a "classic" (longer) text that can be read "from top to bottom" and later "reuse" parts of this text for some more "non-linear" reading.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Citation Index<html><a name="Citation"/></html>
Create a tiddler "Citations" that contains your "citations".
Wrap every citation with a part and a proper name.
''Example''
{{{
<part BAX98>Baxter, Ira D. et al: //Clone Detection Using Abstract Syntax Trees.//
in //Proc. ICSM//, 1998.</part>
<part BEL02>Bellon, Stefan: //Vergleich von Techniken zur Erkennung duplizierten Quellcodes.//
Thesis, Uni Stuttgart, 2002.</part>
<part DUC99>Ducasse, Stéfane et al: //A Language Independent Approach for Detecting Duplicated Code.//
in //Proc. ICSM//, 1999.</part>
}}}
You may now "cite" them just by using a pretty link like {{{[[Citations/BAX98]]}}} or even more pretty, like this {{{[[BAX98|Citations/BAX98]]}}}.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Creating "multi-line" Table Cells<html><a name="TableCells"/></html>
You may have noticed that it is hard to create table cells with "multi-line" content. E.g. if you want to create a bullet list inside a table cell you cannot just write the bullet list
{{{
* Item 1
* Item 2
* Item 3
}}}
into a table cell (i.e. between the | ... | bars) because every bullet item must start in a new line but all cells of a table row must be in one line.
Using the ''part'' feature this problem can be solved. Just create a hidden part that contains the cells content and use a {{{<<tiddler >>}}} macro to include its content in the table's cell.
''Example''
{{{
|!Subject|!Items|
|subject1|<<tiddler ./Cell1>>|
|subject2|<<tiddler ./Cell2>>|
<part Cell1 hidden>
* Item 1
* Item 2
* Item 3
</part>
...
}}}
Notice that inside the {{{<<tiddler ...>>}}} macro you may refer to the "current tiddler" using the ".".
BTW: The same approach can be used to create bullet lists with items that contain more than one line.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Creating Tabs<html><a name="Tabs"/></html>
The build-in {{{<<tabs ...>>}}} macro requires that you defined an additional tiddler for every tab it displays. When you want to have "nested" tabs you need to define a tiddler for the "main tab" and one for every tab it contains. I.e. the definition of a set of tabs that is visually displayed at one place is distributed across multiple tiddlers.
With the ''part'' feature you can put the complete definition in one tiddler, making it easier to keep an overview and maintain the tab sets.
''Example''
The standard tabs at the sidebar are defined by the following eight tiddlers:
* SideBarTabs
* TabAll
* TabMore
* TabMoreMissing
* TabMoreOrphans
* TabMoreShadowed
* TabTags
* TabTimeline
Instead of these eight tiddlers one could define the following SideBarTabs tiddler that uses the ''part'' feature:
{{{
<<tabs txtMainTab
Timeline Timeline SideBarTabs/Timeline
All 'All tiddlers' SideBarTabs/All
Tags 'All tags' SideBarTabs/Tags
More 'More lists' SideBarTabs/More>>
<part Timeline hidden><<timeline>></part>
<part All hidden><<list all>></part>
<part Tags hidden><<allTags>></part>
<part More hidden><<tabs txtMoreTab
Missing 'Missing tiddlers' SideBarTabs/Missing
Orphans 'Orphaned tiddlers' SideBarTabs/Orphans
Shadowed 'Shadowed tiddlers' SideBarTabs/Shadowed>></part>
<part Missing hidden><<list missing>></part>
<part Orphans hidden><<list orphans>></part>
<part Shadowed hidden><<list shadowed>></part>
}}}
Notice that you can easily "overwrite" individual parts in separate tiddlers that have the full name of the part.
E.g. if you don't like the classic timeline tab but only want to see the 100 most recent tiddlers you could create a tiddler "~SideBarTabs/Timeline" with the following content:
{{{
<<forEachTiddler
sortBy 'tiddler.modified' descending
write '(index < 100) ? "* [["+tiddler.title+"]]\n":""'>>
}}}
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Using Sliders<html><a name="Sliders"/></html>
Very similar to the build-in {{{<<tabs ...>>}}} macro (see above) the {{{<<slider ...>>}}} macro requires that you defined an additional tiddler that holds the content "to be slid". You can avoid creating this extra tiddler by using the ''part'' feature
''Example''
In a tiddler "About" we may use the slider to show some details that are documented in the tiddler's "Details" part.
{{{
...
<<slider chkAboutDetails About/Details details "Click here to see more details">>
<part Details hidden>
To give you a better overview ...
</part>
...
}}}
Notice that putting the content of the slider into the slider's tiddler also has an extra benefit: When you decide you need to edit the content of the slider you can just doubleclick the content, the tiddler opens for editing and you can directly start editing the content (in the part section). In the "old" approach you would doubleclick the tiddler, see that the slider is using tiddler X, have to look for the tiddler X and can finally open it for editing. So using the ''part'' approach results in a much short workflow.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Revision history<html><a name="Revisions"/></html>
* v1.0.9 (2007-07-14)
** Bugfix: Error when using the SideBarTabs example and switching between "More" and "Shadow". Thanks to cmari for reporting the issue.
* v1.0.8 (2007-06-16)
** Speeding up display of tiddlers containing multiple pard definitions. Thanks to Paco Rivière for reporting the issue.
** Support "./partName" syntax inside <<tabs ...>> macro
* v1.0.7 (2007-03-07)
** Bugfix: <<tiddler "./partName">> does not always render correctly after a refresh (e.g. like it happens when using the "Include" plugin). Thanks to Morris Gray for reporting the bug.
* v1.0.6 (2006-11-07)
** Bugfix: cannot edit tiddler when UploadPlugin by Bidix is installed. Thanks to José Luis González Castro for reporting the bug.
* v1.0.5 (2006-03-02)
** Bugfix: Example with multi-line table cells does not work in IE6. Thanks to Paulo Soares for reporting the bug.
* v1.0.4 (2006-02-28)
** Bugfix: Shadow tiddlers cannot be edited (in TW 2.0.6). Thanks to Torsten Vanek for reporting the bug.
* v1.0.3 (2006-02-26)
** Adapt code to newly introduced Tiddler.prototype.isReadOnly() function (in TW 2.0.6). Thanks to Paulo Soares for reporting the problem.
* v1.0.2 (2006-02-05)
** Also allow other macros than the "tiddler" macro use the "." in the part reference (to refer to "this" tiddler)
* v1.0.1 (2006-01-27)
** Added Table of Content for plugin documentation. Thanks to RichCarrillo for suggesting.
** Bugfix: newReminder plugin does not work when PartTiddler is installed. Thanks to PauloSoares for reporting.
* v1.0.0 (2006-01-25)
** initial version
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Code<html><a name="Code"/></html>
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
//{{{
//============================================================================
// PartTiddlerPlugin
// Ensure that the PartTiddler Plugin is only installed once.
//
if (!version.extensions.PartTiddlerPlugin) {
version.extensions.PartTiddlerPlugin = {
major: 1, minor: 0, revision: 9,
date: new Date(2007, 6, 14),
type: 'plugin',
source: "http://tiddlywiki.abego-software.de/#PartTiddlerPlugin"
};
if (!window.abego) window.abego = {};
if (version.major < 2) alertAndThrow("PartTiddlerPlugin requires TiddlyWiki 2.0 or newer.");
//============================================================================
// Common Helpers
// Looks for the next newline, starting at the index-th char of text.
//
// If there are only whitespaces between index and the newline
// the index behind the newline is returned,
// otherwise (or when no newline is found) index is returned.
//
var skipEmptyEndOfLine = function(text, index) {
var re = /(\n|[^\s])/g;
re.lastIndex = index;
var result = re.exec(text);
return (result && text.charAt(result.index) == '\n')
? result.index+1
: index;
}
//============================================================================
// Constants
var partEndOrStartTagRE = /(<\/part>)|(<part(?:\s+)((?:[^>])+)>)/mg;
var partEndTagREString = "<\\/part>";
var partEndTagString = "</part>";
//============================================================================
// Plugin Specific Helpers
// Parse the parameters inside a <part ...> tag and return the result.
//
// @return [may be null] {partName: ..., isHidden: ...}
//
var parseStartTagParams = function(paramText) {
var params = paramText.readMacroParams();
if (params.length == 0 || params[0].length == 0) return null;
var name = params[0];
var paramsIndex = 1;
var hidden = false;
if (paramsIndex < params.length) {
hidden = params[paramsIndex] == "hidden";
paramsIndex++;
}
return {
partName: name,
isHidden: hidden
};
}
// Returns the match to the next (end or start) part tag in the text,
// starting the search at startIndex.
//
// When no such tag is found null is returned, otherwise a "Match" is returned:
// [0]: full match
// [1]: matched "end" tag (or null when no end tag match)
// [2]: matched "start" tag (or null when no start tag match)
// [3]: content of start tag (or null if no start tag match)
//
var findNextPartEndOrStartTagMatch = function(text, startIndex) {
var re = new RegExp(partEndOrStartTagRE);
re.lastIndex = startIndex;
var match = re.exec(text);
return match;
}
//============================================================================
// Formatter
// Process the <part ...> ... </part> starting at (w.source, w.matchStart) for formatting.
//
// @return true if a complete part section (including the end tag) could be processed, false otherwise.
//
var handlePartSection = function(w) {
var tagMatch = findNextPartEndOrStartTagMatch(w.source, w.matchStart);
if (!tagMatch) return false;
if (tagMatch.index != w.matchStart || !tagMatch[2]) return false;
// Parse the start tag parameters
var arguments = parseStartTagParams(tagMatch[3]);
if (!arguments) return false;
// Continue processing
var startTagEndIndex = skipEmptyEndOfLine(w.source, tagMatch.index + tagMatch[0].length);
var endMatch = findNextPartEndOrStartTagMatch(w.source, startTagEndIndex);
if (endMatch && endMatch[1]) {
if (!arguments.isHidden) {
w.nextMatch = startTagEndIndex;
w.subWikify(w.output,partEndTagREString);
}
w.nextMatch = skipEmptyEndOfLine(w.source, endMatch.index + endMatch[0].length);
return true;
}
return false;
}
config.formatters.push( {
name: "part",
match: "<part\\s+[^>]+>",
handler: function(w) {
if (!handlePartSection(w)) {
w.outputText(w.output,w.matchStart,w.matchStart+w.matchLength);
}
}
} )
//============================================================================
// Extend "fetchTiddler" functionality to also recognize "part"s of tiddlers
// as tiddlers.
var currentParent = null; // used for the "." parent (e.g. in the "tiddler" macro)
// Return the match to the first <part ...> tag of the text that has the
// requrest partName.
//
// @return [may be null]
//
var findPartStartTagByName = function(text, partName) {
var i = 0;
while (true) {
var tagMatch = findNextPartEndOrStartTagMatch(text, i);
if (!tagMatch) return null;
if (tagMatch[2]) {
// Is start tag
// Check the name
var arguments = parseStartTagParams(tagMatch[3]);
if (arguments && arguments.partName == partName) {
return tagMatch;
}
}
i = tagMatch.index+tagMatch[0].length;
}
}
// Return the part "partName" of the given parentTiddler as a "readOnly" Tiddler
// object, using fullName as the Tiddler's title.
//
// All remaining properties of the new Tiddler (tags etc.) are inherited from
// the parentTiddler.
//
// @return [may be null]
//
var getPart = function(parentTiddler, partName, fullName) {
var text = parentTiddler.text;
var startTag = findPartStartTagByName(text, partName);
if (!startTag) return null;
var endIndexOfStartTag = skipEmptyEndOfLine(text, startTag.index+startTag[0].length);
var indexOfEndTag = text.indexOf(partEndTagString, endIndexOfStartTag);
if (indexOfEndTag >= 0) {
var partTiddlerText = text.substring(endIndexOfStartTag,indexOfEndTag);
var partTiddler = new Tiddler();
partTiddler.set(
fullName,
partTiddlerText,
parentTiddler.modifier,
parentTiddler.modified,
parentTiddler.tags,
parentTiddler.created);
partTiddler.abegoIsPartTiddler = true;
return partTiddler;
}
return null;
}
// Hijack the store.fetchTiddler to recognize the "part" addresses.
//
var hijackFetchTiddler = function() {
var oldFetchTiddler = store.fetchTiddler ;
store.fetchTiddler = function(title) {
var result = oldFetchTiddler.apply(this, arguments);
if (!result && title) {
var i = title.lastIndexOf('/');
if (i > 0) {
var parentName = title.substring(0, i);
var partName = title.substring(i+1);
var parent = (parentName == ".")
? store.resolveTiddler(currentParent)
: oldFetchTiddler.apply(this, [parentName]);
if (parent) {
return getPart(parent, partName, parent.title+"/"+partName);
}
}
}
return result;
};
};
// for debugging the plugin is not loaded through the systemConfig mechanism but via a script tag.
// At that point in the "store" is not yet defined. In that case hijackFetchTiddler through the restart function.
// Otherwise hijack now.
if (!store) {
var oldRestartFunc = restart;
window.restart = function() {
hijackFetchTiddler();
oldRestartFunc.apply(this,arguments);
};
} else
hijackFetchTiddler();
// The user must not edit a readOnly/partTiddler
//
config.commands.editTiddler.oldIsReadOnlyFunction = Tiddler.prototype.isReadOnly;
Tiddler.prototype.isReadOnly = function() {
// Tiddler.isReadOnly was introduced with TW 2.0.6.
// For older version we explicitly check the global readOnly flag
if (config.commands.editTiddler.oldIsReadOnlyFunction) {
if (config.commands.editTiddler.oldIsReadOnlyFunction.apply(this, arguments)) return true;
} else {
if (readOnly) return true;
}
return this.abegoIsPartTiddler;
}
config.commands.editTiddler.handler = function(event,src,title)
{
var t = store.getTiddler(title);
// Edit the tiddler if it either is not a tiddler (but a shadowTiddler)
// or the tiddler is not readOnly
if(!t || !t.abegoIsPartTiddler)
{
clearMessage();
story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
story.focusTiddler(title,"text");
return false;
}
}
// To allow the "./partName" syntax in macros we need to hijack
// the invokeMacro to define the "currentParent" while it is running.
//
var oldInvokeMacro = window.invokeMacro;
function myInvokeMacro(place,macro,params,wikifier,tiddler) {
var oldCurrentParent = currentParent;
if (tiddler) currentParent = tiddler;
try {
oldInvokeMacro.apply(this, arguments);
} finally {
currentParent = oldCurrentParent;
}
}
window.invokeMacro = myInvokeMacro;
// To correctly support the "./partName" syntax while refreshing we need to hijack
// the config.refreshers.tiddlers to define the "currentParent" while it is running.
//
(function() {
var oldTiddlerRefresher= config.refreshers.tiddler;
config.refreshers.tiddler = function(e,changeList) {
var oldCurrentParent = currentParent;
try {
currentParent = e.getAttribute("tiddler");
return oldTiddlerRefresher.apply(this,arguments);
} finally {
currentParent = oldCurrentParent;
}
};
})();
// Support "./partName" syntax inside <<tabs ...>> macro
(function() {
var extendRelativeNames = function(e, title) {
var nodes = e.getElementsByTagName("a");
for(var i=0; i<nodes.length; i++) {
var node = nodes[i];
var s = node.getAttribute("content");
if (s && s.indexOf("./") == 0)
node.setAttribute("content",title+s.substr(1));
}
};
var oldHandler = config.macros.tabs.handler;
config.macros.tabs.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var result = oldHandler.apply(this,arguments);
if (tiddler)
extendRelativeNames(place, tiddler.title);
return result;
};
})();
// Scroll the anchor anchorName in the viewer of the given tiddler visible.
// When no tiddler is defined use the tiddler of the target given event is used.
window.scrollAnchorVisible = function(anchorName, tiddler, evt) {
var tiddlerElem = null;
if (tiddler) {
tiddlerElem = document.getElementById(story.idPrefix + tiddler);
}
if (!tiddlerElem && evt) {
var target = resolveTarget(evt);
tiddlerElem = story.findContainingTiddler(target);
}
if (!tiddlerElem) return;
var children = tiddlerElem.getElementsByTagName("a");
for (var i = 0; i < children.length; i++) {
var child = children[i];
var name = child.getAttribute("name");
if (name == anchorName) {
var y = findPosY(child);
window.scrollTo(0,y);
return;
}
}
}
} // of "install only once"
//}}}
/***
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2006 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
!Definition
A permutation of a possibly infinite set $X$ is a bijection $\alpha : X \rightarrow X.$
!Definition
The family of all the permutations of a set $X,$ denoted by $S_{X},$ is called the symmetric group on $X.$ When $X=\{1,2,\ldots,n\},$ $S_{X}$ is usually denoted by $S_{n},$ and it is called the symmetric group on $n$ letters.
!Definition
If $\alpha \in S_{n}$ and $i \in \{1,2,\ldots,n\},$ then $\alpha$ fixes $i$ if $\alpha(i)=i,$ and $\alpha$ moves $i$ if $\alpha(i) \ne i.$
!Definition
Let $i_1,i_2,\ldots,i_r$ be distinct integers in $\{1,2,\ldots,n\}.$ If $\alpha \in S_n$ fixes the other integers (if any) and if $\alpha(i_1)=i_2, \alpha(i_2)=i_3, \ldots \alpha(i_r)=i_1,$ then $\alpha$ is called an $r$-cycle. One also says that $\alpha$ is a cycle of length $r.$
!Definition
Two permutations $\alpha,\beta \in S_n$ are disjoint if every $i$ moved by one is fixed by the other: if $\alpha(i) \ne i,$ then $\beta(i) = i,$ and if $\beta(j) \ne j,$ then $\alpha(j) = j.$ A family $\beta_1,\ldots,\beta_t$ of permutations is disjoint if each pair of them is disjoint.
!Lemma
Disjoint permutations $\alpha,\beta \in S_n$ commute.
!Proposition
Every permutation $\alpha \in S_n$ is either a cycle or a product of disjoint cycles.
!Definition
A complete factorization of a permutation $\alpha$ is a factorization of $\alpha$ into disjoint cycles that contains one 1-cycle $(i)$ for every $i$ fixed by $\alpha.$
!Theorem
Let $\alpha \in S_n$ and let $\alpha = \beta_1 \cdots \beta_t$ be a complete factorization into disjoint cycles. This factorization is unique except for the order in which the cycles occur.
!Definition
Two permutations $\alpha, \beta \in S_n$ have the same cycle structure if their complete factorizations have the same number of $r$-cycles for each $r \ge 1.$
!Proposition
If $\gamma, \alpha \in S_n,$ then $\alpha \gamma \alpha^{-1}$ has the same cycle structure as $\gamma.$
!Proposition
If $n \ge 2,$ then every $\alpha \in S_n$ is a product of transpositions.
!Definition
If \( \alpha \in S_n \) and \( \alpha = \beta_1 \cdots \beta_t \) is a complete factorization into \( t \) disjoint cycles, then the signum of \( \alpha \) is defined by \( \mbox{sgn}(\alpha)=(-1)^{n-t} \).
!Theorem
For all \( \alpha,\beta \in S_n \), \( \mbox{sgn}(\alpha \beta) = \mbox{sgn}(\alpha) \mbox{sgn}(\beta) \).
!Definition
A permutation \( \alpha \in S_n \) is even if \( \mbox{sgn}(\alpha) = 1 \), and \( \alpha \) is odd if \( \mbox{sgn}(\alpha) = -1 \) We say that \( \alpha \) and \( \beta \) have the same parity if both are even or both are odd.
!Theorem
Let \( \alpha \in S_n \). Then \( \alpha \) is even if and only if \( \alpha \) is a product of an even number of transpositions.
/***
|''Name''|PluginMathJax|
|''Description''|Displays TeX math using MathJax|
|''Author''|[[Canada East|http://tiddlywiki.canada-east.ca/]]|
|''Version''|1.4.1|
|''Date''|2010-10-18|
|''CodeRepository''|[[PluginMathJax|http://tiddlywiki.canada-east.ca/#PluginMathJax]]|
|''CoreVersion''|[[2.6.1|http://www.tiddlywiki.com]]|
|''Requires''|[[MathJax v1.01|http://www.mathjax.org/]]|
|''Feedback''|[[Contact|https://spreadsheets.google.com/viewform?formkey=dGg2RkpxZW5zWTh6QjZxOXgzZUlfakE6MQ]]|
!Description
This plugin uses [[MathJax|http://www.mathjax.org/]] to typeset ([[AMS|http://www.ams.org/publications/authors/tex/amslatex]]) [[LaTeX|http://www.latex-project.org/]] math. It can also be configured to use additional MathJax functionality.
>"MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers."
!Notes
Right click any math display for a MathJax menu. The user can select the renderer and zoom settings. It performs best in [[Webkit|http://en.wikipedia.org/wiki/List_of_web_browsers#WebKit-based_browsers]] based browsers. Larger math displays such as the additional examples tiddler below can put quite a load on IE. PluginMathJax was inspired by : [[Plugin: jsMath|http://bob.mcelrath.org/tiddlyjsmath.html]]
!Installation
#''Backup'' your TiddlyWiki!
#Uninstall or remove systemConfig tag from Plugin: jsMath if it is installed.
#It is required that the MathJax directory is installed in '''js/MathJax/''' in the same location as the TiddlyWiki html file.<br>(Or edit the script source where commented in the plugin code below after installation to match the location of your MathJax install.)
#Install this plugin (and examples tiddler linked below if desired).
!Usage
|!Style|!Source|!Output|
|Inline |{{{The variable <math>x</math> is real.}}}|The variable <math>x</math> is real.|
|~|{{{The variable \(y\) is complex.}}}|The variable \(y\) is complex.|
|Block |{{{This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.}}}|This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.|
|~|{{{This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.}}}|This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.|
| <br />[[Complete list of supported LaTeX commands|http://www.mathjax.org/resources/docs/?tex.html#supported-latex-commands]] |>|>|
!Examples
[[Additional MathJax Examples|MathJax Examples]]
!Configuration
MathJax can be manually configured if desired by editing the code below (advanced). See the [[MathJax documentation|http://www.mathjax.org/resources/docs/?configuration.html#configuration-options-by-component]] for details.
!Revision History
*v1.4.1, 2010-10-18, minor change to createTiddlyElement call and added SyntaxHighlighter tags to code section.
*v1.4, 2010-10-09, re-wrote wikifiers, archived [[previous version|PluginMathJax v1.3]] (Plugin: jsMath - compatible).
*v1.3, 2010-10-07, returned to wikifiers design avoiding autoLink WikiWords conflict, kept modified wikify and recommended way of loading MathJax dynamically, removed the tex2jax extension and corrected several browser compatibility issues (InnerHTML for Opera and IE9).
*v1.2, 2010-10-05, removed some redundant MathJax config entries, moved modified wikify and MathJax.Hub.Queue call.
*v1.1, 2010-10-03, autoLinkWikiWords disabled in absence of DisableWikiLinksPlugin, modifed wikify.
*v1.0, 2010-09-26, Initial Release
!Code
<code=js>
***/
//{{{
if(!version.extensions.PluginMathJax) {
version.extensions.PluginMathJax = {installed: true};
config.extensions.PluginMathJax = {
install: function() {
var mjscript = document.createElement("script");
mjscript.type = "text/javascript";
// ***** Use the location of your MathJax! ***** :
mjscript.src = "../../MathJax/MathJax.js";
var mjconfig = 'MathJax.Hub.Config({' +
'jax: ["input/TeX","output/HTML-CSS"],' +
'extensions: ["TeX/AMSmath.js", "TeX/AMSsymbols.js"],' +
'"HTML-CSS": {' +
'scale: 115' +
'}' +
'});' +
'MathJax.Hub.Startup.onload();';
var ie9RegExp = /^9\./;
var UseInnerHTML = (config.browser.isOpera ||
config.browser.isIE &&
ie9RegExp.test(config.browser.ieVersion[1]));
if (UseInnerHTML) {mjscript.innerHTML = mjconfig;}
else {mjscript.text = mjconfig;}
document.getElementsByTagName("body")[0].appendChild(mjscript);
config.formatterHelpers.mathFormatHelper = function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var text = lookaheadMatch[1];
if(UseInnerHTML) {
createTiddlyElement(w.output,this.element,null,null,null,this.attribs).innerHTML = text;
} else {
createTiddlyElement(w.output,this.element,null,null,text,this.attribs);
}
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
};
config.formatters.push({
name: "inlineMath1",
match: "\\\\\\\(",
lookaheadRegExp: /\\\(([\s\S]+?)\\\)/mg,
element: "script",
attribs: {
type: "math/tex"
},
handler: config.formatterHelpers.mathFormatHelper
});
config.formatters.push({
name: "inlineMath2",
match: "<[Mm][Aa][Tt][Hh]>",
lookaheadRegExp: /<math>([\s\S]+?)<\/math>/img,
element: "script",
attribs: {
type: "math/tex"
},
handler: config.formatterHelpers.mathFormatHelper
});
config.formatters.push({
name: "displayMath1",
match: "\\\\\\\[",
lookaheadRegExp: /\\\[([\s\S]+?)\\\]/mg,
element: "script",
attribs: {
type: "math/tex; mode=display"
},
handler: config.formatterHelpers.mathFormatHelper
});
config.formatters.push({
name: "displayMath2",
match: "\\\${2}",
lookaheadRegExp: /\${2}([\s\S]+?)\${2}/mg,
element: "script",
attribs: {
type: "math/tex; mode=display"
},
handler: config.formatterHelpers.mathFormatHelper
});
mj_old_wikify = wikify;
wikify = function(source,output,highlightRegExp,tiddler)
{
mj_old_wikify.apply(this,arguments);
if (window.MathJax) {MathJax.Hub.Queue(["Typeset",MathJax.Hub,output]);}
};
}
};
config.extensions.PluginMathJax.install();
}
//}}}
//</code>
!Definition
Let $F$ be a field and let $g(x)$ and $f(x)$ be nonzero polynomials in $F[x]$. A greatest common divisor of $g(x)$ and $f(x)$ is a polynomial $d(x)$ of maximal degree that is a factor of both $f(x)$ and $g(x)$. We write $d(x)=\mbox{gcd}(f(x),g(x))$.
!Lemma
Suppose $g(x) \in F[x]$ is a nonzero polynomial and that $f(x)$ is a factor of $g(x)$. Then $f(x)$ is a greatest common divisor of $g(x)$ and $f(x)$.
!Lemma
Suppose that $g(x) \ne 0$ and, after applying the Division Algorithm to $f(x)$ and $g(x)$, we have $f(x) = g(x)q(x) + r(x)$. Let $h(x) \in F[x]$, $h(x) \ne 0$. Then $h(x)$ divides both $f(x)$ and $g(x)$ if and only if $h(x)$ divides both $g(x)$ and $r(x)$.
!Lemma
Suppose that $f(x) = g(x)q(x) + r(x)$. Then $d(x)$ is a greatest common divisor of $f(x)$ and $g(x)$ if and only if $d(x)$ is a greatest common divisor of $g(x)$ and $r(x)$.
!Theorem
Let $f(x)$ and $g(x)$ be polynomials in $F[x]$. Let $d(x)$ be a greatest common divisor of $f(x)$ and $g(x)$. There are polynomials $s(x)$ and $t(x)$ such that $d(x) = s(x) f(x) + t(x) g(x)$.
!Definition
Let $R$ be an integral domain and let $f(x)$ be a polynomial in $R[x]$. We say that $f(x)$ is irreducible if, given any factorization of $f(x)$ in $R[x]$ as $f(x) = h(x) g(x)$, either $g(x)$ or $h(x)$ is a unit in $R$. Otherwise, $f(x)$ is said to be reducible.
!Proposition
Suppose that $p(x)$ and $f(x)$ are polynomials in $F[x]$. Suppose that $p(x)$ is irreducible and that $p(x)$ does not divide $f(x)$. Then the greatest common divisor of $f(x)$ and $p(x)$ is 1.
!Proposition
Let $p(x)$ be a polynomial of degree greater than 0 in $F[x]$. Then either $p(x)$ is irreducible or it can be factored into the product of irreducible polynomials.
!Proposition
Let $f(x)$ and $g(x)$ be polynomials in $F[x]$. Suppose that $p(x)$ is irreducible in $F[x]$ and suppose that $p(x)$ divides the product $f(x)g(x)$. Then $p(x)$ divides $f(x)$ or $p(x)$ divides $g(x)$.
!Theorem
Let $F$ be a field and let $f(x)$ be a nonzero polynomial in $F[x]$. Suppose that $f(x) = p_{1}(x) p_{2}(x) \cdots p_{k}(x) = q_{1}(x) q_{2}(x) \cdots q_{m}(x)$, where each $p_{i}(x)$ and each $q_{j}(x)$ is an irreducible polynomial. Then $m=k$ and, after renumbering if necessary, $p_{i}(x) = c_{i} q_{i}(x)$ for each $i = 1, 2, \ldots, m$ where $c_{i}$ is a nonzero element of $F$.
!Definition
A polynomial $p(x)$ with coefficients in a commutative ring $R$ is an expression of the form $a_{n}x^{n} + a_{n-1}x^{n-1} + \cdots + a_{0}$, where $a_{i} \in R$ for $0 \le i \le n$ and $x$ is a variable. The set of all polynomials with coefficients in $R$ is denoted by $R[x]$.
!Definition
The degree of a polynomial $p(x) = a_{n}x^{n} + a_{n-1}x^{n-1} + \cdots + a_{0}$ is $n$ if $a_{n} \ne 0$ and $a_{i}=0$ for all $i > n$.
!Note
We call $a_{n}$ the leading coefficient of $p(x)$ and we write $\mbox{deg}(p(x))=n$. If $a_{n}=1$ (the unity of $R$), we say that $p(x)$ is monic. The polynomial $p(x)=0$ does not have a degree.
!Proposition
# $\mbox{deg}(p(x)+q(x)) \le \mbox{max}(\mbox{deg}(p(x)), \mbox{deg}(q(x)))$
# $\mbox{deg}(p(x)q(x)) \le \mbox{deg}(p(x)) + \mbox{deg}(q(x))$
!Theorem (Division Algorithm for Polynomials)
Let $F$ be a field and let $p(x)$ and $g(x)$ be two polynomials in $F[x]$ with $p(x) \ne 0$. There are polynomials $q(x)$ and $r(x)$ such that $g(x) = p(x)q(x) + r(x)$ and either $r(x)=0$ or $\mbox{deg}(r(x)) < \mbox{deg}(p(x))$. Furthermore, $q(x)$ and $r(x)$ are unique.
!Corollary (Remainder Theorem)
Let $f(x)$ be any polynomial in $F[x]$ and let $p(x) = x-a$. Suppose $f(x) = q(x)(x-a) + r_{0}$ as in the Division Algorithm. Then $r_{0} = f(a)$.
!Corollary (Root Theorem)
For any polynomial $f(x)$ in $F[x]$ and any $a \in F$, $f(a)=0$ if and only if $x-a$ is a factor of $f(x)$.
''Definition''
The predecessors of a natural number \( n \ge 1\) are the natural numbers \( k \) with \( k < n \), namely, \( 0,1,2, \ldots, n-1 \).
Note that \( 0 \) has no predecessor.
/***
|''Name:''|ProcessingPlugin|
|''Description:''|TiddlyWiki Bundle of John Ressig's processing.js|
|''Date:''|May 9, 2008|
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/ProcessingPlugin.js|
|''Version:''|0.2|
|''License:''|[[MIT license]]|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''~CoreVersion:''|2.2|
With contributions from Simon Baird.
***/
//{{{
// Ensure Plugin is only installed once.
if(!version.extensions.Processingjs) {
version.extensions.Processingjs = {installed:true};
config.macros.Processing = {
counter: 0,
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
var id = "processingcanvas"+this.counter;
var canvas = createTiddlyElement(place,"canvas",id);
// inlined code
var code = paramString;
// quick and dirty grab of code from a named tiddler
if (store.tiddlerExists(params[0])) {
code = store.getTiddlerText(params[0]);
}
// or with no params, grab code from this tiddler
if (paramString.trim() == '') {
code = tiddler.text;
}
createTiddlyElement(place,"br");
var restartBtn = createTiddlyButton(place,"restart","restart",function() {
story.refreshTiddler(tiddler.title,null,true);
return false;
},
'processingRestart' // it's a class so you can style the button
);
Processing(canvas,code);
}
};
// requires 2.4
merge(config.macros.view.views,{
processing: function(value,place,params,wikifier,paramString,tiddler) {
wikify("<<Processing\n"+value+"\n>>",place,highlightHack,tiddler);
}
});
/*
* inlined copy of Processing.js
* latest code at: http://ejohn.org/blog/processingjs/
*/
/*
* Processing.js - John Resig (http://ejohn.org/)
* MIT Licensed
* http://ejohn.org/blog/processingjs/
*
* This is a port of the Processing Visualization Language.
* More information: http://processing.org/
*/
(function(){
this.Processing = function Processing( aElement, aCode )
{
var p = buildProcessing( aElement );
p.init( aCode );
return p;
};
function log()
{
try
{
console.log.apply( console, arguments );
}
catch(e)
{
try
{
opera.postError.apply( opera, arguments );
}
catch(e){}
}
}
function parse( aCode, p )
{
// Angels weep at this parsing code :-(
// Remove end-of-line comments
aCode = aCode.replace(/\/\/ .*\n/g, "\n");
// Weird parsing errors with %
aCode = aCode.replace(/([^\s])%([^\s])/g, "$1 % $2");
// Simple convert a function-like thing to function
aCode = aCode.replace(/(?:static )?(\w+ )(\w+)\s*(\([^\)]*\)\s*{)/g, function(all, type, name, args)
{
if ( name == "if" || name == "for" || name == "while" )
{
return all;
}
else
{
return "Processing." + name + " = function " + name + args;
}
});
// Force .length() to be .length
aCode = aCode.replace(/\.length\(\)/g, ".length");
// foo( int foo, float bar )
aCode = aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g, "$1$4");
aCode = aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g, "$1$4");
// float[] foo = new float[5];
aCode = aCode.replace(/new (\w+)((?:\[([^\]]*)\])+)/g, function(all, name, args)
{
return "new ArrayList(" + args.slice(1,-1).split("][").join(", ") + ")";
});
aCode = aCode.replace(/(?:static )?\w+\[\]\s*(\w+)\[?\]?\s*=\s*{.*?};/g, function(all)
{
return all.replace(/{/g, "[").replace(/}/g, "]");
});
// int|float foo;
var intFloat = /(\n\s*(?:int|float)(?:\[\])?(?:\s*|[^\(]*?,\s*))([a-z]\w*)(;|,)/i;
while ( intFloat.test(aCode) )
{
aCode = aCode.replace(new RegExp(intFloat), function(all, type, name, sep)
{
return type + " " + name + " = 0" + sep;
});
}
// float foo = 5;
aCode = aCode.replace(/(?:static )?(\w+)((?:\[\])+| ) *(\w+)\[?\]?(\s*[=,;])/g, function(all, type, arr, name, sep)
{
if ( type == "return" )
return all;
else
return "var " + name + sep;
});
// Fix Array[] foo = {...} to [...]
aCode = aCode.replace(/=\s*{((.|\s)*?)};/g, function(all,data)
{
return "= [" + data.replace(/{/g, "[").replace(/}/g, "]") + "]";
});
// static { ... } blocks
aCode = aCode.replace(/static\s*{((.|\n)*?)}/g, function(all, init)
{
// Convert the static definitons to variable assignments
//return init.replace(/\((.*?)\)/g, " = $1");
return init;
});
// super() is a reserved word
aCode = aCode.replace(/super\(/g, "superMethod(");
var classes = ["int", "float", "boolean", "string"];
function ClassReplace(all, name, extend, vars, last)
{
classes.push( name );
var static = "";
vars = vars.replace(/final\s+var\s+(\w+\s*=\s*.*?;)/g, function(all,set)
{
static += " " + name + "." + set;
return "";
});
// Move arguments up from constructor and wrap contents with
// a with(this), and unwrap constructor
return "function " + name + "() {with(this){\n " +
(extend ? "var __self=this;function superMethod(){extendClass(__self,arguments," + extend + ");}\n" : "") +
// Replace var foo = 0; with this.foo = 0;
// and force var foo; to become this.foo = null;
vars
.replace(/,\s?/g, ";\n this.")
.replace(/\b(var |final |public )+\s*/g, "this.")
.replace(/this.(\w+);/g, "this.$1 = null;") +
(extend ? "extendClass(this, " + extend + ");\n" : "") +
"<CLASS " + name + " " + static + ">" + (typeof last == "string" ? last : name + "(");
}
var matchClasses = /(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)\b\1\s*\(/g;
var matchNoCon = /(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)(Processing)/g;
aCode = aCode.replace(matchClasses, ClassReplace);
aCode = aCode.replace(matchNoCon, ClassReplace);
var matchClass = /<CLASS (\w+) (.*?)>/, m;
while ( (m = aCode.match( matchClass )) )
{
var left = RegExp.leftContext,
allRest = RegExp.rightContext,
rest = nextBrace(allRest),
className = m[1],
staticVars = m[2] || "";
allRest = allRest.slice( rest.length + 1 );
rest = rest.replace(new RegExp("\\b" + className + "\\(([^\\)]*?)\\)\\s*{", "g"), function(all, args)
{
args = args.split(/,\s*?/);
if ( args[0].match(/^\s*$/) )
args.shift();
var fn = "if ( arguments.length == " + args.length + " ) {\n";
for ( var i = 0; i < args.length; i++ )
{
fn += " var " + args[i] + " = arguments[" + i + "];\n";
}
return fn;
});
// Fix class method names
// this.collide = function() { ... }
// and add closing } for with(this) ...
rest = rest.replace(/(?:public )?Processing.\w+ = function (\w+)\((.*?)\)/g, function(all, name, args)
{
return "ADDMETHOD(this, '" + name + "', function(" + args + ")";
});
var matchMethod = /ADDMETHOD([\s\S]*?{)/, mc;
var methods = "";
while ( (mc = rest.match( matchMethod )) )
{
var prev = RegExp.leftContext,
allNext = RegExp.rightContext,
next = nextBrace(allNext);
methods += "addMethod" + mc[1] + next + "});"
rest = prev + allNext.slice( next.length + 1 );
}
rest = methods + rest;
aCode = left + rest + "\n}}" + staticVars + allRest;
}
// Do some tidying up, where necessary
aCode = aCode.replace(/Processing.\w+ = function addMethod/g, "addMethod");
function nextBrace( right )
{
var rest = right;
var position = 0;
var leftCount = 1, rightCount = 0;
while ( leftCount != rightCount )
{
var nextLeft = rest.indexOf("{");
var nextRight = rest.indexOf("}");
if ( nextLeft < nextRight && nextLeft != -1 )
{
leftCount++;
rest = rest.slice( nextLeft + 1 );
position += nextLeft + 1;
}
else
{
rightCount++;
rest = rest.slice( nextRight + 1 );
position += nextRight + 1;
}
}
return right.slice(0, position - 1);
}
// Handle (int) Casting
aCode = aCode.replace(/\(int\)/g, "0|");
// Remove Casting
aCode = aCode.replace(new RegExp("\\((" + classes.join("|") + ")(\\[\\])?\\)", "g"), "");
// Convert 3.0f to just 3.0
aCode = aCode.replace(/(\d+)f/g, "$1");
// Force numbers to exist
//aCode = aCode.replace(/([^.])(\w+)\s*\+=/g, "$1$2 = ($2||0) +");
// Force characters-as-bytes to work
aCode = aCode.replace(/('[a-zA-Z0-9]')/g, "$1.charCodeAt(0)");
// Convert #aaaaaa into color
aCode = aCode.replace(/#([a-f0-9]{6})/ig, function(m, hex){
var num = toNumbers(hex);
return "color(" + num[0] + "," + num[1] + "," + num[2] + ")";
});
function toNumbers( str ){
var ret = [];
str.replace(/(..)/g, function(str){
ret.push( parseInt( str, 16 ) );
});
return ret;
}
//log(aCode);
return aCode;
}
function buildProcessing( curElement ){
var p = {};
// init
p.PI = Math.PI;
p.TWO_PI = 2 * p.PI;
p.HALF_PI = p.PI / 2;
p.P3D = 3;
p.CORNER = 0;
p.CENTER = 1;
p.CENTER_RADIUS = 2;
p.RADIUS = 2;
p.POLYGON = 1;
p.TRIANGLES = 6;
p.POINTS = 7;
p.LINES = 8;
p.TRIANGLE_STRIP = 9;
p.CORNERS = 10;
p.CLOSE = true;
p.RGB = 1;
p.HSB = 2;
// "Private" variables used to maintain state
var curContext = curElement.getContext("2d");
var doFill = true;
var doStroke = true;
var loopStarted = false;
var hasBackground = false;
var doLoop = true;
var curRectMode = p.CORNER;
var curEllipseMode = p.CENTER;
var inSetup = false;
var inDraw = false;
var curBackground = "rgba(204,204,204,1)";
var curFrameRate = 1000;
var curShape = p.POLYGON;
var curShapeCount = 0;
var opacityRange = 255;
var redRange = 255;
var greenRange = 255;
var blueRange = 255;
var pathOpen = false;
var mousePressed = false;
var keyPressed = false;
var firstX, firstY, prevX, prevY;
var curColorMode = p.RGB;
var curTint = -1;
var curTextSize = 12;
var curTextFont = "Arial";
var getLoaded = false;
var start = (new Date).getTime();
// Global vars for tracking mouse position
p.pmouseX = 0;
p.pmouseY = 0;
p.mouseX = 0;
p.mouseY = 0;
// Will be replaced by the user, most likely
p.mouseDragged = undefined;
p.mouseMoved = undefined;
p.mousePressed = undefined;
p.mouseReleased = undefined;
p.keyPressed = undefined;
p.keyReleased = undefined;
p.draw = undefined;
p.setup = undefined;
// The height/width of the canvas
p.width = curElement.width - 0;
p.height = curElement.height - 0;
// In case I ever need to do HSV conversion:
// http://srufaculty.sru.edu/david.dailey/javascript/js/5rml.js
p.color = function color( aValue1, aValue2, aValue3, aValue4 )
{
var aColor = "";
if ( arguments.length == 3 )
{
aColor = p.color( aValue1, aValue2, aValue3, opacityRange );
}
else if ( arguments.length == 4 )
{
var a = aValue4 / opacityRange;
a = isNaN(a) ? 1 : a;
if ( curColorMode == p.HSB )
{
var rgb = HSBtoRGB(aValue1, aValue2, aValue3);
var r = rgb[0], g = rgb[1], b = rgb[2];
}
else
{
var r = getColor(aValue1, redRange);
var g = getColor(aValue2, greenRange);
var b = getColor(aValue3, blueRange);
}
aColor = "rgba(" + r + "," + g + "," + b + "," + a + ")";
}
else if ( typeof aValue1 == "string" )
{
aColor = aValue1;
if ( arguments.length == 2 )
{
var c = aColor.split(",");
c[3] = (aValue2 / opacityRange) + ")";
aColor = c.join(",");
}
}
else if ( arguments.length == 2 )
{
aColor = p.color( aValue1, aValue1, aValue1, aValue2 );
}
else if ( typeof aValue1 == "number" )
{
aColor = p.color( aValue1, aValue1, aValue1, opacityRange );
}
else
{
aColor = p.color( redRange, greenRange, blueRange, opacityRange );
}
// HSB conversion function from Mootools, MIT Licensed
function HSBtoRGB(h, s, b)
{
h = (h / redRange) * 100;
s = (s / greenRange) * 100;
b = (b / blueRange) * 100;
if (s == 0){
return [b, b, b];
} else {
var hue = h % 360;
var f = hue % 60;
var br = Math.round(b / 100 * 255);
var p = Math.round((b * (100 - s)) / 10000 * 255);
var q = Math.round((b * (6000 - s * f)) / 600000 * 255);
var t = Math.round((b * (6000 - s * (60 - f))) / 600000 * 255);
switch (Math.floor(hue / 60)){
case 0: return [br, t, p];
case 1: return [q, br, p];
case 2: return [p, br, t];
case 3: return [p, q, br];
case 4: return [t, p, br];
case 5: return [br, p, q];
}
}
}
function getColor( aValue, range )
{
return Math.round(255 * (aValue / range));
}
return aColor;
}
p.nf = function( num, pad )
{
var str = "" + num;
while ( pad - str.length )
str = "0" + str;
return str;
};
p.AniSprite = function( prefix, frames )
{
this.images = [];
this.pos = 0;
for ( var i = 0; i < frames; i++ )
{
this.images.push( prefix + p.nf( i, ("" + frames).length ) + ".gif" );
}
this.display = function( x, y )
{
p.image( this.images[ this.pos ], x, y );
if ( ++this.pos >= frames )
this.pos = 0;
};
this.getWidth = function()
{
return getImage(this.images[0]).width;
};
this.getHeight = function()
{
return getImage(this.images[0]).height;
};
};
function buildImageObject( obj )
{
var pixels = obj.data;
var data = p.createImage( obj.width, obj.height );
if ( data.__defineGetter__ && data.__lookupGetter__ && !data.__lookupGetter__("pixels") )
{
var pixelsDone;
data.__defineGetter__("pixels", function()
{
if ( pixelsDone )
return pixelsDone;
pixelsDone = [];
for ( var i = 0; i < pixels.length; i += 4 )
{
pixelsDone.push( p.color(pixels[i], pixels[i+1], pixels[i+2], pixels[i+3]) );
}
return pixelsDone;
});
}
else
{
data.pixels = [];
for ( var i = 0; i < pixels.length; i += 4 )
{
data.pixels.push( p.color(pixels[i], pixels[i+1], pixels[i+2], pixels[i+3]) );
}
}
return data;
}
p.createImage = function createImage( w, h, mode )
{
var data = {
width: w,
height: h,
pixels: new Array( w * h ),
get: function(x,y)
{
return this.pixels[w*y+x];
},
_mask: null,
mask: function(img)
{
this._mask = img;
},
loadPixels: function()
{
},
updatePixels: function()
{
}
};
return data;
}
p.createGraphics = function createGraphics( w, h )
{
var canvas = document.createElement("canvas");
var ret = buildProcessing( canvas );
ret.size( w, h );
ret.canvas = canvas;
return ret;
}
p.beginDraw = function beginDraw()
{
}
p.endDraw = function endDraw()
{
}
p.tint = function tint( rgb, a )
{
curTint = a;
}
function getImage( img ) {
if ( typeof img == "string" )
{
return document.getElementById(img);
}
if ( img.img || img.canvas )
{
return img.img || img.canvas;
}
img.data = [];
for ( var i = 0, l = img.pixels.length; i < l; i++ )
{
var c = (img.pixels[i] || "rgba(0,0,0,1)").slice(5,-1).split(",");
img.data.push( parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseFloat(c[3]) * 100 );
}
var canvas = document.createElement("canvas")
canvas.width = img.width;
canvas.height = img.height;
var context = canvas.getContext("2d");
context.putImageData( img, 0, 0 );
img.canvas = canvas;
return canvas;
}
p.image = function image( img, x, y, w, h )
{
x = x || 0;
y = y || 0;
var obj = getImage(img);
if ( curTint >= 0 )
{
var oldAlpha = curContext.globalAlpha;
curContext.globalAlpha = curTint / opacityRange;
}
if ( arguments.length == 3 )
{
curContext.drawImage( obj, x, y );
}
else
{
curContext.drawImage( obj, x, y, w, h );
}
if ( curTint >= 0 )
{
curContext.globalAlpha = oldAlpha;
}
if ( img._mask )
{
var oldComposite = curContext.globalCompositeOperation;
curContext.globalCompositeOperation = "darker";
p.image( img._mask, x, y );
curContext.globalCompositeOperation = oldComposite;
}
}
p.exit = function exit()
{
}
p.save = function save( file )
{
}
p.loadImage = function loadImage( file )
{
var img = document.getElementById(file);
if ( !img )
return;
var h = img.height, w = img.width;
var canvas = document.createElement("canvas");
canvas.width = w;
canvas.height = h;
var context = canvas.getContext("2d");
context.drawImage( img, 0, 0 );
var data = buildImageObject( context.getImageData( 0, 0, w, h ) );
data.img = img;
return data;
}
p.loadFont = function loadFont( name )
{
return {
name: name,
width: function( str )
{
if ( curContext.mozMeasureText )
return curContext.mozMeasureText( typeof str == "number" ?
String.fromCharCode( str ) :
str) / curTextSize;
else
return 0;
}
};
}
p.textFont = function textFont( name, size )
{
curTextFont = name;
p.textSize( size );
}
p.textSize = function textSize( size )
{
if ( size )
{
curTextSize = size;
}
}
p.textAlign = function textAlign()
{
}
p.text = function text( str, x, y )
{
if ( str && curContext.mozDrawText )
{
curContext.save();
curContext.mozTextStyle = curTextSize + "px " + curTextFont.name;
curContext.translate(x, y);
curContext.mozDrawText( typeof str == "number" ?
String.fromCharCode( str ) :
str );
curContext.restore();
}
}
p.char = function char( key )
{
//return String.fromCharCode( key );
return key;
}
p.println = function println()
{
}
p.map = function map( value, istart, istop, ostart, ostop )
{
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
};
String.prototype.replaceAll = function(re, replace)
{
return this.replace(new RegExp(re, "g"), replace);
};
p.Point = function Point( x, y )
{
this.x = x;
this.y = y;
this.copy = function()
{
return new Point( x, y );
}
}
p.Random = function()
{
var haveNextNextGaussian = false;
var nextNextGaussian;
this.nextGaussian = function()
{
if (haveNextNextGaussian) {
haveNextNextGaussian = false;
return nextNextGaussian;
} else {
var v1, v2, s;
do {
v1 = 2 * p.random(1) - 1; // between -1.0 and 1.0
v2 = 2 * p.random(1) - 1; // between -1.0 and 1.0
s = v1 * v1 + v2 * v2;
} while (s >= 1 || s == 0);
var multiplier = Math.sqrt(-2 * Math.log(s)/s);
nextNextGaussian = v2 * multiplier;
haveNextNextGaussian = true;
return v1 * multiplier;
}
};
}
p.ArrayList = function ArrayList( size, size2, size3 )
{
var array = new Array( 0 | size );
if ( size2 )
{
for ( var i = 0; i < size; i++ )
{
array[i] = [];
for ( var j = 0; j < size2; j++ )
{
var a = array[i][j] = size3 ? new Array( size3 ) : 0;
for ( var k = 0; k < size3; k++ )
{
a[k] = 0;
}
}
}
}
else
{
for ( var i = 0; i < size; i++ )
{
array[i] = 0;
}
}
array.size = function()
{
return this.length;
};
array.get = function( i )
{
return this[ i ];
};
array.remove = function( i )
{
return this.splice( i, 1 );
};
array.add = function( item )
{
for ( var i = 0; this[ i ] != undefined; i++ ) {}
this[ i ] = item;
};
array.clone = function()
{
var a = new ArrayList( size );
for ( var i = 0; i < size; i++ )
{
a[ i ] = this[ i ];
}
return a;
};
array.isEmpty = function()
{
return !this.length;
};
array.clear = function()
{
this.length = 0;
};
return array;
}
p.colorMode = function colorMode( mode, range1, range2, range3, range4 )
{
curColorMode = mode;
if ( arguments.length >= 4 )
{
redRange = range1;
greenRange = range2;
blueRange = range3;
}
if ( arguments.length == 5 )
{
opacityRange = range4;
}
if ( arguments.length == 2 )
{
p.colorMode( mode, range1, range1, range1, range1 );
}
}
p.beginShape = function beginShape( type )
{
curShape = type;
curShapeCount = 0;
}
p.endShape = function endShape( close )
{
if ( curShapeCount != 0 )
{
curContext.lineTo( firstX, firstY );
if ( doFill )
curContext.fill();
if ( doStroke )
curContext.stroke();
curContext.closePath();
curShapeCount = 0;
pathOpen = false;
}
if ( pathOpen )
{
curContext.closePath();
}
}
p.vertex = function vertex( x, y, x2, y2, x3, y3 )
{
if ( curShapeCount == 0 && curShape != p.POINTS )
{
pathOpen = true;
curContext.beginPath();
curContext.moveTo( x, y );
}
else
{
if ( curShape == p.POINTS )
{
p.point( x, y );
}
else if ( arguments.length == 2 )
{
if ( curShape == p.TRIANGLE_STRIP && curShapeCount == 2 )
{
curContext.moveTo( prevX, prevY );
curContext.lineTo( firstX, firstY );
}
curContext.lineTo( x, y );
}
else if ( arguments.length == 4 )
{
if ( curShapeCount > 1 )
{
curContext.moveTo( prevX, prevY );
curContext.quadraticCurveTo( firstX, firstY, x, y );
curShapeCount = 1;
}
}
else if ( arguments.length == 6 )
{
curContext.bezierCurveTo( x, y, x2, y2, x3, y3 );
curShapeCount = -1;
}
}
prevX = firstX;
prevY = firstY;
firstX = x;
firstY = y;
curShapeCount++;
if ( curShape == p.LINES && curShapeCount == 2 ||
(curShape == p.TRIANGLES || curShape == p.TRIANGLE_STRIP) && curShapeCount == 3 )
{
p.endShape();
}
if ( curShape == p.TRIANGLE_STRIP && curShapeCount == 3 )
{
curShapeCount = 2;
}
}
p.curveTightness = function()
{
}
// Unimplmented - not really possible with the Canvas API
p.curveVertex = function( x, y, x2, y2 )
{
p.vertex( x, y, x2, y2 );
}
p.bezierVertex = p.vertex
p.rectMode = function rectMode( aRectMode )
{
curRectMode = aRectMode;
}
p.imageMode = function()
{
}
p.ellipseMode = function ellipseMode( aEllipseMode )
{
curEllipseMode = aEllipseMode;
}
p.dist = function dist( x1, y1, x2, y2 )
{
return Math.sqrt( Math.pow( x2 - x1, 2 ) + Math.pow( y2 - y1, 2 ) );
}
p.year = function year()
{
return (new Date).getYear() + 1900;
}
p.month = function month()
{
return (new Date).getMonth();
}
p.day = function day()
{
return (new Date).getDay();
}
p.hour = function hour()
{
return (new Date).getHours();
}
p.minute = function minute()
{
return (new Date).getMinutes();
}
p.second = function second()
{
return (new Date).getSeconds();
}
p.millis = function millis()
{
return (new Date).getTime() - start;
}
p.ortho = function ortho()
{
}
p.translate = function translate( x, y )
{
curContext.translate( x, y );
}
p.scale = function scale( x, y )
{
curContext.scale( x, y || x );
}
p.rotate = function rotate( aAngle )
{
curContext.rotate( aAngle );
}
p.pushMatrix = function pushMatrix()
{
curContext.save();
}
p.popMatrix = function popMatrix()
{
curContext.restore();
}
p.redraw = function redraw()
{
if ( hasBackground )
{
p.background();
}
inDraw = true;
p.pushMatrix();
p.draw();
p.popMatrix();
inDraw = false;
}
p.loop = function loop()
{
if ( loopStarted )
return;
var looping = setInterval(function()
{
try
{
p.redraw();
}
catch(e)
{
clearInterval( looping );
throw e;
}
}, 1000 / curFrameRate );
loopStarted = true;
}
p.frameRate = function frameRate( aRate )
{
curFrameRate = aRate;
}
p.background = function background( img )
{
if ( arguments.length )
{
if ( img && img.img )
{
curBackground = img;
}
else
{
curBackground = p.color.apply( this, arguments );
}
}
if ( curBackground.img )
{
p.image( curBackground, 0, 0 );
}
else
{
var oldFill = curContext.fillStyle;
curContext.fillStyle = curBackground + "";
curContext.fillRect( 0, 0, p.width, p.height );
curContext.fillStyle = oldFill;
}
}
p.sq = function sq( aNumber )
{
return aNumber * aNumber;
}
p.sqrt = function sqrt( aNumber )
{
return Math.sqrt( aNumber );
}
p.int = function int( aNumber )
{
return Math.floor( aNumber );
}
p.min = function min( aNumber, aNumber2 )
{
return Math.min( aNumber, aNumber2 );
}
p.max = function max( aNumber, aNumber2 )
{
return Math.max( aNumber, aNumber2 );
}
p.ceil = function ceil( aNumber )
{
return Math.ceil( aNumber );
}
p.floor = function floor( aNumber )
{
return Math.floor( aNumber );
}
p.float = function float( aNumber )
{
return typeof aNumber == "string" ?
p.float( aNumber.charCodeAt(0) ) :
parseFloat( aNumber );
}
p.byte = function byte( aNumber )
{
return aNumber || 0;
}
p.random = function random( aMin, aMax )
{
return arguments.length == 2 ?
aMin + (Math.random() * (aMax - aMin)) :
Math.random() * aMin;
}
// From: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
p.noise = function( x, y, z )
{
return arguments.length >= 2 ?
PerlinNoise_2D( x, y ) :
PerlinNoise_2D( x, x );
}
function Noise(x, y)
{
var n = x + y * 57;
n = (n<<13) ^ n;
return Math.abs(1.0 - (((n * ((n * n * 15731) + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0));
}
function SmoothedNoise(x, y)
{
var corners = ( Noise(x-1, y-1)+Noise(x+1, y-1)+Noise(x-1, y+1)+Noise(x+1, y+1) ) / 16;
var sides = ( Noise(x-1, y) +Noise(x+1, y) +Noise(x, y-1) +Noise(x, y+1) ) / 8;
var center = Noise(x, y) / 4;
return corners + sides + center;
}
function InterpolatedNoise(x, y)
{
var integer_X = Math.floor(x);
var fractional_X = x - integer_X;
var integer_Y = Math.floor(y);
var fractional_Y = y - integer_Y;
var v1 = SmoothedNoise(integer_X, integer_Y);
var v2 = SmoothedNoise(integer_X + 1, integer_Y);
var v3 = SmoothedNoise(integer_X, integer_Y + 1);
var v4 = SmoothedNoise(integer_X + 1, integer_Y + 1);
var i1 = Interpolate(v1 , v2 , fractional_X);
var i2 = Interpolate(v3 , v4 , fractional_X);
return Interpolate(i1 , i2 , fractional_Y);
}
function PerlinNoise_2D(x, y)
{
var total = 0;
var p = 0.25;
var n = 3;
for ( var i = 0; i <= n; i++ )
{
var frequency = Math.pow(2, i);
var amplitude = Math.pow(p, i);
total = total + InterpolatedNoise(x * frequency, y * frequency) * amplitude;
}
return total;
}
function Interpolate(a, b, x)
{
var ft = x * p.PI;
var f = (1 - p.cos(ft)) * .5;
return a*(1-f) + b*f;
}
p.red = function( aColor )
{
return parseInt(aColor.slice(5));
}
p.green = function( aColor )
{
return parseInt(aColor.split(",")[1]);
}
p.blue = function( aColor )
{
return parseInt(aColor.split(",")[2]);
}
p.alpha = function( aColor )
{
return parseInt(aColor.split(",")[3]);
}
p.abs = function abs( aNumber )
{
return Math.abs( aNumber );
}
p.cos = function cos( aNumber )
{
return Math.cos( aNumber );
}
p.sin = function sin( aNumber )
{
return Math.sin( aNumber );
}
p.pow = function pow( aNumber, aExponent )
{
return Math.pow( aNumber, aExponent );
}
p.constrain = function constrain( aNumber, aMin, aMax )
{
return Math.min( Math.max( aNumber, aMin ), aMax );
}
p.sqrt = function sqrt( aNumber )
{
return Math.sqrt( aNumber );
}
p.atan2 = function atan2( aNumber, aNumber2 )
{
return Math.atan2( aNumber, aNumber2 );
}
p.radians = function radians( aAngle )
{
return ( aAngle / 180 ) * p.PI;
}
p.size = function size( aWidth, aHeight )
{
var fillStyle = curContext.fillStyle;
var strokeStyle = curContext.strokeStyle;
curElement.width = p.width = aWidth;
curElement.height = p.height = aHeight;
curContext.fillStyle = fillStyle;
curContext.strokeStyle = strokeStyle;
}
p.noStroke = function noStroke()
{
doStroke = false;
}
p.noFill = function noFill()
{
doFill = false;
}
p.smooth = function smooth()
{
}
p.noLoop = function noLoop()
{
doLoop = false;
}
p.fill = function fill()
{
doFill = true;
curContext.fillStyle = p.color.apply( this, arguments );
}
p.stroke = function stroke()
{
doStroke = true;
curContext.strokeStyle = p.color.apply( this, arguments );
}
p.strokeWeight = function strokeWeight( w )
{
curContext.lineWidth = w;
}
p.point = function point( x, y )
{
var oldFill = curContext.fillStyle;
curContext.fillStyle = curContext.strokeStyle;
curContext.fillRect( Math.round( x ), Math.round( y ), 1, 1 );
curContext.fillStyle = oldFill;
}
p.get = function get( x, y )
{
if ( arguments.length == 0 )
{
var c = p.createGraphics( p.width, p.height );
c.image( curContext, 0, 0 );
return c;
}
if ( !getLoaded )
{
getLoaded = buildImageObject( curContext.getImageData(0, 0, p.width, p.height) );
}
return getLoaded.get( x, y );
}
p.set = function set( x, y, color )
{
var oldFill = curContext.fillStyle;
curContext.fillStyle = color;
curContext.fillRect( Math.round( x ), Math.round( y ), 1, 1 );
curContext.fillStyle = oldFill;
}
p.arc = function arc( x, y, width, height, start, stop )
{
if ( width <= 0 )
return;
if ( curEllipseMode == p.CORNER )
{
x += width / 2;
y += height / 2;
}
curContext.beginPath();
curContext.moveTo( x, y );
curContext.arc( x, y, curEllipseMode == p.CENTER_RADIUS ? width : width/2, start, stop, false );
if ( doFill )
curContext.fill();
if ( doStroke )
curContext.stroke();
curContext.closePath();
}
p.line = function line( x1, y1, x2, y2 )
{
curContext.lineCap = "round";
curContext.beginPath();
curContext.moveTo( x1 || 0, y1 || 0 );
curContext.lineTo( x2 || 0, y2 || 0 );
curContext.stroke();
curContext.closePath();
}
p.bezier = function bezier( x1, y1, x2, y2, x3, y3, x4, y4 )
{
curContext.lineCap = "butt";
curContext.beginPath();
curContext.moveTo( x1, y1 );
curContext.bezierCurveTo( x2, y2, x3, y3, x4, y4 );
curContext.stroke();
curContext.closePath();
}
p.triangle = function triangle( x1, y1, x2, y2, x3, y3 )
{
p.beginShape();
p.vertex( x1, y1 );
p.vertex( x2, y2 );
p.vertex( x3, y3 );
p.endShape();
}
p.quad = function quad( x1, y1, x2, y2, x3, y3, x4, y4 )
{
p.beginShape();
p.vertex( x1, y1 );
p.vertex( x2, y2 );
p.vertex( x3, y3 );
p.vertex( x4, y4 );
p.endShape();
}
p.rect = function rect( x, y, width, height )
{
if ( width == 0 && height == 0 )
return;
curContext.beginPath();
var offsetStart = 0;
var offsetEnd = 0;
if ( curRectMode == p.CORNERS )
{
width -= x;
height -= y;
}
if ( curRectMode == p.RADIUS )
{
width *= 2;
height *= 2;
}
if ( curRectMode == p.CENTER || curRectMode == p.RADIUS )
{
x -= width / 2;
y -= height / 2;
}
curContext.rect(
Math.round( x ) - offsetStart,
Math.round( y ) - offsetStart,
Math.round( width ) + offsetEnd,
Math.round( height ) + offsetEnd
);
if ( doFill )
curContext.fill();
if ( doStroke )
curContext.stroke();
curContext.closePath();
}
p.ellipse = function ellipse( x, y, width, height )
{
x = x || 0;
y = y || 0;
if ( width <= 0 && height <= 0 )
return;
curContext.beginPath();
if ( curEllipseMode == p.RADIUS )
{
width *= 2;
height *= 2;
}
var offsetStart = 0;
// Shortcut for drawing a circle
if ( width == height )
curContext.arc( x - offsetStart, y - offsetStart, width / 2, 0, Math.PI * 2, false );
if ( doFill )
curContext.fill();
if ( doStroke )
curContext.stroke();
curContext.closePath();
}
p.link = function( href, target )
{
window.location = href;
}
p.loadPixels = function()
{
p.pixels = buildImageObject( curContext.getImageData(0, 0, p.width, p.height) ).pixels;
}
p.updatePixels = function()
{
var colors = /(\d+),(\d+),(\d+),(\d+)/;
var pixels = {};
var data = pixels.data = [];
pixels.width = p.width;
pixels.height = p.height;
var pos = 0;
for ( var i = 0, l = p.pixels.length; i < l; i++ ) {
var c = (p.pixels[i] || "rgba(0,0,0,1)").match(colors);
data[pos] = parseInt(c[1]);
data[pos+1] = parseInt(c[2]);
data[pos+2] = parseInt(c[3]);
data[pos+3] = parseFloat(c[4]) * 100;
pos += 4;
}
curContext.putImageData(pixels, 0, 0);
}
p.extendClass = function extendClass( obj, args, fn )
{
if ( arguments.length == 3 )
{
fn.apply( obj, args );
}
else
{
args.call( obj );
}
}
p.addMethod = function addMethod( object, name, fn )
{
if ( object[ name ] )
{
var args = fn.length;
var oldfn = object[ name ];
object[ name ] = function()
{
if ( arguments.length == args )
return fn.apply( this, arguments );
else
return oldfn.apply( this, arguments );
};
}
else
{
object[ name ] = fn;
}
}
p.init = function init(code){
p.stroke( 0 );
p.fill( 255 );
// Canvas has trouble rendering single pixel stuff on whole-pixel
// counts, so we slightly offset it (this is super lame).
curContext.translate( 0.5, 0.5 );
if ( code )
{
(function(Processing){with (p){
eval(parse(code, p));
}})(p);
}
if ( p.setup )
{
inSetup = true;
p.setup();
}
inSetup = false;
if ( p.draw )
{
if ( !doLoop )
{
p.redraw();
}
else
{
p.loop();
}
}
attach( curElement, "mousemove", function(e)
{
p.pmouseX = p.mouseX;
p.pmouseY = p.mouseY;
p.mouseX = e.clientX - curElement.offsetLeft;
p.mouseY = e.clientY - curElement.offsetTop;
if ( p.mouseMoved )
{
p.mouseMoved();
}
if ( mousePressed && p.mouseDragged )
{
p.mouseDragged();
}
});
attach( curElement, "mousedown", function(e)
{
mousePressed = true;
if ( typeof p.mousePressed == "function" )
{
p.mousePressed();
}
else
{
p.mousePressed = true;
}
});
attach( curElement, "mouseup", function(e)
{
mousePressed = false;
if ( typeof p.mousePressed != "function" )
{
p.mousePressed = false;
}
if ( p.mouseReleased )
{
p.mouseReleased();
}
});
attach( document, "keydown", function(e)
{
keyPressed = true;
p.key = e.keyCode + 32;
if ( e.shiftKey )
{
p.key = String.fromCharCode(p.key).toUpperCase().charCodeAt(0);
}
if ( typeof p.keyPressed == "function" )
{
p.keyPressed();
}
else
{
p.keyPressed = true;
}
});
attach( document, "keyup", function(e)
{
keyPressed = false;
if ( typeof p.keyPressed != "function" )
{
p.keyPressed = false;
}
if ( p.keyReleased )
{
p.keyReleased();
}
});
function attach(elem, type, fn)
{
if ( elem.addEventListener )
elem.addEventListener( type, fn, false );
else
elem.attachEvent( "on" + type, fn );
}
};
return p;
}
})();
} //# end of "install only once"
//}}}
*[[Quiz 1|quizzes/mat-336-001-2009-fall-quiz-1.pdf]]
*[[Quiz 2|quizzes/mat-336-001-2009-fall-quiz-2.pdf]]
*[[Quiz 3|quizzes/mat-336-001-2009-fall-quiz-3.pdf]]
*[[Quiz 4|quizzes/mat-336-001-2009-fall-quiz-4.pdf]] | [[Solutions|quizzes/mat-336-001-2009-fall-quiz-4-solutions-brief.pdf]]
*[[Quiz 5|quizzes/mat-336-001-2009-fall-quiz-5.pdf]] | [[Solutions|quizzes/mat-336-001-2009-fall-quiz-5-solutions-brief.pdf]]
*[[Additional problems on rings|tests/mat-336-001-2009-fall-ring-problems.pdf]]
!Proposition
If $N$ is a normal subgroup of $G,$ then the set $G/N$ of left cosets of $N$ in $G$ is a group.
!Observation
We say that $G/N$ is a quotient group.
!Proposition
The center $Z(G)$ of a group is a normal subgroup of $G.$
!Example
Compute $Z(D_{8}),$ $Z(D_{10}),$ and $Z(Q_{8}).$
!Proposition
If $G/Z(G)$ is cyclic, then $G$ is abelian.
!Example
Determine whether $Q_{8} / Z(Q_{8})$ is cyclic.
!Observation
Let $p$ and $q$ be prime. Any group of order $pq$ with nontrivial center is abelian.
!Question
When does a group $G$ have an element of order $d?$
!Theorem
Let $G$ be a finite abelian group of order $n,$ and let $p$ be a prime dividing $n.$ Then $G$ contains an element of order $p.$
Please refresh/reload the webpage to see the latest updates to the site.
!Spring 2011
<<tabs Schedule
Jan "January" [[Schedule/January]]
Feb "February" [[Schedule/February]]
Mar "March" [[Schedule/March]]
Apr "April" [[Schedule/April]]
May "May" [[Schedule/May]]
>>
<part January hidden>
*Thursday, January 13
**Section 1.1: Union and Intersection
**Section 1.2: Venn Diagrams
*Tuesday, January 18
**Section 1.3: Mappings
**Section 1.4: Equivalence Relations
*Thursday, January 20
**Section 1.5: Well-ordering and Induction
*Tuesday, January 25
**Section 2.1: Divisibility
**Section 2.2: Divisors
**Section 2.3: Division Algorithm
*Thursday, January 27
**Section 2.4: Euclidean Algorithm
</part>
<part February hidden>
*Tuesday, February 01
**Section 2.5: Primes
*Thursday, February 03
**Section 3.1: Concept of a Polynomial
**Section 3.2: Division and Euclidean Algorithms
*Tuesday, February 08
**Review
*Thursday, February 10
**Test 1
*Tuesday, February 15
**Section 3.3: Axioms and Rings
*Thursday, February 17
**Section 4.1: Semigroups
*Tuesday, February 22
**Section 4.2: Finite and Infinite Groups
*Thursday, February 24
**Section 4.2: Finite and Infinite Groups (continued)
</part>
<part March hidden>
*Tuesday, March 01
**Section 4.3: Definition and Criteria for Subgroups
*Thursday, March 03
**Section 4.3: Special Subgroups: Centers, Centralizers, Normalizers
*Tuesday, March 08
**Section 4.3: Normal Subgroups
*Thursday, March 10
**Section 4.4: Lagrange's Theorem and Cosets
*Tuesday, March 15 - Thursday, March 17
**Spring Break
*Tuesday, March 22
**Section 4.4: Structure of Cyclic Groups
*Thursday, March 24
**Section 4.5: Homomorphisms
*Tuesday, March 29
**Review
*Thursday, March 31
</part>
<part April hidden>
*Tuesday, April 05
**Test 2
*Thursday, April 07
**Section 4.5: Quotient Groups
*Tuesday, April 12
*Thursday, April 14
**Debriefing
*Tuesday, April 19
**Section 4.5: First Isomorphism Theorem
**Section 5.1: Arithmetic Modulo n
*Thursday, April 21
**No Classes
*Tuesday, April 26
**Section 5.2: Integral Domains and Fields
**Section 5.3: Euclidean Domains
**Section 5.5: Principal Ideal and Unique Factorization Domains
*Thursday, April 28
**Review
</part>
<part May hidden>
*Tuesday, May 03
**Reading Day
</part>
''Theorem''
Let \( S(n) \) be a family of statements, one for each integer \( n \ge 1 \), and suppose that
# \( S(1) \) is true
# if \( S(k) \) is true for all predecessors \( k \) of \( n \), then \( S(n) \) is itself true
Then \( S(n) \) is true for all integers \( n \ge 1 \).
*Set, element, and belongs are undefined terms
*A set is determined by the elements in it
*Equality of sets
*Subsets and inclusion
*Proper subsets
*Empty set
*Intersections, unions, and differences of sets
*Cartesian products
*Functions
*Domain and codomain
*Image / range
*Equality of functions
*Surjective / onto
*Injective / one-to-one
*Single-valued / well-defined
*Compositions
*Bijective
*Cardinality / countable / uncountable
*Equivalence classes partition
/* horizontal main menu */
#displayArea { margin: 1em 15.5em 0em 1em; } /* use the full horizontal width */
#topMenu { background: [[ColorPalette::PrimaryMid]]; color: [[ColorPalette::PrimaryPale]]; padding: 0.2em 0.2em 0.2em 0.5em; border-bottom: 2px solid #000000; }
#topMenu br { display: none; }
#topMenu .button, #topMenu .tiddlyLink, #topMenu a { margin-left: 0.25em; margin-right: 0.25em; padding-left: 0.5em; padding-right: 0.5em; color: [[ColorPalette::PrimaryPale]]; font-size: 1.15em; }
#topMenu .button:hover, #topMenu .tiddlyLink:hover { background: [[ColorPalette::PrimaryDark]]; }
*Subgroup definition
*Subgroup criteria
*Subgroups of cyclic groups
*Products and intersections of subgroups
/***
|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#ToggleSideBarMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button for toggling visibility of the SideBar. You can choose whether the SideBar should initially be hidden or displayed.
!Demo
<<toggleSideBar "Toggle Sidebar">>
!Usage:
{{{<<toggleSideBar>>}}} <<toggleSideBar>>
additional options:
{{{<<toggleSideBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideSideBarButton {float:right;} }}}
!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour.
*20-07-06: version 0.11
*27-04-06: version 0.1: working.
!Code
***/
//{{{
config.macros.toggleSideBar={};
config.macros.toggleSideBar.settings={
styleHide : "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
styleShow : " ",
arrow1: "«",
arrow2: "»"
};
config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
var tooltip= params[1]||'toggle sidebar';
var mode = (params[2] && params[2]=="hide")? "hide":"show";
var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
var label= (params[0]&¶ms[0]!='.')?params[0]+" "+arrow:arrow;
var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
if (mode == "hide")
{
(document.getElementById("sidebar")).setAttribute("toggle","hide");
setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
}
};
config.macros.toggleSideBar.onToggleSideBar = function(){
var sidebar = document.getElementById("sidebar");
var settings = config.macros.toggleSideBar.settings;
if (sidebar.getAttribute("toggle")=='hide')
{
setStylesheet(settings.styleShow,"ToggleSideBarStyles");
sidebar.setAttribute("toggle","show");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
}
else
{
setStylesheet(settings.styleHide,"ToggleSideBarStyles");
sidebar.setAttribute("toggle","hide");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
}
return false;
}
setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");
//}}}
**Section 1.1-1.2: Preliminaries
**Section 1.3-1.4: Greatest Common Divisor; Fundamental Theorem of Arithmetic
**Section 1.5: Congruences
**Section 1.5: Fermat's Little Theorem
**Section 2.1: Functions
**Section 2.2: Permutations: Cycle Decomposition
**Section 2.2: Permutations: Parity
**Section 2.3: Groups: Axioms
**Section 2.3: Groups: Examples
**Section 2.4: Subgroups
**Section 2.4: Cosets and Lagrange's Theorem
**Section 2.5: Cosets and Normal Subgroups
**Section 2.5: Group Homomorphisms
**Section 2.6: Quotient Groups
**Section 2.6: Isomorphism Theorems
**Section 2.6: Direct Products
**Section 2.7: Group Actions: Cayley's Theorem
**Section 2.7: Classification of Groups of Small Order
**Section 2.7: Orbits and Stabilizers
**Section 2.7: The Class Equation
**Section 3.1: Commutative Rings
**Section 3.2: Fields
Section 1.1: Union and Intersection
Section 1.2: Venn Diagrams
Section 1.3: Mappings
Section 1.4: Equivalence Relations
Section 1.5: Well-ordering and Induction
Section 1.6: Countable Sets
Section 2.1: Divisibility
Section 2.2: Divisors
Section 2.3: Division Algorithm
Section 2.4: Euclidean Algorithm
Section 2.5: Primes
Section 3.1: Concept of a Polynomial
Section 3.2: Division and Euclidean Algorithms
Section 3.3: Axioms and Rings
Section 4.1: Semigroups
Section 4.2: Finite and Infinite Groups
Section 4.3: Subgroups
Section 4.4: Lagrange's Theorem, Cosets and Conjugacy
Section 4.5: Homomorphisms
Section 5.1: Arithmetic Modulo n
Section 5.2: Integral Domains and Fields
Section 5.3: Euclidean Domains
Section 5.4: Ideals and Homomorphisms
Section 5.5: Principal Ideal and Unique Factorization Domains
Section 5.6: Factorization in Q[x]
Section 6.1: Permutation Groups
Section 6.2: Generators and Relations
Section 6.3: Direct Products and Sums
Section 6.4: Abelian Groups
Section 6.5: p-Groups and Sylow Subgroups
''Theorem''
If \( a \) and \( b \) are integers, then \( \mbox{gcd}(a,b) \) is a linear combination of \( a \) and \( b \).