|
...that'd be an easy calculation. 0 "I need build Skynet. Plz send code"
|
|
|
|
|
I'll make sure my expenses stay outside the [55, 71] range. And I'll double check.
|
|
|
|
|
Why would you want to round up from 55.99 to 56? 55.99 is not greater than or equal to 56. I'd say rounding down is the correct behavior there. However, for maxValue, then you might want to use Math.Ceiling to round up (well, since Math.Ceiling returns a double, you'd round up then cast to a long if you really want a long for some reason). The alternative would be to not round at all and the comparison will work fine (the longs will be promoted to doubles when you do the comparison.
My guess is somebody did the rounding because they didn't think it through very well. But there may be some perfectly valid reason that would be easier to determine if we know what code was replaced by "....".
Side note: this could possibly have something to do with setting pixel values. That is a common place for integers to be required for comparisons and such when the underlying values are really floating point numbers (e.g., doubles).
Fenryl wrote: value = 55.99.
FYI, I assume that "." is supposed to be ";".
|
|
|
|
|
What about adding .5 to 55.99 before truncating it?
|
|
|
|
|
Hi guys/gals. ...I'll cut to the chase.
I'm working with a 2.0 GridView bound to a list of my own custom data object...i.e.:
grid.DataSource = List<Record>;
Among other data, Record has a StatusMessage property that needs to display in one of the columns and it is optionally very long. I want to maintain consistent row sizes, so I am trying to use an ItemTemplate to have the TableCell contain a label with a substring of the StatusMessage plus an optionally visible "ellipsis button" if the length of the StatusMessage is longer than the set-length substring.
(Basically, if the message is "foo", I want to display "foo" and nothing else. If the message is "foofoofoofoofoofoofoofoofoofoofoofoofoo" I want to display "foofoo [...]"
...I'm trying to find an event when the GridView is created where I have access to the controls within the TemplateField (should be 2: {asp:Label, asp:Button}) and the collection never has any contents. (examples of my attempts)
protected void grdOutput_RowCommand(object sender, GridViewCommandEventArgs e)
{
int _selectedIndex = int.Parse(e.CommandArgument.ToString());
grdOutput.Rows[_selectedIndex].BackColor = System.Drawing.Color.CornflowerBlue;
Record record = ((List<Record>)grdOutput.DataSource)[_selectedIndex];
grdErrors.DataSource = GetNotificationErrors(record.NotificationID);
grdErrors.DataBind();
}
protected void grdOutput_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton _rowClickButton = (LinkButton)e.Row.Cells[3].Controls[0];
string _script = ClientScript.GetPostBackClientHyperlink(_rowClickButton, "");
e.Row.Attributes["onclick"] = _script;
e.Row.Cells[2].CssClass = "expandoButton";
e.Row.Cells[2].Controls[1].Visible = true;
}
}
protected void grdOutput_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Record record = (Record)e.Row.DataItem;
if (record != null)
{
TableCell cell = e.Row.Cells[2];
cell.Text = record.StatusMessage;
cell.Controls[1].Visible = true;
if (record.StatusMessage.Length > 50)
{
cell.Text = record.StatusMessage.Substring(0, 50);
}
cell.CssClass = "expandoButton";
cell.BackColor = System.Drawing.Color.Orange;
}
}
}
protected void grdOutput_PreRender(object sender, EventArgs e)
{
GridView output = (GridView)sender;
foreach (GridViewRow row in output.Rows)
{
row.Cells[2].Controls[1].Visible = false;
if (row.Cells[2].Text.Length > 50)
{
row.Cells[2].Text = ((Record)row.DataItem).StatusMessage.Substring(0, 50);
row.Cells[2].Controls[1].Visible = true;
}
}
}<div class="signature"><div class="modified">modified on Thursday, March 18, 2010 2:25 PM</div></div>
|
|
|
|
|
ok...weirdness that I wasn't aware of (related to my original post)
in grdOutput_DataBound event, if I pull the cells out of a GridViewRow, the cells that display text from BoundColumns have been populated, but the TemplateColumn that I have included (that has my StatusMessage data in it) has text=String.Empty. Anyone have any idea which server event it is that the TemplateColumn cells will actually have text?"I need build Skynet. Plz send code"
|
|
|
|
|
I have another strange issue. I deployed my project with "available online ony" and it works fine for everyone except for one particular user. This user is on a college campus and is apparently using http proxy.
Is there a specific port used when executing or something I need to be aware of to help troubleshoot this issue more? It is only for one user. It works fine for everyone else.
Here is the log:
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.3 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package '.NET Framework 3.5 SP1', phase BuildList
Reading value 'SP' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5'
Read integer value 1
Setting value '1 {int}' for property 'DotNet35SP'
The following properties have been set for package '.NET Framework 3.5 SP1':
Property: [DotNet35SP] = 1 {int}
Running checks for command 'DotNetFX35SP1\dotNetFx35setup.exe'
Result of running operator 'ValueGreaterThanEqualTo' on property 'DotNet35SP' and value '1': true
Result of checks for command 'DotNetFX35SP1\dotNetFx35setup.exe' is 'Bypass'
'.NET Framework 3.5 SP1' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697211'
|
|
|
|
|
Hi,
In my project i need to convert the lat/long values to MILS. MILS means milliradians. and lat/long means it have degree values. so,
1MILS=0.0573degrees.
But in the lat/long values, i will have degree, minutes,seconds and direction. So, what are the things that i should consider and calculation to be performed during the conversion? Can somebody help me????
|
|
|
|
|
Ummm... aren't there sixty minutes per degree and sixty seconds per minute?
You didn't like the answer you got before[^]?
|
|
|
|
|
yes.
yes.
no.
|
|
|
|
|
You need to calculate the total degrees first:
Basically:
D = d + m/60 + s/360
Where
D = full degrees,
d = degree of your co-ordinate.
m = minutes of your co-ordinate.
s = second of your co-ordinate.
The to convert to radians:
r = (PI * D) / 180.
The miliradians is r * 1000.
The main things you are likely to run up against are:
1. Precision errors in the maths. You can re-work the formulae I have given you to help.
2. The problem that the Earth isn't a true sphere, it is flattened at the poles. Calculating distances on a non-true sphere is beyond my capabilities at the moment....Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Now you tell you want milliradians. I thought you want to use Miles as in distance.
For 1 Degrees, it comes about "17.452" MILS. To convert Degres, Minutes and seconds use the folowing code:
Double dec = degres + (minutes/60) + (seconds/3600)
Double mils = dec * 17,452
|
|
|
|
|
See http://en.wikipedia.org/wiki/Angular_mil[^]
You need some more information before you can convert. Which definition of mil do you want to use?
Decide which unit definition you really want and apply the appropriate formula. You can convert seconds to degrees by dividing by 3600 and minutes to degrees by dividing by 60.
[Edit] Corrected URL [/Edit]CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
modified on Thursday, March 18, 2010 2:23 PM
|
|
|
|
|
right. see also here[^].
1 circle = 6400 mils.
|
|
|
|
|
Actually it's not quite so simple:
- 1⁄6400 of a circle in NATO countries.
- 1⁄6283 The “real” trigonometric unit of angular measurement of a circle in use by telescopic sight manufacturers.
- 1⁄6000 of a circle in the former Soviet Union and Finland.
- 1⁄6300 of a circle in Sweden.
Aren't standards fun? CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Walt Fair, Jr. wrote: Aren't standards fun?
yes, we can't get enough of them. They really stimulate creativity.
|
|
|
|
|
I want to use 1 degree=17.777777778 mils and i can convert seconds, min to degrees and then to mils.
But i dont know actually regarding the directions which will be specified along with the degree values in the lat/long.
I need to convert the lat/long values to mils. The lat/long values will have N,NE, and so on specified. So, do i need to take those things into consideration after i finish the conversion from deg to mils???
|
|
|
|
|
Well, E/W and N/S are just sign indicators. Usually N and W are negative lat/long respectively and S and E are positive. Just do the normal calcs and use the N/S/E/W with the absolute values depending on the sign of the result.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hi,
I have a C# program that I would like to sell and I want to offer a 14 day trial, I understand that all piracy prevention schemes are overcome so I don't want to waste much time doing this. Could anyone offer any suggestion and even some sample code?
thanks in advance......
|
|
|
|
|
Finger Print Class[^]
This will explain how to get unique key. And you can use it with algorithm to get serial key. If you do not wan't to protect then my suggestion is a Demo mode. You have limited functions, and when someone bought it, they get to download full version.
Any approach you take, it will be pirated.
|
|
|
|
|
when we are running location based services code in an emulator to find maps..........how the connection can be established.plz help me out soon...
|
|
|
|
|
Vote of 1:
Read the FAQs. It isn't clear what you are doing, what you tried or what went wrong. You don't even tell us what you are connecting to.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hi Group members,
I have a problme here...
I have an NT service which i am using as an asynchronous scheduled job in a remote server.
I wish to convert it into a webservice, to make it synchronous, and expose it to the clients, with an ease...
Can some one suggest what would be the right approach to start with??
The NT service is written in the .NET platform.
I think it's a good challenge open for the group...
|
|
|
|
|
Depending on how your original service was written, you may be able to reuse parts of the code. But, as a general rule, you'll be rewriting the thing from scratch.
But, since we know nothing of what your existing service is doing, we can't really make any recommendations, or even if a web service is a viable option for what you want to do.
|
|
|
|
|
well, it is written earlier as a VB.NET scheduled job... then we made it as a .NET NT service...
When u say some part can be reused, i believe that's about the logic part...
we mght have to change the ways it is triggered and the way it can be invoked... am i right or going wrong?
Well, why webservice, as it's better in the ways that it can be exposed for a larger consuming services, and on gets it can invoke, only when required... unlike the scheduled job...
|
|
|
|