624 Posted Topics
Re: I take it your main goal wasn't readability lol! I'd be interested to see the rest. | |
Re: How are you supposed to be anylizing this data? A formal conecpt analysis requires some parameters (are you looking for even, odds, primes, and squares?) Do you have a tree-like class structure made to hold this data, or is this what you are having troubles creating? | |
Re: I started fiddling with QBasic and batch files when I was 10. Funny thing is, my company mostly uses Visual Basic 6 for everything so I am not too far off of what I was doing back then :P (I am 23 now) | |
Re: What protocols does your PLC support/implement(a very common one is modbus over TCP)? Or are you responsible for writing this as well? Are you comfortable with working directly with sockets, or perhaps your PLC has an API that wraps all the socket stuff for you? More information is required to … | |
Re: How do you plan on writing something as advanced as an OS with a language that you are not even sure can compile to executable files? Do you know what a kernel is? How about a HAL? | |
Re: What is the purpose of this? Is it for use with a MIPS compatible IDE? | |
Re: Wouldn't checking for collisions per pixel be extremely expensive cpu wise? | |
Re: Do a solution wide text search for "class Square" to find where the duplicate is being defined. | |
Re: Why not use a class to hold the exponent/variables/bases? class Term { public int Base {get; set;} public string Variable {get; set;} public int Exponent {get; set;} } private string DerivativeOfPolynomial(IList<Term> terms) { return string.Join(" ", from term in terms let tempExponent = term.Exponent - (term.Exponent > 1 ? 1 … | |
Re: First of all, this looks like C++ not C#. Second of all, I suspect that the error is either caused by the curly brackets at line 2 and/or 14 as well as the typo on line 13 (get rid of the '>' character). | |
Re: Errr. I think he just wants to write it to learn something, not to compete with Tetris commercially. What conecpts are you unfamiliar with in creating this game? | |
Re: A perfect number is a number that is equal to the sum of its whole factors, excluding itself. Like 6 (1 + 2 + 3 = 6). So you need a function that calculates the sum of all factors then compare this with the number itself. public static int SumOfFactors(int … | |
Re: I wouldn't recommend using arrays at all in C#. They don't play nice with a lot of other objects. A list of lists of ints would probably work best for you here: var JaggedList = new List<List<int>>(); for (int i = 0; i < 50; i++) JaggedList.Add(new List<int>(PossibleNumbers())); You can … | |
Re: This looks like a DOS attack. Why would someone volunteer their (presumably paid for) server for this? | |
Re: I'm curious as to how CopyManager.cs can set the HexAddress.Address property if the 'set' has been marked private. | |
Re: Asteroids is a classic. And is a nice skeleton for building a class hierarchy out of: abstract class GameOjbect {} abstract class MoveableObject : GameObject {} abstract class StaticObject : GameObject {} class Asteroid : MoveableObject {} class Ship : MoveableObject {} class ScoreText : StaticObject {} I could go … | |
Re: Have you tried stepping through it? I see some fishy looking lines, namely: if (true) ... else Seems like some useless logic. Try stepping through it and post your findings. | |
Re: Do you want it to actually animate as if it were clicked (mouse moves, button is depressed)? Or just perform the same functionality? Typically (in my experience anyway) it is best to avoid calling event handlers when unnessecary. It may be benifitial to have the event handler call a method, … | |
Re: [RealVNC](http://www.realvnc.com/) is a good-ish remote connection tool. It's open source and .Net winform controls are available for free as well. | |
Re: Well, if it's written in C# chances are its object oriented. Basically OOP covers anything that has a class hierarchy. I know C# supports a minimal amount of structured and functional programming, but usually this is just an 'effect' and you are actually working with objects, so you can generally … | |
Re: I wouldn't reconnect to the database every timer interval. I would connect to it once then poll it for new data each time and disconnect from it when you don't need the updates anymore. This will eliminate all the overhead of establishing a connection with a database. Also, if you … | |
Re: Try calling flush after WriteEndDocument. I think it should still be writing everything up until that point though... | |
Re: Neat tool, could come in pretty handy. And the recursive approach is well thought out. But why not write the xml file the way that you want it rather than making a tool to fix this problem? | |
Re: Are you making a web browser? Google Chrome was built using WebKit. [This](http://webkitdotnet.sourceforge.net/) looks like a good implementation of it in C#. But really, you have to ask yourself "Why am I making a webbrowser when the market is clearly dominated by really good ones already?". If the answer is … | |
| |
Re: 1 - Doesn't have to be. 2 - Possibly, depending on how much time it takes to make the graphics look good 3 - OpenGL has a steep learning curve, XNA is OK but for something simple like tetris simple GDI+ calls would probably be easiest 4 - There is … | |
Re: Depends on how the DVR works. If you are lucky, you can connect to it on a different port per camera and stream video over http. Have you looked into any of the documentation for your DVR? Generally people here give help on the programming aspect, it will be up … | |
Re: What IP are you using to connect? You will need to make sure you use the **external ip** of the remote endpoint's computer, not the internal NAT IP, then make sure the port gets forwarded to the right computer in the router settings. | |
Re: What do you mean by 'Command Line Caller'? Are you looking to write an application that **accepts** command line arguments, an application that launches applications **with** command line arguments, or something that places VOIP phone calls **from** the command line? All three are pretty simple to accomplish (with a good … | |
Re: It makes sense to load data from the file in a seperate thread, but is by no means required for this specific situation. The time it takes to load 50 lines of text is probably so small that it won't affect the user in any way, so you can probably … | |
Re: Yep, we definately need some more code to help you. It seems like **this** is getting disposed of somehow - could you be calling close more than once while another thread is preventing your process from closing? If you are trying to close your program altogether, calling **Application.Exit()** might give … | |
Re: Have you tried [this](http://social.msdn.microsoft.com/forums/en-US/clr/thread/c957959e-0f0c-422e-a5be-4ccfdd12e63d)? | |
Re: System.Xml.XPath and System.Xml.Linq both have their strengths and weaknesses. I preffer the Linq approach, but maybe you won't. | |
Re: I couldn't get that to run. Kept throwing an invalid cast exception when casting Thread.CurrentPrincipal. I did, however, get this to work: var x = new WindowsPrincipal(WindowsIdentity.GetCurrent()); if (x.IsInRole(WindowsBuiltInRole.Administrator)) //You are an admin else //Not an admin | |
Re: As in, a global keyboard hook? Or keystrokes in a textbox of some type? | |
Re: Momerath is right. The message isn't a very good way to determine the exception origin. You can use multiple catch blocks for each expected exception type, and 1 final one with the general exception: try { int i = x / y; } catch (DivideByZeroException ex) { Console.Writeline("Divide by zero … | |
I am trying to remember a bit of bitwise math to deal with some CAN bus stuff in c#. Basically, I am trying to create a class that takes in an integer that represents an identifier portion of a CAN frame. They look like this: Priority - 3 bits EXT … | |
Re: Depending on how the Dlls are designed, you might need to make some wrapper classes to expose the dll classes in a web-friendly way. | |
Re: Make a form that is derived from a regular form and put that code in it. Then to make forms that use that code just derive them from it. If you want to use it between projects you will need to either make a dll and reference it, or include … | |
Re: It really looks like you need to think about your structure, or at least improve the clarity of your logic. It seems, for the most part, that the majority of the logic is used to determine possible moves based on a given 10x10 mapping that might have obstacles or something … | |
Re: I, personally, would keep them seperate on the SQL side, but possibly have a RecordManager in the client side (C#) that would enumerate these operations. But it's totally up to you! If you are working with others just make sure you document everything, or at the very least make sure … | |
Re: Check [this](http://www.cafeaulait.org/course/week11/02.html) out. | |
Re: Create a form, play with the different 'BorderStyle' properties to make it splash screen esque, then have this form shown in Program.cs instead of your main form (probably called Form1). In this form, have some sort of timer that controls how long it displays for, then when the timer elapses … | |
Re: You can use the extension method .Concat() to combine 2 linked lists together. But yeah, no pointer magic like you are looking for in c#. All of the properties are readonly. I don't imagine it would be that hard to write your own linked list, however. As for accessing items … | |
Re: You need to make sure your command is actually returning some data. There is a pretty good chance that it isn't (hence the null reference exception caused by trying to convert a null reference to an int16). If this is the case, I recommend checking for nulls and having a … | |
Re: With sockets and more effort than you put into your post. (Albeit not much more) | |
Re: Sounds like you need a modal dialogue box. When you are displaying the form, instead of calling Show(), use ShowDialogue(). This will block the calling forms UI until the form completes. It will also return an enumerated DialogResult that you can check (but also need to set). You can use … | |
Re: I don't think it's easily done (I bet there's some sort of Win32 function for it, but good luck finding it). What I would do is wherever SetCursorPos() is being called, set a flag just before it (something like ProgramMovedMouse=true). Then in the Mouse_Move event check this flag before showing … | |
Lately at work I've been asked to create a .Net form full of DevExpress controls into something easy to work with. DevExpress controls are the opposite of this, most guages with a needle and a display box are actually 10 different controls combined. I am looking to simplify this into … | |
Re: Sounds like you should make your own control. Basically a combination of a label and a checkbox with no text would work. Clicking on the label (the text portion) would fire the select event handler, while clicking on the checkbox would fire the check handler. Although I could just be … |
The End.