|
I try to predict the 21th group of data is 410
|
|
|
|
|
What do you want to achieve? Is this homework? I guess it is not very difficult to find out if you know what random means.
|
|
|
|
|
I'm trying to get server's responce (status) code and use this code:
int statusCode;
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = WebRequestMethods.Http.Head;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
statusCode = (int)response.StatusCode;
response.Close();
}
catch (WebException ex)
{
if (ex.Response == null)
throw;
statusCode = (int)((HttpWebResponse)ex.Response).StatusCode;
}
But when I use this code, the time of getting the result is from 300 ms to 5 s. I think this time can be cutted. Help me, please.
|
|
|
|
|
Hi!
I'm new in this forum, and I know about C# language but don't know about architecture.
I've been coding monolitic (1 tier) applications, but I'd like to learn to code (C#) applications with some tiers.
I was reading about tiers and levels but I don't know how I should to code each tier. Is each tier a class library or simply a class in a project?
Can sombody tell me where I should to read in order to learn about architecture coded with C#?
Thank you in advance.
--
Adrián Córdoba
|
|
|
|
|
aecordoba wrote: Is each tier a class library or simply a class in a project?
In hardcore tiered app each tier is on its own server Ideally each tier should know only necessary minimum (e.g UI tier shouldnt know about data storage), so divide them as much as possible - I vote for different class libraries.
FYI, there is Design and Architecture[^] forum...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
|
Thanks, dnh! I'll check the links.
--
Adrián Córdoba
|
|
|
|
|
I made a custom control, I have a property called Text. When I try to use the control on a page the Text property is set AFTER the control has finished doing the code that needs to use the Text property.
How do I get the Text property to set the instance field prior to running most of the code? Is it an event?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Got it. I forgot a '.'
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
I tried to learn about how to do so, and through pinvoke.net i got to:
http://msdn2.microsoft.com/en-us/library/ms649052.aspx
good, now i know how to listen, but how do i get a notice when the clipboard changes? it lead me to:
http://msdn2.microsoft.com/en-us/library/ms649025.aspx
which is the message sent, but what does that help? well, that lead me to:
http://msdn2.microsoft.com/en-us/library/ms633573.aspx
goody! but...i still don't get it, how do i know when the clipboard changes? :\
how do i know when the WM_DRAWCLIPBOARD message it sent?
|
|
|
|
|
I am creating a graphics user-interface. I need someone to help me with creating it. It will containt hteese controls:
ToolBar,
MenuBar,
ContextMenu,
ExplorerBar,
DockableWindows
and many more. I need special help with creating context menu. If you want to help me in your free time mail me to bball@centrum.sk. thanks very much.
|
|
|
|
|
I think, the better idea is ask here. Reasons:
- you don't waste anyone time;
- you can get answer very quickly;
- you can get many different ideas, from different people, how to do something, and choose the one you like or fit the best;
etc.
|
|
|
|
|
thanks. i want help with creating my own context-menu
|
|
|
|
|
ok, so you drag a toolbar (aka toolstrip in vs2005), menubar (aka menustrip in vs2005), contextmenu (aka contextmenustrip in vs2005), explorer bar...which i guess you mean a status bar, dockable is just a propery.
if you don't know VC# then learn it, don't ask other people to program for you.
|
|
|
|
|
I dont think you understand me. I want to create my own controls. I know C# very well. And i said dockablewindows do you know what that is ? probably not.
|
|
|
|
|
Hi,
I need a scipt in c# which I can call after a certain period of time (let's say 5 seconds) after page has been loaded. Can anybody help me in this?
CHEERS
Abubakar
|
|
|
|
|
Start a new thread that sleeps for five seconds, then does something.
---
single minded; short sighted; long gone;
|
|
|
|
|
Can you give an example code for that? It will be really nice.
|
|
|
|
|
|
|
Thanks for your script but my requirement is that I want a method which I can call after a certain amount of time after page has been loaded sucessfully. I am developing a web application not a windows application. If you still have confusion don't hasitate to ask me.
CHEERS
|
|
|
|
|
Then you shouldn't have asked for C# code to do it, as that is not possible to do using server code.
What you need to do is to use Javascript in the browser. Use the window.setTimeout method to start a timer from the onload event in the body tag.
If you want to execute any code on the server from the Javascript, you have to send another request to the server. This can for example be done by reloading the page or using AJAX.
---
single minded; short sighted; long gone;
|
|
|
|
|
OK. my requirement is that after every 5 seconds I want to check whether user data exists on database or not. on the base of this I want to give him rights to watch movies on website. I know it can be done easily with page_load by reloading page after every 5 seconds but my BOSS doesn't want to do it like that neither me. So is there any alternative?
Greetings,
Abubakar
|
|
|
|
|
As an example, say that you have a control that is positioned on a form at its starting place, and you drag that control to another location on a form at its ending place, that would form a line. If conditions were not appropriate for the placement of that control, it would be a good idea to move that control back to its starting place on the form. However, I would like to show the position of that control at several points as it is moved back to the starting place on the form, or even better to show its placement as a continuous motion.
As near as I could figure it, I worked it out mathematically to place the control at several locations along the line back to its starting point. I would find the half way point, and then from the half way point, I would find the quarter way point and three-quarter way point, and so on. In this way, I could plot 64 points along the line to show its new location on the way back to the starting point.
The question is, is there any way of plotting the place along the line utilizing the equivalent of a spline line? That is, the code currently looks like this:
private static void ProvideDragPathReturnToParent(Control ctrl, int intX_end, int intY_end, int intX_start, int intY_start)
{
Point pt0 = new Point(intX_start, intY_start);
Point pt64 = new Point(intX_end, intY_end);
Point pt32 = new Point(((pt0.X + pt64.X)/2) ((pt0.Y + pt64.Y));
Point pt16 = new Point(((pt0.X + pt32.X)/2) ((pt0.Y + pt32.Y));
Point pt48 = new Point(((pt32.X + pt64.X)/2) ((pt32.Y + pt64.Y));
... etc, etc, etc ...
Point[] arrPoint = {pt64, pt63, pt62, pt61...pt0};
foreach (Point pt in arrPoint)
{
ctrl.Location = pt;
ctrl.Update();
}
}
but I would like the code to resemble something like this:
for each System.Drawing.Point on System.Drawing.Line
{
ctrl.Location = new System.Drawing.Point(e.X, e.Y);
ctrl.Update();
}
Please provide some insights as to how to plot points along a line dynamically or moving the control along the spline along every point rather than along selected points. Does such an approch exist?
-- modified at 17:04 Sunday 4th March, 2007
|
|
|
|
|
How about determining the equation of the line, using the initial point and destination point and then increasing one of the coordinates, solving for the other? Say, for example, your initial point is (5,5) and destination is (15,10).
(y-y1)/(y2-y1) = (x-x1)/(x2-x1)
(y-5)/(10-5) = (x-5)/(15-5)
(y-5)/5 = (x-5)/10
2y-10=x-5
x-2y = -5
You could then run a loop for x = 5 to 15 and calculate y based on the above equation, and then plot the point (x,y).
|
|
|
|