|
|
THREE YEARS!
And he can't do that on his own?
Elephant!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Be fair, he said it was three years in the field. Very possibly there was no computer in this field. Perhaps there were some sheep.
This space for rent
|
|
|
|
|
Even the sheep could have worked it out by now!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
And the profile is 9 years old so it could mean that he has been around for 12 years
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you are really "working on unit of measure", you should take a moment to consider the longer term; e.g. a "weight structure / class".
The weight could have a "native" value, but would have methods for returning different UOMs: all ounces or grams; or pound / kilogram fractions; etc.
public class MyWeight {
public decimal Weight { get; set; }
public UnitOfMeasure Units { get; set; }
public MyWeight( decimal weight, UnitOfMeasure units = UnitOfMeasure.Pounds ) {
this.Weight = weight;
this.Units = units;
}
public decimal InPounds( int decimalPlaces = 0 ) {
decimal qty = 0M;
switch ( this.Units ) {
case UnitOfMeasure.Pounds:
qty = Weight;
break;
case UnitOfMeasure.Ounces:
qty = Weight * 0.0625M;
break;
case UnitOfMeasure.Kilograms:
qty = Weight * 2.20462M;
break;
case UnitOfMeasure.Grams:
qty = Weight * 0.00220462M;
break;
default:
throw new NotImplementedException( string.Format( "{0} to Pounds.", Units ) );
}
qty = RoundUp( qty, decimalPlaces );
return qty;
}
modified 2-Jun-16 11:09am.
|
|
|
|
|
Hello engineers
I'm Alireza Ketabdari,
I need a component for design of UI(user interface) with C# language that has a 2 main feature:
1- draw polygon and points and lines by setting location of these in code.
2- change location of these when program is running by click then moving the mousse(main feature).
I could draw polygon and lines and points in panel component but Its locations couldn't change by click then move mousse.
If you know the component that provide me these two feature, you can help me very much and I appreciate you about your help and your attention.
Tank You
|
|
|
|
|
This sounds a lot like homework!
So what have you tried?
Where are you stuck?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
It's called a "frame".
You "change locations" by "redrawing" the shapes and lines each time you have new coordinates.
Simply changing a "coordinate" usually has no "visual" affect unless you consider how the particular type of window you are working with "renders" its UI (i.e. measuring; layout; updates).
|
|
|
|
|
There is rarely a component that does all you require out of the box, and in the few cases it does, it is often rather expensive.
I'd recommend using a Panel
Member 12560979 wrote: I could draw polygon and lines and points in panel component In that case, you can also create a new Panel (or PictureBox or whatever) and put it in that location, right? You'd need the coordinates (which you got), and add the thing to the controls-property of the panel. Things are easier if you give them different colors.
Something like;
var p = new Panel { BackColor = Blue, Location = new Location(x,y), Size = new Size(10, 10) };
Form1.MainPanel.Controls.Add(p);
This would give you a non-transparent panel on top of another. You could override the painting-event in the panel you added, only drawing the desired line. Moving the panel can be done by hooking the mouse-events of the child.
You could take a look at Paint.NET, Google for such examples and/or post more here if stuck
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have been banging my head for quite sometime over my unit test problem (MSTest VS2012). For some reason all of my test methods are grayed out with white exclamation points in front of them and they can not be selected.
When I do a Clean then Rebuild, the test methods could be selected again. However, when I click Run All, it hangs without crashing or giving me any errors. Eventually I just had to hit cancel.
Please suggest how to fix this issue, thanks.
modified 2-Jun-16 2:57am.
|
|
|
|
|
Ah, yes ... a test for the unit test.
(No, sorry; don't have one. Maybe try NUnit).
|
|
|
|
|
Hi,
I have developed a RESTful windows tray application in C#. I access the public functions of this application from javascript via ajax call to http://localhost:8888/....
In the tray application i have referenced to a vb6 dll.
Now my query...
During the application's execution process, the vb dll shows a message box. Since I am calling the process from web browser, the message box appears behind the browser. Hence, The user has to press alt+tab to see the message, which is costing lot of time.
I want this message box to show up on top of all application all the time.
There is no form element in the tray application and vb6 dll.
Please help me to solve this issue.
Regards
|
|
|
|
|
Don't cross post: you have this posted in QA , so leave it there. Duplicating it an multiple places just duplicates work and annoys people.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
My Apologies... This was my first query posted with code project... Please close this thread. Thank you
|
|
|
|
|
Hi,
I have an requirement where we have some project under Target folder.. for these corrosponding target there will be .cs file in Unittest Folder(which will be created using tool).. based on no of count i can check whether unit test is done for that target.. but I want to check whether logic is implemented or not.
Thanks,
Amit Patel
|
|
|
|
|
well, you either need to
a) parse the .cs file to see if it contains the logic/whatever you're looking for (if its 'simple' you could perhaps use Regexes) or
b) compile the .cs file and use reflection to get the method signatures and compare those to a reference list
(there may be other ways, they strike me as the most obvious)
|
|
|
|
|
Can you Please Regexes sample..
|
|
|
|
|
Also take a look at tools for calculating code coverage of tests. Though they won't tell you if your tests are useful, they will at least show you which lines of your code were reached during the execution of the tests.
|
|
|
|
|
I need to get the popup when the image was browsed using MVC
|
|
|
|
|
Is there a question in there somewhere?
|
|
|
|
|
Yes of course, We need help for cropping image before the file uploaded and after its selection and I need to get that as a popup.
|
|
|
|
|
Still not seeing a question in there. I see things you want to happen but no question as to what code you need help with, and by help I mean that you already have some code in place that isn't working that you need help with. Remember, we don't write entire sections of code for you.
This space for rent
|
|
|
|
|
on seeing all the articles I just had a thought of asking you guys for an article which crops the image before it is uploaded. You can see this example while uploading linkedin profile picture it will ask for crop before uploading. Many people will be grateful if any of you could work on it.
|
|
|
|
|
Member 12551418 wrote: Many people will be grateful if any of you could work on it. Including you because we would be doing your job for you for free. That's not the way this place works.
Now, you could always search in Google to see if anyone has already written something that does this. Bearing in mind that JCrop[^] already does most of the work for you, it doesn't seem unreasonable to expect you to put a little bit of effort into it yourself.
This space for rent
|
|
|
|