PT4 обновлён
This commit is contained in:
parent
d4d38c3730
commit
cdce2f285a
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "0";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "1024";
|
||||
public const string Revision = "1026";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=0
|
||||
%REVISION%=1024
|
||||
%REVISION%=1026
|
||||
%MAJOR%=3
|
||||
%COREVERSION%=0
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -92,7 +92,6 @@ end.
|
|||
// 5.6. Ãðóïïèðîâêà
|
||||
// LinqBegin60: ïðàâèëüíîå ðåøåíèå - 1 âàðèàíò (ñ.175, âíèçó)
|
||||
begin
|
||||
// ===呜攘世 饰滔人咧热===
|
||||
Task('LinqBegin60');
|
||||
ReadSeqString().GroupBy(e -> e[1])
|
||||
.OrderByDescending(e -> e.Sum(s -> s.Length)).ThenBy(e -> e.Key)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -4,7 +4,6 @@
|
|||
// 6.1. Простое задание на обработку отдельной последовательности
|
||||
// LinqObj4: правильное решение (с.191, внизу)
|
||||
begin
|
||||
// === 呜攘世 饰滔人咧圹 ===
|
||||
Task('LinqObj4');
|
||||
var r := ReadAllLines(ReadString)
|
||||
.Select(e ->
|
||||
|
|
@ -18,7 +17,7 @@ begin
|
|||
.GroupBy(e -> e.code,
|
||||
(k, ee) -> new class(k, sum := ee.Sum(c -> c.hours) ))
|
||||
.OrderByDescending(e -> e.sum).ThenBy(e -> e.k)
|
||||
.Select(e -> IntToStr(e.sum) + ' ' + IntToStr(e.k));
|
||||
.Select(e -> e.sum + ' ' + e.k);
|
||||
WriteAllLines(ReadString, r);
|
||||
end.
|
||||
[41]
|
||||
|
|
@ -27,7 +26,6 @@ end.
|
|||
// 6.2. Более сложные задания на обработку отдельных последовательностей
|
||||
// LinqObj41: правильное решение (с.196)
|
||||
begin
|
||||
// === 呜攘世 饰滔人咧圹 ===
|
||||
Task('LinqObj41');
|
||||
var m := ReadInteger;
|
||||
var r := ReadAllLines(ReadString)
|
||||
|
|
@ -44,7 +42,7 @@ begin
|
|||
.GroupBy(e -> e.street,
|
||||
(k, ee) -> new class ( street := k, max := ee.Max(e -> e.price) ))
|
||||
.OrderBy(e -> e.max).ThenBy(e -> e.street)
|
||||
.Select(e -> IntToStr(e.max) + ' ' + IntToStr(e.street))
|
||||
.Select(e -> e.max + ' ' + e.street)
|
||||
.DefaultIfEmpty('Нет');
|
||||
WriteAllLines(ReadString, r);
|
||||
end.
|
||||
|
|
@ -54,7 +52,6 @@ end.
|
|||
// 6.2. Более сложные задания на обработку отдельных последовательностей
|
||||
// LinqObj61: правильное решение (с.199-200)
|
||||
begin
|
||||
// === 呜攘世 滦盘磐<E79B98> 论衔送磐冗 ===
|
||||
Task('LinqObj61');
|
||||
var subjects : array of string := ( 'Алгебра', 'Геометрия', 'Информатика' );
|
||||
var culture := new System.Globalization.CultureInfo('en-US');
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -153,7 +153,6 @@ end.
|
|||
// 7.6. Дополнительные задания на обработку XML-документов
|
||||
// LinqXml82: правильное решение (с.276)
|
||||
begin
|
||||
// 呜攘世 饰滔人咧热
|
||||
Task('LinqXml82');
|
||||
var name := ReadString;
|
||||
var d := XDocument.Load(name);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
uses PT4, PT4Linq;
|
||||
|
||||
(*
|
||||
При решении задач группы LinqObj доступны следующие
|
||||
При решении задач группы LinqBegin доступны следующие
|
||||
дополнительные методы, определенные в модуле PT4Linq:
|
||||
|
||||
ReadSeqInteger() - ввод числовой последовательности;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
uses PT4, PT4Linq, System, System.Xml.Linq;
|
||||
|
||||
(*
|
||||
При решении задач группы LinqObj доступны следующие
|
||||
При решении задач группы LinqXml доступны следующие
|
||||
дополнительные методы, определенные в модуле PT4Linq:
|
||||
|
||||
ReadAllLines(name) - функция, которая возвращает последовательность строк,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.0.0.1024'
|
||||
!define VERSION '3.0.0.1026'
|
||||
139
Utils/PT4Tools/Class1.cs
Normal file
139
Utils/PT4Tools/Class1.cs
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
|
||||
namespace PT4
|
||||
{
|
||||
public class Tools
|
||||
{
|
||||
string sysDir;
|
||||
Process demo, load, res;
|
||||
bool avail, disposed;
|
||||
public Tools(string PABCDir)
|
||||
{
|
||||
sysDir = PABCDir+"\\PT4";
|
||||
avail = Directory.Exists(sysDir) &&
|
||||
File.Exists(sysDir + "\\pt4pabc.dll") &&
|
||||
File.Exists(sysDir + "\\pt4demo.exe") &&
|
||||
File.Exists(sysDir + "\\pt4load.exe") &&
|
||||
File.Exists(sysDir + "\\pt4res.exe") &&
|
||||
File.Exists(sysDir + "\\results.abc");
|
||||
if (!avail)
|
||||
return;
|
||||
}
|
||||
public bool AreAvailable
|
||||
{
|
||||
get { return avail; }
|
||||
}
|
||||
public void Demo(string startDir)
|
||||
{
|
||||
if (!avail || disposed)
|
||||
return;
|
||||
if (demo == null || demo.HasExited)
|
||||
{
|
||||
if (demo == null)
|
||||
{
|
||||
demo = new Process();
|
||||
demo.StartInfo.FileName = sysDir + "\\pt4demo.exe";
|
||||
}
|
||||
demo.StartInfo.Arguments = "\"" + startDir + "\" \"" + sysDir + "\"";
|
||||
demo.StartInfo.WorkingDirectory = startDir;
|
||||
demo.Start();
|
||||
}
|
||||
}
|
||||
public void Res(string startDir)
|
||||
{
|
||||
if (!avail || disposed)
|
||||
return;
|
||||
if (res == null || res.HasExited)
|
||||
{
|
||||
if (res == null)
|
||||
{
|
||||
res = new Process();
|
||||
res.StartInfo.FileName = sysDir + "\\pt4res.exe";
|
||||
}
|
||||
res.StartInfo.Arguments = "\"" + startDir + "\" \"" + sysDir + "\"";
|
||||
res.StartInfo.WorkingDirectory = startDir;
|
||||
res.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public string Load(string startDir)
|
||||
{
|
||||
if (!avail || disposed)
|
||||
return "";
|
||||
if (load == null || load.HasExited)
|
||||
{
|
||||
if (load == null)
|
||||
{
|
||||
load = new Process();
|
||||
load.StartInfo.FileName = sysDir + "\\pt4load.exe";
|
||||
}
|
||||
load.StartInfo.Arguments = "\"" + startDir + "\" \"" + sysDir + "\"";
|
||||
load.StartInfo.WorkingDirectory = startDir;
|
||||
load.Start();
|
||||
while (!load.HasExited)
|
||||
{
|
||||
Application.DoEvents();
|
||||
Thread.Sleep(50);
|
||||
if (load == null)
|
||||
return "";
|
||||
}
|
||||
if (!File.Exists(startDir + "\\ABC.ini"))
|
||||
return "";
|
||||
StreamReader sr = new StreamReader(startDir + "\\ABC.ini");
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
string s = sr.ReadLine();
|
||||
if (s.StartsWith("TaskFile="))
|
||||
{
|
||||
s = s.Substring(s.IndexOf('=')+1);
|
||||
if (File.Exists(s))
|
||||
{
|
||||
sr.Close();
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
disposed = true;
|
||||
if (!avail)
|
||||
return;
|
||||
if (demo != null)
|
||||
{
|
||||
if (!demo.HasExited)
|
||||
demo.Kill();
|
||||
demo.Dispose();
|
||||
demo = null;
|
||||
}
|
||||
if (res != null)
|
||||
{
|
||||
if (!res.HasExited)
|
||||
res.Kill();
|
||||
res.Dispose();
|
||||
res = null;
|
||||
}
|
||||
if (load != null)
|
||||
{
|
||||
if (!load.HasExited)
|
||||
load.Kill();
|
||||
load.Dispose();
|
||||
load = null;
|
||||
}
|
||||
}
|
||||
~Tools()
|
||||
{
|
||||
if (!disposed)
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Utils/PT4Tools/PT4Tools.csproj
Normal file
55
Utils/PT4Tools/PT4Tools.csproj
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A592FFCE-2AF8-4F83-B23B-95FA6DC9DBBA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PT4Tools</RootNamespace>
|
||||
<AssemblyName>PT4Tools</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
</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.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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>
|
||||
35
Utils/PT4Tools/Properties/AssemblyInfo.cs
Normal file
35
Utils/PT4Tools/Properties/AssemblyInfo.cs
Normal file
|
|
@ -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("PT4Tools")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("math-rsu-ru")]
|
||||
[assembly: AssemblyProduct("PT4Tools")]
|
||||
[assembly: AssemblyCopyright("Copyright © math-rsu-ru 2010")]
|
||||
[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("b657ed7d-8196-4398-a39b-23fb0374accf")]
|
||||
|
||||
// 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.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
D:\PT4\!!PascalABC.NET\PT4Tools2010-14\PT4Tools-2015\PT4Tools\bin\Debug\PT4Tools.dll
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010-14\PT4Tools-2015\PT4Tools\bin\Debug\PT4Tools.pdb
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010-14\PT4Tools-2015\PT4Tools\obj\Debug\PT4Tools.csprojResolveAssemblyReference.cache
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010-14\PT4Tools-2015\PT4Tools\obj\Debug\PT4Tools.dll
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010-14\PT4Tools-2015\PT4Tools\obj\Debug\PT4Tools.pdb
|
||||
5
Utils/PT4Tools/obj/PT4Tools.csproj.FileListAbsolute.txt
Normal file
5
Utils/PT4Tools/obj/PT4Tools.csproj.FileListAbsolute.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
D:\PT4\!!PascalABC.NET\PT4Tools2010\PT4Tools\PT4Tools\bin\Debug\PT4Tools.dll
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010\PT4Tools\PT4Tools\bin\Debug\PT4Tools.pdb
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010\PT4Tools\PT4Tools\obj\Debug\ResolveAssemblyReference.cache
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010\PT4Tools\PT4Tools\obj\Debug\PT4Tools.dll
|
||||
D:\PT4\!!PascalABC.NET\PT4Tools2010\PT4Tools\PT4Tools\obj\Debug\PT4Tools.pdb
|
||||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
begin
|
||||
var dct := Dict('öâåò'=>'color');
|
||||
var dct := Dict(KV('öâåò','color'));
|
||||
foreach var s in ReadLines('translations.txt') do
|
||||
begin
|
||||
var ss := s.ToWords;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1019,7 +1019,6 @@
|
|||
<PointOfInterest>
|
||||
<Name>Операции с IEnumerable<T></Name>
|
||||
<FileName>\PABCSystem.pas</FileName>
|
||||
<Text>function System.Collections.Generic.IEnumerable<T>.operator+(a,b: IEnumerable<T>): IEnumerable<T>;</Text>
|
||||
<OuterContext>
|
||||
<OuterContextItem Type="Method">
|
||||
<string>function</string>
|
||||
|
|
@ -1041,18 +1040,16 @@
|
|||
<string>,</string>
|
||||
<string>b</string>
|
||||
<string>:</string>
|
||||
<string>IEnumerable</string>
|
||||
<string><</string>
|
||||
<string>sequence</string>
|
||||
<string>of</string>
|
||||
<string>T</string>
|
||||
<string>></string>
|
||||
<string>)</string>
|
||||
<string>:</string>
|
||||
<string>IEnumerable</string>
|
||||
<string><</string>
|
||||
<string>sequence</string>
|
||||
<string>of</string>
|
||||
<string>T</string>
|
||||
<string>></string>
|
||||
</OuterContextItem>
|
||||
<OuterContextItem Type="" />
|
||||
<OuterContextItem Type="PAS_TreeNode" />
|
||||
</OuterContext>
|
||||
<Items />
|
||||
</PointOfInterest>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -92,7 +92,6 @@ end.
|
|||
// 5.6. Ãðóïïèðîâêà
|
||||
// LinqBegin60: ïðàâèëüíîå ðåøåíèå - 1 âàðèàíò (ñ.175, âíèçó)
|
||||
begin
|
||||
// ===呜攘世 饰滔人咧热===
|
||||
Task('LinqBegin60');
|
||||
ReadSeqString().GroupBy(e -> e[1])
|
||||
.OrderByDescending(e -> e.Sum(s -> s.Length)).ThenBy(e -> e.Key)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -4,7 +4,6 @@
|
|||
// 6.1. Простое задание на обработку отдельной последовательности
|
||||
// LinqObj4: правильное решение (с.191, внизу)
|
||||
begin
|
||||
// === 呜攘世 饰滔人咧圹 ===
|
||||
Task('LinqObj4');
|
||||
var r := ReadAllLines(ReadString)
|
||||
.Select(e ->
|
||||
|
|
@ -18,7 +17,7 @@ begin
|
|||
.GroupBy(e -> e.code,
|
||||
(k, ee) -> new class(k, sum := ee.Sum(c -> c.hours) ))
|
||||
.OrderByDescending(e -> e.sum).ThenBy(e -> e.k)
|
||||
.Select(e -> IntToStr(e.sum) + ' ' + IntToStr(e.k));
|
||||
.Select(e -> e.sum + ' ' + e.k);
|
||||
WriteAllLines(ReadString, r);
|
||||
end.
|
||||
[41]
|
||||
|
|
@ -27,7 +26,6 @@ end.
|
|||
// 6.2. Более сложные задания на обработку отдельных последовательностей
|
||||
// LinqObj41: правильное решение (с.196)
|
||||
begin
|
||||
// === 呜攘世 饰滔人咧圹 ===
|
||||
Task('LinqObj41');
|
||||
var m := ReadInteger;
|
||||
var r := ReadAllLines(ReadString)
|
||||
|
|
@ -44,7 +42,7 @@ begin
|
|||
.GroupBy(e -> e.street,
|
||||
(k, ee) -> new class ( street := k, max := ee.Max(e -> e.price) ))
|
||||
.OrderBy(e -> e.max).ThenBy(e -> e.street)
|
||||
.Select(e -> IntToStr(e.max) + ' ' + IntToStr(e.street))
|
||||
.Select(e -> e.max + ' ' + e.street)
|
||||
.DefaultIfEmpty('Нет');
|
||||
WriteAllLines(ReadString, r);
|
||||
end.
|
||||
|
|
@ -54,7 +52,6 @@ end.
|
|||
// 6.2. Более сложные задания на обработку отдельных последовательностей
|
||||
// LinqObj61: правильное решение (с.199-200)
|
||||
begin
|
||||
// === 呜攘世 滦盘磐<E79B98> 论衔送磐冗 ===
|
||||
Task('LinqObj61');
|
||||
var subjects : array of string := ( 'Алгебра', 'Геометрия', 'Информатика' );
|
||||
var culture := new System.Globalization.CultureInfo('en-US');
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -153,7 +153,6 @@ end.
|
|||
// 7.6. Дополнительные задания на обработку XML-документов
|
||||
// LinqXml82: правильное решение (с.276)
|
||||
begin
|
||||
// 呜攘世 饰滔人咧热
|
||||
Task('LinqXml82');
|
||||
var name := ReadString;
|
||||
var d := XDocument.Load(name);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
uses PT4, PT4Linq;
|
||||
|
||||
(*
|
||||
При решении задач группы LinqObj доступны следующие
|
||||
При решении задач группы LinqBegin доступны следующие
|
||||
дополнительные методы, определенные в модуле PT4Linq:
|
||||
|
||||
ReadSeqInteger() - ввод числовой последовательности;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
uses PT4, PT4Linq, System, System.Xml.Linq;
|
||||
|
||||
(*
|
||||
При решении задач группы LinqObj доступны следующие
|
||||
При решении задач группы LinqXml доступны следующие
|
||||
дополнительные методы, определенные в модуле PT4Linq:
|
||||
|
||||
ReadAllLines(name) - функция, которая возвращает последовательность строк,
|
||||
|
|
|
|||
Loading…
Reference in a new issue