|
Are you and the guy below a) The same person or b) in the same class?
|
|
|
|
|
might be in the same batch doing the final sem project looks like they have communication problem that needs to be resolved first before they find answers for the other problems
Jibesh.V.P
India
|
|
|
|
|
Yes, all you need do is hire someone to write it for you.
|
|
|
|
|
Open your question and have a look at it.
Here's what I, the idiot on the other side of planet, see when I read this question.
- descriptive subject of the topic "hi". Yup, this tells me EXACTLY what I need to know about your question. (figuratively it actually does)
- C# contents of the question considering we're in the C# forum. None.
- Actual coding question. "can i get coding". Answer: Somehow you probably can, the sky is the limit.
- "segmenting overlapped and touching chromosomes" reads as "dkjsgfgf dkjsghfdaskjgfaskdsvf dhgfwkevfwvfkev ewkrhvewk" to me or it could be Klingon, or Ferengi or something else. How should anyone with a normal background in IT know what this is about? it is not unuseful, but it doesn't help in this case, add more context.
- "using hierarchical distributed genetic algorithm for image segmentation" what is this? Can YOU answer this question? My first thought, if I would need this, is to google it and see if I can get some more information. Then I would be able to clarify this to the people I'm asking questions to.
Your question seems to state you want a complete answer and solution to the problem. Wrong forum. Here we try to help people who get stuck with a specific problem they encountered and researched and tried to resolve themselves.
Do some research, get started and come back if you have more information.
|
|
|
|
|
Too bad we can't 5 this! Have a virtual 5.
|
|
|
|
|
|
can i get matlab coding for segmenting overlapped and touching chromosomes using hierarchical distributed genetic algorithm for image segmentation?????
thank u
|
|
|
|
|
|
There is a group of replies to a similar problem here[^]
|
|
|
|
|
Hi all,
I'm new and making a login and register page
The register page form here is-
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="register.aspx.cs" Inherits="register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="style1">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
First
Name</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
Last name</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
E-Mail</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
Password</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Login" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Clear" />
</td>
<td>
</td>
</tr>
</table>
</asp:Content>
and register page logic code is----
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
public partial class register : System.Web.UI.Page
{
string conn = ConfigurationManager.ConnectionStrings["cnn"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
/* string query1 = "select * from tbl_Students";
SqlConnection con = new SqlConnection(conn);
con.Open();
SqlCommand cmd = new SqlCommand(query1,con);
string temp = cmd.ExecuteScalar().ToString();
System.Console.WriteLine("result is:",temp);
//Label1.Text = true;
*/
string query = "Insert into tbl_Students values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')";
SqlConnection con = new SqlConnection(conn);
con.Open();
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
con.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
}
and login page form is---
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
user name :<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
password :<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="Login" />
</p>
</asp:Content>
the register page data is inserted properly but i want proper validation with e-mail id must be unique for validation ...........
please help me ............Thanks a lot ..............
|
|
|
|
|
Use The Login Controls From ToolBox To Have Validation On Your Form To Validate Login Process
VJ
|
|
|
|
|
i got few line of code where configure method is calling and passing just the string value but ConfigureWith function expect delegate. can anyone help me to understand how ConfigureWith() method will work. thanks
MailTemplate
.ConfigureWith(mt => mt.MailBody = "hello world")
.ConfigureWith(mt => mt.MailFrom = "rdingwall@gmail.com")
.DoSomeOtherStuff()
.Build();
The implementation for this would be:
public class MailTemplate
{
// regular auto properties
public string MailFrom { get; set; }
public string MailBody { get; set; }
public MailTemplate ConfigureWith(Action<mailtemplate> func)
{
func(this);
return this;
}
}
tbhattacharjee
|
|
|
|
|
MailTemplate
.ConfigureWith(mt => mt.MailBody = "hello world")
.ConfigureWith(mt => mt.MailFrom = "rdingwall@gmail.com")
.DoSomeOtherStuff()
.Build();
How did you "dream up" this code? Where is the MailTemplate class instantiated? Is "MailTemplate" a static method that returns one of those classes?
You're complicating things a bit. What are you trying to achieve? Wouldn't below suffice and be a bit more readable?
public class MailTemplate
{
public string MailFrom { get; set; }
public string MailBody { get; set; }
}
class Program
{
static void Main()
{
var x = new MailTemplate()
{
MailBody = "hello world",
MailFrom = "rdingwall@gmail.com"
};
x.DoSomethingElse();
x.Build;
Console.ReadLine();
}
}
|
|
|
|
|
The caller is not passing just the string value. He/she is calling the property setter with a string value. In the call func(this) the this pointer takes the place of the mt in the Lambda Expression.
Personally, I wouldn't do it that way. The properties are public, so they can just as well be assigned directly. And if something goes wrong, you have at least a chance to debug the intermediate states when you use seperate statements instead of putting all into one.
|
|
|
|
|
Hi I am working on file io and am getting an io exception the process cannot access the file it's in use by another process.
I tried to closed all streams. I'm baffled please help.
Here is my code:
DateTime dt = DateTime.Now.Date;
try
{
string fileLocation = "C:\\pprdate.txt";
FileStream fs = null;
if (!File.Exists( fileLocation ))
{
using (fs = File.Create( fileLocation ))
{
fs.Close();
fs = null;
}
}
string line = null;
TextReader readFile = new StreamReader(fileLocation);
while (true)
{
line = readFile.ReadLine();
if (line != null)
{
DateTime sd = DateTime.Parse( line );
if (dt >= sd.AddDays( 16 ))
{
sd = sd.AddDays( 30 );
StartDate.Text = sd.ToShortDateString();
EndDate.Text = sd.AddDays( 30 ).ToShortDateString();
}
readFile.Close();
readFile = null;
}
else
{
TextWriter writeFile = new StreamWriter(fileLocation);
DateTime sd = dt.AddDays( 7 );
writeFile.WriteLine( sd );
StartDate.Text = sd.ToShortDateString();
EndDate.Text = sd.AddDays( 30 ).ToShortDateString();
writeFile.Close();
writeFile = null;
}
}
Frazzle the name say's it all
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
John F. Woods
|
|
|
|
|
If I'm looking correctly, you try to open a StreamWriter to the same fileLocation you already have opened a StreamReader .
For example if the line variable is null, you don't close the reader since it's inside the if statement:
...
if (line != null)
{
DateTime sd = DateTime.Parse( line );
if (dt >= sd.AddDays( 16 ))
{
sd = sd.AddDays( 30 );
StartDate.Text = sd.ToShortDateString();
EndDate.Text = sd.AddDays( 30 ).ToShortDateString();
}
readFile.Close();
readFile = null;
}
else ...
You didn't explain the overall idea you're trying to accomplish so I'm not able to sae what would be a good correction to the code, but I encourage to use using[^] statement to ensure proper disposing etc.
|
|
|
|
|
frazzle-me wrote:
if (!File.Exists( fileLocation ))
{
using (fs = File.Create( fileLocation ))
{
fs.Close();
fs = null;
}
}
This is utterly useless. There are options when opening a file that will create it if it doesn't exist already, so creating the file, just to close it is pointless.
Secondly, the using statement will automatically Dispose (which calls Close on a file oject) when the using block exits. So calling Close and then setting fs to null just duplicates code that is already there.
|
|
|
|
|
There are so many problems with your code here, but the issue you are seeing is because you are using the same file to read from and write to.
|
|
|
|
|
Hi guys . i'm working on a small project , is related to a socket programming . it's kind of chat program just we have one server and plenty of client . i have done every thing right . and im getting the result in the message box when a client sent me sth . but the problem is here when i'm trying to just put the string or the word that the client sent me into a textbox , it'll give me an error and i know wht it give me this kind of error , im using a while loop into my server program so when i start the program it get stop(hang) till get the message of the client so i figure out to run it into a new thread . i think you get the idea why this kind of error is appear to me , so i just decide to use the delegate the code its like this .
Thread thr;
public delegate void Dosth();
string sth = "";
private void buttonX1_Click(object sender, EventArgs e)
{
thr = new Thread(Listen);
thr.Start();
}
void Listen()
{
Soc.Bind(ipend);
Soc.Listen(10);
byte[] data = new byte[500];
while (true)
{
Socket client = Soc.Accept();
client.Receive(data);
sth = Encoding.ASCII.GetString(data);
athreadedfunction();
.
.
.
}
}
public void writeintotext()
{
textBox1.Text = sth;
}
public void athreadedfunction()
{
Dosth writeinto = new Dosth(writeintotext);
textBox1.Invoke(writeinto);
}
what do i need to know is how the invoke + delegate done sth and let the error disapear .
and i know the delegate is kind of pointer to the method or functions .
but what does mean of the invoke here ?
and how this error ("Cross-thread operation not valid: Control 'textBox1'") didnt appear to me when i used this piece of code.
plz help me in that i want to know how that done .
and im sorry about my poor english .
|
|
|
|
|
In Windows forms, you can access a UI control only from the same thread that created it. Accessing it from any other thread throws a Cross thread operation exception.
So, what Control.Invoke essentially does it to call the method passed to it using the thread that created the control.
|
|
|
|
|
Hello everyone,
I started to build WPF app the that one of the fuctions is loding html file into WebBrwoser control.
* the html file is file that i created (local on my pc)
my problem is that when i use WebBrowesr.Nevigate(path to html file) , i need to pass to the html 2 strings.
can anyone suggest a way for pass this 2 string to the html?
is there any way in html to read variables from my c# code?
hope i was clear enough.
Thanks alot !
|
|
|
|
|
How is the html file "expecting" the variables? As a query-string? How would you pass the data in a real webbrowser?
|
|
|
|
|
Hi,
i am trying to use WebBrowser.navigate("c:\path?pramaters").
so it should send the parameters like in GET method - as part of the address.
but it seems like there is a problem with the '?' char.
i also used the followig way:
String postdata = "long1=32";
System.Text.Encoding a = System.Text.Encoding.UTF8;
byte[] byte1 = a.GetBytes(postdata);
webBrowser1.Navigate("c:\\map.htm","", byte1, "Content-Type: application/x-www-form-urlencoded\r\n");
then i the map.html i m getting the parameters using javascript but the results of the parametrers is "undefined"
when i m trying to load the same html file (map.html?lat=12) directly in my chrome browser it getting the parameter as i pass him - 12 .
so the problem is the C# code , the javascript works well
|
|
|
|
|
Queryvalues are usually used from PHP or ASP, not from raw HTML. Fortunately, it's also possible using JavaScript[^].
|
|
|
|
|
Thanx Eddy but i already done it.
but this is not solves the problem.
the problem the when i m using the Nevigate mathod of the WebBrowser control , its looks like the parameters are not pass.
the javascript code is returing "undefined" values for the parameters.
so if i m navigate to : map.htm?lat=12 using the WebBrowser control.
the value of lat is return "undefined"
but if i m using my chrome browser end putting the same : path/mat.htm?lat=12
than the value of lat is return 12 by the javascrip code.
so the problem is with the WebBroser contorl.
any suggestions ?
|
|
|
|