Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangQiang committed Jun 17, 2016
1 parent 84cc315 commit 3e10d37
Show file tree
Hide file tree
Showing 59 changed files with 803 additions and 0 deletions.
Binary file modified ++i_i++/bin/Debug/++i_i++.exe
Binary file not shown.
Binary file modified ++i_i++/bin/Debug/++i_i++.pdb
Binary file not shown.
5 changes: 5 additions & 0 deletions ++i_i++/obj/Debug/++i_i++.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\++i_i++\bin
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\++i_i++\obj\Debug\++i_i++.csprojResolveAssemblyReference.cache
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\++i_i++\obj\Debug\++i_i++.exe
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\++i_i++\obj\Debug\++i_i++.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\++i_i++\bin\Debug\++i_i++.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\++i_i++\bin\Debug\++i_i++.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\++i_i++\obj\Debug\++i_i++.csprojResolveAssemblyReference.cache
C:\Users\love_\Documents\GitHub\LibrarySolution\++i_i++\obj\Debug\++i_i++.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\++i_i++\obj\Debug\++i_i++.pdb
Binary file modified ++i_i++/obj/Debug/++i_i++.exe
Binary file not shown.
Binary file modified ++i_i++/obj/Debug/++i_i++.pdb
Binary file not shown.
Binary file modified ++i_i++/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
55 changes: 55 additions & 0 deletions AsyncDelegate/AsyncDelegate.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5BC1CD5A-6E8E-4B40-B78D-63AB6F9FDCBF}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AsyncDelegate</RootNamespace>
<AssemblyName>AsyncDelegate</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>
110 changes: 110 additions & 0 deletions AsyncDelegate/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;

namespace AsyncDelegate
{
class Program
{


static void Main(string[] args)
{
//
}



}
class AsyncDelegateClass
{
public delegate int TakesAWhileDelegate(int data, int ms);

public int TakesAWhile(int data, int ms)
{
Console.WriteLine("TakesAWhile Started");
Thread.Sleep(ms);
Console.WriteLine("TakesAWhile Completed");
return +data;
}

/// <summary>
/// 投票
/// </summary>
void Example1()
{
TakesAWhileDelegate d1 = TakesAWhile;
IAsyncResult ar = d1.BeginInvoke(1, 3000, null, null);
while (!ar.IsCompleted)
{
Console.WriteLine(".");
Thread.Sleep(50);
}
int result = d1.EndInvoke(ar);
Console.WriteLine("Result is {0}", result);
}


/// <summary>
/// 等待句柄
/// </summary>
void Example2()
{
TakesAWhileDelegate d1 = TakesAWhile;
IAsyncResult ar = d1.BeginInvoke(1, 3000, null, null);
while (true)
{
Console.WriteLine(".");
if (ar.AsyncWaitHandle.WaitOne(50, false))
{
Console.WriteLine("Can not get the result");
break;
}
int result = d1.EndInvoke(ar);
Console.WriteLine("Result is {0}", result);
}
}


/// <summary>
/// 异步回调
/// </summary>
void Example3()
{
TakesAWhileDelegate d1 = TakesAWhile;
d1.BeginInvoke(1, 3000, TakesAWhileCompleted, d1);
for (int i = 0; i < 100; i++)
{
Console.WriteLine(".");
Thread.Sleep(50);
}
}

void TakesAWhileCompleted(IAsyncResult ar)
{
TakesAWhileDelegate d1 = ar.AsyncState as TakesAWhileDelegate;
Trace.Assert(d1 != null, "Invalid object type");
int result = d1.EndInvoke(ar);
Console.WriteLine("Result is {0}", result);
}


void Example4()
{
TakesAWhileDelegate d1 = TakesAWhile;
d1.BeginInvoke(1, 3000, ar =>
{
int result = d1.EndInvoke(ar);
Console.WriteLine("Result is {0}", result);
}, null);
for (int i = 0; i < 100; i++)
{
Console.WriteLine(".");
Thread.Sleep(50);
}
}
}
}
36 changes: 36 additions & 0 deletions AsyncDelegate/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AsyncDelegate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AsyncDelegate")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b124ab92-e152-442e-b08c-735e6383611e")]

// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified BackTrackingAlgorithm/bin/Debug/BackTrackingAlgorithm.exe
Binary file not shown.
Binary file modified BackTrackingAlgorithm/bin/Debug/BackTrackingAlgorithm.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\BackTrackin
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.csprojResolveAssemblyReference.cache
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.exe
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\BackTrackingAlgorithm\bin\Debug\BackTrackingAlgorithm.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\BackTrackingAlgorithm\bin\Debug\BackTrackingAlgorithm.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\BackTrackingAlgorithm\obj\Debug\BackTrackingAlgorithm.csprojResolveAssemblyReference.cache
Binary file modified BackTrackingAlgorithm/obj/Debug/BackTrackingAlgorithm.exe
Binary file not shown.
Binary file modified BackTrackingAlgorithm/obj/Debug/BackTrackingAlgorithm.pdb
Binary file not shown.
Binary file not shown.
55 changes: 55 additions & 0 deletions DP_KnapsackProblem/DP_KnapsackProblem.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{50213488-E465-4FF2-BE8D-8C55FBEEF241}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DP_KnapsackProblem</RootNamespace>
<AssemblyName>DP_KnapsackProblem</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>
25 changes: 25 additions & 0 deletions DP_KnapsackProblem/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DP_KnapsackProblem
{
/// <summary>
/// 动态规划思想解决0-1背包问题
/// </summary>
class Program
{
static void Main(string[] args)
{
}
}

class Algotithm
{
public void DynamicProgramming()
{

}
}
}
36 changes: 36 additions & 0 deletions DP_KnapsackProblem/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DP_KnapsackProblem")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DP_KnapsackProblem")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c204666d-3ff2-49eb-b186-9738048a6b8c")]

// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified DelegateInvoke/bin/Debug/DelegateInvoke.exe
Binary file not shown.
Binary file modified DelegateInvoke/bin/Debug/DelegateInvoke.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\DelegateInv
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\DelegateInvoke\bin\Debug\DelegateInvoke.pdb
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\DelegateInvoke\obj\Debug\DelegateInvoke.exe
C:\Users\love_\documents\visual studio 2013\Projects\LibrarySolution\DelegateInvoke\obj\Debug\DelegateInvoke.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\bin\Debug\DelegateInvoke.exe.config
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\bin\Debug\DelegateInvoke.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\bin\Debug\DelegateInvoke.pdb
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\obj\Debug\DelegateInvoke.csprojResolveAssemblyReference.cache
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\obj\Debug\DelegateInvoke.exe
C:\Users\love_\Documents\GitHub\LibrarySolution\DelegateInvoke\obj\Debug\DelegateInvoke.pdb
Binary file modified DelegateInvoke/obj/Debug/DelegateInvoke.exe
Binary file not shown.
Binary file modified DelegateInvoke/obj/Debug/DelegateInvoke.pdb
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 3e10d37

Please sign in to comment.