|
ferronrsmith wrote: So basically, if the user enters only one value, only 1 report is queried if they entered more than 1 then more than one report is generated one after another.
What do you mean report here?? Is it a crystal report? I dont see any report binding code.
I would appreciate if you elaborate your requirement.
Cheers,
Sudhanva
|
|
|
|
|
i am cheap, can't afford crystal, lol. I wanna create a form that grabs data from a database and insert it in my layout, the problem i am having is that i want to grab multiple records from the database and display it. Three per page.
Ferron
|
|
|
|
|
ferronrsmith wrote: I wanna create a form that grabs data from a database and insert it in my layout
Instead create a usercontrol (which should have your forms' controls) to bind the data, and put a for loop for number of querystring items, and call the usercontrol and bind the data.
That should solve your problem.
Cheers,
Sudhanva
|
|
|
|
|
I need to take a .docx file or .doc and make it into HTML. Here is an example of before and after of what I need.
.doc or .docx file
Interviewer: Question
Interviewee: Answer
HTML
<div class="interview">Interviewer</div>
<div class="QorA">Question</div>
<div class="interview">Interviewee</div>
<div class="QorA">Answer</div>
If anyone could help me out on starting to write this.
Thanks!
|
|
|
|
|
I am used to C++ more than C#.
In C++ you have header files and you have the ability to declare states. For example, you can declare a series of unsigned integers to be for a variety of different states to later use in switch statements or if-then statements.
Since C# does not have the same sort of structure with header files, how would I impliment a simular functionality in C#?
The reason why I want to use UINT is because you can do that super cool bit-wise and and or with them. Remember those good ol' days? You could define four different conditions like this:
UINT state_001 2
UINT state_002 4
UINT state_003 8
UINT state_004 16
Then a variable can be any one state or any combination of states. To assign a variable a particular state, you do a bitwise and to the variable. To see if the variable was set to any of the states, you do a bitwise or.
How would that look like in Visual C#?
|
|
|
|
|
It would look good, and a lil' bit more readable than C++.
I are troll
|
|
|
|
|
Use an enum with the [Flags] attribute set for a bitfield. Here's a snippet from MSDN:
// A bit field or flag enumeration of harvesting seasons.
[Flags]
public enum Seasons
{
None = 0,
Summer = 1,
Autumn = 2,
Winter = 4,
Spring = 8,
All = Summer | Autumn | Winter | Spring
}
Hope this helps!
Jon
|
|
|
|
|
Xarzu wrote: How would that look like in Visual C#?
It would look better.
You use an enum, which gives it more structure. This will also give you the possible values to use right in the intellisense, so you don't have to wade through loads of header files to find out which constants you can use.
[Flags]
public enum Feeling {
Happy = 1,
Hungry = 2,
Free = 4,
Cold = 8
}
The Flags attribute enables you to perform bitwise operations on the enum values:
Feeling xarzu = Feeling.Happy | Feeling.Hungry;
if ((xarzu & Feeling.Happy) != 0) MessageBox.Show("Xarzu is happy.");
The data type that the enum uses by default is int , as that's the most efficient type. You can specify a different type like an uint if you like, but there is rarely any reason for that.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
viterbi algorithm in c#
can any one explain wats happening in the code
i need working of this code,,, antyone pls
using System;
using System.Collections.Generic;
using System.Text;
namespace Viterbi
{
public class ForwardViterbi
{
// The Class Globals
string[] states;
string[] observations;
double[] startProbability;
double[,] transitionProbability;
double[,] emissionProbability;
double scaleFactor;
//Computed Variables
int[] vPath; //The Viterbi Path
double[] vProbs;
//----------------------------------------------------------------------
// The Getters or Accessors
public int[] VPath
{
get { return vPath; }
}
public double[] VProbs
{
get { return vProbs; }
}
//----------------------------------------------------------------------
//Constructor
public ForwardViterbi(string[] states, string[] observations, double[] startProbability, double[,] transitionProbability, double[,] emissionProbability, double scaleFactor)
{
this.states = states;
this.observations = observations;
this.startProbability = startProbability;
this.transitionProbability = transitionProbability;
this.emissionProbability = emissionProbability;
this.scaleFactor = scaleFactor;
}
//----------------------------------------------------------------------
//The Methods
public void Process(int[] problem)
{
double[,] T = new double[states.Length, 3]; //We will store the probability sequence for the Viterbi Path
vPath = new int[problem.Length];
vProbs = new double[problem.Length];
//initialize T
//------------------------------------------------------------------
for (int state = 0; state < states.Length; state++)
{
T[state, 0] = startProbability[state];
T[state, 1] = state;
T[state, 2] = startProbability[state];
}
for (int output = 0; output < problem.Length; output++)
{
double[,] U = new double[states.Length, 3]; //We will use this array to calculate the future probabilities
Console.WriteLine("\nTesting hypothesis {0} ({1})", output, observations[problem[output]]);
double highest = 0;
for (int nextState = 0; nextState < states.Length; nextState++)
{
double total = 0;
double argMax = 0;
double valMax = 0;
Console.WriteLine(" Estimating probability for future state {0} ({1})", nextState, states[nextState]);
for (int state = 0; state < states.Length; state++)
{
Console.WriteLine(" The testing state is {0} ({1})", states[state], state);
double prob = T[state, 0];
double v_path = T[state, 1];
double v_prob = T[state, 2];
double p = emissionProbability[state, problem[output]] * transitionProbability[state, nextState] * scaleFactor;
prob *= p;
v_prob *= p;
total += prob;
if (v_prob > valMax)
{
valMax = v_prob;
argMax = nextState;
}
Console.WriteLine(" VProbability of {0} is {1} with scale {2}^{3}", states[nextState], v_prob, scaleFactor, output + 1);
if (v_prob > highest)
{
highest = v_prob;
vPath[output] = nextState;
vProbs[output] = v_prob;
}
}
U[nextState, 0] = total;
U[nextState, 1] = argMax;
U[nextState, 2] = valMax;
}
T = U;
Console.WriteLine("The highest probability was {0} in state {1} (scale factor of {2}^{3})", highest, states[vPath[output]], scaleFactor, output + 1);
}
//Apply SumMax
double Total = 0;
double ValMax = 0;
for (int state = 0; state < states.Length; state++)
{
double prob = T[state, 0];
double v_path = T[state, 1];
double v_prob = T[state, 2];
Total += prob;
if (v_prob > ValMax)
{
ValMax = v_prob;
}
}
Console.WriteLine("\nAnalysis: Total probability (sum of all paths) for the given state is :: {0}\nThe Viterbi Path Probability is :: {1}", Total, ValMax);
Console.WriteLine("The above results are presented with a scale factor of {0}^{1}", scaleFactor, problem.Length);
}
}; // end Forward Viterbi Class
}
|
|
|
|
|
No-one is going to read all of this, or do your homework for you. How about you tell us which line is not doing what you expect ? Have you spent some time in the debugger to see where the code is not following the logic you hoped for ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
dear friend
i spent time and studied.. but these lines i don understand the logic... can u help me pls
if (v_prob > valMax)
{
valMax = v_prob;
argMax = nextState;
}
Console.WriteLine(" VProbability of {0} is {1} with scale {2}^{3}", states[nextState], v_prob, scaleFactor, output + 1);
if (v_prob > highest)
{
highest = v_prob;
vPath[output] = nextState;
vProbs[output] = v_prob;
}
}
U[nextState, 0] = total;
U[nextState, 1] = argMax;
U[nextState, 2] = valMax;
}
T = U;
Console.WriteLine("The highest probability was {0} in state {1} (scale factor of {2}^{3})", highest, states[vPath[output]], scaleFactor, output + 1);
}
//Apply SumMax
double Total = 0;
double ValMax = 0;
for (int state = 0; state < states.Length; state++)
{
double prob = T[state, 0];
double v_path = T[state, 1];
double v_prob = T[state, 2];
the quieter u become more u hear
|
|
|
|
|
How about no scott? Scotty says no? howbowudoee? Ladies and gentlemen scotty don't.
|
|
|
|
|
Hi,
The Viterbi algorithm is an interesting one, IMO its working is best explained and understood using
several graphics, rather than code. Anyway it is beyond the scope of a forum like this one, you would
better look it up in a specialized book, such as a digital communications course.
Once you fully understand the allgorithm, I suggest you take a really really simple test case,
and work it out by hand, then run it through the program you want debugged, and compare the results
step by step. Don't expect too much help from this forum, unless you prove you understand and really
tried, but got stuck at a very specific point.
|
|
|
|
|
Luc Pattyn wrote: Once you fully understand the allgorithm..
..write an article about it and post it here!
Luc Pattyn wrote: Don't expect too much help from this forum
Sad, but true. "Gimme codez, urgent" makes one cynical.
The noise is going up in this forum, and it's killing the music..
I are troll
|
|
|
|
|
Eddy Vluggen wrote: "Gimme codez, urgent" makes one cynical.
The noise is going up in this forum,
That was not the point, the topic is rather complex an not very suited for a text-only forum
that focuses on small programming issues.
|
|
|
|
|
Fortunately, one can use pictures when submitting an article
I are troll
|
|
|
|
|
I am writing a windows service in c# and am loading a crystal report. I need to export this report as a jpg file to disk or to take some kind of image stream which I can load into a bitmap or image object. I can export to a PDF but this is no use to me.
Any ideas?
|
|
|
|
|
Have never had the need to use Crystal Reports myself but this link[^] looks like it might have the answer.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi thanks for the reply. but.. the link takes me to a page describing how to "export crystal as image" perhaps you gave me wrong link? or else my english writing is a total failure. i need help on how to list parameter values dynamically created by the report.
Br
Tomas
If it' stuck, DO NOT pull harder!
|
|
|
|
|
c0ax_lx wrote: help on how to list parameter values dynamically
That's not the question you asked!:
c0ax_lx wrote: I need to export this report as a jpg file to disk or to take some kind of image stream which I can load into a bitmap or image object.
I'd start a new thread seeing as it's a totally new question.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
D'uh! i'm really sorry! this wasnt even my post! not used to see crystal report questions here *sigh*. well. You are totally correct, your post is the answer to the question.
so i'll just shut up now and try to find my own post.
hmm. i feel stupid.
Rgds
Tomas
If it' stuck, DO NOT pull harder!
|
|
|
|
|
LOL, no worries - I didn't check the user name(s).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Your post here[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
How can I play flash on C# form? Can you help me about that please?
Thanks in advance.
|
|
|
|
|
Link 1[^]
Link 2[^]
Both do exactly what you should have done before posting and you might have been finished this project (or the part that you asked about) by now instead of waiting for another to do a simple search you could have done yourself.
|
|
|
|
|