|
shank07ct wrote: Need advice on basics, Start with research[^].
|
|
|
|
|
Does anyone know if there is a way to assign a ProcessID the way you would assign a port for a socket?
It would make my life a whole lot simpler.
"I need build Skynet. Plz send code"
|
|
|
|
|
No. The process ID is assigned by the OS.
I'm curious - why would you want to assign a specific process ID to a process?
/ravi
|
|
|
|
|
trying to pull an end around a EULA
"I need build Skynet. Plz send code"
modified 21-Oct-14 10:34am.
|
|
|
|
|
I don't think so. You can, however, use Process.Id to identify your runnung app.
|
|
|
|
|
Member 9986689 wrote: You can, however, use Process.Id to identify your runnung app.
The problem here is that the process I was spawning was a daemon, and there is a battery of instances of the daemon all with the same process name...so without some way to either specify the processId of the child or persist its processId before the parent process died, there would be no way to attach to the proper instance (and the instances were not interchangeable)
I was able to work around this by adding a Configurator that attached the monitoring process to the daemon as it was being spawned.
...Being able to assign it an arbitrary ProcessID would have made the job easier and reduced the complexity of the implementation (not sure what justified the downvote of my original question)
"I need build Skynet. Plz send code"
|
|
|
|
|
What is better way to organise code of big project with
kilometers of code. And don't make mess of it.
My way is
using a1;
using a2;
namespace BasicLogic
{ class Form1:Form
{
..
}
...
}
File a1.cs
namespace a1
{...
}
File a2.cs
namespace a2
{...
}
Is it correct way? How to deal with and connecet other .cs files in project?
|
|
|
|
|
I like to organise my class files into the logical folder groups, which then in turn helps me manage my namespaces.
Each class file is responsible for a single object for example client, house etc.
I personally try to keep my namespace down to a maximum of 3 levels to hopefully keep the code easy to read.
They are most of what I do to try and organise a project with out going as far defining project layers (i.e. class libraries)
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Member 11151571 wrote: Is it correct way?
As long as the compiler knows what you mean, there is no wrong way.
The files don't matter as much as the logical structure of the code.
You will likely want a layered approach, each layer could be in its own Assembly.
I prefer lots of small files to provide granularity in version control.
|
|
|
|
|
There's a .NET framework with a lot of classes. It might help to look at how that code is grouped.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
A namespace per file doesn't strike me as a good way to do it: I generally arrange one namespace (maybe two or three) per assembly, with each class in one (preferably) or two files, and with the exception of embedded "helper" classes I wouldn't have more than one class per file either.
I generally create assemblies (and thus separate projects) for each logical group: Data Layer, Business Layer, Presentation layer for example would be three assemblies, each containing multiple classes and class files.
I am also a big fan of UserControls, generally having a separate assembly for them as well, and try to keep a form down to five or six controls only - which can be user controls containing more controls. This way, the amount of code in any one class is kept down, which make it easier to work with and understand.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you all.
To make it more clear and independent from control elemnents i wish to have component "Frames", what is in Delphi XE6. Just connect other frame to main form with coulpe of code lines.
|
|
|
|
|
Hi Deeksha;
Thanks for publishing my article (electric organ with directsound)
Best wishes:
R. Hevesi
|
|
|
|
|
Not a good place for this: this is a forum for C# problems.
If you have been communicating with Deeksha, then reply to her last message rather than post here.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Its okay, but we don't correspond at all, I just wanted to say thank you to her. And I couldn't find any message address.
So please delete my message from here.
REgards
R. Hevesi.
|
|
|
|
|
If you haven't corresponded, then the chances are she hasn't been involved at all: the decision on publication is taken by moderators (like me), who are "normal" members who have written enough articles to be allowed to "stand in judgement" over others articles.
At present, there is no way to tell which members (and it takes 5) approved your article.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I see.
Its okay, thanks.
Bye!
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi guys, it me again!
I really appreciated your help in the last part of this exercise im currently working on, and could really use some advice on this new part im stuck on.
am working on an exercise in which we are given an incomplete project file. The project was to create a board game which lets up to six people play (fairly simple in theory). The part I am currently stuck on is showing the player "tokens" on the board.
This is what the final board is meant to look like:
http://i.stack.imgur.com/dcdy8.png[^]
As you can see, the on "0" (start square) there are 6 circles (or tokens) and on the right side there is a datagrid view with columns showing relevant information (colour, name, money, winner).
This is what I have been able to do so far:
http://i.stack.imgur.com/jxRh1.png[^]
As you see, I have been able to show the player name, and money. Though I cannot get the colour to show up in the start square or the data grid view. Instead, I get this:
http://i.stack.imgur.com/oPtMA.png[^]
The relevant classess/methods are these:
(IM just going to post the stack overflow link, since the formatting is already done there, but I was unable to get help from there)
http://stackoverflow.com/questions/26458550/drawing-board-game-tokens-to-board-and-datagrid-view[^]
So far, this is my understanding. I know I need to work with the ResetGame() Method in the HareandTortoiseForm.Cs class, but I very very lost on what to do. The description given to us of the method is:
Again, I would really appreciate guidance.
EDIT1:
Okay, So I have gone through and read class/method comments again and would I think I know what I'm meant to be doing (not exactly sure how, but hey, getting somewhere).
This is what I'm referring to:
/// <summary>
/// At several places in the program's code, it is necessary to update the GUI board,
/// so that player's tokens (or "pieces") are removed from their old squares
/// or added to their new squares. E.g. when all players are moved back to the Start.
///
/// For each of the players, this method is to use the GetSquareNumberOfPlayer method to find out
/// which square number the player is on currently, then use the SquareControlAt method
/// to find the corresponding SquareControl, and then update that SquareControl so that it
/// knows whether the player is on that square or not.
///
/// Moving all players from their old to their new squares requires this method to be called twice:
/// once with the parameter typeOfGuiUpdate set to RemovePlayer, and once with it set to AddPlayer.
/// In between those two calls, the players locations must be changed by using one or more methods
/// in the HareAndTortoiseGame class. Otherwise, you won't see any change on the screen.
///
/// Because this method moves ALL players, it should NOT be used when animating a SINGLE player's
/// movements from square to square.
///
///
/// Post: the GUI board is updated to match the locations of all Players objects.
/// </summary>
/// <param name="typeOfGuiUpdate">Specifies whether all the players are being removed
/// from their old squares or added to their new squares</param>
private void UpdatePlayersGuiLocations(TypeOfGuiUpdate typeOfGuiUpdate) {
//##################### Code needs to be added here. ############################################################
RefreshBoardTablePanelLayout(); // Must be the last line in this method. DO NOT put it inside a loop.
}// end UpdatePlayersGuiLocations
EDIT 2:
I was talking to a class fellow who said I had to do something Like this in the Updateplayersguilocations method, though he was helpful, I would really like your input.
He said that something like this:
getSquarecontrolat(square the player is on).contains = bool[] of all players on that square
modified 20-Oct-14 3:32am.
|
|
|
|
|
hello guys! Can anyone help me on this error I'm receiving this error message. The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"> to the system.web/httpHandlers section of the web.config file, or add <add name="ReportViewerWebControlHandler" precondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"> to the system.webServer/handlers section for Internet Information Services 7 or later.
These settings of handlers are already exists in my asp.net project web config I can't understand why this error keeps showing though these settings is already in my web config.
Im using VS2012 and SQL 2008 - Thanks
|
|
|
|
|
Wrong forum; this is an ASP.NET question.
|
|
|
|
|
my intention was to compare two images and get the diff images using Emgu CV library. this is can be done below way. here is bit of code for achieving my goal.
Image<Gray, Byte> img1 = new Image<Gray, Byte>("C:\\image1.png");
Image<Gray, Byte> img2 = new Image<Gray, Byte>("C:\\image2.png");
Image<Gray, Byte> img3 = img2 - img1;
now my intention to know how to merge diff images with first image as a result i will get another image which will look like second image.as example say i have two images 1st image is full green image and second image is full green but have red circle at middle right corner. when i got the diff image after subtract then how can i merge the diff portion with full green image as a result my new merge image will look like full green image with red circle at middle right corner. can u please suggest anything how to achieve it with EmguCV library.give me a sample code using EmguCV library.thanks
tbhattacharjee
|
|
|
|
|
Can I use small local method in program method in C#?
Like it is flexible in Pascal function in function.
And in which places can i make methods?
|
|
|
|
|
No, you can;t declare a formal method as local to a method:
public int OuterMethod(int i)
{
public int InnerMethod(int i)
{
return 1 * 2;
}
return InnerMethod(i) - 1;
} That is not allowed by the C# syntax.
You can use a lambda though: Lambdas[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
So recursion is it impossible to use?
Inconvenient to define many variables twice to see them in other place. And make many arguments to simple mechanical code.
|
|
|
|