You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(128) |
Jun
(97) |
Jul
(13) |
Aug
(40) |
Sep
(50) |
Oct
(27) |
Nov
(7) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(18) |
Feb
(47) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
|
Sep
(14) |
Oct
(22) |
Nov
|
Dec
|
From: <br...@us...> - 2009-01-24 22:39:01
|
Revision: 462 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=462&view=rev Author: brus07 Date: 2009-01-24 22:38:57 +0000 (Sat, 24 Jan 2009) Log Message: ----------- Added new project for doing concrete connection to Web and can modification of this project to easy using other type and style of connection. Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Library/ConcreteConnector/ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties/ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.cs ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.csproj Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2009-01-17 21:05:36 UTC (rev 461) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2009-01-24 22:38:57 UTC (rev 462) @@ -33,6 +33,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubmitterGUIPlugin", "Plugins\TesterPlugins\SubmitterGUIPlugin\SubmitterGUIPlugin.csproj", "{E255910C-499D-48E2-9846-7EB24DE32C4A}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConcreteConnector", "ConcreteConnector", "{4E42F296-7321-4193-9E35-9B7202005229}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWebConnector", "Library\ConcreteConnector\SampleWebConnector\SampleWebConnector.csproj", "{45B4D72E-CD81-42A7-AD46-3471380A290F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,6 +91,10 @@ {E255910C-499D-48E2-9846-7EB24DE32C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU {E255910C-499D-48E2-9846-7EB24DE32C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU {E255910C-499D-48E2-9846-7EB24DE32C4A}.Release|Any CPU.Build.0 = Release|Any CPU + {45B4D72E-CD81-42A7-AD46-3471380A290F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45B4D72E-CD81-42A7-AD46-3471380A290F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45B4D72E-CD81-42A7-AD46-3471380A290F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45B4D72E-CD81-42A7-AD46-3471380A290F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -96,6 +104,7 @@ {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} {30C0EFA3-36A8-4C6F-8FEC-28F771D4933F} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} {4EB54D66-105B-4CFD-8883-CBE7CA70AFA5} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + {4E42F296-7321-4193-9E35-9B7202005229} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {69FB4176-F298-4AF7-B714-B6758AA9A58E} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} @@ -104,5 +113,6 @@ {8F305004-8FB7-4F85-8063-3A7041DB840F} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {79EB24DD-AF0D-40D0-974E-198F4D8C92BC} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {E255910C-499D-48E2-9846-7EB24DE32C4A} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} + {45B4D72E-CD81-42A7-AD46-3471380A290F} = {4E42F296-7321-4193-9E35-9B7202005229} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Library/ConcreteConnector ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector ___________________________________________________________________ Added: svn:ignore + bin obj SampleWebConnector.csproj.user Added: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/Properties/AssemblyInfo.cs 2009-01-24 22:38:57 UTC (rev 462) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("SampleWebConnector")] +[assembly: AssemblyDescription("http://acm.lviv.ua")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("AcmContester")] +[assembly: AssemblyProduct("SampleWebConnector")] +[assembly: AssemblyCopyright("Copyright © AcmContester 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b7266d48-2a23-40f7-85a8-e1f06ce11ce7")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.cs 2009-01-24 22:38:57 UTC (rev 462) @@ -0,0 +1,98 @@ +using System; +using AcmContester.Library.Connector.Getter; +using AcmContester.Library.LibraryExtention; +using AcmContester.Library.LibraryExtention.Data; +using System.Net; +using System.IO; + +namespace AcmContester.Library.ConcreateConnector.SampleWebConnector +{ + public class SampleWebConnector : IGetter + { + //"http://127.0.0.1/d"; + string fullPathToWebPages = ""; + + #region IGetter Members + + public string PathToSource + { + get + { + return fullPathToWebPages; + } + set + { + fullPathToWebPages = value; + } + } + + public SystemMessage GetData() + { + return new SystemMessage(GetFullInfoFromSite()); + } + + public void Send(SystemMessage message) + { + if (message.IsType("TestingResult") == true) + { + SendTestingResultToSite(message.Message); + } + } + + #endregion + + + void SendTestingResultToSite(string message) + { + string res = ""; + string id = ""; + string usedMemory = ""; + string usedTime = ""; + + //TODO: + Result result = Result.CreateFromXml(message); + res = result.res; + id = result.Submit.id.ToString(); + usedMemory = result.usedMemory.ToString(); + usedTime = result.usedTime.ToString(); + + string fullURL = fullPathToWebPages + "/set.php?"; + fullURL += "res=" + res; + fullURL += "&id=" + id; + fullURL += "&usedMemory=" + usedMemory; + fullURL += "&usedTime=" + usedTime; + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullURL); + myRequest.Method = "GET"; + WebResponse myResponse = myRequest.GetResponse(); + myResponse.Close(); + } + + + + string GetFullInfoFromSite() + { + string result = null; + try + { + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/get.php"); + myRequest.Method = "GET"; + //myRequest.Timeout = 100000; + WebResponse myResponse = myRequest.GetResponse(); + StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); + result = sr.ReadToEnd(); + sr.Close(); + myResponse.Close(); + if (result.Length == 0) + return null; + } + catch (WebException wex) + { + if (wex.Status == WebExceptionStatus.Timeout) + { + return "SystemResult: Timeout"; + } + } + return result; + } + } +} Added: ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Library/ConcreteConnector/SampleWebConnector/SampleWebConnector.csproj 2009-01-24 22:38:57 UTC (rev 462) @@ -0,0 +1,61 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{45B4D72E-CD81-42A7-AD46-3471380A290F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SampleWebConnector</RootNamespace> + <AssemblyName>SampleWebConnector</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SampleWebConnector.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Connector\Connector.csproj"> + <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> + <Name>Connector</Name> + </ProjectReference> + <ProjectReference Include="..\..\Data\Data.csproj"> + <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project> + <Name>Data</Name> + </ProjectReference> + <ProjectReference Include="..\..\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2009-01-17 21:05:36 UTC (rev 461) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2009-01-24 22:38:57 UTC (rev 462) @@ -6,6 +6,7 @@ using AcmContester.Library.LibraryExtention.Data; using System.Net; using System.Collections.Generic; +using AcmContester.Library.ConcreateConnector.SampleWebConnector; namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { @@ -14,6 +15,8 @@ //"http://127.0.0.1/d"; string fullPathToWebPages = ""; + IGetter getter = new SampleWebConnector(); + DataMediator container = new DataMediator(); public WebGetter() @@ -26,11 +29,13 @@ get { checkAddress(); + getter.PathToSource = fullPathToWebPages; return fullPathToWebPages; } set { fullPathToWebPages = value; + getter.PathToSource = value; } } @@ -39,7 +44,7 @@ if (fullPathToWebPages == "") { StreamReader s = new StreamReader("InDataW.txt", Encoding.Default); - fullPathToWebPages = s.ReadLine(); + PathToSource = s.ReadLine(); s.Close(); } } @@ -55,7 +60,11 @@ public void Send(SystemMessage message) { if (message.IsType("TestingResult") == true) - SendTestingResultToSite(message.Message); + { + Send(message); + Result result = Result.CreateFromXml(message.Message); + container.Return(result); + } //jaksho inakshyj typ, todi potribno bude inakshu funkciju vyklykaty } @@ -63,46 +72,22 @@ { get { + getter.PathToSource = fullPathToWebPages; return fullPathToWebPages; } set { fullPathToWebPages = value; + getter.PathToSource = fullPathToWebPages; } } #endregion - void SendTestingResultToSite(string message) - { - string res = ""; - string id = ""; - string usedMemory = ""; - string usedTime = ""; - //TODO: - Result result = Result.CreateFromXml(message); - res = result.res; - id = result.Submit.id.ToString(); - usedMemory = result.usedMemory.ToString(); - usedTime = result.usedTime.ToString(); - - string fullURL = fullPathToWebPages + "/set.php?"; - fullURL += "res=" + res; - fullURL += "&id=" + id; - fullURL += "&usedMemory=" + usedMemory; - fullURL += "&usedTime=" + usedTime; - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullURL); - myRequest.Method = "GET"; - WebResponse myResponse = myRequest.GetResponse(); - myResponse.Close(); - - container.Return(result); - } - SystemMessage GetMessageFromSite() { - string getAll = GetFullInfoFromSite(); + string getAll = getter.GetData().Message; if (String.IsNullOrEmpty(getAll) == true) return new SystemMessage("", "Empty"); if (getAll.Contains("submitList") == true) @@ -138,31 +123,5 @@ resultList.Items = result.ToArray(); return new SystemMessage(resultList.ToString(), "TestingSubmitList"); } - - string GetFullInfoFromSite() - { - string result = null; - try - { - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/get.php"); - myRequest.Method = "GET"; - //myRequest.Timeout = 100000; - WebResponse myResponse = myRequest.GetResponse(); - StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); - result = sr.ReadToEnd(); - sr.Close(); - myResponse.Close(); - if (result.Length == 0) - return null; - } - catch (WebException wex) - { - if (wex.Status == WebExceptionStatus.Timeout) - { - return "SystemResult: Timeout"; - } - } - return result; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Руслан Б. <br...@ma...> - 2009-01-17 22:56:54
|
Don't reply. Новые Карты@Mail.Ru с пробками и спутниками! http://r.mail.ru/cln4831/map.mail.ru/ |
From: <br...@us...> - 2009-01-17 21:05:37
|
Revision: 461 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=461&view=rev Author: brus07 Date: 2009-01-17 21:05:36 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Added events (RowAdding, RowAdded). Added xml docs to one methods. Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 12:19:20 UTC (rev 460) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 21:05:36 UTC (rev 461) @@ -50,8 +50,19 @@ } delegate void AddRowCallback(Message message); + + /// <summary> + /// \xC4\xEE\xE1\xE0\xE2\xEB\xE5\xED\xED\xFF \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF \xE4\xEE \xF1\xEF\xE8\xF1\xEA\xF3 \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xFC. + /// </summary> + /// <param name="message"> - \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF, \xFF\xEA\xE0 \xE4\xEE\xE1\xE0\xE2\xEB\xFF\xBA\xF2\xFC\xF1\xFF \xE4\xEE \xF1\xEF\xE8\xF1\xEA\xF3.</param> + /// <exception cref="ArgumentNullException">If message is null.</exception> public void AddRow(Message message) { + if (message == null) + { + throw new ArgumentNullException("message", "Can't be null"); + } + if (dataGridView.InvokeRequired) { AddRowCallback d = AddRow; @@ -59,8 +70,26 @@ } else { + OnRowAdding(message); AddRowInner(message); + OnRowAdded(message); } } + + public delegate void RowAddingDelegate(Message message); + public event RowAddingDelegate RowAdding; + private void OnRowAdding(Message message) + { + if (RowAdding != null) + RowAdding(message); + } + + public delegate void RowAddedDelegate(Message message); + public event RowAddedDelegate RowAdded; + private void OnRowAdded(Message message) + { + if (RowAdded != null) + RowAdded(message); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Di...@us...> - 2009-01-17 12:19:33
|
Revision: 460 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=460&view=rev Author: DixonD Date: 2009-01-17 12:19:20 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Some refactoring for LogDataGridView. Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 10:54:43 UTC (rev 459) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 12:19:20 UTC (rev 460) @@ -1,5 +1,4 @@ using System; -using System.Data; using System.Windows.Forms; using System.Collections.Generic; using System.Drawing; @@ -10,14 +9,14 @@ [ToolboxBitmap(typeof(LogDataGridView), "notas1.ico")] public partial class LogDataGridView : UserControl { - Type systemMessageType = null; + Type systemMessageType; public LogDataGridView() { InitializeComponent(); } - private void Init(IList<DataGridViewColumn> columns) + private void Init(IEnumerable<DataGridViewColumn> columns) { foreach(DataGridViewColumn column in columns) { @@ -28,12 +27,15 @@ private void AddRowInner(Message message) { if (message == null) - throw new ArgumentNullException("message", "Can't be null"); + { + throw new ArgumentNullException("message", "Can't be null."); + } if (systemMessageType == null) { systemMessageType = message.GetType(); Init(message.GetDataGridViewColumns()); } + if (message.GetType() != systemMessageType) throw new ArgumentException("Type of systemMessage must be equal", "message"); if (dataGridView.ColumnCount != message.GetValues().Length) @@ -50,10 +52,10 @@ delegate void AddRowCallback(Message message); public void AddRow(Message message) { - if (this.dataGridView.InvokeRequired) + if (dataGridView.InvokeRequired) { - AddRowCallback d = new AddRowCallback(AddRow); - this.Invoke(d, new object[] { message }); + AddRowCallback d = AddRow; + Invoke(d, new object[] { message }); } else { Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs 2009-01-17 10:54:43 UTC (rev 459) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs 2009-01-17 12:19:20 UTC (rev 460) @@ -7,15 +7,15 @@ { public class SystemMessage : Message { - string text; - SystemMessageMode mode; + readonly string text; + readonly SystemMessageMode mode; - private ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); - private ToolStripMenuItem toolStripMenuItemTime = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemDate = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemText = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemMode = new ToolStripMenuItem(); + private readonly ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); + private readonly ToolStripMenuItem toolStripMenuItemTime = new ToolStripMenuItem(); + private readonly ToolStripMenuItem toolStripMenuItemDate = new ToolStripMenuItem(); + private readonly ToolStripMenuItem toolStripMenuItemText = new ToolStripMenuItem(); + private readonly ToolStripMenuItem toolStripMenuItemMode = new ToolStripMenuItem(); private void InitContexMenu() { contextMenuStrip.Items.AddRange(new ToolStripItem[]{ @@ -23,7 +23,7 @@ toolStripMenuItemDate, toolStripMenuItemText, toolStripMenuItemMode}); - contextMenuStrip.Name = "ContexMenuStrip"; + contextMenuStrip.Name = "ContextMenuStrip"; contextMenuStrip.ShowCheckMargin = true; contextMenuStrip.ShowImageMargin = false; contextMenuStrip.Size = new Size(180, 92); @@ -31,22 +31,22 @@ toolStripMenuItemTime.Size = new Size(179, 22); toolStripMenuItemTime.Text = "Visible Time Column"; toolStripMenuItemTime.Checked = true; - toolStripMenuItemTime.Click += new EventHandler(toolStripMenuItem_Click); + toolStripMenuItemTime.Click += toolStripMenuItem_Click; toolStripMenuItemDate.Size = new Size(179, 22); toolStripMenuItemDate.Text = "Visible Date Column"; toolStripMenuItemDate.Checked = true; - toolStripMenuItemDate.Click += new EventHandler(toolStripMenuItem_Click); + toolStripMenuItemDate.Click += toolStripMenuItem_Click; toolStripMenuItemText.Size = new Size(179, 22); toolStripMenuItemText.Text = "Visible Text Column"; toolStripMenuItemText.Checked = true; - toolStripMenuItemText.Click += new EventHandler(toolStripMenuItem_Click); + toolStripMenuItemText.Click += toolStripMenuItem_Click; toolStripMenuItemMode.Size = new Size(179, 22); toolStripMenuItemMode.Text = "Visible Mode Columna"; toolStripMenuItemMode.Checked = true; - toolStripMenuItemMode.Click += new EventHandler(toolStripMenuItem_Click); + toolStripMenuItemMode.Click += toolStripMenuItem_Click; } void toolStripMenuItem_Click(object sender, EventArgs e) @@ -54,64 +54,21 @@ //Bug: jaksho shovaty vsi kolonky, todi ne mozna vidkryty ContextMenu ToolStripMenuItem toolStrip = (ToolStripMenuItem)sender; - if (toolStrip == toolStripMenuItemTime) + for (int i = 0; i < 4; ++i) { - if (toolStripMenuItemTime.Checked) + if (toolStrip == toolStripMenuItemTime) { - columns[0].Visible = false; - toolStripMenuItemTime.Checked = false; + if (i == 2 && !toolStripMenuItemText.Checked) + { + //Hack: jaksho shovaty, a potim vidobrazyty Text'ovu kolonky + // todi vysota rjadkiv stane defoltnoju, a ne roztjagnetsja avtomatom, po tekstu. + // Tomu roblju she taki dvi zminy, shob updejtnyty GridView + columns[1].Visible = !columns[1].Visible; + columns[1].Visible = !columns[1].Visible; + } + columns[i].Visible = toolStripMenuItemTime.Checked = !toolStripMenuItemTime.Checked; } - else - { - columns[0].Visible = true; - toolStripMenuItemTime.Checked = true; - } } - if (toolStrip == toolStripMenuItemDate) - { - if (toolStripMenuItemDate.Checked) - { - columns[1].Visible = false; - toolStripMenuItemDate.Checked = false; - } - else - { - columns[1].Visible = true; - toolStripMenuItemDate.Checked = true; - } - } - if (toolStrip == toolStripMenuItemText) - { - if (toolStripMenuItemText.Checked) - { - columns[2].Visible = false; - toolStripMenuItemText.Checked = false; - } - else - { - columns[2].Visible = true; - toolStripMenuItemText.Checked = true; - - //Hack: jaksho shovaty, a potim vidobrazyty Text'ovu kolonky - // todi vysota rjadkiv stane defoltnoju, a ne roztjagnetsja avtomatom, po tekstu. - // Tomu roblju she taki dvi zminy, shob updejtnyty GridView - columns[1].Visible = !columns[1].Visible; - columns[1].Visible = !columns[1].Visible; - } - } - if (toolStrip == toolStripMenuItemMode) - { - if (toolStripMenuItemMode.Checked) - { - columns[3].Visible = false; - toolStripMenuItemMode.Checked = false; - } - else - { - columns[3].Visible = true; - toolStripMenuItemMode.Checked = true; - } - } } IList<DataGridViewColumn> columns; @@ -124,26 +81,26 @@ DataGridViewColumn column = new DataGridViewTextBoxColumn(); column.Name = "Time"; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; + column.ContextMenuStrip = contextMenuStrip; result.Add(column); column = new DataGridViewTextBoxColumn(); column.Name = "Date"; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; + column.ContextMenuStrip = contextMenuStrip; result.Add(column); column = new DataGridViewTextBoxColumn(); column.Name = "Log text"; column.MinimumWidth = 150; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - column.ContextMenuStrip = this.contextMenuStrip; + column.ContextMenuStrip = contextMenuStrip; result.Add(column); column = new DataGridViewTextBoxColumn(); column.Name = "Mode"; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; + column.ContextMenuStrip = contextMenuStrip; result.Add(column); columns = result; @@ -155,52 +112,46 @@ this.text = text; try { - this.mode = (SystemMessageMode)Enum.Parse(typeof(SystemMessageMode), type, true); + mode = (SystemMessageMode)Enum.Parse(typeof(SystemMessageMode), type, true); } catch (ArgumentException) { - this.mode = SystemMessageMode.Other; + mode = SystemMessageMode.Other; } } public SystemMessage(string text, SystemMessageMode type) { this.text = text; - this.mode = type; + mode = type; } public override object[] GetValues() { object[] result = new object[4]; - result[0] = this.Time; - result[1] = this.Date; - result[2] = this.Text; - result[3] = this.Mode; + result[0] = Time; + result[1] = Date; + result[2] = Text; + result[3] = Mode; return result; } - private string Time + private static string Time { get { DateTime dt = DateTime.Now; - string result = ""; - result += dt.ToLongTimeString(); - result += "."; - result += dt.Millisecond.ToString(); - return result; + return dt.ToLongTimeString() + "." + dt.Millisecond; } } - private string Date + private static string Date { get { - DateTime dt = DateTime.Now; - string result = ""; - result += dt.ToShortDateString(); - return result; + return DateTime.Now.ToShortDateString(); } } + private string Text { get @@ -208,6 +159,7 @@ return text; } } + private string Mode { get This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-17 10:54:53
|
Revision: 459 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=459&view=rev Author: brus07 Date: 2009-01-17 10:54:43 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Change assembly to file version to 1.2.* Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs 2009-01-17 10:53:07 UTC (rev 458) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs 2009-01-17 10:54:43 UTC (rev 459) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.*")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.*")] +[assembly: AssemblyFileVersion("1.2.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-17 10:53:19
|
Revision: 458 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=458&view=rev Author: brus07 Date: 2009-01-17 10:53:07 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Added icon to projects. Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj Added Paths: ----------- smallprojects/sps/brus07/LogDataGridView/trunk/resources/ smallprojects/sps/brus07/LogDataGridView/trunk/resources/notas1.ico Added: smallprojects/sps/brus07/LogDataGridView/trunk/resources/notas1.ico =================================================================== (Binary files differ) Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/resources/notas1.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 10:52:35 UTC (rev 457) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-17 10:53:07 UTC (rev 458) @@ -2,10 +2,12 @@ using System.Data; using System.Windows.Forms; using System.Collections.Generic; +using System.Drawing; namespace sps.brus07.LogDataGridView { + [ToolboxBitmap(typeof(LogDataGridView), "notas1.ico")] public partial class LogDataGridView : UserControl { Type systemMessageType = null; Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-17 10:52:35 UTC (rev 457) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-17 10:53:07 UTC (rev 458) @@ -51,6 +51,11 @@ <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="..\..\resources\notas1.ico"> + <Link>notas1.ico</Link> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Di...@us...> - 2009-01-17 10:52:40
|
Revision: 457 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=457&view=rev Author: DixonD Date: 2009-01-17 10:52:35 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Some refactoring was done. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs ACMServer/trunk/ACMServer/Library/Data/Result.cs ACMServer/trunk/ACMServer/Library/Data/Submit.cs ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/Configuration.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/IniFile.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/Log.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/Reader.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlSerializer.cs ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlValidator.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernel.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernelGUI.cs ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs ACMServer/trunk/ACMServer/Runner/Class1.cs ACMServer/trunk/ACMServer/Tester/Form1.cs ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs ACMServer/trunk/ACMServer/Tester/Library/WorkMediator.cs ACMServer/trunk/ACMServer/Tester/Library/WorkRunner.cs ACMServer/trunk/ACMServer/Tester/Program.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetterOld.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,10 +1,4 @@ using System; -using System.Threading; -using System.Windows.Forms; -using System.Net; -using System.IO; -using System.Text; -using AcmContester.Library.LibraryExtention.Data; using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector.Getter Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketClient.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,4 +1,3 @@ -using System; using JadBenAutho.EasySocket; using AcmContester.Library.LibraryExtention; @@ -6,14 +5,14 @@ { public class SocketClient: AbstractConnector { - string ip = "127.0.0.1"; - int port = 4120; + readonly string ip = "127.0.0.1"; + readonly int port = 4120; EasyClient client; void init() { - client = new EasyClient(new ServerInfo(this.ip, this.port, true)); + client = new EasyClient(new ServerInfo(ip, port, true)); client.DataArrived += DataArrived; } @@ -23,13 +22,13 @@ } public SocketClient(string IP) { - this.ip = IP; + ip = IP; init(); } public SocketClient(string IP, int Port) { - this.ip = IP; - this.port = Port; + ip = IP; + port = Port; init(); } @@ -37,7 +36,7 @@ { if (client == null) { - client = new EasyClient(new ServerInfo(this.ip, this.port, true)); + client = new EasyClient(new ServerInfo(ip, port, true)); } if (client.IsConnected == false) client.ConnectToServerAsync(); @@ -46,7 +45,7 @@ { if (client != null) { - if (client.IsConnected == true) + if (client.IsConnected) client.DisconnectFromServer(); client.Dispose(); client = null; Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,24 +1,23 @@ -using System; using AcmContester.Library.LibraryExtention; namespace AcmContester.Library.Connector { public class SocketClientTask: AbstractConnector { - SocketClient client; + readonly SocketClient client; private string descriptionMessage = ""; public SocketClientTask(string IP) { client = new SocketClient(IP); - client.onDataArrived +=new SocketClient.DataArrivedDelegate(SocketClientGate_onDataArrived); + client.onDataArrived +=SocketClientGate_onDataArrived; } void SocketClientGate_onDataArrived(SystemMessage message) { - if (message.IsType("SystemTestBusyMessage") == true) + if (message.IsType("SystemTestBusyMessage")) { - if (SystemMessageX(message) == true) + if (SystemMessageX(message)) return; } @@ -38,21 +37,13 @@ if (mes[0] == "test") { OnAddLogText("SystemReceive", message); - string result = ""; - if (IsBusy() == true) - { - result = "busy"; - } - else - { - result = "free"; - } + string result = IsBusy() ? "busy" : "free"; for (int i = 1; i < mes.Length; i++) { result += " " + mes[i]; } OnAddLogText("SystemSend", result); - this.Send(new SystemMessage(result, _message.Type, _message.Description)); + Send(new SystemMessage(result, _message.Type, _message.Description)); return true; } return false; Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServer.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -6,7 +6,7 @@ { public class SocketServer: AbstractConnector { - int port = 4120; + readonly int port = 4120; EasyServer server; private void init() @@ -21,7 +21,7 @@ } public SocketServer(int Port) { - this.port = Port; + port = Port; init(); } Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -6,13 +6,13 @@ { public class SocketServerTask: AbstractConnector { - SocketServer server; + readonly SocketServer server; //val: //free - vilnyj //busy - zajnjatyj //unknown - nevidomyj - Dictionary<int, string> cleintStatus = new Dictionary<int, string>(); + readonly Dictionary<int, string> clientStatus = new Dictionary<int, string>(); public SocketServerTask() @@ -49,23 +49,23 @@ { //TODO: dlja cjogo bulo potribno pidkljuchyty EasySocket // potim ne zabuty jogo vidjednaty vid chogo proektu - cleintStatus[server.ClientsList[clientIndex].GetHashCode()] = "busy"; + clientStatus[server.ClientsList[clientIndex].GetHashCode()] = "busy"; message.Description = server.ClientsList[clientIndex].GetHashCode().ToString(); ServerSend(message, clientIndex); } private void DataArrived(SystemMessage sysMes) { - if (sysMes.IsType("SystemTestBusyMessage") == true) + if (sysMes.IsType("SystemTestBusyMessage")) { - if (SystemMessageX(sysMes) == true) + if (SystemMessageX(sysMes)) return; } DataArriver(sysMes); } protected virtual void DataArriver(SystemMessage message) { - cleintStatus[Int32.Parse(message.Description)] = "free"; + clientStatus[Int32.Parse(message.Description)] = "free"; OnDataArrived(message); } @@ -75,7 +75,7 @@ } - Queue<string> q = new Queue<string>(); + readonly Queue<string> q = new Queue<string>(); /// <summary> /// \xCF\xEE\xE2\xE5\xF0\xF2\xE0\xBA \xF1\xEF\xE8\xF1\xEE\xEA \xE2\xB3\xEB\xFC\xED\xE8\xF5 \xF2\xE5\xF1\xF2\xE5\xF0\xB3\xE2. @@ -97,14 +97,14 @@ string curHashCode = DateTime.Now.GetHashCode().ToString(); for (int i = 0; i < server.CountClients; i++) { - if (cleintStatus.ContainsKey(server.ClientsList[i].GetHashCode()) == false) + if (clientStatus.ContainsKey(server.ClientsList[i].GetHashCode()) == false) { - cleintStatus[server.ClientsList[i].GetHashCode()] = "unknown"; + clientStatus[server.ClientsList[i].GetHashCode()] = "unknown"; } - if (cleintStatus[server.ClientsList[i].GetHashCode()] == "unknown") + if (clientStatus[server.ClientsList[i].GetHashCode()] == "unknown") { string message = "test"; - message += " " + server.ClientsList[i].GetHashCode().ToString(); + message += " " + server.ClientsList[i].GetHashCode(); message += " " + curHashCode; SystemMessage mes = new SystemMessage(message, "SystemTestBusyMessage"); ServerSend(mes, i); @@ -115,7 +115,7 @@ Dictionary<string, int> preResult = new Dictionary<string, int>(); while (server != null && preResult.Count < server.CountClients) { - if (((TimeSpan)(DateTime.Now - start)).TotalSeconds > 1.0) + if ((DateTime.Now - start).TotalSeconds > 1.0) { break; } @@ -129,14 +129,14 @@ string[] mes = curStr.Split(chars); if (mes[0] == "free" && curHashCode == mes[2]) { - cleintStatus[Int32.Parse(mes[1])] = "free"; + clientStatus[Int32.Parse(mes[1])] = "free"; preResult.Add(mes[1], 0); } else { if (mes[0] == "busy") { - cleintStatus[Int32.Parse(mes[1])] = "busy"; + clientStatus[Int32.Parse(mes[1])] = "busy"; } } } @@ -147,9 +147,9 @@ List<int> result = new List<int>(); for (int i = 0; i < server.CountClients; i++) { - if (cleintStatus.ContainsKey(server.ClientsList[i].GetHashCode()) == false) - cleintStatus[server.ClientsList[i].GetHashCode()] = "unknown"; - if (cleintStatus[server.ClientsList[i].GetHashCode()] == "free") + if (clientStatus.ContainsKey(server.ClientsList[i].GetHashCode()) == false) + clientStatus[server.ClientsList[i].GetHashCode()] = "unknown"; + if (clientStatus[server.ClientsList[i].GetHashCode()] == "free") result.Add(i); //string hashCode = server.ClientsList[i].GetHashCode().ToString(); //if (preResult.ContainsKey(hashCode) == true) Modified: ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Connector/WebConnector.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -7,12 +7,12 @@ { public class WebConnector: AbstractConnector { - Timer timer = new Timer(); + readonly Timer timer = new Timer(); public event EventHandler onChecking; public event EventHandler onChecked; - private IGetter getter = new WebGetterOld(); + private readonly IGetter getter = new WebGetterOld(); private WebConnector() { @@ -29,17 +29,15 @@ private void InitTimer() { timer.Interval = 10 * 1000; - timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); + timer.Elapsed += OnTimedEvent; timer.Enabled = true; } public string Address { - //TODO: get { - return getter.PathToSource; } set Modified: ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Data/DataMediator.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -8,7 +8,7 @@ { private int secondToLive = 60; - private Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); + private readonly Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); public int SecondToLive { @@ -74,7 +74,7 @@ public void Return(Result data) { DeleteOld(); - if (Contains(data.Submit.GetHashCode()) == true) + if (Contains(data.Submit.GetHashCode())) { d.Remove(data.Submit.GetHashCode()); } Modified: ACMServer/trunk/ACMServer/Library/Data/Result.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Result.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Data/Result.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,4 +1,3 @@ -using System; using System.Xml.Serialization; using AcmContester.AcmLibraryExtention.XML; @@ -29,16 +28,13 @@ [XmlElement("usedMemory", typeof(int))] public int usedMemory; - string temp; + readonly string temp; - private Result() - { - } - public Result(Submit ssubmit) { submit = ssubmit; } + public Result(string message) { //TODO @@ -58,8 +54,7 @@ } public string ToStringX() { - string result = XmlSerializer<Result>.Serialization(this); - return result; + return XmlSerializer<Result>.Serialization(this); } } } Modified: ACMServer/trunk/ACMServer/Library/Data/Submit.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Submit.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Data/Submit.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,7 +1,5 @@ using System; using AcmContester.AcmLibraryExtention.XML; -using System.IO; -using System.Xml; using System.Xml.Serialization; namespace AcmContester.Library.LibraryExtention.Data Modified: ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -8,7 +8,7 @@ [XmlRoot("submitList")] public class SubmitList { - ArrayList listSubmits; + readonly ArrayList listSubmits; public SubmitList() { @@ -37,7 +37,7 @@ set { if (value == null) return; - Submit[] submits = (Submit[])value; + Submit[] submits = value; listSubmits.Clear(); foreach (Submit item in submits) listSubmits.Add(item); Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/Configuration.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/Configuration.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/Configuration.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -6,7 +6,7 @@ { public static string ExecutablePath; - static readonly string defaultConfigFileName = "config.ini"; + private const string defaultConfigFileName = "config.ini"; static public string DefaultConfigFileName { get @@ -37,7 +37,7 @@ { get { - if (String.IsNullOrEmpty(mainFormName) == true) + if (String.IsNullOrEmpty(mainFormName)) return "MainForm"; return mainFormName; } @@ -49,7 +49,7 @@ private static string LoadStringFromDifferentFile(string sectionName, string keyName) { - string defaultString = "#$%^$343@#$"; + const string defaultString = "#$%^$343@#$"; string result = defaultString; if (concreteConfigFileName != null) { Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/IniFile.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/IniFile.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/IniFile.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -26,7 +26,7 @@ public const int MaxSectionSize = 32767; // 32 KB //The path of the file we are operating on. - private string m_path; + private readonly string m_path; #region P/Invoke declares @@ -132,7 +132,7 @@ private string[] GetArreyKeys(string sectionName, string keyName) { - string[] allKeys = this.GetKeyNames(sectionName); + string[] allKeys = GetKeyNames(sectionName); List<string> list = new List<string>(); for (int i = 0; i < allKeys.Length; i++) { @@ -172,13 +172,13 @@ if (keyName == null) throw new ArgumentNullException("keyName"); - StringBuilder retval = new StringBuilder(IniFile.MaxSectionSize); + StringBuilder retval = new StringBuilder(MaxSectionSize); NativeMethods.GetPrivateProfileString(sectionName, keyName, defaultValue, retval, - IniFile.MaxSectionSize, + MaxSectionSize, m_path); return retval.ToString(); @@ -252,7 +252,7 @@ { string retval = GetString(sectionName, keyName, ""); - if (retval == null || retval.Length == 0) + if (string.IsNullOrEmpty(retval)) { return defaultValue; } @@ -296,23 +296,20 @@ /// </exception> public List<KeyValuePair<string, string>> GetSectionValuesAsList(string sectionName) { - List<KeyValuePair<string, string>> retval; string[] keyValuePairs; - string key, value; - int equalSignPos; if (sectionName == null) throw new ArgumentNullException("sectionName"); //Allocate a buffer for the returned section names. - IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize); + IntPtr ptr = Marshal.AllocCoTaskMem(MaxSectionSize); try { //Get the section key/value pairs into the buffer. int len = NativeMethods.GetPrivateProfileSection(sectionName, ptr, - IniFile.MaxSectionSize, + MaxSectionSize, m_path); keyValuePairs = ConvertNullSeperatedStringToStringArray(ptr, len); @@ -324,17 +321,17 @@ } //Parse keyValue pairs and add them to the list. - retval = new List<KeyValuePair<string, string>>(keyValuePairs.Length); + List<KeyValuePair<string, string>> retval = new List<KeyValuePair<string, string>>(keyValuePairs.Length); for (int i = 0; i < keyValuePairs.Length; ++i) { //Parse the "key=value" string into its constituent parts - equalSignPos = keyValuePairs[i].IndexOf('='); + int equalSignPos = keyValuePairs[i].IndexOf('='); - key = keyValuePairs[i].Substring(0, equalSignPos); + string key = keyValuePairs[i].Substring(0, equalSignPos); - value = keyValuePairs[i].Substring(equalSignPos + 1, - keyValuePairs[i].Length - equalSignPos - 1); + string value = keyValuePairs[i].Substring(equalSignPos + 1, + keyValuePairs[i].Length - equalSignPos - 1); retval.Add(new KeyValuePair<string, string>(key, value)); } @@ -363,13 +360,10 @@ /// </exception> public Dictionary<string, string> GetSectionValues(string sectionName) { - List<KeyValuePair<string, string>> keyValuePairs; - Dictionary<string, string> retval; + List<KeyValuePair<string, string>> keyValuePairs = GetSectionValuesAsList(sectionName); - keyValuePairs = GetSectionValuesAsList(sectionName); - //Convert list into a dictionary. - retval = new Dictionary<string, string>(keyValuePairs.Count); + Dictionary<string, string> retval = new Dictionary<string, string>(keyValuePairs.Count); foreach (KeyValuePair<string, string> keyValuePair in keyValuePairs) { @@ -403,24 +397,23 @@ /// </exception> public string[] GetKeyNames(string sectionName) { - int len; string[] retval; if (sectionName == null) throw new ArgumentNullException("sectionName"); //Allocate a buffer for the returned section names. - IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize); + IntPtr ptr = Marshal.AllocCoTaskMem(MaxSectionSize); try { //Get the section names into the buffer. - len = NativeMethods.GetPrivateProfileString(sectionName, - null, - null, - ptr, - IniFile.MaxSectionSize, - m_path); + int len = NativeMethods.GetPrivateProfileString(sectionName, + null, + null, + ptr, + MaxSectionSize, + m_path); retval = ConvertNullSeperatedStringToStringArray(ptr, len); } @@ -444,16 +437,15 @@ public string[] GetSectionNames() { string[] retval; - int len; //Allocate a buffer for the returned section names. - IntPtr ptr = Marshal.AllocCoTaskMem(IniFile.MaxSectionSize); + IntPtr ptr = Marshal.AllocCoTaskMem(MaxSectionSize); try { //Get the section names into the buffer. - len = NativeMethods.GetPrivateProfileSectionNames(ptr, - IniFile.MaxSectionSize, m_path); + int len = NativeMethods.GetPrivateProfileSectionNames(ptr, + MaxSectionSize, m_path); retval = ConvertNullSeperatedStringToStringArray(ptr, len); } @@ -627,7 +619,7 @@ //Write new element into INI file for (int i = 0; i < values.Length; i++) { - string newKey = keyName + "." + i.ToString(); + string newKey = keyName + "." + i; WriteValue(sectionName, newKey, values[i]); } Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/Log.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/Log.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/Log.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -8,7 +8,7 @@ /// </summary> public class Log { - private static Log instance = new Log(); + private static readonly Log instance = new Log(); private StreamWriter writer; Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/Reader.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/Reader.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/Reader.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -6,17 +6,17 @@ { public class Reader { - static Dictionary<string, string> strings = new Dictionary<string, string>(); + static readonly Dictionary<string, string> strings = new Dictionary<string, string>(); public static string ReadString(string fileName, bool cash) { string text = null; if (cash == false || strings.ContainsKey(fileName) == false) { text = ReadString(fileName); - if (cash == true) + if (cash) strings[fileName] = text; } - if (cash == true) + if (cash) { text = strings[fileName]; } Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/SystemMessage.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -8,7 +8,7 @@ [Serializable] public class SystemMessage { - string type = ""; + readonly string type = ""; public string Type { @@ -18,7 +18,7 @@ } } - string message = ""; + readonly string message = ""; public string Message { @@ -43,9 +43,9 @@ public SystemMessage(SystemMessage sysMes) { - this.message = sysMes.Message; - this.type = sysMes.Type; - this.description = sysMes.Description; + message = sysMes.Message; + type = sysMes.Type; + description = sysMes.Description; } public SystemMessage(string message) Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlHelper.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Xml; using AcmContester.Library.LibraryExtention; @@ -45,24 +44,19 @@ /// <exception cref="ArgumentException"></exception> public static T GetObject<T>(string fullXml, string xmlPath, string pathToSchemaFile) where T: class { - if (fullXml == null) - throw new ArgumentNullException("Can't be null", "fullXml"); - if (fullXml == null) - throw new ArgumentException("Can't be empty", "fullXml"); - if (xmlPath == null) - throw new ArgumentNullException("Can't be null", "xmlPath"); - if (xmlPath == null) - throw new ArgumentException("Can't be empty", "xmlPath"); - if (pathToSchemaFile == null) - throw new ArgumentNullException("Can't be null. You can use other method without this parameter", "pathToSchemaFile"); - if (pathToSchemaFile == null) - throw new ArgumentException("Can't be null. You can use other method without this parameter", "pathToSchemaFile"); + + if (String.IsNullOrEmpty(fullXml)) + throw new ArgumentNullException("fullXml", "Can't be null or empty string."); + if (String.IsNullOrEmpty(xmlPath)) + throw new ArgumentNullException("xmlPath", "Can't be null or empty string."); + if (String.IsNullOrEmpty(pathToSchemaFile)) + throw new ArgumentNullException("pathToSchemaFile", "Can't be null or empty string."); - fullXml = XmlHelper.GetOuterXmlOfSingleNodeFromXpath(fullXml, xmlPath); - if (fullXml == null || fullXml == "") + fullXml = GetOuterXmlOfSingleNodeFromXpath(fullXml, xmlPath); + if (string.IsNullOrEmpty(fullXml)) return null; string schema = Reader.ReadString(pathToSchemaFile); - if (XmlHelper.ValidateXmlWithSchema(fullXml, schema) == false) + if (ValidateXmlWithSchema(fullXml, schema) == false) return null; T result = XmlSerializer<T>.Load(fullXml); @@ -80,17 +74,13 @@ /// <exception cref="ArgumentException"></exception> public static T GetObject<T>(string fullXml, string xmlPath) where T : class { - if (fullXml == null) - throw new ArgumentNullException("fullXml", "Can't be null"); - if (fullXml == null) - throw new ArgumentException("fullXml", "Can't be empty"); - if (xmlPath == null) - throw new ArgumentNullException("xmlPath", "Can't be null"); - if (xmlPath == null) - throw new ArgumentException("xmlPath", "Can't be empty"); + if (String.IsNullOrEmpty(fullXml)) + throw new ArgumentNullException("fullXml", "Can't be null or empty string."); + if (String.IsNullOrEmpty(xmlPath)) + throw new ArgumentNullException("xmlPath", "Can't be null or empty string."); - fullXml = XmlHelper.GetOuterXmlOfSingleNodeFromXpath(fullXml, xmlPath); - if (fullXml == null || fullXml == "") + fullXml = GetOuterXmlOfSingleNodeFromXpath(fullXml, xmlPath); + if (string.IsNullOrEmpty(fullXml)) return null; T result = XmlSerializer<T>.Load(fullXml); Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlSerializer.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlSerializer.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlSerializer.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Text; using System.IO; @@ -21,10 +20,9 @@ public static T Load(string message) { // Deserialization - T result; TextReader r = new StringReader(message); System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(T)); - result = (T)serializer.Deserialize(r); + T result = (T)serializer.Deserialize(r); r.Close(); return result; } Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlValidator.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlValidator.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/XML/XmlValidator.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -7,7 +7,7 @@ { class XmlValidator { - string xmlDocument; + readonly string xmlDocument; bool validity; @@ -19,10 +19,8 @@ public bool Validate(string xmlSchema) { - XmlSchema schema = new XmlSchema(); - schema = XmlSchema.Read(new StringReader(xmlSchema), ValidationXmlSchemaCallBack); + XmlSchema schema = XmlSchema.Read(new StringReader(xmlSchema), ValidationXmlSchemaCallBack); - // Create the XmlSchemaSet class. XmlSchemaSet schemas = new XmlSchemaSet(); @@ -33,7 +31,7 @@ XmlReaderSettings settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Schema; settings.Schemas = schemas; - settings.ValidationEventHandler += new ValidationEventHandler(ValidationXmlCallBack); + settings.ValidationEventHandler += ValidationXmlCallBack; // Create the XmlReader object. XmlReader reader = XmlReader.Create(new StringReader(xmlDocument), settings); @@ -41,13 +39,15 @@ validity = true; // Parse the file. - while (reader.Read() && validity) ; + while (reader.Read() && validity) + { + } return validity; } // Happen validation errors when read XmlSchema - private void ValidationXmlSchemaCallBack(object sender, ValidationEventArgs e) + private static void ValidationXmlSchemaCallBack(object sender, ValidationEventArgs e) { throw new XmlSchemaException(e.Message); } Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/BaseMediatorPlugin.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -14,7 +14,7 @@ public abstract void Send(SystemMessage message); - private UserControl control = null; + private UserControl control; public UserControl Control { Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernel.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernel.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernel.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,6 +1,4 @@ using System; -using System.Collections; -using AcmContester.Plugins.PluginsFramework; using System.Collections.Generic; using System.Windows.Forms; using AcmContester.Library.LibraryExtention; @@ -14,8 +12,8 @@ public sealed class ControlEventArgs : EventArgs { - Control control; - string name; + readonly Control control; + readonly string name; public ControlEventArgs(Control in_Control, string in_Name) { control = in_Control; @@ -54,7 +52,7 @@ plugin.onDataArrived += DataArrivedFromTesterList; if (plugin.Control != null) { - this.OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); + OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); } } } @@ -66,7 +64,7 @@ plugin.onDataArrived += DataArrivedFromClientList; if (plugin.Control != null) { - this.OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); + OnAddControl(new ControlEventArgs(plugin.Control, plugin.GetType().Name)); } } } @@ -84,7 +82,7 @@ { for (int index = 0; index < testerSideList.Count; index++) { - ((BaseMediatorPlugin)testerSideList[index]).Send(message); + testerSideList[index].Send(message); } } } @@ -94,7 +92,7 @@ { for (int index = 0; index < clientSideList.Count; index++) { - ((BaseMediatorPlugin)clientSideList[index]).Send(message); + clientSideList[index].Send(message); } } } Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernelGUI.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernelGUI.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/MediatorKernelGUI.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,18 +1,13 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; using System.Windows.Forms; -using AcmContester.Plugins.PluginsFramework; using AcmContester.Library.LibraryExtention; namespace AcmContester.Plugins.PluginsFramework { public partial class MediatorKernelGUI : UserControl { - MediatorKernel mediator = new MediatorKernel(); + readonly MediatorKernel mediator = new MediatorKernel(); private MediatorKernelGUI() { @@ -43,17 +38,17 @@ string testerFolderPath = list[0]; string clientFolderPath = list[1]; - mediator.AddControl += new EventHandler<MediatorKernel.ControlEventArgs>(mediator_AddControl); + mediator.AddControl += mediator_AddControl; mediator.LoadLists(testerFolderPath, clientFolderPath); } private delegate void AddControlCallback(object sender, MediatorKernel.ControlEventArgs e); private void mediator_AddControl(object sender, MediatorKernel.ControlEventArgs e) { - if (this.tabControl1.InvokeRequired) + if (tabControl1.InvokeRequired) { - AddControlCallback d = new AddControlCallback(mediator_AddControl); - this.Invoke(d, new object[] { sender, e }); + AddControlCallback d = mediator_AddControl; + Invoke(d, new object[] { sender, e }); } else { Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -57,7 +57,6 @@ /// add them to provided list.</para> /// </summary> /// <param name="filename">Which file to scan.</param> - /// <param name="lst">Where to add found objects.</param> public static List<T> ScanAndLoad(string filename) { List<T> lst = new List<T>(); @@ -86,15 +85,15 @@ if (t.GetInterface(typeof(T).FullName) != null || t.IsSubclassOf(typeof(T))) lst.Add((T)Activator.CreateInstance(t)); } - catch (System.Reflection.TargetInvocationException) + catch (TargetInvocationException) { //throw ex; } - catch (System.MissingMethodException) + catch (MissingMethodException) { //throw ex; } - catch (System.InvalidCastException) + catch (InvalidCastException) { //throw ex; } Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.IO; using AcmContester.Library.LibraryExtention; using AcmContester.Library.LibraryExtention.Data; @@ -38,14 +37,13 @@ string code = submit.sourceCode; code = HtmlEntityDecode(code); int language = submit.language; - string id = submit.id.ToString(); Result result = new Result(submit); try { //Console.SetOut(File.CreateText("logout.txt")); string[] data = File.ReadAllLines("InData.txt"); - data[2] = data[2] + submit.pbolemID.ToString() + "\\"; + data[2] = data[2] + submit.pbolemID + "\\"; string src = code; TestEnv test = new TestEnv(src, language, data[1], data[2]); test.Compile(); @@ -59,13 +57,13 @@ log.Loging("-------------------END SOURCE---------------------------", Log.Priority.INFO); Console.WriteLine("-------------------END SOURCE---------------------------"); - log.Loging(String.Format("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result.ToString(), test.comp.Details, test.comp.UsedTime), Log.Priority.INFO); - Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result.ToString(), test.comp.Details, test.comp.UsedTime); + log.Loging(String.Format("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result, test.comp.Details, test.comp.UsedTime), Log.Priority.INFO); + Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result, test.comp.Details, test.comp.UsedTime); log.Loging(String.Format("Comp Output: {0}", test.comp.CompilerOutput), Log.Priority.INFO); Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); - if (test.comp.Result == Test.CompRes.OK) + if (test.comp.Result == CompRes.OK) { SecureType secureType = SecureType.Double; try @@ -91,7 +89,7 @@ //TODO: result.res = test.comp.Result.ToString(); - if (test.comp.Result == Test.CompRes.OK) + if (test.comp.Result == CompRes.OK) { int usedTime = -1; int usedMemory = -1; @@ -117,7 +115,7 @@ } catch (Exception tex) { - log.Loging("Runner:GetResult - Exception (" + tex.ToString() + ": " + tex.Message, Log.Priority.INFO); + log.Loging("Runner:GetResult - Exception (" + tex + ": " + tex.Message, Log.Priority.INFO); log.Loging(tex.StackTrace, Log.Priority.INFO); result.res = "Exception"; } Modified: ACMServer/trunk/ACMServer/Tester/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Form1.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Tester/Form1.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; using System.IO; using AcmContester.Tester.Library; @@ -35,7 +32,7 @@ tabPage3.Controls.Add(view); } - DataTable tableLog = new DataTable(); + readonly DataTable tableLog = new DataTable(); private void initGrid() { tableLog.Columns.Add(new DataColumn("Time")); @@ -66,7 +63,7 @@ Disconnect(); } - private void Disconnect() + private static void Disconnect() { if (socket != null) { @@ -83,14 +80,14 @@ delegate void AddTextCallback(string text); public void AddText(string text) { - if (this.textBox1.InvokeRequired) + if (textBox1.InvokeRequired) { - AddTextCallback d = new AddTextCallback(AddText); - this.Invoke(d, new object[] { text }); + AddTextCallback d = AddText; + Invoke(d, new object[] { text }); } else { - string timeStr = DateTime.Now.ToLongTimeString() + "." + DateTime.Now.Millisecond.ToString(); + string timeStr = DateTime.Now.ToLongTimeString() + "." + DateTime.Now.Millisecond; textBox1.Text += timeStr + " " + text + Environment.NewLine; //if (autoScrollCheckBox.Checked) { @@ -115,7 +112,7 @@ type = _type; } - string text; + readonly string text; public string Text { get @@ -124,7 +121,7 @@ } } - string type; + readonly string type; public string Type { get @@ -152,7 +149,7 @@ { get { - return DateTime.Now.ToLongTimeString() + "." + DateTime.Now.Millisecond.ToString(); + return DateTime.Now.ToLongTimeString() + "." + DateTime.Now.Millisecond; } } } @@ -160,10 +157,10 @@ delegate void AddTextToGridLogCallback(LogMessage text); public void AddTextToGridLog(LogMessage text) { - if (this.dataGridViewLog.InvokeRequired) + if (dataGridViewLog.InvokeRequired) { - AddTextToGridLogCallback d = new AddTextToGridLogCallback(AddTextToGridLog); - this.Invoke(d, new object[] { text }); + AddTextToGridLogCallback d = AddTextToGridLog; + Invoke(d, new object[] { text }); } else { @@ -174,8 +171,7 @@ //table.Rows.Add(row); tableLog.Rows.InsertAt(row, 0); - int c = tableLog.Rows.Count - 1; - c = 0; + const int c = 0; dataGridViewLog.Rows[c].DefaultCellStyle.BackColor = text.Color; dataGridViewLog.Update(); @@ -199,10 +195,7 @@ { if (socket != null) { - if (socket.IsConnected() == true) - toolStripStatusLabel1.Text = "CONNECTED"; - else - toolStripStatusLabel1.Text = "not connected"; + toolStripStatusLabel1.Text = socket.IsConnected() ? "CONNECTED" : "not connected"; } else toolStripStatusLabel1.Text = "null"; Modified: ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,4 +1,3 @@ -using System; using AcmContester.Library.LibraryExtention; using AcmContester.Library.LibraryExtention.Data; using AcmContester.Library.Connector; @@ -9,12 +8,12 @@ { ISocketMediator mediator; - SocketClientTask client; + readonly SocketClientTask client; public SocketClientGate(string IP) { client = new SocketClientTask(IP); - client.onDataArrived +=new SocketClient.DataArrivedDelegate(SocketClientGate_onDataArrived); + client.onDataArrived += SocketClientGate_onDataArrived; client.onAddLogText += OnAddLogText; client.isBusy += IsBusy; } @@ -36,7 +35,7 @@ { OnAddLogText("Receive", message.Message); - if (message.IsType("TestingSubmit") == true) + if (message.IsType("TestingSubmit")) { OnDataArrived(message); } @@ -46,7 +45,7 @@ { message = new SystemMessage(message); - if (message.IsType("TestingResult") == true) + if (message.IsType("TestingResult")) { Result res = Result.CreateFromXml(message.Message); OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res); Modified: ACMServer/trunk/ACMServer/Tester/Library/WorkMediator.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/WorkMediator.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Tester/Library/WorkMediator.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -5,7 +5,7 @@ { sealed class WorkMediator: ISocketMediator, IWorkerMediator { - private static WorkMediator instance = new WorkMediator(); + private static readonly WorkMediator instance = new WorkMediator(); WorkRunner runner; SocketClientGate socketClient; @@ -21,11 +21,11 @@ this.runner.onDataArrived += ((IWorkerMediator)this).Arrived; } - if (this.socketClient == null) + if (socketClient == null) { - this.socketClient = client; - this.socketClient.Mediator = (ISocketMediator)this; - this.socketClient.onDataArrived += SocketArrived; + socketClient = client; + socketClient.Mediator = this; + socketClient.onDataArrived += SocketArrived; } } public static WorkMediator GetInstance(WorkRunner runner, SocketClientGate client) @@ -39,12 +39,12 @@ } - public bool Send(SystemMessage message) + public static bool Send(SystemMessage message) { throw new Exception("The method or operation is not implemented."); } - public bool Arrived(SystemMessage message) + public static bool Arrived(SystemMessage message) { throw new Exception("The method or operation is not implemented."); } @@ -78,7 +78,7 @@ bool IWorkerMediator.Send(SystemMessage message) { - if (message.IsType("TestingSubmit") == true) + if (message.IsType("TestingSubmit")) return runner.AddWork(message.Message); return true; } Modified: ACMServer/trunk/ACMServer/Tester/Library/WorkRunner.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Library/WorkRunner.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Tester/Library/WorkRunner.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,7 +1,6 @@ using System; using AcmContester.Library.LibraryExtention; using System.Threading; -using AcmContester.Library.LibraryExtention.Data; namespace AcmContester.Tester.Library { @@ -13,7 +12,7 @@ string source = ""; object working = 0; - Thread thread = new Thread(new ParameterizedThreadStart(Go)); + Thread thread = new Thread(Go); internal bool IsBusy() { @@ -29,7 +28,7 @@ internal bool AddWork(string message) { - if (IsBusy() == true) + if (IsBusy()) { return false; } @@ -42,7 +41,7 @@ //TODO: potribno jakos obnulyty status thread, // tak shob ne potribno bulo stvorjuvaty novyj - thread = new Thread(new ParameterizedThreadStart(Go)); + thread = new Thread(Go); thread.Start(this); return true; } @@ -86,14 +85,14 @@ //TODO: ne znaju chy tut potriben lock lock (this) { - this.Send(new SystemMessage(result, "TestingResult")); + Send(new SystemMessage(result, "TestingResult")); } } private bool Send(SystemMessage systemMessage) { if (onDataArrived != null) - return this.onDataArrived(systemMessage); + return onDataArrived(systemMessage); return true; } Modified: ACMServer/trunk/ACMServer/Tester/Program.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Program.cs 2009-01-17 09:16:35 UTC (rev 456) +++ ACMServer/trunk/ACMServer/Tester/Program.cs 2009-01-17 10:52:35 UTC (rev 457) @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Windows.Forms; namespace Tester This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2009-01-17 09:16:46
|
Revision: 456 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=456&view=rev Author: Oracle_ Date: 2009-01-17 09:16:35 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Added optimization to C++ compiler. Modified Paths: -------------- ACMServer/branches/Version_2/Server/CompilationUnit.pas Modified: ACMServer/branches/Version_2/Server/CompilationUnit.pas =================================================================== --- ACMServer/branches/Version_2/Server/CompilationUnit.pas 2009-01-16 23:43:35 UTC (rev 455) +++ ACMServer/branches/Version_2/Server/CompilationUnit.pas 2009-01-17 09:16:35 UTC (rev 456) @@ -109,7 +109,7 @@ Sleep(100); - result := Run(ExtractShortPathName(ProgramPath+'Compillers\vc6\cl.exe')+' -I '+ExtractShortPathName(ProgramPath+'Compillers\vc6 ')+FilePath+ ' /EHsc -link -LIBPATH:'+ExtractShortPathName(ProgramPath+'Compillers\vc6'), + result := Run(ExtractShortPathName(ProgramPath+'Compillers\vc6\cl.exe')+' -I '+ExtractShortPathName(ProgramPath+'Compillers\vc6 ')+FilePath+ ' /O1 /EHsc -link -LIBPATH:'+ExtractShortPathName(ProgramPath+'Compillers\vc6'), FilePath,ExtractFilePath(FilePath)+'compile_res.txt', ExtractFilePath(FilePath), MaxCompilationTime,50000000,70000,tu,mu); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-16 23:43:40
|
Revision: 455 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=455&view=rev Author: brus07 Date: 2009-01-16 23:43:35 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Added thrown exception in AddRowInner method. Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-16 23:39:45 UTC (rev 454) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-16 23:43:35 UTC (rev 455) @@ -25,14 +25,17 @@ private void AddRowInner(Message message) { + if (message == null) + throw new ArgumentNullException("message", "Can't be null"); if (systemMessageType == null) { systemMessageType = message.GetType(); Init(message.GetDataGridViewColumns()); } if (message.GetType() != systemMessageType) - //TODO: - throw new ArgumentException(); + throw new ArgumentException("Type of systemMessage must be equal", "message"); + if (dataGridView.ColumnCount != message.GetValues().Length) + throw new ArgumentException("Count of elements must be equal to count of columns", "message"); //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE4\xEE\xE1\xE0\xE2\xEB\xFF\xF2\xE8 \xF3 \xEA\xB3\xED\xE5\xF6 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-16 23:39:51
|
Revision: 454 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=454&view=rev Author: brus07 Date: 2009-01-16 23:39:45 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Implementation class of abstract class moved to "impl" folder and change namespace to "*.impl". Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj Added Paths: ----------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessageMode.cs Removed Paths: ------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-16 20:01:38 UTC (rev 453) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-16 23:39:45 UTC (rev 454) @@ -34,6 +34,8 @@ <Reference Include="System.Windows.Forms" /> </ItemGroup> <ItemGroup> + <Compile Include="impl\SystemMessage.cs" /> + <Compile Include="impl\SystemMessageMode.cs" /> <Compile Include="LogDataGridView.cs"> <SubType>UserControl</SubType> </Compile> @@ -42,8 +44,6 @@ </Compile> <Compile Include="Message.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="SystemMessage.cs" /> - <Compile Include="SystemMessageMode.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="LogDataGridView.resx"> Deleted: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs 2009-01-16 20:01:38 UTC (rev 453) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs 2009-01-16 23:39:45 UTC (rev 454) @@ -1,235 +0,0 @@ -using System; -using System.Drawing; -using System.Windows.Forms; -using System.Collections.Generic; - -namespace sps.brus07.LogDataGridView -{ - public class SystemMessage : Message - { - string text; - SystemMessageMode mode; - - - private ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); - private ToolStripMenuItem toolStripMenuItemTime = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemDate = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemText = new ToolStripMenuItem(); - private ToolStripMenuItem toolStripMenuItemMode = new ToolStripMenuItem(); - private void InitContexMenu() - { - contextMenuStrip.Items.AddRange(new ToolStripItem[]{ - toolStripMenuItemTime, - toolStripMenuItemDate, - toolStripMenuItemText, - toolStripMenuItemMode}); - contextMenuStrip.Name = "ContexMenuStrip"; - contextMenuStrip.ShowCheckMargin = true; - contextMenuStrip.ShowImageMargin = false; - contextMenuStrip.Size = new Size(180, 92); - - toolStripMenuItemTime.Size = new Size(179, 22); - toolStripMenuItemTime.Text = "Visible Time Column"; - toolStripMenuItemTime.Checked = true; - toolStripMenuItemTime.Click += new EventHandler(toolStripMenuItem_Click); - - toolStripMenuItemDate.Size = new Size(179, 22); - toolStripMenuItemDate.Text = "Visible Date Column"; - toolStripMenuItemDate.Checked = true; - toolStripMenuItemDate.Click += new EventHandler(toolStripMenuItem_Click); - - toolStripMenuItemText.Size = new Size(179, 22); - toolStripMenuItemText.Text = "Visible Text Column"; - toolStripMenuItemText.Checked = true; - toolStripMenuItemText.Click += new EventHandler(toolStripMenuItem_Click); - - toolStripMenuItemMode.Size = new Size(179, 22); - toolStripMenuItemMode.Text = "Visible Mode Columna"; - toolStripMenuItemMode.Checked = true; - toolStripMenuItemMode.Click += new EventHandler(toolStripMenuItem_Click); - } - - void toolStripMenuItem_Click(object sender, EventArgs e) - { - //Bug: jaksho shovaty vsi kolonky, todi ne mozna vidkryty ContextMenu - - ToolStripMenuItem toolStrip = (ToolStripMenuItem)sender; - if (toolStrip == toolStripMenuItemTime) - { - if (toolStripMenuItemTime.Checked) - { - columns[0].Visible = false; - toolStripMenuItemTime.Checked = false; - } - else - { - columns[0].Visible = true; - toolStripMenuItemTime.Checked = true; - } - } - if (toolStrip == toolStripMenuItemDate) - { - if (toolStripMenuItemDate.Checked) - { - columns[1].Visible = false; - toolStripMenuItemDate.Checked = false; - } - else - { - columns[1].Visible = true; - toolStripMenuItemDate.Checked = true; - } - } - if (toolStrip == toolStripMenuItemText) - { - if (toolStripMenuItemText.Checked) - { - columns[2].Visible = false; - toolStripMenuItemText.Checked = false; - } - else - { - columns[2].Visible = true; - toolStripMenuItemText.Checked = true; - - //Hack: jaksho shovaty, a potim vidobrazyty Text'ovu kolonky - // todi vysota rjadkiv stane defoltnoju, a ne roztjagnetsja avtomatom, po tekstu. - // Tomu roblju she taki dvi zminy, shob updejtnyty GridView - columns[1].Visible = !columns[1].Visible; - columns[1].Visible = !columns[1].Visible; - } - } - if (toolStrip == toolStripMenuItemMode) - { - if (toolStripMenuItemMode.Checked) - { - columns[3].Visible = false; - toolStripMenuItemMode.Checked = false; - } - else - { - columns[3].Visible = true; - toolStripMenuItemMode.Checked = true; - } - } - } - - IList<DataGridViewColumn> columns; - - public override IList<DataGridViewColumn> GetDataGridViewColumns() - { - InitContexMenu(); - IList<DataGridViewColumn> result = new List<DataGridViewColumn>(); - - DataGridViewColumn column = new DataGridViewTextBoxColumn(); - column.Name = "Time"; - column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; - result.Add(column); - - column = new DataGridViewTextBoxColumn(); - column.Name = "Date"; - column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; - result.Add(column); - - column = new DataGridViewTextBoxColumn(); - column.Name = "Log text"; - column.MinimumWidth = 150; - column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - column.ContextMenuStrip = this.contextMenuStrip; - result.Add(column); - - column = new DataGridViewTextBoxColumn(); - column.Name = "Mode"; - column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - column.ContextMenuStrip = this.contextMenuStrip; - result.Add(column); - - columns = result; - return result; - } - - public SystemMessage(string text, string type) - { - this.text = text; - try - { - this.mode = (SystemMessageMode)Enum.Parse(typeof(SystemMessageMode), type, true); - } - catch (ArgumentException) - { - this.mode = SystemMessageMode.Other; - } - } - public SystemMessage(string text, SystemMessageMode type) - { - this.text = text; - this.mode = type; - } - - - public override object[] GetValues() - { - object[] result = new object[4]; - result[0] = this.Time; - result[1] = this.Date; - result[2] = this.Text; - result[3] = this.Mode; - return result; - } - - private string Time - { - get - { - DateTime dt = DateTime.Now; - string result = ""; - result += dt.ToLongTimeString(); - result += "."; - result += dt.Millisecond.ToString(); - return result; - } - } - private string Date - { - get - { - DateTime dt = DateTime.Now; - string result = ""; - result += dt.ToShortDateString(); - return result; - } - } - private string Text - { - get - { - return text; - } - } - private string Mode - { - get - { - return mode.ToString(); - } - } - public override Color Color - { - get - { - if (mode == SystemMessageMode.Send) - return Color.LimeGreen; - if (mode == SystemMessageMode.Receive) - return Color.LightGreen; - if (mode == SystemMessageMode.SystemSend) - return Color.LightSkyBlue; - if (mode == SystemMessageMode.SystemReceive) - return Color.LightBlue; - return Color.Empty; - } - } - } - -} Deleted: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs 2009-01-16 20:01:38 UTC (rev 453) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs 2009-01-16 23:39:45 UTC (rev 454) @@ -1,11 +0,0 @@ -namespace sps.brus07.LogDataGridView -{ - public enum SystemMessageMode - { - Send, - Receive, - SystemSend, - SystemReceive, - Other - } -} Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl ___________________________________________________________________ Added: tsvn:logminsize + 5 Copied: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs (from rev 452, smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs) =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs (rev 0) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessage.cs 2009-01-16 23:39:45 UTC (rev 454) @@ -0,0 +1,235 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; + +namespace sps.brus07.LogDataGridView.impl +{ + public class SystemMessage : Message + { + string text; + SystemMessageMode mode; + + + private ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); + private ToolStripMenuItem toolStripMenuItemTime = new ToolStripMenuItem(); + private ToolStripMenuItem toolStripMenuItemDate = new ToolStripMenuItem(); + private ToolStripMenuItem toolStripMenuItemText = new ToolStripMenuItem(); + private ToolStripMenuItem toolStripMenuItemMode = new ToolStripMenuItem(); + private void InitContexMenu() + { + contextMenuStrip.Items.AddRange(new ToolStripItem[]{ + toolStripMenuItemTime, + toolStripMenuItemDate, + toolStripMenuItemText, + toolStripMenuItemMode}); + contextMenuStrip.Name = "ContexMenuStrip"; + contextMenuStrip.ShowCheckMargin = true; + contextMenuStrip.ShowImageMargin = false; + contextMenuStrip.Size = new Size(180, 92); + + toolStripMenuItemTime.Size = new Size(179, 22); + toolStripMenuItemTime.Text = "Visible Time Column"; + toolStripMenuItemTime.Checked = true; + toolStripMenuItemTime.Click += new EventHandler(toolStripMenuItem_Click); + + toolStripMenuItemDate.Size = new Size(179, 22); + toolStripMenuItemDate.Text = "Visible Date Column"; + toolStripMenuItemDate.Checked = true; + toolStripMenuItemDate.Click += new EventHandler(toolStripMenuItem_Click); + + toolStripMenuItemText.Size = new Size(179, 22); + toolStripMenuItemText.Text = "Visible Text Column"; + toolStripMenuItemText.Checked = true; + toolStripMenuItemText.Click += new EventHandler(toolStripMenuItem_Click); + + toolStripMenuItemMode.Size = new Size(179, 22); + toolStripMenuItemMode.Text = "Visible Mode Columna"; + toolStripMenuItemMode.Checked = true; + toolStripMenuItemMode.Click += new EventHandler(toolStripMenuItem_Click); + } + + void toolStripMenuItem_Click(object sender, EventArgs e) + { + //Bug: jaksho shovaty vsi kolonky, todi ne mozna vidkryty ContextMenu + + ToolStripMenuItem toolStrip = (ToolStripMenuItem)sender; + if (toolStrip == toolStripMenuItemTime) + { + if (toolStripMenuItemTime.Checked) + { + columns[0].Visible = false; + toolStripMenuItemTime.Checked = false; + } + else + { + columns[0].Visible = true; + toolStripMenuItemTime.Checked = true; + } + } + if (toolStrip == toolStripMenuItemDate) + { + if (toolStripMenuItemDate.Checked) + { + columns[1].Visible = false; + toolStripMenuItemDate.Checked = false; + } + else + { + columns[1].Visible = true; + toolStripMenuItemDate.Checked = true; + } + } + if (toolStrip == toolStripMenuItemText) + { + if (toolStripMenuItemText.Checked) + { + columns[2].Visible = false; + toolStripMenuItemText.Checked = false; + } + else + { + columns[2].Visible = true; + toolStripMenuItemText.Checked = true; + + //Hack: jaksho shovaty, a potim vidobrazyty Text'ovu kolonky + // todi vysota rjadkiv stane defoltnoju, a ne roztjagnetsja avtomatom, po tekstu. + // Tomu roblju she taki dvi zminy, shob updejtnyty GridView + columns[1].Visible = !columns[1].Visible; + columns[1].Visible = !columns[1].Visible; + } + } + if (toolStrip == toolStripMenuItemMode) + { + if (toolStripMenuItemMode.Checked) + { + columns[3].Visible = false; + toolStripMenuItemMode.Checked = false; + } + else + { + columns[3].Visible = true; + toolStripMenuItemMode.Checked = true; + } + } + } + + IList<DataGridViewColumn> columns; + + public override IList<DataGridViewColumn> GetDataGridViewColumns() + { + InitContexMenu(); + IList<DataGridViewColumn> result = new List<DataGridViewColumn>(); + + DataGridViewColumn column = new DataGridViewTextBoxColumn(); + column.Name = "Time"; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + column = new DataGridViewTextBoxColumn(); + column.Name = "Date"; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + column = new DataGridViewTextBoxColumn(); + column.Name = "Log text"; + column.MinimumWidth = 150; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + column = new DataGridViewTextBoxColumn(); + column.Name = "Mode"; + column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + column.ContextMenuStrip = this.contextMenuStrip; + result.Add(column); + + columns = result; + return result; + } + + public SystemMessage(string text, string type) + { + this.text = text; + try + { + this.mode = (SystemMessageMode)Enum.Parse(typeof(SystemMessageMode), type, true); + } + catch (ArgumentException) + { + this.mode = SystemMessageMode.Other; + } + } + public SystemMessage(string text, SystemMessageMode type) + { + this.text = text; + this.mode = type; + } + + + public override object[] GetValues() + { + object[] result = new object[4]; + result[0] = this.Time; + result[1] = this.Date; + result[2] = this.Text; + result[3] = this.Mode; + return result; + } + + private string Time + { + get + { + DateTime dt = DateTime.Now; + string result = ""; + result += dt.ToLongTimeString(); + result += "."; + result += dt.Millisecond.ToString(); + return result; + } + } + private string Date + { + get + { + DateTime dt = DateTime.Now; + string result = ""; + result += dt.ToShortDateString(); + return result; + } + } + private string Text + { + get + { + return text; + } + } + private string Mode + { + get + { + return mode.ToString(); + } + } + public override Color Color + { + get + { + if (mode == SystemMessageMode.Send) + return Color.LimeGreen; + if (mode == SystemMessageMode.Receive) + return Color.LightGreen; + if (mode == SystemMessageMode.SystemSend) + return Color.LightSkyBlue; + if (mode == SystemMessageMode.SystemReceive) + return Color.LightBlue; + return Color.Empty; + } + } + } + +} Copied: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessageMode.cs (from rev 452, smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs) =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessageMode.cs (rev 0) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/impl/SystemMessageMode.cs 2009-01-16 23:39:45 UTC (rev 454) @@ -0,0 +1,11 @@ +namespace sps.brus07.LogDataGridView.impl +{ + public enum SystemMessageMode + { + Send, + Receive, + SystemSend, + SystemReceive, + Other + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-16 20:01:45
|
Revision: 453 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=453&view=rev Author: brus07 Date: 2009-01-16 20:01:38 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Change default configuration to Release. Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/build.build Modified: smallprojects/sps/brus07/LogDataGridView/trunk/build.build =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/build.build 2009-01-16 19:54:44 UTC (rev 452) +++ smallprojects/sps/brus07/LogDataGridView/trunk/build.build 2009-01-16 20:01:38 UTC (rev 453) @@ -14,7 +14,7 @@ <target name="compile" description="Compiles"> <!--<msbuild project="src\Jerry.sln">--> <msbuild project="src\LogDataGridView\LogDataGridView.csproj"> - <!--<property name="Configuration" value="AutomatedDebug" />--> + <property name="Configuration" value="Release" /> <property name="OutDir" value="${fullbuildpath.dir}\\" /> </msbuild> <delete if="${directory::exists(fullbuildpath.dir)}"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-16 19:54:50
|
Revision: 452 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=452&view=rev Author: brus07 Date: 2009-01-16 19:54:44 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Change project properties (AssemblyCompany, AssemblyCopyright, AssemblyDescription, RootNamespace, AssemblyName). Modified Paths: -------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.Designer.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Message.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs Property Changed: ---------------- smallprojects/sps/brus07/LogDataGridView/trunk/src/ Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/src ___________________________________________________________________ Added: svn:ignore + LogDataGridView.suo Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.Designer.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.Designer.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.Designer.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -1,4 +1,4 @@ -namespace LogDataGridView +namespace sps.brus07.LogDataGridView { partial class LogDataGridView { Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -3,7 +3,7 @@ using System.Windows.Forms; using System.Collections.Generic; -namespace LogDataGridView +namespace sps.brus07.LogDataGridView { public partial class LogDataGridView : UserControl Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/LogDataGridView.csproj 2009-01-16 19:54:44 UTC (rev 452) @@ -7,8 +7,8 @@ <ProjectGuid>{263DC481-D532-43CE-AB44-BC99918E5A44}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>LogDataGridView</RootNamespace> - <AssemblyName>LogDataGridView</AssemblyName> + <RootNamespace>sps.brus07.LogDataGridView</RootNamespace> + <AssemblyName>sps.brus07.LogDataGridView</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Message.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Message.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Message.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -2,7 +2,7 @@ using System.Windows.Forms; using System.Collections.Generic; -namespace LogDataGridView +namespace sps.brus07.LogDataGridView { public abstract class Message { Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/Properties/AssemblyInfo.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -6,11 +6,11 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("LogDataGridView")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Using DataGridView for cool log output.")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Home")] +[assembly: AssemblyCompany("SPS.brus07")] [assembly: AssemblyProduct("LogDataGridView")] -[assembly: AssemblyCopyright("Copyright © Home 2008")] +[assembly: AssemblyCopyright("Copyright © SPS.brus07 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessage.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -3,7 +3,7 @@ using System.Windows.Forms; using System.Collections.Generic; -namespace LogDataGridView +namespace sps.brus07.LogDataGridView { public class SystemMessage : Message { Modified: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs 2009-01-16 19:36:58 UTC (rev 451) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/SystemMessageMode.cs 2009-01-16 19:54:44 UTC (rev 452) @@ -1,4 +1,4 @@ -namespace LogDataGridView +namespace sps.brus07.LogDataGridView { public enum SystemMessageMode { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-16 19:37:04
|
Revision: 451 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=451&view=rev Author: brus07 Date: 2009-01-16 19:36:58 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Moved LogDataGridView to new folder and changed repositories structure. Added Paths: ----------- smallprojects/sps/ smallprojects/sps/brus07/ smallprojects/sps/brus07/LogDataGridView/ smallprojects/sps/brus07/LogDataGridView/branches/ smallprojects/sps/brus07/LogDataGridView/tags/ smallprojects/sps/brus07/LogDataGridView/trunk/ smallprojects/sps/brus07/LogDataGridView/trunk/build.build smallprojects/sps/brus07/LogDataGridView/trunk/docs/ smallprojects/sps/brus07/LogDataGridView/trunk/go.bat smallprojects/sps/brus07/LogDataGridView/trunk/lib/ smallprojects/sps/brus07/LogDataGridView/trunk/lib/nunit.framework.dll smallprojects/sps/brus07/LogDataGridView/trunk/src/ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView/ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView.sln smallprojects/sps/brus07/LogDataGridView/trunk/tools/ smallprojects/sps/brus07/LogDataGridView/trunk/tools/NCover/ smallprojects/sps/brus07/LogDataGridView/trunk/tools/NCover/NCover here.txt smallprojects/sps/brus07/LogDataGridView/trunk/tools/nant/ smallprojects/sps/brus07/LogDataGridView/trunk/tools/nant/NAnt here.txt smallprojects/sps/brus07/LogDataGridView/trunk/tools/nunit/ smallprojects/sps/brus07/LogDataGridView/trunk/tools/nunit/nunit here.txt Removed Paths: ------------- ACMServer/trunk/tasks/LogDataGridView/ Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk ___________________________________________________________________ Added: svn:ignore + build build.log Added: smallprojects/sps/brus07/LogDataGridView/trunk/build.build =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/build.build (rev 0) +++ smallprojects/sps/brus07/LogDataGridView/trunk/build.build 2009-01-16 19:36:58 UTC (rev 451) @@ -0,0 +1,30 @@ +<?xml version="1.0" ?> +<project name="Jerry" default="test" xmlns="http://nant.sf.net/schemas/nant.xsd"> + <property name="build.dir" value="build" /> + <property name="fullpath.dir" value="${directory::get-parent-directory(build.dir)}" /> + <property name="fullbuildpath.dir" value="${fullpath.dir}\${build.dir}" /> + <property name="nant.settings.currentframework" value="net-2.0" /> + + <!-- User targets --> + <target name="clean" description="Delete artifacts"> + <delete dir="${build.dir}" if="${directory::exists(build.dir)}"/> + </target> + + <!-- Comile --> + <target name="compile" description="Compiles"> + <!--<msbuild project="src\Jerry.sln">--> + <msbuild project="src\LogDataGridView\LogDataGridView.csproj"> + <!--<property name="Configuration" value="AutomatedDebug" />--> + <property name="OutDir" value="${fullbuildpath.dir}\\" /> + </msbuild> + <delete if="${directory::exists(fullbuildpath.dir)}"> + <fileset> + <include name="**\*.pdb" /> + </fileset> + </delete> + </target> + + <target name="full" depends="clean, compile" description="Deploy: clean and compiles" /> + +</project> + Added: smallprojects/sps/brus07/LogDataGridView/trunk/go.bat =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/go.bat (rev 0) +++ smallprojects/sps/brus07/LogDataGridView/trunk/go.bat 2009-01-16 19:36:58 UTC (rev 451) @@ -0,0 +1,7 @@ +@echo off +if "%1"=="" goto show_help +tools\nant\nant.exe -nologo -l:build.log -buildfile:build.build %* +goto exit +:show_help +tools\nant\nant.exe -nologo -buildfile:build.build -projecthelp +:exit Added: smallprojects/sps/brus07/LogDataGridView/trunk/lib/nunit.framework.dll =================================================================== (Binary files differ) Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/lib/nunit.framework.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Copied: smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView.sln (from rev 450, ACMServer/trunk/tasks/LogDataGridView/LogDataGridView.sln) =================================================================== --- smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView.sln (rev 0) +++ smallprojects/sps/brus07/LogDataGridView/trunk/src/LogDataGridView.sln 2009-01-16 19:36:58 UTC (rev 451) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogDataGridView", "LogDataGridView\LogDataGridView.csproj", "{263DC481-D532-43CE-AB44-BC99918E5A44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {263DC481-D532-43CE-AB44-BC99918E5A44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {263DC481-D532-43CE-AB44-BC99918E5A44}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/tools/NCover ___________________________________________________________________ Added: svn:ignore + NCover.Console.exe.config CoverLib.dll MSVCP71.dll MSVCP80.dll MSVCR71.dll MSVCR80.dll NCover.Framework.dll ncover.exe NCover.Console.exe NCoverFAQ.html Coverage.xsl Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/tools/nant ___________________________________________________________________ Added: svn:ignore + extensions lib GenerateNAntSchema.build NAnt.exe.config CollectionGen.dll Interop.MsmMergeTypeLib.dll Interop.StarTeam.dll Interop.WindowsInstaller.dll log4net.dll NAnt.CompressionTasks.dll NAnt.Contrib.Tasks.dll NAnt.Core.dll NAnt.DotNetTasks.dll NAnt.MSNetTasks.dll NAnt.NUnit.dll NAnt.NUnit1Tasks.dll NAnt.NUnit2Tasks.dll NAnt.SourceControlTasks.dll NAnt.VisualCppTasks.dll NAnt.VSNetTasks.dll NAnt.Win32Tasks.dll NDoc.Documenter.NAnt.dll SLiNgshoT.Core.dll SourceSafe.Interop.dll NAnt.exe scvs.exe SLiNgshoT.exe license.html MSITaskTemplate.msi MSMTaskTemplate.msm MSITaskErrors.mst MSMTaskErrors.mst NAnt.xml NAnt.CompressionTasks.xml NAnt.Contrib.Tasks.xml NAnt.Core.xml NAnt.DotNetTasks.xml NAnt.MSNetTasks.xml NAnt.NUnit.xml NAnt.NUnit1Tasks.xml NAnt.NUnit2Tasks.xml NAnt.SourceControlTasks.xml NAnt.VisualCppTasks.xml NAnt.VSNetTasks.xml NAnt.Win32Tasks.xml Property changes on: smallprojects/sps/brus07/LogDataGridView/trunk/tools/nunit ___________________________________________________________________ Added: svn:ignore + clr.bat mock-assembly.dll.config nunit-console.exe.config nunit-gui.exe.config NUnitTests.config mock-assembly.dll nonamespace-assembly.dll notestfixtures-assembly.dll nunit-console-runner.dll nunit-console.tests.dll nunit-gui-runner.dll nunit-gui.tests.dll nunit-server.tests.dll nunit-test-server.dll nunit.core.dll nunit.core.extensions.dll nunit.extensions.tests.dll nunit.framework.dll nunit.framework.tests.dll nunit.mocks.dll nunit.mocks.tests.dll nunit.uikit.dll nunit.uikit.tests.dll nunit.util.dll nunit.util.tests.dll test-utilities.dll timing-tests.dll nunit-console.exe nunit-gui.exe nunit-server.exe license.html NUnitTests.nunit TestResult.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-12 22:27:36
|
Revision: 450 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=450&view=rev Author: brus07 Date: 2009-01-12 21:54:38 +0000 (Mon, 12 Jan 2009) Log Message: ----------- Fixed grammatic error. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerUserControl.cs Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerUserControl.cs 2009-01-09 20:33:38 UTC (rev 449) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerUserControl.cs 2009-01-12 21:54:38 UTC (rev 450) @@ -111,7 +111,7 @@ { MessageBox.Show("Unknow result type when update form counters" + Environment.NewLine + - "retult type: " + text); + "return type: " + text); } UpdateCounters(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-01-09 20:33:46
|
Revision: 449 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=449&view=rev Author: brus07 Date: 2009-01-09 20:33:38 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Added new folder for small projects. Added Paths: ----------- smallprojects/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-23 23:13:19
|
Revision: 448 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=448&view=rev Author: brus07 Date: 2008-12-23 23:13:16 +0000 (Tue, 23 Dec 2008) Log Message: ----------- Fixed grammatic error. Modified Paths: -------------- ACMServer/trunk/web/get/getfromold.php Modified: ACMServer/trunk/web/get/getfromold.php =================================================================== --- ACMServer/trunk/web/get/getfromold.php 2008-12-12 10:11:40 UTC (rev 447) +++ ACMServer/trunk/web/get/getfromold.php 2008-12-23 23:13:16 UTC (rev 448) @@ -24,7 +24,7 @@ if ($status == 7) $status = "InternalError"; if ($status == 9) - $status = "PresentationError"; + $status = "DestrictedFunction"; if ($status == 10) $status = "Accepted"; $problem = $result['problemID']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-12 10:11:45
|
Revision: 447 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=447&view=rev Author: brus07 Date: 2008-12-12 10:11:40 +0000 (Fri, 12 Dec 2008) Log Message: ----------- New version of Web client. Update table for work with parallel testing (on two TesterSystem). Small change. Modified Paths: -------------- ACMServer/trunk/web/action.php ACMServer/trunk/web/get.php ACMServer/trunk/web/insert.php ACMServer/trunk/web/submit.php ACMServer/trunk/web/table.php Added Paths: ----------- ACMServer/trunk/web/get/ ACMServer/trunk/web/get/connect.php ACMServer/trunk/web/get/diff.php ACMServer/trunk/web/get/get.php ACMServer/trunk/web/get/getfromold.php ACMServer/trunk/web/get/set.php ACMServer/trunk/web/get/table.php ACMServer/trunk/web/install.php ACMServer/trunk/web/start.sql Removed Paths: ------------- ACMServer/trunk/web/update.php ACMServer/trunk/web/update3.0.0.1.sql ACMServer/trunk/web/update3.0.0.2.sql Modified: ACMServer/trunk/web/action.php =================================================================== --- ACMServer/trunk/web/action.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/action.php 2008-12-12 10:11:40 UTC (rev 447) @@ -4,6 +4,14 @@ require_once("connect.php"); + + if (isset($delete) && $delete = 1) + { + $sql = "DELETE FROM `v3_submits` WHERE `id` = ".$id." LIMIT 1;"; + $result = MySql_Query ($sql); + echo "Delete $id<br>"; + } + if (isset($empty) && $empty=1) { $sql = 'UPDATE `v3_submits` SET `result` = NULL WHERE `id` >= '.$from.' AND `id` <= '.$to; Property changes on: ACMServer/trunk/web/get ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/web/get/connect.php =================================================================== --- ACMServer/trunk/web/get/connect.php (rev 0) +++ ACMServer/trunk/web/get/connect.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,3 @@ +<?php + + require_once("../connect.php"); \ No newline at end of file Added: ACMServer/trunk/web/get/diff.php =================================================================== --- ACMServer/trunk/web/get/diff.php (rev 0) +++ ACMServer/trunk/web/get/diff.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,126 @@ +<a href=submit.php>Submit</a><br> +<a href=get.php>Get</a><br> +<a href=table.php>Table</a><br> +<?php + if (isset($full) != true || $full != 1) + { + echo "<a href=\"diff.php?full=1\">Full table</a><br>"; + } + else + { + echo "<a href=\"diff.php?full=0\">Small table</a><br>"; + } +?> + +<?php + require_once("connect.php"); + + function getMax() + { + $sql = 'SELECT MAX(`id`) FROM `v3_submits`'; + $result = MySql_Query ($sql); + while($arr = mysql_fetch_array($result)) { + return $arr[0]; + } + return -1; + } +?> + +<FORM action = "../action.php?delete=1" method=post> + ID: <INPUT name=id value=-1> + <INPUT type=submit value="Delete"> +</FORM> + +<FORM action = "../action.php?empty=1" method=post> + Empty: <INPUT name=from value=<?php echo getMax();?> >- + <INPUT name=to value=<?php echo getMax();?> > + <INPUT type=submit value=run> +</FROM> + + +<?php + require_once("connect.php"); + + $Query = "SELECT * FROM `v3_submits` ORDER BY `id` DESC"; + if (isset($full) != true || $full != 1) + { + $Query .= " LIMIT 0 , 20;"; + } + + $result = MySql_Query ($Query); + echo "<table border=1>\n"; + echo "\t<tr>\n"; + echo "\t\t<td>"; + echo "<b>id</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>Problem</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>language</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>result</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedMemory</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedTime</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealStatus</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealTimeWorked</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealMemoryUsed</b>"; + echo "</td>\n"; + echo "\t</tr>\n"; + while($arr = mysql_fetch_array($result)) { + echo "\t<tr>\n"; + + echo "\t\t<td>"; + $arr[0] = $bodytag = str_replace("\r\n", "<br>", $arr[0]); + echo $arr[0]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[5] = $bodytag = str_replace("\r\n", "<br>", $arr['problemID']); + echo $arr[5]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[1] = $bodytag = str_replace("\r\n", "<br>", $arr['language']); + echo $arr[1]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[2] = $bodytag = str_replace("\r\n", "<br>", $arr[2]); + echo $arr[2]; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[4]/1000.0; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[3]/1000.0; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['Status']; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['TimeWorked']; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['MemoryUsed']; + echo "</td>\n"; + + echo "\t</tr>\n"; + } + echo "</table>\n"; Added: ACMServer/trunk/web/get/get.php =================================================================== --- ACMServer/trunk/web/get/get.php (rev 0) +++ ACMServer/trunk/web/get/get.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,27 @@ +<?php + + require_once("connect.php"); + + require_once("getfromold.php"); + + $Query = "SELECT `id`, `value`, `problemID`, `language` FROM `v3_submits` WHERE `result` IS NULL;"; + + $result = MySql_Query ($Query); + + $arr = mysql_fetch_array($result); + if ($arr != false) + { + header('Content-type: text/xml'); + echo "<?xml version=\"1.0\" encoding=\"utf-16\"?>"; + echo "<?xml-stylesheet type=\"text/xsl\" href=\"../get.xsl\"?>"; + echo "<submitList xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"; + do{ + echo "<submit>"; + echo "<id>".$arr['id']."</id>"; + echo "<problem>".$arr['problemID']."</problem>"; + echo "<sourceCode>".htmlspecialchars($arr['value'])."</sourceCode>"; + echo "<language>".$arr['language']."</language>"; + echo "</submit>"; + }while($arr = mysql_fetch_array($result)); + echo "</submitList>"; + } \ No newline at end of file Added: ACMServer/trunk/web/get/getfromold.php =================================================================== --- ACMServer/trunk/web/get/getfromold.php (rev 0) +++ ACMServer/trunk/web/get/getfromold.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,42 @@ +<?php + $sql = 'SELECT SubmitID, submits.problemID, Source, submits.Language, submits.`Status`, submits.TestNumber, submits.TimeWorked, submits.MemoryUsed FROM submits LEFT JOIN v3_submits ON submits.SubmitID = v3_submits.id WHERE submits.`Status` > 0 AND submits.`Status` < 11 AND submits.FirstOnly=0 AND v3_submits.id IS NULL LIMIT 1 '; + $result = MySql_Query($sql); + if ($result != FALSE) + { + if ($result = mysql_fetch_array($result)) + { + $id = $result['SubmitID']; + $source = $result['Source']; + + $status = $result['Status']; + if ($status == 1) + $status = "CompileErr"; + if ($status == 2) + $status = "RealTimeLimit"; + if ($status == 3) + $status = "WrongAnswer"; + if ($status == 4) + $status = "TimeLimit"; + if ($status == 5) + $status = "MemoryLimit"; + if ($status == 6) + $status = "OutputLimit"; + if ($status == 7) + $status = "InternalError"; + if ($status == 9) + $status = "PresentationError"; + if ($status == 10) + $status = "Accepted"; + $problem = $result['problemID']; + $timeWorked = $result['TimeWorked']; + $memoryUsed = $result['MemoryUsed']; + $language = $result['Language']; + if ($language == 3) + $language = 1; + + $Query = "INSERT INTO `v3_submits` (`id`, `value`, `result`, `problemID`, `language`, `Status`, `TimeWorked`, `MemoryUsed`)" + ."VALUES ($id, '".mysql_real_escape_string($source)."', NULL, $problem, $language, '$status', $timeWorked, $memoryUsed);"; + + $result = MySql_Query($Query); + } + } \ No newline at end of file Added: ACMServer/trunk/web/get/set.php =================================================================== --- ACMServer/trunk/web/get/set.php (rev 0) +++ ACMServer/trunk/web/get/set.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,16 @@ +<?php + + require_once("connect.php"); + + if (isset($res) && isset($id)) + { + echo $res; + echo "<p>"; + echo $id; + $res = mysql_real_escape_string($res); + $Query = "UPDATE `v3_submits` SET `result` = \"$res\", `usedMemory`=$usedMemory, `usedTime`=$usedTime WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; + + echo "<p>"; + echo $Query; + $result = MySql_Query ($Query); + } \ No newline at end of file Added: ACMServer/trunk/web/get/table.php =================================================================== --- ACMServer/trunk/web/get/table.php (rev 0) +++ ACMServer/trunk/web/get/table.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,132 @@ +<a href=../submit.php>Submit</a><br> +<a href=get.php>Get</a><br> +<a href=diff.php>Different table</a><br> +<?php + if (isset($full) != true || $full != 1) + { + echo "<a href=\"table.php?full=1\">Full table</a><br>"; + } + else + { + echo "<a href=\"table.php?full=0\">Small table</a><br>"; + } +?> + +<?php + require_once("connect.php"); + + function getMax() + { + $sql = 'SELECT MAX(`id`) FROM `v3_submits`'; + $result = MySql_Query ($sql); + while($arr = mysql_fetch_array($result)) { + return $arr[0]; + } + return -1; + } +?> + +<FORM action = "../action.php?delete=1" method=post> + ID: <INPUT name=id value=-1> + <INPUT type=submit value="Delete"> +</FORM> + +<FORM action = "../action.php?empty=1" method=post> + Empty: <INPUT name=from value=<?php echo getMax();?> >- + <INPUT name=to value=<?php echo getMax();?> > + <INPUT type=submit value=run> +</FROM> + +<?php + + $Query = "SELECT * FROM `v3_submits` ORDER BY `id` DESC"; + if (isset($full) != true || $full != 1) + { + $Query .= " LIMIT 0 , 20;"; + } + + $result = MySql_Query ($Query); + echo "<table border=1>\n"; + echo "\t<tr>\n"; + echo "\t\t<td>"; + echo "<b>id</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>Problem</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>value</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>language</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>result</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedMemory</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedTime</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealStatus</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealTimeWorked</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>RealMemoryUsed</b>"; + echo "</td>\n"; + echo "\t</tr>\n"; + while($arr = mysql_fetch_array($result)) { + echo "\t<tr>\n"; + + echo "\t\t<td>"; + $arr[0] = $bodytag = str_replace("\r\n", "<br>", $arr[0]); + echo $arr[0]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[5] = $bodytag = str_replace("\r\n", "<br>", $arr['problemID']); + echo $arr[5]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[1] = $bodytag = str_replace("\r\n", "<br>", htmlentities($arr[1])); + echo $arr[1]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[1] = $bodytag = str_replace("\r\n", "<br>", $arr['language']); + echo $arr[1]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[2] = $bodytag = str_replace("\r\n", "<br>", $arr[2]); + echo $arr[2]; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[4]/1000.0; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[3]/1000.0; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['Status']; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['TimeWorked']; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr['MemoryUsed']; + echo "</td>\n"; + + echo "\t</tr>\n"; + } + echo "</table>\n"; Modified: ACMServer/trunk/web/get.php =================================================================== --- ACMServer/trunk/web/get.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/get.php 2008-12-12 10:11:40 UTC (rev 447) @@ -2,7 +2,7 @@ require_once("connect.php"); - $Query = "SELECT `id`, `value` FROM `v3_submits` WHERE `result` IS NULL;"; + $Query = "SELECT `id`, `value`, `problemID`, `language` FROM `v3_submits` WHERE `result` IS NULL;"; $result = MySql_Query ($Query); @@ -11,12 +11,14 @@ { header('Content-type: text/xml'); echo "<?xml version=\"1.0\" encoding=\"utf-16\"?>"; + echo "<?xml-stylesheet type=\"text/xsl\" href=\"get.xsl\"?>"; echo "<submitList xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"; do{ echo "<submit>"; - echo "<id>".$arr[0]."</id>"; - echo "<sourceCode>".$arr[1]."</sourceCode>"; - echo "<language>2</language>"; + echo "<id>".$arr['id']."</id>"; + echo "<problem>".$arr['problemID']."</problem>"; + echo "<sourceCode>".htmlspecialchars($arr['value'])."</sourceCode>"; + echo "<language>".$arr['language']."</language>"; echo "</submit>"; }while($arr = mysql_fetch_array($result)); echo "</submitList>"; Modified: ACMServer/trunk/web/insert.php =================================================================== --- ACMServer/trunk/web/insert.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/insert.php 2008-12-12 10:11:40 UTC (rev 447) @@ -7,7 +7,6 @@ echo $text; echo "<p>"; echo mysql_real_escape_string($text); - $Query = "INSERT INTO `v3_submits` ( `id` , `value` , `result` ) VALUES ('', '".mysql_real_escape_string($text)."', NULL);"; - + $Query = "INSERT INTO `v3_submits` ( `id` , `value` , `result`, `problemID`, `language`) VALUES ('', '".mysql_real_escape_string($text)."', NULL, ".$problem.", ".$language.");"; $result = MySql_Query ($Query); } Added: ACMServer/trunk/web/install.php =================================================================== --- ACMServer/trunk/web/install.php (rev 0) +++ ACMServer/trunk/web/install.php 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,12 @@ +<?php + + require_once("connect.php"); + + $filename = "start.sql"; + $handle = fopen($filename, "rb"); + $contents = fread($handle, filesize($filename)); + fclose($handle); + + $sql = $contents; + + $result = MySql_Query ($sql); Added: ACMServer/trunk/web/start.sql =================================================================== --- ACMServer/trunk/web/start.sql (rev 0) +++ ACMServer/trunk/web/start.sql 2008-12-12 10:11:40 UTC (rev 447) @@ -0,0 +1,31 @@ +-- phpMyAdmin SQL Dump +-- version 2.6.3-pl1 +-- http://www.phpmyadmin.net +-- +-- \xD5\xEE\xF1\xF2: localhost +-- \xD7\xE0\xF1 \xF1\xF2\xE2\xEE\xF0\xE5\xED\xED\xFF: \xC3\xF0\xF3 12 2008 \xF0., 11:11 +-- \xC2\xE5\xF0\xF1\xB3\xFF \xF1\xE5\xF0\xE2\xE5\xF0\xE0: 4.0.14 +-- \xC2\xE5\xF0\xF1\xB3\xFF PHP: 4.3.4 +-- +-- \xC1\xC4: `acm` +-- + +-- -------------------------------------------------------- + +-- +-- \xD1\xF2\xF0\xF3\xEA\xF2\xF3\xF0\xE0 \xF2\xE0\xE1\xEB\xE8\xF6\xB3 `v3_submits_se` +-- + +CREATE TABLE `v3_submits` ( + `id` int(11) NOT NULL auto_increment, + `value` blob NOT NULL, + `result` varchar(255) default NULL, + `usedMemory` varchar(20) NOT NULL default '', + `usedTime` varchar(20) NOT NULL default '', + `language` int(11) NOT NULL default '1', + `problemID` int(11) NOT NULL default '0', + `Status` varchar(255) NOT NULL default '', + `TimeWorked` varchar(20) NOT NULL default '', + `MemoryUsed` varchar(20) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM AUTO_INCREMENT=1 ; Modified: ACMServer/trunk/web/submit.php =================================================================== --- ACMServer/trunk/web/submit.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/submit.php 2008-12-12 10:11:40 UTC (rev 447) @@ -1,4 +1,10 @@ <FORM action = "insert.php" method=post> - Text: <br><textarea name=text rows="20" wrap="VIRTUAL" cols="65"></textarea><br> + ProblemID: <INPUT name=problem type=edit value="1"><br> + LanguageID: + <select name=language size="1" name="lang" class="textbox"> + <option value="1" selected="selected">Pascal</option> + <option value="2">C++</option> + </select><br> + SourceCode: <br><textarea name=text rows="20" wrap="VIRTUAL" cols="65"></textarea><br> <INPUT type=submit value=\xC2i\xE4i\xF1\xEB\xE0\xF2\xE8> </FROM> \ No newline at end of file Modified: ACMServer/trunk/web/table.php =================================================================== --- ACMServer/trunk/web/table.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/table.php 2008-12-12 10:11:40 UTC (rev 447) @@ -24,6 +24,11 @@ return -1; } ?> + +<FORM action = "action.php?delete=1" method=post> + ID: <INPUT name=id value=-1> + <INPUT type=submit value="Delete"> +</FORM> <FORM action = "action.php?empty=1" method=post> Empty: <INPUT name=from value=<?php echo getMax();?> >- @@ -46,9 +51,15 @@ echo "<b>id</b>"; echo "</td>\n"; echo "\t\t<td>"; + echo "<b>Problem</b>"; + echo "</td>\n"; + echo "\t\t<td>"; echo "<b>value</b>"; echo "</td>\n"; echo "\t\t<td>"; + echo "<b>language</b>"; + echo "</td>\n"; + echo "\t\t<td>"; echo "<b>result</b>"; echo "</td>\n"; echo "\t\t<td>"; @@ -57,22 +68,44 @@ echo "\t\t<td>"; echo "<b>usedTime</b>"; echo "</td>\n"; + echo "\t</tr>\n"; while($arr = mysql_fetch_array($result)) { echo "\t<tr>\n"; - for ($i=0; $i<3; $i++) - { + echo "\t\t<td>"; - $arr[$i] = $bodytag = str_replace("\r\n", "<br>", $arr[$i]); - echo $arr[$i]; + $arr[0] = $bodytag = str_replace("\r\n", "<br>", $arr[0]); + echo $arr[0]; echo "</td>\n"; - } - for ($i=3; $i<5; $i++) - { + echo "\t\t<td>"; - echo $arr[$i]/1000.0; + $arr[5] = $bodytag = str_replace("\r\n", "<br>", $arr['problemID']); + echo $arr[5]; echo "</td>\n"; - } + + echo "\t\t<td>"; + $arr[1] = $bodytag = str_replace("\r\n", "<br>", htmlentities($arr[1])); + echo $arr[1]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[1] = $bodytag = str_replace("\r\n", "<br>", $arr['language']); + echo $arr[1]; + echo "</td>\n"; + + echo "\t\t<td>"; + $arr[2] = $bodytag = str_replace("\r\n", "<br>", $arr[2]); + echo $arr[2]; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[4]/1000.0; + echo "</td>\n"; + + echo "\t\t<td>"; + echo $arr[3]/1000.0; + echo "</td>\n"; + echo "\t</tr>\n"; } echo "</table>\n"; Deleted: ACMServer/trunk/web/update.php =================================================================== --- ACMServer/trunk/web/update.php 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/update.php 2008-12-12 10:11:40 UTC (rev 447) @@ -1,7 +0,0 @@ -<?php - - require_once("connect.php"); - - $sql = 'ALTER TABLE `v3_submits` CHANGE `value` `value` BLOB NOT NULL'; - - $result = MySql_Query ($sql); \ No newline at end of file Deleted: ACMServer/trunk/web/update3.0.0.1.sql =================================================================== --- ACMServer/trunk/web/update3.0.0.1.sql 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/update3.0.0.1.sql 2008-12-12 10:11:40 UTC (rev 447) @@ -1,5 +0,0 @@ --- --- Insert new column to table --- -ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL , -ADD `usedTime` VARCHAR( 20 ) NOT NULL ; \ No newline at end of file Deleted: ACMServer/trunk/web/update3.0.0.2.sql =================================================================== --- ACMServer/trunk/web/update3.0.0.2.sql 2008-12-11 14:08:54 UTC (rev 446) +++ ACMServer/trunk/web/update3.0.0.2.sql 2008-12-12 10:11:40 UTC (rev 447) @@ -1,5 +0,0 @@ --- --- Change type and length of field 'value' --- - -ALTER TABLE `v3_submits` CHANGE `value` `value` BLOB NOT NULL \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Di...@us...> - 2008-12-11 14:09:00
|
Revision: 446 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=446&view=rev Author: DixonD Date: 2008-12-11 14:08:54 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Change to scriptExample.txt to pass outputs with whitespaces at the end Modified Paths: -------------- ACMServer/trunk/sharp tester/Checker/Checker/scriptExample.txt Modified: ACMServer/trunk/sharp tester/Checker/Checker/scriptExample.txt =================================================================== --- ACMServer/trunk/sharp tester/Checker/Checker/scriptExample.txt 2008-12-11 11:52:47 UTC (rev 445) +++ ACMServer/trunk/sharp tester/Checker/Checker/scriptExample.txt 2008-12-11 14:08:54 UTC (rev 446) @@ -1,3 +1,3 @@ -if (output==correctOutput) +if (output.TrimEnd(null) == correctOutput.TrimEnd(null)) result='AC'; else result='WA'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-12-11 12:13:07
|
Revision: 445 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=445&view=rev Author: Oracle_ Date: 2008-12-11 11:52:47 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Fixed bug with loading input/output files. ReadToEnd() replaced with File::ReadAllText(); Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-12-11 10:10:49 UTC (rev 444) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-12-11 11:52:47 UTC (rev 445) @@ -89,7 +89,7 @@ PointPath = pointname; if (File.Exists(inname)) { - input = File.OpenText(inname).ReadToEnd(); + input = File.ReadAllText(inname); } else { @@ -98,7 +98,7 @@ if (File.Exists(outname)) { - output = File.OpenText(outname).ReadToEnd(); + output = File.ReadAllText(outname); } else { @@ -109,7 +109,7 @@ { try { - points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + points = Convert.ToInt32(File.ReadAllText(pointname)); } catch (Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-11 10:11:03
|
Revision: 444 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=444&view=rev Author: brus07 Date: 2008-12-11 10:10:49 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Added new ComboBox for select language. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs 2008-12-11 10:09:19 UTC (rev 443) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs 2008-12-11 10:10:49 UTC (rev 444) @@ -35,6 +35,7 @@ this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.problemTextBox = new System.Windows.Forms.TextBox(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // panel1 @@ -75,7 +76,7 @@ this.languageTextBox.Enabled = false; this.languageTextBox.Location = new System.Drawing.Point(64, 3); this.languageTextBox.Name = "languageTextBox"; - this.languageTextBox.Size = new System.Drawing.Size(100, 20); + this.languageTextBox.Size = new System.Drawing.Size(27, 20); this.languageTextBox.TabIndex = 3; this.languageTextBox.Text = "1"; // @@ -105,10 +106,24 @@ this.problemTextBox.TabIndex = 5; this.problemTextBox.Text = "1"; // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "1 (Pascal)", + "2 (C++)"}); + this.comboBox1.Location = new System.Drawing.Point(97, 3); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(67, 21); + this.comboBox1.TabIndex = 7; + this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); + // // SubmitterGUIUserControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.comboBox1); this.Controls.Add(this.label2); this.Controls.Add(this.problemTextBox); this.Controls.Add(this.label1); @@ -132,5 +147,6 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox problemTextBox; + private System.Windows.Forms.ComboBox comboBox1; } } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs 2008-12-11 10:09:19 UTC (rev 443) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs 2008-12-11 10:10:49 UTC (rev 444) @@ -42,5 +42,10 @@ int problem = Int32.Parse(problemTextBox.Text); plugin.SendSubmit(sourceTextBox.Text, lang, problem); } + + private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) + { + languageTextBox.Text = ""+comboBox1.Text[0]; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-11 10:09:29
|
Revision: 443 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=443&view=rev Author: brus07 Date: 2008-12-11 10:09:19 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Change Tester to new version (with language parameter). Modified Paths: -------------- ACMServer/trunk/ACMServer/Runner/Class1.cs ACMServer/trunk/ACMServer/Runner/Load.dll ACMServer/trunk/ACMServer/Runner/Main.dll ACMServer/trunk/ACMServer/Runner/Plugin.dll ACMServer/trunk/ACMServer/Runner/Runner.csproj ACMServer/trunk/ACMServer/Runner/Test.dll Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-10 17:34:11 UTC (rev 442) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-11 10:09:19 UTC (rev 443) @@ -37,6 +37,7 @@ Submit submit = Submit.CreateFromXml(message); string code = submit.sourceCode; code = HtmlEntityDecode(code); + int language = submit.language; string id = submit.id.ToString(); Result result = new Result(submit); @@ -46,7 +47,7 @@ string[] data = File.ReadAllLines("InData.txt"); data[2] = data[2] + submit.pbolemID.ToString() + "\\"; string src = code; - TestEnv test = new TestEnv(src, data[0], data[1], data[2]); + TestEnv test = new TestEnv(src, language, data[1], data[2]); test.Compile(); log.Loging("------------------BEGIN SOURCE--------------------------", Log.Priority.INFO); Modified: ACMServer/trunk/ACMServer/Runner/Load.dll =================================================================== (Binary files differ) Modified: ACMServer/trunk/ACMServer/Runner/Main.dll =================================================================== (Binary files differ) Modified: ACMServer/trunk/ACMServer/Runner/Plugin.dll =================================================================== (Binary files differ) Modified: ACMServer/trunk/ACMServer/Runner/Runner.csproj =================================================================== --- ACMServer/trunk/ACMServer/Runner/Runner.csproj 2008-12-10 17:34:11 UTC (rev 442) +++ ACMServer/trunk/ACMServer/Runner/Runner.csproj 2008-12-11 10:09:19 UTC (rev 443) @@ -32,7 +32,7 @@ <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="Test, Version=1.0.3190.20622, Culture=neutral, processorArchitecture=x86" /> + <Reference Include="Test, Version=1.0.3267.427, Culture=neutral, processorArchitecture=x86" /> </ItemGroup> <ItemGroup> <Compile Include="Class1.cs" /> Modified: ACMServer/trunk/ACMServer/Runner/Test.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2008-12-10 17:34:21
|
Revision: 442 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=442&view=rev Author: panzaboi Date: 2008-12-10 17:34:11 +0000 (Wed, 10 Dec 2008) Log Message: ----------- Added Contests Added support for teams Added support for Virtual Contests and Team Contests Fixed XML structure to support the new tester Modified Paths: -------------- website/application/modules/acm/controllers/ArchieveController.php website/application/modules/acm/models/Archieve.php website/application/modules/acm/models/Form/Login.php website/application/modules/acm/views/scripts/tester/entry.phtml website/application/modules/acm/views/scripts/tester/submits.phtml website/other/dq.sql website/other/todo.txt Added Paths: ----------- website/application/modules/acm/controllers/ContestController.php website/application/modules/acm/models/Contest.php website/application/modules/acm/views/scripts/contest/ website/application/modules/acm/views/scripts/contest/contest.phtml website/application/modules/acm/views/scripts/contest/entry.phtml website/application/modules/acm/views/scripts/contest/incontest.phtml website/application/modules/acm/views/scripts/contest/index.phtml website/application/modules/acm/views/scripts/contest/notrun.phtml website/application/modules/acm/views/scripts/contest/problemset.phtml website/application/modules/acm/views/scripts/contest/registered.phtml website/application/modules/acm/views/scripts/contest/result.phtml website/application/modules/acm/views/scripts/contest/results.phtml website/application/modules/acm/views/scripts/contest/view.phtml website/other/submits/6 website/other/submits/7 website/other/submits/8 website/other/submits/9 Modified: website/application/modules/acm/controllers/ArchieveController.php =================================================================== --- website/application/modules/acm/controllers/ArchieveController.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/controllers/ArchieveController.php 2008-12-10 17:34:11 UTC (rev 442) @@ -10,7 +10,7 @@ public function viewAction() { $id = $this->_getParam('id'); - $problem = $this->_model->get($id); + $problem = $this->_model->getChallenge($id); if (!$problem) return $this->_forward('index', null, null, $this->_getAllParams() + array('message' => 'noProblem')); Added: website/application/modules/acm/controllers/ContestController.php =================================================================== --- website/application/modules/acm/controllers/ContestController.php (rev 0) +++ website/application/modules/acm/controllers/ContestController.php 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,134 @@ +<?php + +class Acm_ContestController extends Ostacium_Controller_Action +{ + public function indexAction() + { + $this->view->contests = $this->_model->getContests(); + } + + public function registerAction() + { + $contestid = $this->_getParam('contestid'); + + if (!$this->_model->isContestRunning($contestid)) + { + return $this->render('notrun'); + } + + if ($this->_model->isInContest($contestid)) + { + return $this->render('incontest'); + } + + $this->_model->registerUser($contestid); + + return $this->render('registered'); + } + + public function viewAction() + { + $id = $this->_getParam('id'); + $contestid = $this->_getParam('contestid'); + + $problem = $this->_model->getChallenge($id, $contestid); + + if (!$problem) + return $this->_forward('problemset', null, null, $this->_getAllParams() + array('message' => 'noProblem')); + + $this->view->assign($problem); + } + + public function problemsetAction() + { + $contestid = $this->_getParam('contestid'); + + // check if user is in this contest + + $this->view->challenges = $this->_model->getChallenges($contestid); + } + + public function submitAction() + { + $contestid = $this->_getParam('contestid'); + + if (!$this->_model->isContestRunning($contestid)) + { + return $this->render('notrun'); + } + + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + + $form = new Form_Submit(); + + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + echo $form; + } + + public function uploadAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $form = new Form_Submit(); + + if (!$this->getRequest()->isPost()) + { + return $this->_forward('submit', null, null, $this->_getAllParams()); + } + + if ($_POST['type'] == 0) + { + $form->code->setRequired(true); + } + elseif ($_POST['type'] == 1) + { + $form->codefile->setRequired(true); + } + + $result = $form->isValid($this->getRequest()->getPost()); + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + if ($form->type->getValue() == 0) + { + $form->code->setRequired(false); + } + elseif ($form->type->getValue() == 1) + { + $form->codefile->setRequired(false); + } + + if (!$result) + { + echo $form; + return; + } + + $values = $form->getValues(); + $values += $this->_getAllParams(); + $id = $this->_model->addSubmit($values); + + if ($id === false) + { + if ($values['type'] == 1) + unlink($form->codefile->getFileName()); + + return $this->render('notrun'); + } + + if ($values['type'] == 0) + { + file_put_contents(Application::getDocRoot().'/other/submits/'.$id, $values['code']); + } + elseif ($values['type'] == 1) + { + rename($form->codefile->getFileName(), Application::getDocRoot().'/other/submits/'.$id); + } + } + + public function resultsAction() + { + $contestid = $this->_getParam('contestid'); + + $this->view->submits = $this->_model->getSubmits($contestid); + } +} \ No newline at end of file Modified: website/application/modules/acm/models/Archieve.php =================================================================== --- website/application/modules/acm/models/Archieve.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/models/Archieve.php 2008-12-10 17:34:11 UTC (rev 442) @@ -14,7 +14,7 @@ return $submits->getAll(); } - public function get($id) + public function getChallenge($id) { $challenges = new Challenges(); return $challenges->get($id); @@ -23,6 +23,7 @@ public function addSubmit($values) { $data = array( + 'contestid' => 0, 'username' => Zend_Auth::getInstance()->getStorage()->read()->username, 'challengeid' => (int)$values['id'], 'codelangid' => $values['languageid'], @@ -30,8 +31,9 @@ 'when' => time() ); - $challenges = new Challenges(); - $challenges->update(array('tries' => 'tries + 1'), $this->_db->quoteInto('id = ?', $data['challengeid'])); + //$challenges = new Challenges(); + //$challenges->update(array('tries' => 'tries + 1'), $this->_db->quoteInto('id = ?', $data['challengeid'])); + // move this to the page, where we recieve data from Tester, add tries and accepts there. $submits = new Submits(); return $submits->insert($data); @@ -45,22 +47,22 @@ public function get($id) { - return $this->selectLang(array('name', 'description'))->where($this->_name.'.id = ?', $id)->query()->fetch(); + return $this->selectLang(array('name', 'description'))->where('challenges.id = ? AND enabled = 1', $id)->query()->fetch(); } public function getAll() { - return $this->selectLang(array('name', 'description'))->where('enabled = ?', 1)->query()->fetchAll(); + return $this->selectLang(array('name', 'description'))->where('challenges.enabled = 1')->query()->fetchAll(); } } class Submits extends Ostacium_Db_Table { - protected $_name = 'archieve_submits'; + protected $_name = 'submits'; protected $_primary = 'id'; public function getAll() { - return $this->select()->from($this)->setIntegrityCheck(false)->joinLeft('code_languages', 'code_languages.id = archieve_submits.codelangid', array('codelang' => 'name'))->order('id DESC')->query()->fetchAll(); + return $this->select()->from($this)->setIntegrityCheck(false)->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name'))->where('contestid = 0')->order('submits.id DESC')->query()->fetchAll(); } } \ No newline at end of file Added: website/application/modules/acm/models/Contest.php =================================================================== --- website/application/modules/acm/models/Contest.php (rev 0) +++ website/application/modules/acm/models/Contest.php 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,165 @@ +<?php + +class Contest extends Ostacium_Model +{ + public function getContests() + { + $contests = new Contests(); + return $contests->getAll(); + } + + public function registerUser($id) + { + $username = Zend_Auth::getInstance()->getStorage()->read()->username; + + $ca = new ContestsApplicants(); + $ca->insert(array('username' => $username, 'contestid' => $id)); + + return true; + } + + public function isContestRunning($contestid) + { + $contest = new Contests(); + return $contest->isRunning($contestid); + } + + public function isInContest($contestid) + { + $username = Zend_Auth::getInstance()->getStorage()->read()->username; + $contest = new Contests(); + + return $contest->isInContest($contestid, $username); + } + + public function getChallenges($contestid) + { + $challenges = new Challenges(); + return $challenges->getAll($contestid); + } + + public function getChallenge($id, $contestid) + { + $challenges = new Challenges(); + return $challenges->get($id, $contestid); + } + + public function addSubmit($values) + { + $data = array( + 'contestid' => $values['contestid'], + 'username' => Zend_Auth::getInstance()->getStorage()->read()->username, + 'challengeid' => (int)$values['id'], + 'codelangid' => $values['languageid'], + 'firsttest' => $values['firsttest'], + 'when' => time() + ); + + $contest = new Contests(); + + if ($contest->isRunning($values['contestid'])) + { + $submits = new Submits(); + return $submits->insert($data); + } + else + return false; + } + + public function getSubmits($contestid) + { + $submits = new Submits(); + return $submits->getAll($contestid); + } +} + +class Challenges extends Ostacium_Db_Table +{ + protected $_name = 'challenges'; + protected $_primary = 'id'; + + public function getAll($contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), 'cc.contestid = c.id', 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetchAll(); + } + + public function get($id, $contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), $this->getAdapter()->quoteInto('cc.contestid = c.id AND cc.challengeid = ?', $id), 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetch(); + } +} + +class Submits extends Ostacium_Db_Table +{ + protected $_name = 'submits'; + protected $_primary = 'id'; + + public function getAll($contestid) + { + return $this->select()->setIntegrityCheck(false) + ->from($this) + ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ?', $contestid), array()) + ->where('submits.contestid = c.id')->order('submits.id DESC') + ->query()->fetchAll(); + } +} + +class Contests extends Ostacium_Db_Table +{ + protected $_name = 'contests'; + protected $_primary = 'id'; + + public function isRunning($contestid) + { + $id = $this->select()->from($this, 'id') + ->where('id = ? AND start <= UNIX_TIMESTAMP() AND end >= UNIX_TIMESTAMP() AND enabled = 1', $contestid) + ->query()->fetchColumn('id'); + + if ($id && $id == $contestid) + return true; + else + return false; + } + + public function getAll() + { + return $this->selectLang(array('name', 'description')) + ->where('enabled = 1 AND start <= UNIX_TIMESTAMP() AND end > UNIX_TIMESTAMP()') + ->query()->fetchAll(); + } + + public function isInContest($contestid, $username) + { + $id = $this->select()->setIntegrityCheck(false) + ->from(array('c' => $this->_name), 'id') + ->joinInner(array('a' => 'contests_applicants'), 'c.id=a.contestid', array()) + ->where('c.id = ?', $contestid) + ->where('a.username = ?', $username) + ->query()->fetchColumn('username'); + + if ($id && $id == $contestid) return true; + else return false; + } +} + +class ContestsApplicants extends Ostacium_Db_Table +{ + protected $_name = 'contests_applicants'; + protected $_primary = array('contestid', 'username'); +} + + +class Users extends Ostacium_Db_Table +{ + protected $_name = 'users'; + protected $_primaty = 'username'; +} \ No newline at end of file Modified: website/application/modules/acm/models/Form/Login.php =================================================================== --- website/application/modules/acm/models/Form/Login.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/models/Form/Login.php 2008-12-10 17:34:11 UTC (rev 442) @@ -18,7 +18,7 @@ $translate = Zend_Registry::get('Zend_Translate'); $router = Zend_Controller_Front::getInstance()->getRouter(); - $this->setAction($router->assemble(array('action' => 'login'), null)); + $this->setAction($router->assemble(array('action' => 'login', 'controller' => 'index'), null)); $this->setMethod('post'); $this->setName('loginform'); Property changes on: website/application/modules/acm/views/scripts/contest ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/acm/views/scripts/contest/contest.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/contest.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/contest.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,7 @@ +<tr> + <td align="center"><?= $this->id ?></td> + <td align="center"><?= $this->name ?></td> + <td align="center"><?= $this->date($this->start, "d.m.Y H:i:s") ?></td> + <td align="center"><?= $this->date($this->end, "d.m.Y H:i:s") ?></td> + <td align="center"><a href="<?= $this->url(array('action' => 'register', 'contestid' => $this->id), null) ?>"><?= $this->translate('register') ?></a></td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/entry.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/entry.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/entry.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,14 @@ +<tr bgcolor="#f4f3f8" align="middle"> + <td style="border-left: 0px none; border-right: 1px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'view', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->id ?></a> + </td> + + <td align="left" style="border-left: 0px none; border-right: 1px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'view', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->name ?></a> + </td> + + <td style="border-left: 0px none; border-right: 0px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'submit', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><img height="17" width="22" alt="Здати" title="Здати" src="images/b_find.gif"/></a> + <a href="<?= $this->url( array('action' => 'status', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><img height="17" width="22" alt="Показати як здають" src="images/probstatus.png"/> + </td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/incontest.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/incontest.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/incontest.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +You are already in this contest \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/index.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/index.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/index.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td bgcolor="#d0d4de" width="4" class="name"> + +<img height="18" width="4" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/"/></td> + +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Набiр контестів</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <table width="60%" cellspacing="0" cellpadding="0" border="0" summary="" align="center"><tbody><tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів контестів</b></td></tr><tr bgcolor="#e1e1e1" align="middle"> +<th>Номер</th><th>Назва</th><th>Початок</th><th>Кінець</th><th>Зареєструватись</th></tr> +<?= $this->partialLoop('contest/contest.phtml', $this->contests) ?> +</table><br/></td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/notrun.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/notrun.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/notrun.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +The contest is not running at the moment \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/problemset.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/problemset.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/problemset.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td bgcolor="#d0d4de" width="4" class="name"> + +<img height="18" width="4" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/"/></td> + +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Набiр задач</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <table cellspacing="0" cellpadding="0" border="0" summary="" align="center"><tbody><tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів задач</b></td></tr><tr><td bgcolor="#c4c4db" colspan="20"><img height="1" width="1" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/" alt=""/></td></tr><tr bgcolor="#e1e1e1" align="middle"> +<th width="70">Задача</th><th align="left" width="270"> Назва</th><th align="middle" width="70">Дії</th></tr><tr><td height="1" bgcolor="#c4c4db" colspan="20"><img height="1" width="1" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/" alt=""/></td></tr> +<?= $this->partialLoop('contest/entry.phtml', $this->challenges) ?> +</table><br/></td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/registered.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/registered.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/registered.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +You have successfully registered for contest \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/result.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/result.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/result.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<tr> + <td align="center"><?= $this->id ?></td> + <td align="center"><?= $this->date($this->when) ?></td> + <td align="center"><?= $this->username ?></td> + <td align="center"><a href="<?= $this->url( array('action' => 'view', 'id' => $this->challengeid), null) ?>"><?= $this->challengeid ?></a></td> + <td align="center"><?= $this->codelang ?></td> + <td align="center"><?= $this->state($this->state) ?></td> + <td align="center"><?= ($this->tests == 0 ? '-' : $this->tests) ?></td> + <td align="center"><?= ($this->runtime == 0 ? '-' : $this->runtime) ?>/<?= ($this->memory == 0 ? '-' : $this->memory) ?></td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/results.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/results.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/results.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"> +<tbody> +<tr> +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> +<font color="#d4d0e2"><b><small>Набiр задач</small></b><small/></font> +</td> +<td nowrap="" bgcolor="#122a5b" align="right" class="name"> +<font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font> +</td> +</tr> +</tbody> +</table> + +<table cellspacing="0" cellpadding="0" border="0" summary="" align="center" width="80%"> +<tbody> +<tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів задач</b></td></tr> +<tr bgcolor="#e1e1e1" align="middle"> +<th>ID</th> +<th>Дата</th> +<th>Логін</th> +<th>Задача</th> +<th>Мова</th> +<th>Стан</th> +<th>Тест</th> +<th>Час/Пам'ять</th> +</tr> + +<?= $this->partialLoop('archieve/result.phtml', $this->submits) ?> +</table> + +</td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/view.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/view.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/view.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,12 @@ +<h2 align="center"><?= $this->id.' - '.$this->name ?></h2> +<div align="center"> + <?= $this->translate('timelimit') ?>: <?= $this->measure("Time", $this->timelimit, Zend_Measure_Time::MILLISECOND, Zend_Measure_Time::SECOND, 0 ) ?><br /> + <?= $this->translate('memorylimit') ?>: <?= $this->measure("Binary", $this->memorylimit, Zend_Measure_Binary::BYTE, Zend_Measure_Binary::KILOBYTE ) ?><br /> + <?= $this->translate('outputlimit') ?>: <?= $this->measure("Binary", $this->outputlimit, Zend_Measure_Binary::BYTE, Zend_Measure_Binary::KILOBYTE ) ?><br /> +</div> +<br /> +<p><?= $this->description ?></p> + +<div> + <a href="<?= $this->url(array('action' => 'submit', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->translate('submit') ?></a> +</div> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/tester/entry.phtml =================================================================== --- website/application/modules/acm/views/scripts/tester/entry.phtml 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/views/scripts/tester/entry.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -1,3 +1,6 @@ -<entry id="<?= $this->id ?>" problemid="<?= $this->challengeid ?>" language="<?= $this->codelang ?>"> -<?= htmlentities(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?> -</entry> \ No newline at end of file +<submit> + <id><?= $this->id ?></id> + <sourceCode><?= htmlentities(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?></sourceCode> + <language><?= $this->codelangid ?></language> + <problem><?= $this->challengeid ?></problem> +</submit> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/tester/submits.phtml =================================================================== --- website/application/modules/acm/views/scripts/tester/submits.phtml 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/views/scripts/tester/submits.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -1,4 +1,4 @@ <?= '<?xml version="1.0" encoding="UTF-8"?>' ?> -<entries> +<submitList> <?= $this->partialLoop('tester/entry.phtml', $this->submits) ?> -</entries> \ No newline at end of file +</submitList> \ No newline at end of file Modified: website/other/dq.sql =================================================================== --- website/other/dq.sql 2008-12-10 00:41:43 UTC (rev 441) +++ website/other/dq.sql 2008-12-10 17:34:11 UTC (rev 442) @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Generation Time: Dec 07, 2008 at 11:51 PM +-- Generation Time: Dec 10, 2008 at 07:16 PM -- Server version: 5.0.51 -- PHP Version: 5.2.6 @@ -22,34 +22,6 @@ -- -------------------------------------------------------- -- --- Table structure for table `archieve_submits` --- - -CREATE TABLE IF NOT EXISTS `archieve_submits` ( - `id` int(11) NOT NULL auto_increment, - `username` varchar(50) NOT NULL, - `challengeid` int(11) NOT NULL, - `codelangid` int(11) NOT NULL, - `state` int(11) NOT NULL default '0', - `tests` int(11) NOT NULL default '0', - `firsttest` tinyint(1) NOT NULL, - `runtime` double NOT NULL default '0', - `memory` int(11) NOT NULL default '0', - `when` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; - --- --- Dumping data for table `archieve_submits` --- - -INSERT INTO `archieve_submits` (`id`, `username`, `challengeid`, `codelangid`, `state`, `tests`, `firsttest`, `runtime`, `memory`, `when`) VALUES -(3, 'tester', 1000, 1, 1, 100, 0, 1002, 1001, 1228664380), -(5, 'panza', 1000, 1, 0, 0, 1, 0, 0, 1228685834); - --- -------------------------------------------------------- - --- -- Table structure for table `challenges` -- @@ -277,7 +249,7 @@ `langcode` varchar(2) NOT NULL, `name` varchar(200) NOT NULL, `description` text NOT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`,`langcode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- @@ -520,21 +492,45 @@ CREATE TABLE IF NOT EXISTS `contests` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `description` varchar(100) NOT NULL, `start` int(11) NOT NULL, `end` int(11) NOT NULL, + `enabled` tinyint(1) NOT NULL default '0', + `virtual` tinyint(1) NOT NULL default '0', + `team` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `contests` -- +INSERT INTO `contests` (`id`, `start`, `end`, `enabled`, `virtual`, `team`) VALUES +(1, 228766000, 2147483647, 1, 0, 0); -- -------------------------------------------------------- -- +-- Table structure for table `contests_applicants` +-- + +CREATE TABLE IF NOT EXISTS `contests_applicants` ( + `contestid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + PRIMARY KEY (`contestid`,`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_applicants` +-- + +INSERT INTO `contests_applicants` (`contestid`, `username`) VALUES +(0, 'panza'), +(1, 'admin'), +(1, 'panza'); + +-- -------------------------------------------------------- + +-- -- Table structure for table `contests_challenges` -- @@ -548,10 +544,72 @@ -- Dumping data for table `contests_challenges` -- +INSERT INTO `contests_challenges` (`contestid`, `challengeid`) VALUES +(1, 1000), +(1, 1001); -- -------------------------------------------------------- -- +-- Table structure for table `contests_lang` +-- + +CREATE TABLE IF NOT EXISTS `contests_lang` ( + `id` int(11) NOT NULL, + `langcode` varchar(2) NOT NULL, + `name` varchar(200) NOT NULL, + `description` text NOT NULL, + PRIMARY KEY (`id`,`langcode`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_lang` +-- + +INSERT INTO `contests_lang` (`id`, `langcode`, `name`, `description`) VALUES +(1, 'uk', 'Тестовий Контест', 'Тестовий Контест'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `contests_results` +-- + +CREATE TABLE IF NOT EXISTS `contests_results` ( + `contestid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + `challengeid` int(11) NOT NULL, + `tries` int(11) NOT NULL, + `penalty` int(11) NOT NULL, + `accepted` tinyint(1) NOT NULL, + PRIMARY KEY (`contestid`,`username`,`challengeid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_results` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `contests_teams` +-- + +CREATE TABLE IF NOT EXISTS `contests_teams` ( + `contestid` int(11) NOT NULL, + `teamid` int(11) NOT NULL, + PRIMARY KEY (`contestid`,`teamid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_teams` +-- + + +-- -------------------------------------------------------- + +-- -- Table structure for table `languages` -- @@ -583,12 +641,117 @@ `message` text NOT NULL, `ip` varchar(15) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=105 ; -- -- Dumping data for table `log` -- +INSERT INTO `log` (`id`, `when`, `username`, `type`, `message`, `ip`) VALUES +(1, 1228687021, 'panza', 'NOTICE', 'runtime: 0.402740955353; totalqueries: 5; totalqueriestime: 0.000763177871704', '127.0.0.1'), +(2, 1228687062, 'panza', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(3, 1228687062, 'panza', 'NOTICE', 'runtime: 0.268155813217; totalqueries: 6; totalqueriestime: 0.000887155532837', '127.0.0.1'), +(4, 1228687077, 'panza', 'ERR', 'Type:EXCEPTION_NOTALLOWED\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(5, 1228687077, 'panza', 'NOTICE', 'runtime: 0.255424976349; totalqueries: 6; totalqueriestime: 0.00112795829773', '127.0.0.1'), +(6, 1228687081, 'panza', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(7, 1228687081, 'panza', 'NOTICE', 'runtime: 0.252156019211; totalqueries: 6; totalqueriestime: 0.000904083251953', '127.0.0.1'), +(8, 1228687083, 'panza', 'NOTICE', 'runtime: 0.352587938309; totalqueries: 5; totalqueriestime: 0.000739097595215', '127.0.0.1'), +(9, 1228687087, 'tester', 'NOTICE', 'runtime: 0.35676407814; totalqueries: 5; totalqueriestime: 0.000777006149292', '127.0.0.1'), +(10, 1228687681, 'tester', 'NOTICE', 'runtime: 0.251905918121; totalqueries: 5; totalqueriestime: 0.000739097595215', '127.0.0.1'), +(11, 1228687683, 'tester', 'NOTICE', 'runtime: 0.451593875885; totalqueries: 6; totalqueriestime: 0.00546813011169', '127.0.0.1'), +(12, 1228688210, 'tester', 'NOTICE', 'runtime: 0.375689983368; totalqueries: 5; totalqueriestime: 0.000783920288086', '127.0.0.1'), +(13, 1228688221, 'tester', 'NOTICE', 'runtime: 0.354820966721; totalqueries: 5; totalqueriestime: 0.000791072845459', '127.0.0.1'), +(14, 1228688276, 'guest', 'NOTICE', 'runtime: 0.353997945786; totalqueries: 5; totalqueriestime: 0.000945568084717', '127.0.0.1'), +(15, 1228688289, 'guest', 'NOTICE', 'runtime: 0.363173961639; totalqueries: 5; totalqueriestime: 0.00074315071106', '127.0.0.1'), +(16, 1228688308, 'guest', 'NOTICE', 'runtime: 0.364115953445; totalqueries: 5; totalqueriestime: 0.000854730606079', '127.0.0.1'), +(17, 1228741301, 'guest', 'NOTICE', 'runtime: 1.43999099731; totalqueries: 6; totalqueriestime: 0.0433101654053', '127.0.0.1'), +(18, 1228741346, 'guest', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(19, 1228741346, 'guest', 'NOTICE', 'runtime: 0.302864074707; totalqueries: 6; totalqueriestime: 0.000945806503296', '127.0.0.1'), +(20, 1228741349, 'guest', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(21, 1228741349, 'guest', 'NOTICE', 'runtime: 0.254481077194; totalqueries: 6; totalqueriestime: 0.000924110412598', '127.0.0.1'), +(22, 1228741719, 'guest', 'NOTICE', 'runtime: 0.322642087936; totalqueries: 6; totalqueriestime: 0.00111651420593', '127.0.0.1'), +(23, 1228745567, 'guest', 'NOTICE', 'runtime: 1.22641611099; totalqueries: 6; totalqueriestime: 0.000978708267212', '127.0.0.1'), +(24, 1228745669, 'guest', 'NOTICE', 'runtime: 0.473080158234; totalqueries: 6; totalqueriestime: 0.00102496147156', '127.0.0.1'), +(25, 1228766766, 'guest', 'NOTICE', 'runtime: 0.910779953003; totalqueries: 5; totalqueriestime: 0.000758409500122', '127.0.0.1'), +(26, 1228766773, 'guest', 'NOTICE', 'runtime: 0.377062082291; totalqueries: 5; totalqueriestime: 0.000734090805054', '127.0.0.1'), +(27, 1228766780, 'admin', 'NOTICE', 'runtime: 0.344890117645; totalqueries: 5; totalqueriestime: 0.000730991363525', '127.0.0.1'), +(28, 1228766909, 'admin', 'NOTICE', 'runtime: 0.286052942276; totalqueries: 6; totalqueriestime: 0.00117993354797', '127.0.0.1'), +(29, 1228767005, 'admin', 'NOTICE', 'runtime: 0.249300956726; totalqueries: 6; totalqueriestime: 0.00116324424744', '127.0.0.1'), +(30, 1228767091, 'admin', 'NOTICE', 'runtime: 0.268568992615; totalqueries: 6; totalqueriestime: 0.00105500221252', '127.0.0.1'), +(31, 1228767258, 'admin', 'NOTICE', 'runtime: 0.26207113266; totalqueries: 6; totalqueriestime: 0.00106501579285', '127.0.0.1'), +(32, 1228767334, 'admin', 'NOTICE', 'runtime: 0.275465011597; totalqueries: 6; totalqueriestime: 0.00116205215454', '127.0.0.1'), +(33, 1228767360, 'admin', 'NOTICE', 'runtime: 0.423779964447; totalqueries: 6; totalqueriestime: 0.00103998184204', '127.0.0.1'), +(34, 1228767377, 'admin', 'NOTICE', 'runtime: 0.297820091248; totalqueries: 6; totalqueriestime: 0.00109577178955', '127.0.0.1'), +(35, 1228767424, 'admin', 'NOTICE', 'runtime: 0.332688093185; totalqueries: 6; totalqueriestime: 0.00102591514587', '127.0.0.1'), +(36, 1228767434, 'admin', 'NOTICE', 'runtime: 0.297483921051; totalqueries: 6; totalqueriestime: 0.00101661682129', '127.0.0.1'), +(37, 1228767933, 'admin', 'NOTICE', 'runtime: 0.311790943146; totalqueries: 6; totalqueriestime: 0.00101613998413', '127.0.0.1'), +(38, 1228767948, 'admin', 'NOTICE', 'runtime: 0.275632143021; totalqueries: 6; totalqueriestime: 0.000970840454102', '127.0.0.1'), +(39, 1228767974, 'admin', 'NOTICE', 'runtime: 0.283143997192; totalqueries: 6; totalqueriestime: 0.000986099243164', '127.0.0.1'), +(40, 1228768018, 'admin', 'NOTICE', 'runtime: 0.272602081299; totalqueries: 6; totalqueriestime: 0.00103712081909', '127.0.0.1'), +(41, 1228768043, 'admin', 'NOTICE', 'runtime: 0.257270097733; totalqueries: 6; totalqueriestime: 0.00101089477539', '127.0.0.1'), +(42, 1228768049, 'admin', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(43, 1228768049, 'admin', 'NOTICE', 'runtime: 0.269228935242; totalqueries: 6; totalqueriestime: 0.000887870788574', '127.0.0.1'), +(44, 1228768867, 'admin', 'NOTICE', 'runtime: 0.231039047241; totalqueries: 6; totalqueriestime: 0.000965118408203', '127.0.0.1'), +(45, 1228768896, 'admin', 'NOTICE', 'runtime: 0.437469005585; totalqueries: 6; totalqueriestime: 0.00623726844788', '127.0.0.1'), +(46, 1228768902, 'admin', 'NOTICE', 'runtime: 0.251997947693; totalqueries: 6; totalqueriestime: 0.00103378295898', '127.0.0.1'), +(47, 1228770333, 'admin', 'NOTICE', 'runtime: 0.264349937439; totalqueries: 6; totalqueriestime: 0.00107169151306', '127.0.0.1'), +(48, 1228770367, 'admin', 'NOTICE', 'runtime: 0.241730928421; totalqueries: 6; totalqueriestime: 0.00105619430542', '127.0.0.1'), +(49, 1228770407, 'admin', 'NOTICE', 'runtime: 0.25093793869; totalqueries: 6; totalqueriestime: 0.00124430656433', '127.0.0.1'), +(50, 1228770465, 'admin', 'NOTICE', 'runtime: 0.269231081009; totalqueries: 6; totalqueriestime: 0.00140309333801', '127.0.0.1'), +(51, 1228770715, 'admin', 'NOTICE', 'runtime: 0.262792110443; totalqueries: 6; totalqueriestime: 0.00123476982117', '127.0.0.1'), +(52, 1228771020, 'admin', 'NOTICE', 'runtime: 0.300353050232; totalqueries: 6; totalqueriestime: 0.00111222267151', '127.0.0.1'), +(53, 1228771033, 'admin', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(54, 1228771033, 'admin', 'NOTICE', 'runtime: 0.234899997711; totalqueries: 6; totalqueriestime: 0.00088906288147', '127.0.0.1'), +(55, 1228771053, 'admin', 'NOTICE', 'runtime: 0.714066982269; totalqueries: 6; totalqueriestime: 0.00090503692627', '127.0.0.1'), +(56, 1228771484, 'admin', 'NOTICE', 'runtime: 0.465132951736; totalqueries: 7; totalqueriestime: 0.00111651420593', '127.0.0.1'), +(57, 1228771529, 'admin', 'NOTICE', 'runtime: 0.298429965973; totalqueries: 6; totalqueriestime: 0.00111413002014', '127.0.0.1'), +(58, 1228771563, 'admin', 'NOTICE', 'runtime: 0.302327156067; totalqueries: 6; totalqueriestime: 0.00112509727478', '127.0.0.1'), +(59, 1228771785, 'admin', 'NOTICE', 'runtime: 0.284492015839; totalqueries: 6; totalqueriestime: 0.0012526512146', '127.0.0.1'), +(60, 1228826180, 'admin', 'NOTICE', 'runtime: 13.5730581284; totalqueries: 6; totalqueriestime: 0.00137305259705', '127.0.0.1'), +(61, 1228826199, 'admin', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(62, 1228826199, 'admin', 'NOTICE', 'runtime: 0.783575057983; totalqueries: 6; totalqueriestime: 0.000910758972168', '127.0.0.1'), +(63, 1228826201, 'admin', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(64, 1228826201, 'admin', 'NOTICE', 'runtime: 0.235674142838; totalqueries: 6; totalqueriestime: 0.00092077255249', '127.0.0.1'), +(65, 1228843063, 'admin', 'NOTICE', 'runtime: 0.402568101883; totalqueries: 6; totalqueriestime: 0.00116920471191', '127.0.0.1'), +(66, 1228843086, 'admin', 'NOTICE', 'runtime: 0.260549068451; totalqueries: 6; totalqueriestime: 0.00125503540039', '127.0.0.1'), +(67, 1228843598, 'admin', 'NOTICE', 'runtime: 0.280871152878; totalqueries: 6; totalqueriestime: 0.00107192993164', '127.0.0.1'), +(68, 1228843602, 'admin', 'NOTICE', 'runtime: 0.274296045303; totalqueries: 6; totalqueriestime: 0.00107288360596', '127.0.0.1'), +(69, 1228843606, 'admin', 'NOTICE', 'runtime: 0.405455112457; totalqueries: 6; totalqueriestime: 0.00119829177856', '127.0.0.1'), +(70, 1228843619, 'admin', 'NOTICE', 'runtime: 0.31596493721; totalqueries: 6; totalqueriestime: 0.00110936164856', '127.0.0.1'), +(71, 1228844705, 'admin', 'NOTICE', 'runtime: 0.395545959473; totalqueries: 6; totalqueriestime: 0.00116276741028', '127.0.0.1'), +(72, 1228844717, 'admin', 'NOTICE', 'runtime: 0.314126968384; totalqueries: 6; totalqueriestime: 0.00121402740479', '127.0.0.1'), +(73, 1228844720, 'admin', 'NOTICE', 'runtime: 0.27409696579; totalqueries: 6; totalqueriestime: 0.00108957290649', '127.0.0.1'), +(74, 1228844724, 'admin', 'NOTICE', 'runtime: 0.29937005043; totalqueries: 6; totalqueriestime: 0.00117301940918', '127.0.0.1'), +(75, 1228849580, 'admin', 'NOTICE', 'runtime: 0.350373983383; totalqueries: 6; totalqueriestime: 0.00121092796326', '127.0.0.1'), +(76, 1228849582, 'admin', 'NOTICE', 'runtime: 0.32250213623; totalqueries: 6; totalqueriestime: 0.00111365318298', '127.0.0.1'), +(77, 1228849585, 'admin', 'NOTICE', 'runtime: 0.283563137054; totalqueries: 6; totalqueriestime: 0.00141477584839', '127.0.0.1'), +(78, 1228849587, 'admin', 'NOTICE', 'runtime: 1.00412106514; totalqueries: 6; totalqueriestime: 0.00116395950317', '127.0.0.1'), +(79, 1228849587, 'admin', 'NOTICE', 'runtime: 1.16452503204; totalqueries: 6; totalqueriestime: 0.000949621200562', '127.0.0.1'), +(80, 1228849594, 'admin', 'NOTICE', 'runtime: 0.435815095901; totalqueries: 7; totalqueriestime: 0.00116896629333', '127.0.0.1'), +(81, 1228849677, 'admin', 'NOTICE', 'runtime: 0.318450927734; totalqueries: 6; totalqueriestime: 0.00130677223206', '127.0.0.1'), +(82, 1228849750, 'admin', 'NOTICE', 'runtime: 0.407657146454; totalqueries: 7; totalqueriestime: 0.00122785568237', '127.0.0.1'), +(83, 1228849778, 'admin', 'NOTICE', 'runtime: 0.414417028427; totalqueries: 7; totalqueriestime: 0.00116395950317', '127.0.0.1'), +(84, 1228849789, 'admin', 'NOTICE', 'runtime: 0.319971084595; totalqueries: 6; totalqueriestime: 0.00115609169006', '127.0.0.1'), +(85, 1228849961, 'admin', 'NOTICE', 'runtime: 0.32728600502; totalqueries: 6; totalqueriestime: 0.00110483169556', '127.0.0.1'), +(86, 1228850462, 'admin', 'NOTICE', 'runtime: 0.33651804924; totalqueries: 6; totalqueriestime: 0.00116801261902', '127.0.0.1'), +(87, 1228850649, 'admin', 'NOTICE', 'runtime: 0.328559160233; totalqueries: 6; totalqueriestime: 0.00132656097412', '127.0.0.1'), +(88, 1228850917, 'admin', 'NOTICE', 'runtime: 0.306250095367; totalqueries: 6; totalqueriestime: 0.00110626220703', '127.0.0.1'), +(89, 1228857665, 'admin', 'NOTICE', 'runtime: 1.30937600136; totalqueries: 6; totalqueriestime: 0.00122904777527', '127.0.0.1'), +(90, 1228857669, 'admin', 'NOTICE', 'runtime: 0.324778079987; totalqueries: 6; totalqueriestime: 0.00106501579285', '127.0.0.1'), +(91, 1228922920, 'guest', 'NOTICE', 'runtime: 4.43998098373; totalqueries: 5; totalqueriestime: 0.0010986328125', '127.0.0.1'), +(92, 1228927133, 'guest', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(93, 1228927133, 'guest', 'NOTICE', 'runtime: 0.472977161407; totalqueries: 6; totalqueriestime: 0.00107407569885', '127.0.0.1'), +(94, 1228927141, 'guest', 'NOTICE', 'runtime: 0.385906934738; totalqueries: 5; totalqueriestime: 0.000811100006104', '127.0.0.1'), +(95, 1228927146, 'guest', 'NOTICE', 'runtime: 0.364606142044; totalqueries: 5; totalqueriestime: 0.000753879547119', '127.0.0.1'), +(96, 1228927151, 'guest', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(97, 1228927151, 'guest', 'NOTICE', 'runtime: 0.259967088699; totalqueries: 6; totalqueriestime: 0.000933170318604', '127.0.0.1'), +(98, 1228927190, 'guest', 'NOTICE', 'runtime: 0.358453035355; totalqueries: 5; totalqueriestime: 0.000750780105591', '127.0.0.1'), +(99, 1228927196, 'panza', 'NOTICE', 'runtime: 0.361056089401; totalqueries: 5; totalqueriestime: 0.00078010559082', '127.0.0.1'), +(100, 1228927202, 'panza', 'NOTICE', 'runtime: 0.644073009491; totalqueries: 6; totalqueriestime: 0.0622811317444', '127.0.0.1'), +(101, 1228927206, 'panza', 'NOTICE', 'runtime: 0.314320087433; totalqueries: 6; totalqueriestime: 0.00124430656433', '127.0.0.1'), +(102, 1228927213, 'panza', 'NOTICE', 'runtime: 0.276901006699; totalqueries: 6; totalqueriestime: 0.00113844871521', '127.0.0.1'), +(103, 1228927238, 'panza', 'NOTICE', 'runtime: 0.278286933899; totalqueries: 6; totalqueriestime: 0.00106000900269', '127.0.0.1'), +(104, 1228928996, 'panza', 'NOTICE', 'runtime: 0.269110202789; totalqueries: 7; totalqueriestime: 0.00115633010864', '127.0.0.1'); -- -------------------------------------------------------- @@ -614,6 +777,7 @@ (1, 5), (1, 6), (1, 8), +(2, 9), (4, 7); -- -------------------------------------------------------- @@ -627,7 +791,7 @@ `controller` varchar(50) NOT NULL, `action` varchar(50) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Dumping data for table `resources` @@ -641,7 +805,8 @@ (5, 'acm:index', '*'), (6, 'acm:archieve', '*'), (7, 'acm:tester', '*'), -(8, 'acm:user', '*'); +(8, 'acm:user', '*'), +(9, 'acm:contest', '*'); -- -------------------------------------------------------- @@ -686,6 +851,76 @@ -- -------------------------------------------------------- -- +-- Table structure for table `submits` +-- + +CREATE TABLE IF NOT EXISTS `submits` ( + `id` int(11) NOT NULL auto_increment, + `contestid` int(11) NOT NULL default '0', + `username` varchar(50) NOT NULL, + `challengeid` int(11) NOT NULL, + `codelangid` int(11) NOT NULL, + `state` int(11) NOT NULL default '0', + `tests` int(11) NOT NULL default '0', + `firsttest` tinyint(1) NOT NULL, + `runtime` double NOT NULL default '0', + `memory` int(11) NOT NULL default '0', + `when` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; + +-- +-- Dumping data for table `submits` +-- + +INSERT INTO `submits` (`id`, `contestid`, `username`, `challengeid`, `codelangid`, `state`, `tests`, `firsttest`, `runtime`, `memory`, `when`) VALUES +(3, 0, 'tester', 1000, 1, 1, 100, 0, 1002, 1001, 1228664380), +(5, 0, 'panza', 1000, 1, 1, 100, 1, 1000, 1000, 1228685834), +(6, 1, 'admin', 1000, 1, 0, 0, 0, 0, 0, 1228771484), +(9, 1, 'admin', 1000, 1, 0, 0, 0, 0, 0, 1228849778); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `teams` +-- + +CREATE TABLE IF NOT EXISTS `teams` ( + `id` int(11) NOT NULL, + `name` varchar(100) NOT NULL, + `captain` varchar(50) NOT NULL, + `trainer` varchar(100) NOT NULL, + `contests` int(11) NOT NULL, + `tries` int(11) NOT NULL, + `accepted` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `teams` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `teams_members` +-- + +CREATE TABLE IF NOT EXISTS `teams_members` ( + `teamid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + PRIMARY KEY (`teamid`,`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `teams_members` +-- + + +-- -------------------------------------------------------- + +-- -- Table structure for table `users` -- @@ -710,7 +945,7 @@ INSERT INTO `users` (`username`, `password`, `email`, `registered`, `online`, `posts`, `roleid`, `activated`, `banned`, `ip`) VALUES ('admin', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'ad...@os...', 1223066421, 1223066447, 0, 2, NULL, 0, '192.168.1.7'), -('tester', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'te...@os...', 1228663658, 0, 0, 4, NULL, 0, ''), +('tester', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'te...@os...', 1228663658, 1228927008, 0, 4, NULL, 0, ''), ('panza', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'pa...@os...', 1228684723, 1228684723, 0, 2, NULL, 0, '127.0.0.1'); -- -------------------------------------------------------- @@ -723,7 +958,7 @@ `username` varchar(50) NOT NULL, `name` varchar(50) NOT NULL, `surname` varchar(50) NOT NULL, - `study` varchar(50) NOT NULL, + `study` varchar(50) default NULL, `birthday` int(11) NOT NULL, `aim` varchar(50) default NULL, `icq` varchar(50) default NULL, @@ -747,8 +982,8 @@ INSERT INTO `usersdetails` (`username`, `name`, `surname`, `study`, `birthday`, `aim`, `icq`, `msn`, `skype`, `yahoo`, `web`, `topcoder`, `timus`, `timeoffset`, `codelangid`, `language`, `tshirtsize`, `hideemail`) VALUES ('admin', 'Igor', 'Petrovich', 'LNU PMI-21', 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '+2', 1, 'en', 'small', 0), -('tester', 'Tester', 'Tester', '', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', 1, 'en', '', 1), -('panza', 'Igor', 'Petrovich', 'LNU', 1988, '', '', 'pan...@ho...', '', '', 'http://www.panzaboi.com/', '', '', '+2', 1, 'uk', 'L', 0); +('tester', 'Tester', 'Tester', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', 1, 'en', '', 1), +('panza', 'Igor', 'Petrovich', 'LNU', 1988, NULL, NULL, 'pan...@ho...', NULL, NULL, 'http://www.panzaboi.com/', NULL, NULL, '+2', 1, 'uk', 'L', 0); -- -------------------------------------------------------- @@ -760,6 +995,8 @@ `username` varchar(50) NOT NULL, `archieve_tries` int(11) NOT NULL default '0', `archieve_accepts` int(11) NOT NULL default '0', + `contest_tries` int(11) NOT NULL default '0', + `contest_accepts` int(11) NOT NULL default '0', PRIMARY KEY (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -767,7 +1004,7 @@ -- Dumping data for table `usersstats` -- -INSERT INTO `usersstats` (`username`, `archieve_tries`, `archieve_accepts`) VALUES -('admin', 0, 0), -('tester', 0, 0), -('panza', 0, 0); +INSERT INTO `usersstats` (`username`, `archieve_tries`, `archieve_accepts`, `contest_tries`, `contest_accepts`) VALUES +('admin', 0, 0, 0, 0), +('tester', 0, 0, 0, 0), +('panza', 0, 0, 0, 0); Added: website/other/submits/6 =================================================================== --- website/other/submits/6 (rev 0) +++ website/other/submits/6 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/7 =================================================================== --- website/other/submits/7 (rev 0) +++ website/other/submits/7 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/8 =================================================================== --- website/other/submits/8 (rev 0) +++ website/other/submits/8 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/9 =================================================================== --- website/other/submits/9 (rev 0) +++ website/other/submits/9 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Modified: website/other/todo.txt =================================================================== --- website/other/todo.txt 2008-12-10 00:41:43 UTC (rev 441) +++ website/other/todo.txt 2008-12-10 17:34:11 UTC (rev 442) @@ -1,3 +1,7 @@ +1. Virtual Contests +2. Teams +3. Team Contests +------------------------------------------------ +/-1. Add Zend_Log, write - undecided, FILE? DB? 2. Design Change 3. Ostacium_CrudAction redesign @@ -5,7 +9,7 @@ 5. Front_Controller => catch Exception => go to Error Controller 6. Caching for DB, VIEW, etc. -7. Table Prefix - відложено -8. Custom Admin Email ++8. Custom From Email 9. Add mb_ support to everything 10!. _authenticateCreateSelect - quote the reference! how? 11. Extend Profiler - getLongestQuery \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-10 00:41:47
|
Revision: 441 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=441&view=rev Author: brus07 Date: 2008-12-10 00:41:43 +0000 (Wed, 10 Dec 2008) Log Message: ----------- Fixed buf with HtmlEntity. Modified Paths: -------------- ACMServer/trunk/ACMServer/Runner/Class1.cs Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-09 20:36:22 UTC (rev 440) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-10 00:41:43 UTC (rev 441) @@ -18,7 +18,7 @@ InitHtmlEntityList(); for (int i = 0; i < htmlEntityList.Count; i++) { - str = str.Replace(htmlEntityList[i].Key, htmlEntityList[i].Value); + str = str.Replace(htmlEntityList[i].Value, htmlEntityList[i].Key); } return str; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-09 20:36:26
|
Revision: 440 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=440&view=rev Author: brus07 Date: 2008-12-09 20:36:22 +0000 (Tue, 09 Dec 2008) Log Message: ----------- Added LanguageID and ProblemID to Submit structure. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/Submit.cs ACMServer/trunk/ACMServer/Library/testData/data.xsd ACMServer/trunk/ACMServer/Library/testData/data.xsx ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIPlugin.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs ACMServer/trunk/ACMServer/Runner/Class1.cs Modified: ACMServer/trunk/ACMServer/Library/Data/Submit.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Submit.cs 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Library/Data/Submit.cs 2008-12-09 20:36:22 UTC (rev 440) @@ -11,6 +11,8 @@ { [XmlElement("id", typeof(int))] public int id; + [XmlElement("problem", typeof(int))] + public int pbolemID; [XmlElement("sourceCode", typeof(string))] public string sourceCode; [XmlElement("language", typeof(int))] Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsd =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsd 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsd 2008-12-09 20:36:22 UTC (rev 440) @@ -4,6 +4,7 @@ <xs:sequence maxOccurs="1"> <!-- потрібно щоб ці записи могли слідувати у довільному порядку --> <xs:element name="id" type="xs:positiveInteger" /> + <xs:element name="problem" type="xs:positiveInteger" /> <xs:element name="sourceCode" type="xs:string" /> <xs:element name="language"> <!-- обмеження для ID мови програмування --> Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsx =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsx 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsx 2008-12-09 20:36:22 UTC (rev 440) @@ -14,16 +14,16 @@ </_x0028_group1_x0029__XmlSequence> </submitList_XmlElement> <resultType_XmlComplexType left="1317" top="7932" width="5292" height="2831" selected="0" zOrder="19" index="2" expanded="1"> - <submit_XmlElement left="7243" top="7932" width="5292" height="2831" selected="0" zOrder="21" index="0" expanded="1"> + <submit_XmlElement left="7243" top="7932" width="5292" height="2831" selected="0" zOrder="21" index="4" expanded="1"> <language_XmlElement left="13169" top="8990" width="5292" height="714" selected="0" zOrder="24" index="2" expanded="0" /> </submit_XmlElement> </resultType_XmlComplexType> <result_XmlElement left="1317" top="11271" width="5292" height="2831" selected="0" zOrder="27" index="3" expanded="1"> - <submit_XmlElement left="7243" top="11271" width="5292" height="2831" selected="0" zOrder="29" index="0" expanded="1"> + <submit_XmlElement left="7243" top="11271" width="5292" height="2831" selected="0" zOrder="29" index="4" expanded="1"> <language_XmlElement left="13169" top="12329" width="5292" height="714" selected="0" zOrder="32" index="2" expanded="0" /> </submit_XmlElement> </result_XmlElement> <submit_XmlElement left="2910" top="14393" width="5292" height="2831" selected="0" zOrder="35" index="4" expanded="1"> - <language_XmlElement left="8836" top="15385" width="5292" height="714" selected="0" zOrder="37" index="2" expanded="0" /> + <language_XmlElement left="8836" top="15451" width="5292" height="714" selected="0" zOrder="37" index="2" expanded="0" /> </submit_XmlElement> </XSDDesignerLayout> \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIPlugin.cs 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIPlugin.cs 2008-12-09 20:36:22 UTC (rev 440) @@ -15,11 +15,12 @@ ((SubmitterGUIUserControl)base.Control).SetPlugin(this); } - public bool SendSubmit(string sourceCode, int language) + public bool SendSubmit(string sourceCode, int language, int problem) { Submit submit = new Submit(); submitID++; submit.id = submitID; + submit.pbolemID = problem; submit.sourceCode = sourceCode; submit.language = language; Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.Designer.cs 2008-12-09 20:36:22 UTC (rev 440) @@ -33,6 +33,8 @@ this.button1 = new System.Windows.Forms.Button(); this.languageTextBox = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.problemTextBox = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // panel1 @@ -75,7 +77,7 @@ this.languageTextBox.Name = "languageTextBox"; this.languageTextBox.Size = new System.Drawing.Size(100, 20); this.languageTextBox.TabIndex = 3; - this.languageTextBox.Text = "2"; + this.languageTextBox.Text = "1"; // // label1 // @@ -86,10 +88,29 @@ this.label1.TabIndex = 4; this.label1.Text = "Language"; // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(170, 6); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(45, 13); + this.label2.TabIndex = 6; + this.label2.Text = "Problem"; + // + // problemTextBox + // + this.problemTextBox.Location = new System.Drawing.Point(221, 3); + this.problemTextBox.Name = "problemTextBox"; + this.problemTextBox.Size = new System.Drawing.Size(100, 20); + this.problemTextBox.TabIndex = 5; + this.problemTextBox.Text = "1"; + // // SubmitterGUIUserControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label2); + this.Controls.Add(this.problemTextBox); this.Controls.Add(this.label1); this.Controls.Add(this.languageTextBox); this.Controls.Add(this.button1); @@ -109,5 +130,7 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.TextBox languageTextBox; private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox problemTextBox; } } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SubmitterGUIPlugin/SubmitterGUIUserControl.cs 2008-12-09 20:36:22 UTC (rev 440) @@ -39,7 +39,8 @@ private void button1_Click(object sender, EventArgs e) { int lang = Int32.Parse(languageTextBox.Text); - plugin.SendSubmit(sourceTextBox.Text, lang); + int problem = Int32.Parse(problemTextBox.Text); + plugin.SendSubmit(sourceTextBox.Text, lang, problem); } } } Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-09 15:17:25 UTC (rev 439) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-09 20:36:22 UTC (rev 440) @@ -38,14 +38,13 @@ string code = submit.sourceCode; code = HtmlEntityDecode(code); string id = submit.id.ToString(); - Result result = new Result(submit); try { //Console.SetOut(File.CreateText("logout.txt")); string[] data = File.ReadAllLines("InData.txt"); - + data[2] = data[2] + submit.pbolemID.ToString() + "\\"; string src = code; TestEnv test = new TestEnv(src, data[0], data[1], data[2]); test.Compile(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-12-09 15:17:28
|
Revision: 439 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=439&view=rev Author: brus07 Date: 2008-12-09 15:17:25 +0000 (Tue, 09 Dec 2008) Log Message: ----------- Read SecureLever from config file. Now source code can send with HtmlEntity, in this class it decode to normal chars. Modified Paths: -------------- ACMServer/trunk/ACMServer/Runner/Class1.cs Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-08 11:06:24 UTC (rev 438) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2008-12-09 15:17:25 UTC (rev 439) @@ -11,6 +11,18 @@ { public class Checker { + private static List<KeyValuePair<string, string>> htmlEntityList; + + private static string HtmlEntityDecode(string str) + { + InitHtmlEntityList(); + for (int i = 0; i < htmlEntityList.Count; i++) + { + str = str.Replace(htmlEntityList[i].Key, htmlEntityList[i].Value); + } + return str; + } + public static string GetResult(string message) { Log log = Log.GetLog(); @@ -18,9 +30,13 @@ log.Loging(message, Log.Priority.INFO); log.Loging("", Log.Priority.INFO); + IniFile iniFile = new IniFile("RealTesterConfig.ini"); + string secureLever = iniFile.GetString("MainConfig", "SecureLevel", "Double"); + //TODO: Submit submit = Submit.CreateFromXml(message); string code = submit.sourceCode; + code = HtmlEntityDecode(code); string id = submit.id.ToString(); Result result = new Result(submit); @@ -51,7 +67,17 @@ if (test.comp.Result == Test.CompRes.OK) { - test.RunAllTests(SecureType.Double); + SecureType secureType = SecureType.Double; + try + { + secureType = (SecureType)Enum.Parse(typeof(SecureType), secureLever, true); + } + catch (ArgumentException) + { + } + if (secureLever == "None") + secureType = SecureType.None; + test.RunAllTests(secureType); for (int i = 0; i < test.run.results.Length; i++) { @@ -97,5 +123,21 @@ } return result.ToStringX(); } + + + private static void InitHtmlEntityList() + { + if (htmlEntityList != null) + return; + htmlEntityList = new List<KeyValuePair<string,string>>(); + AddElementToHtmlEntityList("\"", """); + AddElementToHtmlEntityList("<", "<"); + AddElementToHtmlEntityList("&", "&"); + } + + private static void AddElementToHtmlEntityList(string p, string p_2) + { + htmlEntityList.Add(new KeyValuePair<string, string>(p, p_2)); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |