[Assorted-commits] SF.net SVN: assorted: [860] pop-quiz
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-07-02 06:32:52
|
Revision: 860 http://assorted.svn.sourceforge.net/assorted/?rev=860&view=rev Author: yangzhang Date: 2008-07-01 23:32:54 -0700 (Tue, 01 Jul 2008) Log Message: ----------- added popquiz Added Paths: ----------- pop-quiz/ pop-quiz/trunk/ pop-quiz/trunk/PopQuiz/ pop-quiz/trunk/PopQuiz/App.ico pop-quiz/trunk/PopQuiz/AssemblyInfo.cs pop-quiz/trunk/PopQuiz/Copy of Form1.cs pop-quiz/trunk/PopQuiz/Form1.cs pop-quiz/trunk/PopQuiz/Form1.resx pop-quiz/trunk/PopQuiz/PopQuiz.csproj pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user pop-quiz/trunk/PopQuiz/PopQuiz.sln pop-quiz/trunk/PopQuiz/PopQuiz.suo Added: pop-quiz/trunk/PopQuiz/App.ico =================================================================== (Binary files differ) Property changes on: pop-quiz/trunk/PopQuiz/App.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pop-quiz/trunk/PopQuiz/AssemblyInfo.cs =================================================================== --- pop-quiz/trunk/PopQuiz/AssemblyInfo.cs (rev 0) +++ pop-quiz/trunk/PopQuiz/AssemblyInfo.cs 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] Added: pop-quiz/trunk/PopQuiz/Copy of Form1.cs =================================================================== --- pop-quiz/trunk/PopQuiz/Copy of Form1.cs (rev 0) +++ pop-quiz/trunk/PopQuiz/Copy of Form1.cs 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,457 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.IO; +using System.Data; +using System.Xml; +using System.Diagnostics; +using System.Threading; + +namespace PopQuiz +{ + /// <summary> + /// Summary description for Form1. + /// </summary> + public class Form1 : System.Windows.Forms.Form + { +// [DllImport("user32")] +// public static extern int SetWindowPos(int hwnd, int hWndInsertAfter, int x, +// int y, int cx, int cy, int wFlags); + + private bool isDefault = false; + private System.Windows.Forms.Timer timer; + private System.ComponentModel.IContainer components; + + private Def def = null; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelKey; + private System.Windows.Forms.TextBox textBox; + private System.Windows.Forms.Label label; + + // map int to string + private ArrayList list = null; + private ArrayList uniq = null; + private int initSize = 0; + private int increment; + private int decrement; + private int maxval; + private string txtPath = null; + private System.Windows.Forms.Panel panelButtons; + private System.Windows.Forms.Button buttonCorrect; + private System.Windows.Forms.Button buttonIncorrect; + private Form1 parent = null; + + public Form1() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + isDefault = true; + timer.Enabled = true; + list = new ArrayList(); + uniq = new ArrayList(); + using(StreamReader reader = new StreamReader(@"list.txt")) + { +// xmlPath = reader.ReadLine(); + txtPath = reader.ReadLine(); + } + +// using(XmlTextReader reader = new XmlTextReader(xmlPath)) +// { +// while (reader.Read()) +// { +// switch (reader.NodeType) +// { +// case XmlNodeType.Element: +// break; +// default: +// break; +// } +// } +// } + + string readTxtPath = txtPath; + if (File.Exists(txtPath + ".new")) + { + readTxtPath += ".new"; + } + + using(StreamReader reader = new StreamReader(readTxtPath)) + { + while (true) + { + int freq; + string strFreq = ""; + string key; + try + { + while (strFreq == "") + strFreq = reader.ReadLine(); + freq = int.Parse(strFreq); + key = reader.ReadLine(); + } + catch + { + key = strFreq; + freq = 1; + } + string value = reader.ReadLine(); + string details = ""; + string line = null; + while (true) + { + line = reader.ReadLine(); + if (line == "" || line == null) + { + // trim off newline chars + if (details.Length > 0) + details = details.Substring(0, details.Length - 2); + break; + } + details += line + "\r\n"; + } + + if (key == null || value == null || line == null) + break; + + Def def = new Def(key, value, details, freq); + for ( int i = 0; i < freq; i++ ) + { + list.Add(def); + } + uniq.Add(def); + } + } + + initSize = uniq.Count; + increment = Math.Max(initSize / 10, 2); + decrement = Math.Max(increment / 5, 1); + maxval = Math.Max(initSize / 2, 2); + this.labelKey.Visible = false; + this.textBox.Visible = false; + this.label.Text = "Increment: " + increment + + "\r\nDecrement: " + decrement + + "\r\nUniques: " + uniq.Count + + "\r\nTotal: " + list.Count + + "\r\nMax Val: " + maxval; + this.buttonCorrect.Enabled = false; + this.buttonIncorrect.Enabled = false; + this.buttonOK.Text = "&Quiz Me Now"; + this.WindowState = FormWindowState.Normal; + this.MaximizeBox = true; + this.MinimizeBox = true; + } + + public Form1(Form1 parent, Def def) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + isDefault = false; + this.def = def; + this.labelKey.Text = def.Key; + this.parent = parent; + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.labelKey = new System.Windows.Forms.Label(); + this.timer = new System.Windows.Forms.Timer(this.components); + this.buttonOK = new System.Windows.Forms.Button(); + this.textBox = new System.Windows.Forms.TextBox(); + this.label = new System.Windows.Forms.Label(); + this.buttonCorrect = new System.Windows.Forms.Button(); + this.buttonIncorrect = new System.Windows.Forms.Button(); + this.panelButtons = new System.Windows.Forms.Panel(); + this.panelButtons.SuspendLayout(); + this.SuspendLayout(); + // + // labelKey + // + this.labelKey.Cursor = System.Windows.Forms.Cursors.Default; + this.labelKey.Dock = System.Windows.Forms.DockStyle.Top; + this.labelKey.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.labelKey.Location = new System.Drawing.Point(10, 10); + this.labelKey.Name = "labelKey"; + this.labelKey.Size = new System.Drawing.Size(404, 38); + this.labelKey.TabIndex = 0; + // + // timer + // + this.timer.Interval = 300000; + this.timer.Tick += new System.EventHandler(this.timer_Tick); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(304, 8); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(96, 32); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // textBox + // + this.textBox.Dock = System.Windows.Forms.DockStyle.Top; + this.textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.textBox.Location = new System.Drawing.Point(10, 48); + this.textBox.Name = "textBox"; + this.textBox.Size = new System.Drawing.Size(404, 30); + this.textBox.TabIndex = 1; + this.textBox.Text = ""; + // + // label + // + this.label.Dock = System.Windows.Forms.DockStyle.Fill; + this.label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.label.Location = new System.Drawing.Point(10, 78); + this.label.Name = "label"; + this.label.Size = new System.Drawing.Size(404, 222); + this.label.TabIndex = 3; + // + // buttonCorrect + // + this.buttonCorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCorrect.Location = new System.Drawing.Point(200, 8); + this.buttonCorrect.Name = "buttonCorrect"; + this.buttonCorrect.Size = new System.Drawing.Size(96, 32); + this.buttonCorrect.TabIndex = 4; + this.buttonCorrect.Text = "&Correct"; + this.buttonCorrect.Click += new System.EventHandler(this.buttonCorrect_Click); + // + // buttonIncorrect + // + this.buttonIncorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonIncorrect.Location = new System.Drawing.Point(96, 8); + this.buttonIncorrect.Name = "buttonIncorrect"; + this.buttonIncorrect.Size = new System.Drawing.Size(96, 32); + this.buttonIncorrect.TabIndex = 4; + this.buttonIncorrect.Text = "&D\'oh!"; + this.buttonIncorrect.Click += new System.EventHandler(this.buttonIncorrect_Click); + // + // panelButtons + // + this.panelButtons.Controls.Add(this.buttonOK); + this.panelButtons.Controls.Add(this.buttonCorrect); + this.panelButtons.Controls.Add(this.buttonIncorrect); + this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panelButtons.Location = new System.Drawing.Point(10, 252); + this.panelButtons.Name = "panelButtons"; + this.panelButtons.Size = new System.Drawing.Size(404, 48); + this.panelButtons.TabIndex = 5; + // + // Form1 + // + this.AcceptButton = this.buttonOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(424, 310); + this.Controls.Add(this.panelButtons); + this.Controls.Add(this.label); + this.Controls.Add(this.textBox); + this.Controls.Add(this.labelKey); + this.DockPadding.All = 10; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form1"; + this.Text = "PopQuiz!"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.Form1_Load); + this.Closed += new System.EventHandler(this.OnClosed); + this.panelButtons.ResumeLayout(false); + this.ResumeLayout(false); + + } + #endregion + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + public static void Main() + { + Application.Run(new Form1()); + } + + private void OnClosed(object sender, System.EventArgs e) + { + if (this.isDefault) + { + Application.Exit(); + } + } + + private void timer_Tick(object sender, System.EventArgs e) + { + int rand = new Random().Next(list.Count); + Def def = (Def) list[rand]; + Form1 form = new Form1(this, def); + form.Show(); + form.Activate(); + } + + private void buttonOK_Click(object sender, System.EventArgs e) + { + if (this.isDefault) + { + this.timer_Tick(null, null); + return; + } + + if (this.def.Value != this.textBox.Text) + Incorrect(); + else + Correct(); + + parent.Save(); + } + + private void Incorrect() + { + if (this.label.Text != "") + { + Close(); + return; + } + this.def.Freq += parent.increment; + if (this.def.Freq > parent.maxval) + this.def.Freq = parent.maxval; + for (int i = 0; i < parent.increment; i++) + parent.list.Add(def); + this.label.Text = this.def.Value + "\r\n\r\n" + this.def.Details + "\r\n\r\nNow At: " + this.def.Freq; + } + + private void Correct() + { + this.def.Freq -= parent.decrement; + for (int i = 0; i < parent.decrement; i++) + parent.list.Remove(def); + if (this.def.Freq <= 1) + this.def.Freq = 1; + Close(); + } + + private void Save() + { + using (FileStream stream = new FileStream(txtPath + ".new", FileMode.Create)) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + foreach (Def def in uniq) + { + writer.WriteLine(def.Freq); + writer.WriteLine(def.Key); + writer.WriteLine(def.Value); + writer.WriteLine(def.Details); + writer.WriteLine(); + } + } + } + } + + private void buttonCorrect_Click(object sender, System.EventArgs e) + { + if (!this.isDefault) + { + Correct(); + } + } + + private void buttonIncorrect_Click(object sender, System.EventArgs e) + { + if (!this.isDefault) + { + Incorrect(); + } + } + + private void Form1_Load(object sender, System.EventArgs e) + { + if (this.isDefault) + this.timer_Tick(null, null); + else + this.TopMost = true; + } + } + + public class Def + { + private string key; + private string value; + private string details; + private int freq; + + public Def(string key, string value, string details, int freq) + { + Debug.Assert(key != null && value != null && details != null && freq > 0); + this.key = key; + this.value = value; + this.details = details; + this.freq = freq; + } + + public string Key + { + get + { + return key; + } + } + + public string Value + { + get + { + return value; + } + } + + public string Details + { + get + { + return details; + } + } + + public int Freq + { + get + { + return freq; + } + set + { + freq = value; + } + } + } +} + Added: pop-quiz/trunk/PopQuiz/Form1.cs =================================================================== --- pop-quiz/trunk/PopQuiz/Form1.cs (rev 0) +++ pop-quiz/trunk/PopQuiz/Form1.cs 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,862 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.IO; +using System.Data; +using System.Xml; +using System.Diagnostics; +using System.Threading; +using System.Text.RegularExpressions; + +namespace PopQuiz +{ + public enum Status + { + Neutral, + Correct, + Incorrect + } + + /// <summary> + /// Summary description for Form1. + /// </summary> + public class Form1 : System.Windows.Forms.Form + { + private bool isDefault = false; + private System.Windows.Forms.Timer timer; + private System.ComponentModel.IContainer components; + + private Def def = null; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelKey; + private System.Windows.Forms.TextBox textBox; + + // ArrayList<Def> + private ArrayList list = null; + private ArrayList uniq = null; + private ArrayList additions = null; + private ArrayList history = new ArrayList(); + // map string (word) to int (freq) + private Hashtable table = null; + private Hashtable fullTable = null; + private Status status = Status.Neutral; + private int initSize = 0; + private int increment; + private int decrement; + private int maxval; + private int undoFreq = -1; + private Def delayDef = null; + private string logPath = null; + private string txtPath = null; + private string freqPath = null; + private string addPath = null; + private DateTime spawnTime = DateTime.Now; + private System.Windows.Forms.Panel panelButtons; + private System.Windows.Forms.Button buttonCorrect; + private System.Windows.Forms.Button buttonIncorrect; + private System.Windows.Forms.Button buttonShow; + private System.Windows.Forms.TextBox label; + private System.Windows.Forms.Button buttonDelay; + private Form1 parent = null; + + public Form1() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + isDefault = true; + timer.Enabled = true; + table = new Hashtable(); + list = new ArrayList(); + uniq = new ArrayList(); + additions = new ArrayList(); + using(StreamReader reader = new StreamReader(@"list.txt")) + { + txtPath = reader.ReadLine(); + } + + freqPath = Regex.Replace(txtPath, @"\.txt$", " Freq.txt"); + if (File.Exists(freqPath)) + { + using(StreamReader reader = new StreamReader(freqPath)) + { + while (true) + { + int freq = 1; + string line = reader.ReadLine(); + if (line == null) + break; + if (line == "") + continue; + line = line.Trim(); + if (line[0] == '#') + continue; + string[] parts = line.Split('\t'); + + // format: <freq>\t<word> + freq = int.Parse(parts[0]); + table[parts[1]] = freq; + } + } + } + + string filterPath = Regex.Replace(txtPath, @"\.txt$", " Filter.txt"); + Hashtable filter = null; + if (File.Exists(filterPath)) + { + filter = new Hashtable(); + uniq = new ArrayList(); + using(StreamReader reader = new StreamReader(filterPath)) + { + while (true) + { + string line = reader.ReadLine(); + if (line == null) + break; + if (line == "") + continue; + line = line.Trim(); + if (line[0] == '#') + continue; + + // format: <key>\t<value> + filter[line] = line; + } + } + } + + fullTable = new Hashtable(); + using(StreamReader reader = new StreamReader(txtPath)) + { + while (true) + { + int freq = 1; + string line = reader.ReadLine(); + if (line == null) + break; + if (line == "") + continue; + line = line.Trim(); + if (line[0] == '#') + continue; + string[] parts = line.Split('\t'); + + if (filter != null && !filter.ContainsKey(parts[0])) + continue; + + if (table.ContainsKey(parts[0])) + freq = (int) table[parts[0]]; + + if (!Regex.IsMatch(parts[0], @"[a-z]")) + { + // all caps, so must be assoc list + string[] keys = parts[1].Split(' '); + string[] values = line.Split(' ', '\t'); + for (int i = 1; i < keys.Length; i++) + Add(new Def(keys[i], freq, values)); + continue; + } + + Def def = new Def(parts[0], freq, parts[1].Split(';')); + Add(def); + } + } + + addPath = Regex.Replace(txtPath, @"\.txt$", " Additions.txt"); + if (File.Exists(addPath)) { + using(StreamReader reader = new StreamReader(addPath)) { + while (true) { + string line = reader.ReadLine(); + if (line == null) + break; + if (line == "") + continue; + line = line.Trim(); + if (line[0] == '#') + continue; + string[] parts = line.Split('\t'); + + // format: <key>\t<value> + string key = parts[0]; + string text = parts[1]; + additions.Add(new Def(key, text)); + if (fullTable.ContainsKey(key)) + { + ((Def) fullTable[key]).Values.Add(text); + } + } + } + } + + + logPath = Regex.Replace(txtPath, @"\.txt$", " Log.txt"); + if (File.Exists(logPath)) { + using(StreamReader reader = new StreamReader(logPath)) { + while (true) { + string line = reader.ReadLine(); + if (line == null) + break; + if (line == "") + continue; + line = line.Trim(); + if (line[0] == '#') + continue; + string[] parts = line.Split(':'); + if (parts.Length != 3) + continue; + parts = parts[2].Split('('); + if (parts.Length != 2) + continue; + line = parts[0].Trim(); + if (line == "") + continue; + + string key = line; + if (!fullTable.Contains(key)) { + continue; + } + history.Add(fullTable[key]); + this.label.Text += line + "\r\n"; + } + } + } + + initSize = uniq.Count; + increment = Math.Max(initSize / 20, 2); + decrement = Math.Max(increment / 3, 1); + maxval = Math.Max(initSize / 5, 2); + + this.label.Text += "Increment: " + increment + + "\r\nDecrement: " + decrement + + "\r\nUniques: " + uniq.Count + + "\r\nTotal: " + list.Count + + "\r\nMax Val: " + maxval + + "\r\nTimer: " + this.timer.Interval + "ms\r\n\r\n"; + + this.labelKey.Visible = false; + this.buttonDelay.Visible = false; + this.buttonShow.Visible = false; + this.buttonIncorrect.Visible = false; + this.buttonCorrect.Text = "Change &Timer"; + this.buttonOK.Text = "&Quiz Me Now"; + this.WindowState = FormWindowState.Normal; + this.MaximizeBox = true; + this.MinimizeBox = true; + } + + public Form1(Form1 parent, Def def) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + isDefault = false; + this.def = def; + this.labelKey.Text = def.Key; + this.parent = parent; + + int count = 0; + foreach (Def def2 in parent.list) + if (def2.Key == this.def.Key) + count ++; + this.labelKey.Text += " (" + count + ")"; + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.labelKey = new System.Windows.Forms.Label(); + this.timer = new System.Windows.Forms.Timer(this.components); + this.buttonOK = new System.Windows.Forms.Button(); + this.textBox = new System.Windows.Forms.TextBox(); + this.buttonCorrect = new System.Windows.Forms.Button(); + this.buttonIncorrect = new System.Windows.Forms.Button(); + this.panelButtons = new System.Windows.Forms.Panel(); + this.buttonShow = new System.Windows.Forms.Button(); + this.label = new System.Windows.Forms.TextBox(); + this.buttonDelay = new System.Windows.Forms.Button(); + this.panelButtons.SuspendLayout(); + this.SuspendLayout(); + // + // labelKey + // + this.labelKey.Cursor = System.Windows.Forms.Cursors.Default; + this.labelKey.Dock = System.Windows.Forms.DockStyle.Top; + this.labelKey.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.labelKey.Location = new System.Drawing.Point(10, 10); + this.labelKey.Name = "labelKey"; + this.labelKey.Size = new System.Drawing.Size(548, 38); + this.labelKey.TabIndex = 0; + // + // timer + // + this.timer.Interval = 300000; + this.timer.Tick += new System.EventHandler(this.timer_Tick); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(448, 8); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(96, 32); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // textBox + // + this.textBox.Dock = System.Windows.Forms.DockStyle.Top; + this.textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.textBox.Location = new System.Drawing.Point(10, 48); + this.textBox.Name = "textBox"; + this.textBox.Size = new System.Drawing.Size(548, 30); + this.textBox.TabIndex = 1; + this.textBox.Text = ""; + // + // buttonCorrect + // + this.buttonCorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCorrect.Location = new System.Drawing.Point(344, 8); + this.buttonCorrect.Name = "buttonCorrect"; + this.buttonCorrect.Size = new System.Drawing.Size(96, 32); + this.buttonCorrect.TabIndex = 4; + this.buttonCorrect.Text = "&Correct"; + this.buttonCorrect.Click += new System.EventHandler(this.buttonCorrect_Click); + // + // buttonIncorrect + // + this.buttonIncorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonIncorrect.Location = new System.Drawing.Point(240, 8); + this.buttonIncorrect.Name = "buttonIncorrect"; + this.buttonIncorrect.Size = new System.Drawing.Size(96, 32); + this.buttonIncorrect.TabIndex = 4; + this.buttonIncorrect.Text = "&D\'oh!"; + this.buttonIncorrect.Click += new System.EventHandler(this.buttonIncorrect_Click); + // + // panelButtons + // + this.panelButtons.Controls.Add(this.buttonShow); + this.panelButtons.Controls.Add(this.buttonOK); + this.panelButtons.Controls.Add(this.buttonCorrect); + this.panelButtons.Controls.Add(this.buttonIncorrect); + this.panelButtons.Controls.Add(this.buttonDelay); + this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panelButtons.Location = new System.Drawing.Point(10, 396); + this.panelButtons.Name = "panelButtons"; + this.panelButtons.Size = new System.Drawing.Size(548, 48); + this.panelButtons.TabIndex = 5; + // + // buttonShow + // + this.buttonShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonShow.Location = new System.Drawing.Point(136, 8); + this.buttonShow.Name = "buttonShow"; + this.buttonShow.Size = new System.Drawing.Size(96, 32); + this.buttonShow.TabIndex = 5; + this.buttonShow.Text = "&Show"; + this.buttonShow.Click += new System.EventHandler(this.buttonShow_Click); + // + // label + // + this.label.BackColor = System.Drawing.SystemColors.Window; + this.label.Dock = System.Windows.Forms.DockStyle.Fill; + this.label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.label.Location = new System.Drawing.Point(10, 78); + this.label.Multiline = true; + this.label.Name = "label"; + this.label.ReadOnly = true; + this.label.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.label.Size = new System.Drawing.Size(548, 318); + this.label.TabIndex = 6; + this.label.Text = ""; + this.label.WordWrap = false; + this.label.TextChanged += new System.EventHandler(this.label_TextChanged); + // + // buttonDelay + // + this.buttonDelay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDelay.Location = new System.Drawing.Point(32, 8); + this.buttonDelay.Name = "buttonDelay"; + this.buttonDelay.Size = new System.Drawing.Size(96, 32); + this.buttonDelay.TabIndex = 5; + this.buttonDelay.Text = "D&elay"; + this.buttonDelay.Click += new System.EventHandler(this.buttonDelay_Click); + // + // Form1 + // + this.AcceptButton = this.buttonOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(568, 454); + this.Controls.Add(this.label); + this.Controls.Add(this.panelButtons); + this.Controls.Add(this.textBox); + this.Controls.Add(this.labelKey); + this.DockPadding.All = 10; + this.KeyPreview = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form1"; + this.Text = "PopQuiz!"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); + this.Load += new System.EventHandler(this.Form1_Load); + this.Closed += new System.EventHandler(this.OnClosed); + this.panelButtons.ResumeLayout(false); + this.ResumeLayout(false); + + } + #endregion + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + public static void Main() + { + Application.Run(new Form1()); + + } + + private void OnClosed(object sender, System.EventArgs e) + { + if (this.isDefault) + { + Application.Exit(); + } + else + { + switch (this.status) + { + case Status.Neutral: + parent.Log(def.Key); + break; + case Status.Correct: + parent.Log(def.Key + " (correct)"); + break; + case Status.Incorrect: + parent.Log(def.Key + " (INCORRECT)"); + break; + } + lock(this.parent) + { + this.parent.buttonOK.Enabled = true; + this.parent.timer.Enabled = true; + } + } + } + + private void timer_Tick(object sender, System.EventArgs e) + { + lock(this) + { + if (!this.buttonOK.Enabled) + return; + this.buttonOK.Enabled = false; + } + + Def def; + this.timer.Enabled = false; + if (this.delayDef == null) { + while (true) { + int rand = new Random().Next(list.Count); + def = (Def) list[rand]; + bool wasRecent = false; + if (def.Freq <= uniq.Count / 40) { + for (int i = 0; i < uniq.Count / 2 && i < history.Count; i++) { + if (history[history.Count - i - 1] == def) { + wasRecent = true; + break; + } + } + } + if (!wasRecent) { + break; + } + } + } else { + def = this.delayDef; + } + history.Add(def); + this.delayDef = null; + Form1 form = new Form1(this, def); + form.Show(); + form.Activate(); + } + + private void buttonOK_Click(object sender, System.EventArgs e) + { + if (this.isDefault) + { + if (this.textBox.Text != "") + if (this.fullTable.ContainsKey(this.textBox.Text)) + this.delayDef = (Def) this.fullTable[this.textBox.Text]; + else + { + MessageBox.Show("Can't find word '" + this.textBox.Text + "'", "PopQuiz"); + return; + } + this.timer_Tick(null, null); + return; + } + + if ((DateTime.Now - this.spawnTime).Seconds <= 1) + { + MessageBox.Show("One second must have elapsed before you can hit Enter.", "Accidental Typing Protection"); + return; + } + if (!this.def.Contains(this.textBox.Text)) + { + this.undoFreq = this.def.Freq; + Incorrect(); + this.buttonShow.Text = "&Add definition"; + } + else + { + Correct(); + } + } + + private void Incorrect() + { + if (this.label.Text != "") + { + Close(); + return; + } + + int oldFreq = this.def.Freq; + this.def.Freq += parent.increment; + if (this.def.Freq > parent.maxval) + this.def.Freq = parent.maxval; + this.label.ForeColor = Color.Red; + ShowDef(oldFreq); + int inc = this.def.Freq - oldFreq; + for (int i = 0; i < inc; i++) + parent.list.Add(def); + + this.status = Status.Incorrect; + } + + private void ShowDef(int oldFreq) + { + this.label.Text = "\r\n"; + for (int i = 0; i < this.def.Values.Count; i++) + { + if (i == this.def.OrigCount) + this.label.Text += "\r\n"; + this.label.Text += (i+1) + ". " + this.def.Values[i] + "\r\n"; + } + + this.label.Text += "\r\n\r\nFreq: " + this.def.Freq + "/" + this.parent.list.Count; + if (oldFreq < this.def.Freq) + this.label.Text += " = " + oldFreq + " + " + (this.def.Freq - oldFreq); + else if (oldFreq > this.def.Freq) + this.label.Text += " = " + oldFreq + " - " + (oldFreq - this.def.Freq); + + if (oldFreq != this.def.Freq) + this.parent.Save(); + + this.buttonCorrect.Text = "Close"; + this.buttonIncorrect.Text = "Close"; + this.buttonShow.Text = "Close"; + this.buttonOK.Text = "&Close"; + } + + private void Correct() + { + Correct(false); + } + + private void Correct(bool isUndo) + { + if (this.label.Text != "" && !isUndo) + { + Close(); + return; + } + + int oldFreq = this.def.Freq; + if (isUndo) + this.def.Freq = undoFreq; + this.def.Freq -= parent.decrement; + if (this.def.Freq <= 1) + this.def.Freq = 1; + this.label.ForeColor = Color.Blue; + ShowDef(isUndo ? undoFreq : oldFreq); + int dec = oldFreq - this.def.Freq; + for (int i = 0; i < dec; i++) + parent.list.Remove(def); + this.status = Status.Correct; + if (isUndo) + undoFreq = 0; + } + + private void Add(Def def) + { + if (fullTable.ContainsKey(def.Key)) + { + Def oldDef = (Def) fullTable[def.Key]; + Debug.Assert(def.Freq == oldDef.Freq); + foreach (string val in def.Values) + if (!oldDef.Contains(val)) + oldDef.Values.Add(val); + } + else + { + fullTable[def.Key] = def; + for ( int i = 0; i < def.Freq; i++ ) + list.Add(def); + uniq.Add(def); + } + } + + private void Save() + { + using (FileStream stream = new FileStream(freqPath, FileMode.Create)) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + foreach (Def def in uniq) + if (def.Freq > 1) + writer.WriteLine(def.Freq + "\t" + def.Key); + } + } + } + + private void SaveAdditions() + { + using (FileStream stream = new FileStream(addPath, FileMode.Create)) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + foreach (Def def in additions) + writer.WriteLine(def.Key + "\t" + def.Values[0]); + } + } + } + + private void buttonCorrect_Click(object sender, System.EventArgs e) + { + if (!this.isDefault) + { + Correct(); + } + else + { + try + { + this.timer.Interval = int.Parse(this.textBox.Text); + Log("Updated timer to " + this.timer.Interval + "ms"); + } + catch + { + MessageBox.Show("Please specify a number.", "Timer Update"); + } + } + } + + private void Log(string text) + { + string line = DateTime.Now.ToString("t") + ": " + text; + this.label.Text += line + "\r\n"; + StreamWriter log = new StreamWriter(this.logPath, true); + log.WriteLine(line); + log.Close(); + } + + private void buttonIncorrect_Click(object sender, System.EventArgs e) + { + if (!this.isDefault) + { + Incorrect(); + } + } + + private void Form1_Load(object sender, System.EventArgs e) + { + if (!this.isDefault) + this.TopMost = true; + } + + private void buttonShow_Click(object sender, System.EventArgs e) + { + if (this.undoFreq > 0) + { + string text = this.textBox.Text.Trim(); + if (!this.def.Contains(text)) + { + this.parent.additions.Add(new Def(this.def.Key, text)); + this.def.Values.Add(text); + parent.SaveAdditions(); + } + + Correct(true); + return; + } + + if (this.label.Text != "") + { + Close(); + return; + } + + if (!this.isDefault) + ShowDef(this.def.Freq); + } + + private void label_TextChanged(object sender, System.EventArgs e) + { + this.label.SelectionStart = this.label.Text.Length; + this.label.ScrollToCaret(); + } + + private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) + { + if (!this.isDefault && e.KeyCode == Keys.Escape) + { + this.Close(); + } + } + + private void buttonDelay_Click(object sender, System.EventArgs e) + { + this.parent.delayDef = this.def; + Close(); + } + } + + + public class Def + { + private int origCount; + private string key; + private ArrayList values = new ArrayList(); // strings + private int freq; + private int correctCount; + private int incorrectCount; + + public Def(string key, string value) + { + this.key = key; + this.values.Add(value); + } + + public Def(string key, int freq, string[] values) + { + Debug.Assert(key != null && values != null && values.Length != 0 && freq > 0); + this.key = key.ToLower().Trim(); + this.freq = freq; + + // take out our current word + int i = 0; + for (i = 0; i < values.Length; i++) + { + string val = values[i].ToLower().Trim(); + if (val != key) + this.Values.Add(val); + } + + origCount = this.values.Count; + } + + public string Key + { + get + { + return key; + } + } + + public ArrayList Values + { + get + { + return values; + } + } + + public int Freq + { + get + { + return freq; + } + set + { + freq = value; + } + } + + public int IncorrectCount + { + get + { + return this.incorrectCount; + } + set + { + this.incorrectCount = value; + } + } + + public int CorrectCount + { + get + { + return this.correctCount; + } + set + { + this.correctCount = value; + } + } + + private string Simplify(string value) + { + value = Regex.Replace(value, @"\b(the|an|a)\b", ""); // remove articles + value = Regex.Replace(value, @"[ \.,-]+", ""); // remove spaces and punctuation + return value.ToLower(); + } + + public bool Contains(string value) + { + foreach (string val in values) + if (Simplify(val) == Simplify(value)) + return true; + return false; + } + + public int OrigCount + { + get + { + return origCount; + } + } + } +} \ No newline at end of file Added: pop-quiz/trunk/PopQuiz/Form1.resx =================================================================== --- pop-quiz/trunk/PopQuiz/Form1.resx (rev 0) +++ pop-quiz/trunk/PopQuiz/Form1.resx 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 1.3 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">1.3</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1">this is my long string</data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + [base64 mime encoded serialized .NET Framework object] + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + [base64 mime encoded string representing a byte array form of the .NET Framework object] + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used forserialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>1.3</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="labelKey.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="labelKey.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="labelKey.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="timer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="timer.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </data> + <data name="timer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="textBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="textBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="textBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonCorrect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonCorrect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonCorrect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonIncorrect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonIncorrect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonIncorrect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panelButtons.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="panelButtons.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panelButtons.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panelButtons.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="panelButtons.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panelButtons.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonShow.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonShow.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonShow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonDelay.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonDelay.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonDelay.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>(Default)</value> + </data> + <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Name"> + <value>Form1</value> + </data> + <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>80</value> + </data> + <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> +</root> \ No newline at end of file Added: pop-quiz/trunk/PopQuiz/PopQuiz.csproj =================================================================== --- pop-quiz/trunk/PopQuiz/PopQuiz.csproj (rev 0) +++ pop-quiz/trunk/PopQuiz/PopQuiz.csproj 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,119 @@ +<VisualStudioProject> + <CSHARP + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}" + > + <Build> + <Settings + ApplicationIcon = "App.ico" + AssemblyKeyContainerName = "" + AssemblyName = "PopQuiz" + AssemblyOriginatorKeyFile = "" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "WinExe" + PreBuildEvent = "" + PostBuildEvent = "" + RootNamespace = "PopQuiz" + RunPostBuildEvent = "OnBuildSuccess" + StartupObject = "" + > + <Config + Name = "Debug" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "DEBUG;TRACE" + DocumentationFile = "" + DebugSymbols = "true" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "false" + OutputPath = "bin\Debug\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + <Config + Name = "Release" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "TRACE" + DocumentationFile = "" + DebugSymbols = "false" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "true" + OutputPath = "bin\Release\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" + /> + <Reference + Name = "System.Data" + AssemblyName = "System.Data" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" + /> + <Reference + Name = "System.Drawing" + AssemblyName = "System.Drawing" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll" + /> + <Reference + Name = "System.Windows.Forms" + AssemblyName = "System.Windows.Forms" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll" + /> + <Reference + Name = "System.XML" + AssemblyName = "System.Xml" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" + /> + </References> + </Build> + <Files> + <Include> + <File + RelPath = "App.ico" + BuildAction = "Content" + /> + <File + RelPath = "AssemblyInfo.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Form1.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "Form1.resx" + DependentUpon = "Form1.cs" + BuildAction = "EmbeddedResource" + /> + </Include> + </Files> + </CSHARP> +</VisualStudioProject> + Added: pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user =================================================================== --- pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user (rev 0) +++ pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,48 @@ +<VisualStudioProject> + <CSHARP LastOpenVersion = "7.10.3077" > + <Build> + <Settings ReferencePath = "" > + <Config + Name = "Debug" + EnableASPDebugging = "false" + EnableASPXDebugging = "false" + EnableUnmanagedDebugging = "false" + EnableSQLServerDebugging = "false" + RemoteDebugEnabled = "false" + RemoteDebugMachine = "" + StartAction = "Project" + StartArguments = "" + StartPage = "" + StartProgram = "" + StartURL = "" + StartWorkingDirectory = "" + StartWithIE = "true" + /> + <Config + Name = "Release" + EnableASPDebugging = "false" + EnableASPXDebugging = "false" + EnableUnmanagedDebugging = "false" + EnableSQLServerDebugging = "false" + RemoteDebugEnabled = "false" + RemoteDebugMachine = "" + StartAction = "Project" + StartArguments = "" + StartPage = "" + StartProgram = "" + StartURL = "" + StartWorkingDirectory = "" + StartWithIE = "true" + /> + </Settings> + </Build> + <OtherProjectSettings + CopyProjectDestinationFolder = "" + CopyProjectUncPath = "" + CopyProjectOption = "0" + ProjectView = "ProjectFiles" + ProjectTrust = "0" + /> + </CSHARP> +</VisualStudioProject> + Added: pop-quiz/trunk/PopQuiz/PopQuiz.sln =================================================================== --- pop-quiz/trunk/PopQuiz/PopQuiz.sln (rev 0) +++ pop-quiz/trunk/PopQuiz/PopQuiz.sln 2008-07-02 06:32:54 UTC (rev 860) @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PopQuiz", "PopQuiz.csproj", "{D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}.Debug.ActiveCfg = Debug|.NET + {D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}.Debug.Build.0 = Debug|... [truncated message content] |