|
hi all,
my problem is i have data like below(dates are in dd\mm\yyyy format)
start_date end_date fruits_eaten per_day_fruit_eaten
5/5/2008 14/5/2008 40 40/10 = 4
12/5/2008 21/5/2008 30 30/10 = 3
20/5/2008 30/5/208 55 55/11 = 5
i want to calculate above data like below
for the dates between 10/5/2008 and 25/5/2008 total fruits eaten are :
10/5/2008 = 4
11/5/2008 = 4
12/5/2008 = 4 + 3
13/5/2008 = 4 + 3
14/5/2008 = 4 + 3
15/5/2008 = 3
16/5/2008 = 3
17/5/2008 = 3
18/5/2008 = 3
19/5/2008 = 3
20/5/2008 = 3 + 5
21/5/2008 = 3 + 5
22/5/2008 = 5
23/5/2008 = 5
24/5/2008 = 5
25/5/2008 = 5
please help me solve this puzzle as it is driving me nuts !! i want to solve it in c# but logics are also welcomed
thanks in advance !
|
|
|
|
|
Hmmm... lets see, this can be done using a HashTable.
First make empty string entries with keys equal to the dates present in the range.
Then iterate through each date range you have, and map the corresponding entry into the HashTable seperated by a +
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
shyam can u give example.the problem is i haven't used hashtables !
|
|
|
|
|
Hello everyone,
In IIS, we can set the directory security of some virtual directory to .Net Passport authentication. I am very interested in this feature. But I am not sure that if I configure IIS in this way,
- Which .Net passport account should I use? Could I use the public MSN ID/Live ID applied from Microsoft (which we use to login MSN messenger) or should be use some other kinds .Net Passport ID?
- I learned if a web site is involved to use .Net Passport based authentication, web site delegates authentication work to .Net Passport login server, and the .Net passport login server is involved to do real authentication and ticket assignment. I am wondering if I use .Net Passport based authentication in the web site I setup, should I configure some .Net passport login server? If ues, how? I searched for quite some time but not found related documents regarding this setup.
thanks in advance,
George
|
|
|
|
|
Hi I am trying to make a Windows Forms Application in C# that uses pin7 (RTS) and pin 5 (Ground) of a 9pin comport to PTT a radio smile.gif
With just one button of the Form when the button is clicked the radio must PTT until it is clicked again !
any help wellcome
Regards
Cyberax
|
|
|
|
|
hello world!
I wanted to access my Images In Database and I write these codes :
byte[] buffer2 = (byte[])dsPicture.Tables["documentImageTable"].Rows[3]["diImage"];
MemoryStream stream2 = new MemoryStream(buffer2);
pictureBox2.Image = Image.FromStream(stream2);
stream2.Close();<pre>
But It have this error:
Object reference not set to an instance of an object.
Tanx world...
modified on Monday, October 20, 2008 1:40 PM
|
|
|
|
|
You should turn option strict on in your project, so that you get an error message telling you that you are using the variable stream1 that is not declared anywhere.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: option strict
Eslam Afifi
|
|
|
|
|
My problem not solve ...
if(Human.live)
{
Human.peaceful = false;
while(true)
{
Human.love(Human girl, Human Boy);
}
}
|
|
|
|
|
What do you mean? You open stream2 and close stream1 (which doesn't exist in the code that you posted), that is definitely a problem.
It might not be your only problem, though. On which line do you get the error message?
Edit:
You should name your variables to something more descriptive than stream1 and stream2, that way you are not so likely to mix them up.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: option strict on
Is there even one in C#?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Paul Conrad wrote: Is there even one in C#?
No, you are right. There isn't. I was thinking of VB, where such a mistake is usually caused by not using strict mode.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I writed correctly in my codes but I wrong in this...
what I do for solve this error ...
if(Human.live)
{
Human.peaceful = false;
while(true)
{
Human.love(Human girl, Human Boy);
}
}
|
|
|
|
|
Use this routine (doesn´t crash with *.gifs)
public static byte[] ReadFile(string image_path)
{
byte[] data = null;
FileInfo file_info = new FileInfo(image_path);
long bytes_count = file_info.Length;
FileStream file_stream = new FileStream(image_path, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(file_stream);
data = br.ReadBytes((int)bytes_count);
return data;
}
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Mr nelsonpaixao, my Image in database And not in file ...
if(Human.live)
{
Human.peaceful = false;
while(true)
{
Human.love(Human girl, Human Boy);
}
}
|
|
|
|
|
hi
i want to load external codes to my project
i need run defferenct codes by defferent developers that i dont know what they write in their codes
but there is same naming roles in system
external codes have same operation names, makes running codes easy
but base of system is wich they wrote in there functions and methods
How can i load external dlls in my code and use their functions?
tnx
|
|
|
|
|
Hi,
You probably want to take a look at Reflection.
Also, while I realise your first language may not be English, I suggest you run your posts through some form of English spellchecker (the Google toolbar has one), and if possible a grammar checker. You may find that helps you get better results.
Tony
|
|
|
|
|
Suppose that the thread which parses any page put found URLs in a URL server,
how i can use multy_threading to download the content from internet
|
|
|
|
|
Perhaps you should rephrase your question. It doesn't make any sense (or it's too general).
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Visual studio 2008 c#
i have a treeview with nodeA, nodeB, NodeC.
i have array with child in tow colums (name of child, name of parent)
i want to insert this value into the treeview, but i don't now how to insert the child to the receptive parents
IN VB6
Set xNode = tvClass.Nodes.Add(xPai, tvwChild, xcod, xText, 1, 2)
|
|
|
|
|
Have you done a search on this? There should be plenty of documentation on how to do so.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Simply press F1 on TreeView class and you'll get something like: TreeView Class[^]. If you scroll down a bit you'll find good basic examples.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello!
Yesterday I posted an article, which tried exactly to explain my problems with Linq2Sql - Dataclasses.
It contained 3 questions, but the simply answer I got were 2 Ratings of "1", so from now on noone will find that article anymore.
So I ask you again, please to help me.
My questions in short are:
- How can I define in the DataClass-Designer an Linq2Sql-Association with deletrule.cascade ?
- Is there a more simple way to add Entities directly to a Table<TEntity> (without submitting data to the DB)?
- How can I enforce the Datacontext to submit Delete-Commands, when I delete a Child-Entity from a DataGridview (actually it submits an Update, which sets the Child.ParentID to null)?
As I said, my questions are asked more detailed in that article[^], and are shipped with a sample-project to make it easy to reproduce my problems.
|
|
|
|
|
Well Mr poorenglish an article is supposed to be an informative, instructional contribution from you to CP. If you pose a complex question in an article then you must expect it to be vetoed as a rubish article.
If you look at the forum list you will find a forum for LINQ and dotnet 3.5. I suggest you pose the questions in that forum and just possibly you may get an answer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hmm - in my opinion the article was informative and instructional too.
- It shows, how to set up a SQLServer-Database fromout a real Designer. (IMO that Table-"Designer" of the Database-Explorer cannot seriously be called "Designer").
- It shows, how to avoid superflues Database-requests by first adding new Entities in memory.
- It points out, that the Linq2SQL-DataContext creates Requests wich may not reflect the user-Input propperly.
Ok, u're not the right address to argue with about my ratings
And thanx for the tipp with the appropriate forum, I will look, wether I can find it.
|
|
|
|