如何在C#中编写遗传算法?有图书馆吗?像C ++:http://lancet.mit.edu/ga/
我尝试更新没有linq的xml(我正在使用VC 2.0).我的xml文件格式:
<schedule>
<id>0</id>
<name>yusuf</name>
<status>0</status>
</schedule>
AFTER UPDATE:
<schedule>
<id>0</id>
<name>yusuf</name>
<status>1</status>
</schedule>
但我不知道更新状态= 0到状态= 1
如何删除数据集的列?
有没有一种方法可以为我这样做:
rh.dsDetail = ds.Tables[0].Columns.Remove(
Run Code Online (Sandbox Code Playgroud)
或者像这样:
rh.dsDetail = ds.Tables[0].Columns.Remove( ds.Tables[0].Columns[1],ds.Tables[0].Columns[2])
Run Code Online (Sandbox Code Playgroud) 我尝试使用asp.net配置文件,我尝试使用ProfileBase继承
public class dort_islem : ProfileBase
{
    public int ilk_sayi { get; set; }
    public int ikinci_sayi { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
  <anonymousIdentification enabled="true"/>
  <profile enabled="true" inherits="dort_islem">
   <providers>
    <clear/>
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="profiller"/>
   </providers>
   <properties>
    <add name="ad" allowAnonymous="true" defaultValue="yusuf"/>
    <add name="soy_ad" allowAnonymous="true"/>
    <add name="sevdigi_renk" allowAnonymous="true" type="System.Drawing.Color" serializeAs="Binary" />
        <group name="detaylar">
          <add name="numara" type="Integer" allowAnonymous="true"/>
          <add name="giris_tarihi" type="Date" allowAnonymous="true"/>
          <add name="cinsiyet" allowAnonymous="true"/>
          <add name="adres" allowAnonymous="true"/>
        </group>
   </properties>
  </profile>Run Code Online (Sandbox Code Playgroud)
但如果我尝试使用这些代码Default.aspx: alt text http://i47.tinypic.com/zn5v60.gif
我如何从dort_islem类中看到ilk_sayi?问候....
我看不到MyLoad.TreeLoader(),但为什么?我已经实现iloader了TreeViewLoad.我应该能够看到TreeLoader().
namespace Rekursive
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //treeView1.Nodes.Add("Test");
            iloader MyLoad = new TreeViewLoad();
            MyLoad.loader("test", treeView1, 1);
        }
    }
    interface iloader
    {
        void loader(string nodeName, TreeView myTre, int id);
    }
    class TreeViewLoad : iloader
    {
       public void TreeLoader(TreeView tre)
        {
           // Here I want to call the loader
        }
        public void loader(string nodeName, TreeView myTre, int id) …Run Code Online (Sandbox Code Playgroud) i need to control Only ExcelFile uploading with RegularExpressionValidator How can i do that? i need to write a regex pattern in ValidationExpression...
 <h3>FileUpload Test</h3>
    <div>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:Button id="UploadBtn" Text="Upload File" OnClick="UploadBtn_Click" runat="server" Width="105px" />
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <asp:RegularExpressionValidator
id="FileUpLoadValidator" runat="server"
ErrorMessage="Upload Excel only."
ValidationExpression="([a-z]\w*)(.xlsx|.xlsm|.xls)$"
ControlToValidate="FileUpload1">
</asp:RegularExpressionValidator>
    </div>Run Code Online (Sandbox Code Playgroud) 我如何比较两个通用集合?这是我尝试使用两个字符串数组,但它不会返回true.
namespace genericCollections
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] xx = new string[] { "gfdg", "gfgfd", "fgfgfd" };
            string[] yy = new string[] { "gfdg", "gfgfd", "fgfgfd" };
            Console.WriteLine(ComparerCollection(xx, yy).ToString());
            Console.ReadKey();
        }
        static bool ComparerCollection<T>(ICollection<T> x, ICollection<T> y)
        {
            return x.Equals(y);
        }
    }
}
Run Code Online (Sandbox Code Playgroud) 当我从组合框中选择一个项目时,如何禁用复选框.例如,如果我选择"ABONE",角度将使abone复选框禁用.
注意(示例):DefinitionType:ABONE
                  <div class="row">
                <div class="form-group">
                    <label class="control-label col-md-2">Tan?m Tipi<sup>*</sup></label>
                    <div class="col-md-3">
                        <select class="form-control" placeholder="Tan?m Tipi" ng-options="field.value for field in DefinitionTypes" ng-model="DefinitionType"  required></select>
                    </div>
                </div>
            </div><br />  
Run Code Online (Sandbox Code Playgroud)
EkstraTanımTipi
                        <div class="checkboxinsameline" ng-repeat="item in DefinitionTypes">
                            <label>
                                <input type="checkbox" name="item.value" ng-click="DefinitionTypesChecked(item.id)" > {{item.value}}
                            </label>
                        </div>
                    </div>
                </div>
            </div><br />
Run Code Online (Sandbox Code Playgroud) 我通过Newtonsoft.Json在类下面进行序列化,但我无法通过Newtonsoft.Json反序列化相同的json.我怎样才能做到这一点?
JSON:
"{\"UserEvents\":[{\"id\":1214308,\"Date\":20150801000000,\"IsRead\":true}]}"
Run Code Online (Sandbox Code Playgroud)
我的实体:
   public class UserEventLog {
    [JsonProperty("UserEvents")]
    public List<UserEvent> UserEvents { get; set; }
    public UserEventLog() {
        UserEvents = new List<UserEvent>();
    }
}
public class UserEvent {
    [JsonProperty("id")]
    public long id{ get; set; }
      [JsonProperty("Date")]
    public long Date{ get; set; }
      [JsonProperty("IsRead")]
    public bool IsRead { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我的解串器是这样的:
  List<UserEventLog> convert = JsonConvert.DeserializeObject<List<UserEventLog>>(user.ToString()) as List<UserEventLog>;
Run Code Online (Sandbox Code Playgroud)
但错误产生:
Newtonsoft.Json.dll中发生未处理的"Newtonsoft.Json.JsonSerializationException"类型异常
其他信息:将值转换
"{"UserEvents":[{"id":1214308,"Date":20150801000000,"IsRead":true}]}"为类型'System.Collections.Generic.List`1时出错
我怎么解决呢?我怎样才能将我的对象列表反序列化为UserEvents列表?