|
and I want one of these[^] and $10,000,000 in my bank account.
The whole point is you have to work at getting this stuff. Nobody is going to just hand it to you. If you don't want to put the work into writing the code, why should we do it for you?
|
|
|
|
|
Anyone can help me in my problem on how to implement progress bar?..
for now i wanted to know how could implement a progress bar while executing threads like connecting to database, inserting, updating, deleting, retrieving data.. it's like generic that fits for all threads when every time i execute it..
someone could help me on this and can give me a sample better code in c#.net..
tnx a lot..
|
|
|
|
|
You cannot possibly have done any research on this subject at all, otherwise you would have stumbled across the many articles here on CP and the 1000s on the web with examples of this.
Send you the code! It is sitting out there waiting for you to do even the simplest search.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Using the BackgroundWorker, it is very easy to do. The main thing to be aware if that you should call ReportProgress at an appropriate rate to have a balance between progress bar updating and actual processing. As a starting point, you might report the progress each time the percentage is increased by 1.
Philippe Mori
|
|
|
|
|
i want to create a wind or rain effect in c#
|
|
|
|
|
In what? A still image? An XNA scene? DirectX? OpenGL? A small house just outside of Phnom Penh?
|
|
|
|
|
in still images like apply effect on picture box
|
|
|
|
|
It's obvious. Open Windows.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Peter_in_2780 wrote: Open Windows.
Yeah, but that's always such a pane!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You have two choices that I can see. One is to hand code the Paint routine to modify the image in a sequence that simulates rain falling, pixel-by-pixel. Or you can use a tool like photoshop to create a sequence of changed images, then save them in an animated .gif format. There may be other, better formats for animations than .gif, but I don't know of any that don't require a separate viewer. Try using Google to search for animation formats, and keep in mind that some will require that your user have some display tool installed to view some of them. Try to avoid that, if you can.
If that doesn't pan out, you can still go through the tedious task of sequencing hand-coded bitmaps using the Paint routine. Personally, I'd rather have a root canal, but tastes vary...
Will Rogers never met me.
|
|
|
|
|
thanks for your help..
but can you please to help me to find a small demo .. for starting this task ..
|
|
|
|
|
The BBC Radiophonic Workshop would have been able to help, but they shut it down years ago.
|
|
|
|
|
Hi there i want to create node to make the Half man Tree The code that i found to make node is here
<pre lang="c#">
public class Node
{
public char Symbol { get; set; }
public int Frequency { get; set; }
public Node Right { get; set; }
public Node Left { get; set; }
public List<bool> Traverse(char symbol, List<bool> data)
{
// Leaf
if (Right == null && Left == null)
{
if (symbol.Equals(this.Symbol))
{
return data;
}
else
{
return null;
}
}
else
{
List<bool> left = null;
List<bool> right = null;
if (Left != null)
{
List<bool> leftPath = new List<bool>();
leftPath.AddRange(data);
leftPath.Add(false);
left = Left.Traverse(symbol, leftPath);
}
if (Right != null)
{
List<bool> rightPath = new List<bool>();
rightPath.AddRange(data);
rightPath.Add(true);
right = Right.Traverse(symbol, rightPath);
}
if (left != null)
{
return left;
}
else
{
return right;
}
}
}
}
</pre>
I know that the Symbol and Frequency Are the data and the Left and Right is to store the position of the another Node. but i dont understand the Traverse Method. what is for!!!
The Rest of the halff man code is here:
<pre lang="c#">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace HuffmanTest
{
public class HuffmanTree
{
private List<Node> nodes = new List<Node>();
public Node Root { get; set; }
public Dictionary<char, int> Frequencies = new Dictionary<char, int>();
public void Build(string source)
{
for (int i = 0; i < source.Length; i++)
{
if (!Frequencies.ContainsKey(source[i]))
{
Frequencies.Add(source[i], 0);
}
Frequencies[source[i]]++;
}
foreach (KeyValuePair<char, int> symbol in Frequencies)
{
nodes.Add(new Node() { Symbol = symbol.Key, Frequency = symbol.Value });
}
while (nodes.Count > 1)
{
List<Node> orderedNodes = nodes.OrderBy(node => node.Frequency).ToList<Node>();
if (orderedNodes.Count >= 2)
{
// Take first two items
List<Node> taken = orderedNodes.Take(2).ToList<Node>();
// Create a parent node by combining the frequencies
Node parent = new Node()
{
Symbol = '*',
Frequency = taken[0].Frequency + taken[1].Frequency,
Left = taken[0],
Right = taken[1]
};
nodes.Remove(taken[0]);
nodes.Remove(taken[1]);
nodes.Add(parent);
}
this.Root = nodes.FirstOrDefault();
}
}
public BitArray Encode(string source)
{
List<bool> encodedSource = new List<bool>();
for (int i = 0; i < source.Length; i++)
{
List<bool> encodedSymbol = this.Root.Traverse(source[i], new List<bool>());
encodedSource.AddRange(encodedSymbol);
}
BitArray bits = new BitArray(encodedSource.ToArray());
return bits;
}
public string Decode(BitArray bits)
{
Node current = this.Root;
string decoded = "";
foreach (bool bit in bits)
{
if (bit)
{
if (current.Right != null)
{
current = current.Right;
}
}
else
{
if (current.Left != null)
{
current = current.Left;
}
}
if (IsLeaf(current))
{
decoded += current.Symbol;
current = this.Root;
}
}
return decoded;
}
public bool IsLeaf(Node node)
{
return (node.Left == null && node.Right == null);
}
}
}
</pre>
|
|
|
|
|
Did you get this to work for you yet? By the way, it's called Huffman Tree
"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
|
|
|
|
|
I have a question about the benefits of using linq to sql in a C# 2010 web application. I am asking that question since I am the only programmer at a small company that is making changes to the company website that was written originally by a contract shop that went out of business. This is the first time I have worked with linq to sql.
From my point of view, I just see linq as more performance overhead to slow down the performance of the website. The linq needs to be translated to sql by the .net application. Thus can you tell me what I am missing?
|
|
|
|
|
In a lot of cases, a well designed LINQ application is no less performant than a hand crafted SQL solution. You have to be aware of what you are doing, but when you do know, it's a pretty powerful technique.
|
|
|
|
|
Neh. The peformance is similar to hand rolling the code against SQL directly, but (as Pete has said) you need to know what you are doing. You can use SQL Queries, with LINQ to SQL, and the queries can be optimised in the usual way.
What is does bring in the ability not to need write yet another DAL Implementation, freeing you up to be more productive in other areas. I've not really used ADO.NET directly for a good few years now, nor have I felt the need to.
|
|
|
|
|
Hi,
If you can utilize LINQ perfectly then linq to sql will definitely improve your application performance. One more advantage is database dependency. you can provide multiple database support for your application like MySQL, MsSQL, etc....
You do not need to maintain two database query individually. Framework will manage that.
There are more features and both way have pros and cons. so you need to decide it from your application requirements.
Thanks
-amit
|
|
|
|
|
amitgajjar wrote: If you can utilize LINQ perfectly then linq to sql will definitely
improve your application performance.
Bold statement there. It MAY improve application performance, but if I write equally optimised SQL then I won't see an improvement.
|
|
|
|
|
Yes but my personal opinion is if we are with the latest trend or flow of the Microsoft evolution then we can win the race. As we can see Microsoft people concentrate on new things, so if you are planning for long term project then we should use latest one.
As good coding in Framework 2.0 is better then Bad in Framework 4.0
But i would like to know your personal opinion, if you have a long term project what will be your choice ?
-Amit
|
|
|
|
|
|
on codeplex it says this project is in progress. so can we rely on that ?
|
|
|
|
|
Yes. The in progress part means we are adding lots of new features to it - this really is an ongoing project. It's actually up and running here[^].
|
|
|
|
|
my project i used tcp server done by c# program and wp7 client tcp
i want ask if i can used wcf service (to remote DB on server ) with tcp in the same project ??????????????????????
|
|
|
|