|
Hi, MD file is Markdown, I want to create it then save some info. in it then read it
|
|
|
|
|
|
Hi, I am a beginner in C# and programming in general. I have a problem getting started with C#, and I need some tips for one project I'm doing for myself.
In general I need a list of items in a combo box, and based on the selection in the combo box I need some variables to take different values, then make calculations based on these values and produce a numerical result into a TextBlock.
For now I understand that I should do it like this (but I am missing a lot):
1. I made a class like this (in MainWindow.xaml.cs):
class Concrete
{
public double CompressionStrength { get; set; }
public double YoungModulus { get; set; }
}
create some instances of this class like this:
Concrete C37 = new Concrete();
C37.ConpressionStrength = "30";
C37.YoungModulus = "21"
Concrete C30 = new Concrete();
C37.ConpressionStrength = "25";
C37.YoungModulus = "21"
2. I made a combo box in MainWindow.xaml
<ComboBox x:Name="ConcreteList">
</ComboBox>
3. Now I need to somehow populate the combo box with different instances of my class, like:
<ComboBox.item1 = C37/>
ComboBox.item2 = C30/>
4. Then I need to create some variables based on the selection in the combo box and make some calculations, for example:
if TextBoxSelection=C37;
double a = 10;
double b = 20;
double CompressionStrength = C37.CompressionStrength;
double c = a*b*CompressionStrength;
else ....
end if
5. And then I just need to print value "c" to a TextBlock in the WPF window.
Now I need to ask for some general guidance about this because I am a little stuck...
1. How do I populate combo box in MainWindow.xaml with names of my class instances that are in the MainWindow.xaml.cs?
2. How do I create a numerical variable from the class property and perform calculatons on it?
3. Is it even doable this way / what would be your suggestions for making this work?
I would be grateful for any comments.
|
|
|
|
|
|
Hi all,
Scenario: a non thread-safe .net assembly is accessed by a C# web service (multi-thread) and returns corrupted data when concurrent requests are issued due to sharing non safe data. The C# web service is consumed by a Java web site.
Actual solution: the C# web service implements by code a FIFO - First In First Out queue for the requests. With this approach, every web service call that redirects to the assembly go to the queue and is attended when the previous request to the assembly is finished. The assembly logic's performance is good and Users most time do not fell the delay caused by waiting in the queue. However it was a contingency solution and it is far to be the ideal solution.
Alternative options: load the assembly dynamically for each request and access the needed method at run-time
Drawbacks:
The code below compiles but there are syntax troubles:
Assembly pb_dll = Assembly.LoadFile("C:\\inetpub\\wwwroot\\rsasmPBService\\bin\\rs4pb2017asm.dll");
Type memberServicing = pb_dll.GetType("rs4pb2017asm.n_eas_member_servicing_iis");
string [] args = new string[2];
args[0] = orgId;
args[1] = contactId;
object memberServ_Instance = Activator.CreateInstance(memberServicing);
object Result = memberServicing.InvokeMember("getmemberoptions_iis", BindingFlags.Default |
BindingFlags.InvokeMethod,null, memberServ_Instance, args );
Return Result ;
The assembly returns a data structure that each element of the structure is an array. The elements have different data types. The structure has to be sent back to the caller.
QUESTIONS:
1. How to convert/cast the object "Result" into the structure format ?
2. In the above syntax, the arguments are passed to the assembly in an array of strings. However there are methods that expect to receive string and integer data as argument, for instance. So what could be a syntax to pass individual arguments, not an array?
Thank you for the help.
Paulo
|
|
|
|
|
Serialize to and from XML (or JSON?) and use that for "data transfer".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Sorry. Caffeine-deficiency brainfart. Meant it for OP anyway.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
modified 25-May-18 22:06pm.
|
|
|
|
|
Why?
You in a habit of "marshalling" "web services"?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
how can create a Newton Raphson method program using C# that allows the user to input the values which include trigonometry,exponential,polynomials and product of any of the three
|
|
|
|
|
Well, before you can write a program for it, you have to understand it. This is my contribution toward your ultimate goal.
Newton's method - Wikipedia[^]
I wonder why instructors continue to give homework assignments that can easily be resolved by a minimalist google search...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Because the instructors are almost as lazy as some of the students they give assignments to?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You'll enjoy NR; it doesn't always converge to an answer.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi everyone,
I've been trying to implement Haar Cascade car classifer lass in order to detection vehicles in a video. However I can't seem to find anything on this. I'm new to Haar Cascade and EmguCV. Any help would be much appreciated, thanks in advance. All I have been able to find so far is:
public class HaarCascade : ICloneable
{
String path = @"C:\Users\Dylan\car.xml";
HaarCascade cascade1 = HaarCascade.FromXml(path);
Image<bgr, byte=""> frame = new Image<bgr, byte="">(bitmap);
Image<gray, byte=""> grayFrame = frame.Convert<gray, byte="">();
var cars = haar.DetectMultiScale(grayFrame, 1.5, 20, new System.Drawing.Size(10, 10), new System.Drawing.Size(80, 80));
foreach (var car in cars);
frame.Draw((Rectangle)car, new Bgr(255.0, 0, 0), 2);
}
|
|
|
|
|
How did you ever hear of "Haar Cascade" if you "can't seem to find anything on (it)"?
I only found 587,000 references.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I got 1,030,000!
(I'm guessing he used Bing)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You're bang on about Bing.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi guys,
How can I add radiobutton's image to .pdf? what to add to below sample code?
if (radioButton54.Checked)
{
Paragraph soru1 = new Paragraph(label10.Text + " " + radioButton54.Text);
pdfDosya.Add(soru1);
}
else if (radioButton122.Checked)
{
Paragraph soru1 = new Paragraph(label10.Text + " " + radioButton122.Text);
pdfDosya.Add(soru1);
}
else if (radioButton1.Checked)
{
Paragraph soru1 = new Paragraph(label10.Text + " " + radioButton1.Text);
pdfDosya.Add(soru1);
}
modified 13-Feb-19 21:02pm.
|
|
|
|
|
|
I tried as
if (radioButton54.Checked)
{
Paragraph soru1 = new Paragraph(label10.Text + " " + radioButton54.Text + radioButton54.Image);
pdfDosya.Add(soru1);
}
but it shows up as System.Drawing.Bitmap at .pdf
modified 13-Feb-19 21:02pm.
|
|
|
|
|
I get the employee list from SQL Server problem with fields:
ID: id employee
Employee: name employee
after filter the kernel list dv.RowFilter = "set condition unique 1 recoder" at the command if (dv.Count == 1) at this assignment id and the kernel name is not correct the unique file filter on which it assign the first file in the family list. yourself want to get sample sample already been filter by dv.RowFilter, main syntax in command if (dv.Count == 1) {// chars this again as what ?)
string tmpSQL = "string to get the list employee";
DataTable dt = Conection.FillDatatable(tmpSQL);
DataView dv = new DataView(dt);
dv.RowFilter = "set condition unique 1 recoder";
if (dv.Count == 1)
{
txtIdEmployee.Text = dv.Table.Rows[0]["ID"].ToString();
txtNameEmployee.Text = dv.Table.Rows[0]["Employee"].ToString();
}
else
{
}
modified 23-May-18 2:55am.
|
|
|
|
|
It may be early in the morning and I'm still drinking my first coffee of the day, but that makes no sense to me at all.
Please, try copy and pasting the code you are actually using (use the "code" widget to format it)
if (a)
{
b();
} And show sample DB data. Then explain what you expected to happen, and compare that to what did, tell us when it happened, what you did to make it happen, give us any error messages that appeared. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
But from what you have posted so far, I can't even work out when the problem occurs (compilation or run time) much less what the problem itself might be - and so can't even begin to come up with a solution!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 2458467 wrote: dv.RowFilter = "set condition unique 1 recoder";
The RowFilter property[^] has a defined syntax[^] which you must follow.
"set condition unique 1 recoder " is not a valid row filter.
The rest of your question makes absolutely no sense. I suggest you find a better translator.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You could try this:
DataTable table = dv.ToTable().AsEnumerable().GroupBy(x=>x.ID);
if (table.Rows.Count == 1)
{
txtIdEmployee.Text = table.Rows[0]["ID"].ToString();
txtNameEmployee.Text = table.Rows[0]["Employee"].ToString();
}
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hi Guys,
How can I make below work? 3 radio button is there and whichever is clicked will be added to pdf.
switch
{
case 1 (radioButton54.Checked)
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton54.Text);
pdfDosya.Add(q1);
case 2 (radioButton122.Checked)
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton122.Text);
pdfDosya.Add(q1);
case 3 (radioButton1.Checked)
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton1.Text);
pdfDosya.Add(q1);
}
modified 13-Feb-19 21:02pm.
|
|
|
|
|
You can't use switch like that in C#, the format is:
switch (variable)
{
case constantValue1:
...
break;
case constantValue2:
...
break;
default:
...
break;
} You could use a variable to "combine" the radio buttons and the switch on that, but it would be very messy. You would be much better off with an if ... else if ... else instead:
if (radioButton54.Checked)
{
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton54.Text);
pdfDosya.Add(q1);
}
else if (radioButton122.Checked)
{
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton122.Text);
pdfDosya.Add(q1);
}
else if (radioButton1.Checked)
{
Paragraph q1 = new Paragraph(label10.Text + " " + radioButton1.Text);
pdfDosya.Add(q1);
} In the long term, it'll be a lot more readable and maintainable.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|