This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
How do I fix the errors in this code?
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
Info = "The Process" + ProcessID.ToString("") + " Has Been Attached !";
For this line PS3TMAPI.GetProcessList(0, out processIDs); I'm getting "the best overloaded method match for PS3TMAPI.GetProcessList(int, out uint[]) has some imvalid arguments"
Argument 2: cannot convert from out processIDs to out uint[]
For all the processIDs I'm getting doesn't exist in current context
And for all the ProcessID I'm getting doesn't exist in current context
I'm getting Info doesn't exist in current context
Also how do I do this in this video for example in bottom left hand corner the guy presses the button and the not connected in red turns green after it connects I connected a letterbox in my program but to let me know if it connected successfully I want to do that, in the video it's in the bottom left from 1:22 - 1:27 http://www.youtube.com/watch?v=uUI5IIhrj78
You need to post more (all?) of the relevant code to get any real help with this. Without more to go on the best you'll likely get is this.
processIDs is not a uint[] (see answer 3 below).
see answer to 1.
processIDs is declared elsewhere (outside this method) or not at all.
ProcessID is declared elsewhere (outside this method) or not at all.
Info is declared elsewhere (outside this method) or not at all.
you can fix several of the errors by adding
uint[] processIDs = null;
at the start
But I agree with Jon (duuh) that the question is not very clear.
Related
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
How can I get complete querystring in asp.net?
Suppose a QueryString like this passed to my Login Page.
login.aspx?redirect=cart.aspx&p=1&q=2&r=3
I have to pass parameters p,q and r to Cart.aspx with all of the parameters except redirect.
Login.aspx may handle different querystrings but all parameters except the redirect are to be passed to the redirecting page.(Actually, I know there will be a parameter 'redirect' but can't write code for p,q,and r bcoz it may change in different contexts)
The parameters except 'redirect' will be different in different contexts. The p,q,r are required parameters for cart.aspx. If the redirection is to another page then the parameters may not be p,q,r instead something else like l,m,n
You can use like this
Request.Url.Query
Input like this
Input: http://localhost:96/Cambia3/Temp/Test.aspx?q=item#fragment
Output
You can get the parameters using
string _url=Request.RawUrl.toString();
and
For path ...
string _path = Request.Path.ToString();
string _url = Request.ServerVariables["URL"].ToString();
O/P = /Home/About/
RawURl Returns whole querystring....
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I was trying to convert the following c# code to vb.net.
I see the problem is my lack of familiarity with the syntax of the parameters of OrderByDescending() What is the proper VB.Net equivalent of the C# line?
//C# code
SelectedFolder.Search("ALL", true).OrderByDescending(_ => _.Date).ToList();
//VB.Net part which doesn't work
For Each msg In SelectedFolder.Search("ALL", True).OrderByDescending(Function(_).[Date]).ToList()
After removing the underscore before [Date] the error became,
Error 1 Identifier expected.
The _ character is a line continuation in VB. Try changing the variable name to something more common, like x
For Each msg In SelectedFolder.Search("ALL", True).OrderByDescending(Function(x) x.[Date]).ToList()
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
Currently, not even the simplest examples of using the 'ExpandoObject' work on my machine.
Both
dynamic obj = new ExpandoObject();
obj.Value = 10;
var action = new Action<string>((line) => Console.WriteLine(line));
obj.WriteNow = action;
obj.WriteNow(obj.Value.ToString());
(from this website) and
dynamic sampleObject = new ExpandoObject();
sampleObject.test = "Dynamic Property";
Console.WriteLine(sampleObject.test);
(from the MSDN examples) fail with a RuntimeBinderException. I presume I've misconfigured something, but I am at a loss about what it might be.
I am using .NET v4.0.30319 and Visual Studio 2010 SP1 Premium. Please ask for anything else you might need to know. =)
Deleting the hidden "SolutionName.suo" file in the solution directory fixed this problem for me.
I still have no clue why it occured, though.
Edit:
Andras Zoltan, who deleted his answer, guessed correctly. I have had "Break on all Exceptions" enabled and was being stupid. =)
The problem is simply that Console.WriteLine has too many overloads and so the dynamic part cannot be figured out correctly.
Put the output into a typed variable before or just cast it.
e.g.
dynamic sampleObject = new ExpandoObject();
sampleObject.test = "Dynamic Property";
Console.WriteLine((string)sampleObject.test);
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
Can anyone help me in casting generic collection in c# 4.
Here is the code snippet.
GridView1.DataSource = dataServiceColl.Select(t => t.product_desc="EdibileItem")
It is throwing up runtime error at the below line,
Gridview1.Databind();
Saying it is a HTTP Exception.
I think it should be a simple type cast.
Thanks,
Kris.
Use
t => t.product_desc=="EdibileItem"
HTTP Exception? That has nothing to do with casting.
More importantly, why are you assigning "EdibleItem" to t.product_desc here?
Select(t => t.product_desc="EdibileItem")
Did you meant == instead of =? If so, would a Where be more appropriate than a Select?
I think it all boils down to: what are you trying to achieve, exactly?
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
After reading these questions:
Code is behaving differently in Release vs Debug Mode
C# - Inconsistent math operation result on 32-bit and 64-bit
Double precision problems on .NET
Why does this floating-point calculation give different results on different machines?
I suspect that the reason my method for determining FPS which works while in Debug mode and no longer works in Release mode is because I'm using Long to hold time values. Here's the relevant code:
public void ActualFPS()
{
if (Stopwatch.GetTimestamp() >= lastTicks + Stopwatch.Frequency)
{
actualFPS = runsThisSecond;
lastTicks = Stopwatch.GetTimestamp();
runsThisSecond = 0;
}
}
runsThisSecond is incremented by one every time the method I'm tracing is called. Granted this isn't an overly accurate way to determine FPS, but it works for what I need it to.
lastTicks is a variable of type Long, and I believe that Stopwatch.GetTimestamp() is returned as a Long as well(?). Is this my problem? If so: any suggestions as to how to work around this?
EDIT: Stopwatch is using the High Resolution timer.
EDIT2: The problem has resolved itself. Without any changes to any of my code. At all. None. I have no idea what caused it to break, or to fix itself. Perhaps my computer decided to spontaneously consider my feelings?
You have a very accurate interval measurement available (gettimestamp - lastticks), but you are not using it all to compute the frame rate. You assume the interval is a second, it won't be. It will be more, by a random amount that's determined by how often you call ActualFPS(). In Release mode you'll call ActualFPS() more frequently so the error is less.
Divide runsThisSecond by (gettimestamp - lastticks) converted to seconds.