Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
I assume this is for a game job? Most other jobs (non-game related) probably won't want to see any code you've written (at least, I wouldn't want to look through it). So if it's for a game job, I could only guess they'd want some sample games. I'd make sure the code was "clean" - well formatted, good comments, etc. I'd avoid anything that might make it look "bad", such as a bunch of global vars, variables named "a" or "p" or such, etc. I'm no expert in applying for a game programming related job, but I'd also expect some kind of documentation (at least a one page readme) that explained what the programs were, how to get them setup to compile, and any keypoints worth looking at (techniques used in code, etc.). Be expected to be asked how you did the coding (any design), how long it took, problems you encountered, why you made certain decisions, etc. - or, the normal interview stuff. -Ner
-
Dealing with null values in a Column Expression
Nerseus replied to The One Who Was's topic in Database / XML / Reporting
No problem. Also, if you just need to loop through a DataTables rows but not bind them, you can use the Select method of the DataTable, as in (I may not have the VB syntax correct - I'm more C#): Dim rows() As DataRow = dsSystems.Tables("Contacts").Select("FirstName IS NOT NULL and LastName IS NOT NULL") Dim row As DataRow ForEach row In rows ' Do something with row here Next ' ? Not sure how to end Foreach in VB.NET :) Along with the filter shown above, you can pass Select an "ORDER BY". There are other methods, such as Compute (to quickly calculate a SUM, AVG, COUNT, etc.) that are worth looking at as well. -Nerseus -
There will definitely be some overhead in events, but generally not of consequence unless you plan on raising hundreds of events (or more) per second. Events can use single or multicase delegates (multiple receivers), so if you have more listeners you will have more overhead (I imagine it working like a foreach that loops through the functions, calling each one in turn). Again, you could easily test this with a sample project that loops and calls a function x number of times and raises an event the same number. Keep in mind that your function/event handler is likely do *something*, and that the something is likely to take longer than the call. If it's generally a LOT longer, than delegats won't be adding that much in terms of the overall time. If they're very fast events (setting a property or two or just a few if's), then a pure method call might be worth it. -Ner
-
I'd go with the XmlDocument class and use it's Load method to read an XML file from disk. Look at this post for a code snippet. There are a couple of posts on this forum that discuss INI files vs. XML. There are many advantages to using XML, but ease of use in the beginning isn't one of them. Once you pick up XML it's easy enough though. -Nerseus
-
Dealing with null values in a Column Expression
Nerseus replied to The One Who Was's topic in Database / XML / Reporting
You could use a DataView to bind to, as in: dsSystems.Tables("Contacts").DefaultView.RowFilter = "FirstName IS NOT NULL and LastName IS NOT NULL" comboBox1.DataSource = dsSystems.Tables("Contacts").DefaultView Or replace the filter with "FullName <> ''" or whatever works out best. If you're already using the DefaultView property, you can create a new DataView to bind to: Dim dv As DataView = New DataView(dsSystems.Tables("Contacts")) dv.RowFilter = "FirstName IS NOT NULL and LastName IS NOT NULL" comboBox1.DataSource = dv -Nerseus -
It's like asking the differences between Windows 3.11 and Windows 95 - they're completely different. If you want, the .NET environment can use the keyboard mappings as they were in VS but you can always tweak them later. What are you looking for, a reason to upgrade or just curious? -Nerseus
-
I've never tried using the Reference Rasterizer as I thought it was mostly for developers who want to test out functionality that they don't have access to on their video cards. Most users would rather use the Software renderer over the Reference one since the Reference one is SOOO slow. Of course if you're using functions that the user's graphics card doesn't support in hardware OR software, you're stuck with the reference guy. I think there's a registry setting to allow use of the reference driver (in addition to just copying over the dll). There might also be something in the DirectX control panel applet thingy. Also, most end users will only have the end user runtime installed which isn't a debug version of the DirectX dlls, so dbmon won't be getting any messages. You can test this by going to the control panel for DirectX and seeing if you can enable the "Debug" radio buttons. By the way, I've gotten frame rates down around 1 or .5 (that's one frame every two seconds) using the Reference driver using the following cards (bother are pretty nice): GeForce 2 GTS (32meg) Radeon 9500 Pro (64 meg) Good luck :) -nerseus
-
For some of the items you mentioned, there is no support in DirectX. You can always lock a surface (texture in DirectDraw, I think), and get a handle to it that you can then use with normal Win32 GDI functions. I don't know if there's a way to have GDI+ draw onto that handle, but if so it would be something to do with getting GDI+ to draw onto an hDC. Sorry I'm not more help, I'm not real big on mixing DirectX, GDI, and GDI+. Some of the MS samples use GDI to draw onto a surface. If you can't find them, let me know and I'll see what I can find. -Ner
-
They should 10 and 13, not 10 and 11. If you're parsing a log file and you want to grab individual bits of information, such as an IP, datetime and a message, I'd consider regular expressions. They're a bit slower than using Split or Substring, but they're much more powerful. You could create an expression that essentially gives you the parameters in a named fashion using Groups and Matches. The code would be MUCH more readable than a bunch of substrings or Splits, but at the expense of some speed. Unless the speed is just horrible, I'd always go with more readable code. Of course, if you don't want to learn regular expressions, that would be another reason to not go that route. Me, if I hear that there's code out there that's *made* to do something that I need, I like to invest a couple of hours and figure it out to see if it is what they say it is. -Nerseus
-
You should stay away from Left and Right, in general. The string object supports a Substring method which does everything you need. Try this instead: LogWriter.WriteLine("*TaskTime " & TaskTime.ToString().Substring(11)) -Nerseus
-
I don't believe 3DS Max 5 comes with Character Studio but it's a fairly essential add-on if you're doing character animation. The full version runs around $1000 while 3DS 5 is a little over $3000. -Nerseus
-
It comes with a 500+ page manual, including tutorials and a getting started section ... didn't that help? -Nerseus
-
Normally you don't care about the value of the control. The DataSet (or whatever you're binding to) is usually the "master" of the data and is what you care about. Normally you only care about the value in the control if you're doing some kind of pre-validation before moving the data into the datasource. But, you can usually handle that through the Format/Parse events (Parse is the one to get the data from the control and convert it to whatever is needed in the datasource). But, I'm glad you found a solution :) -Nerseus
-
Here's the same link with Google attempting to translate Italian into English: http://translate.google.com/translate?u=http%3A%2F%2Fmembers.xoom.virgilio.it%2Frobydx%2Fmain.htm&langpair=it%7Cen&hl=en&ie=UTF-8&oe=UTF-8&safe=off&prev=%2Flanguage_tools Or the translate page: http://www.google.com/language_tools?hl=en -ner PS I've looked at shouzama's linked site before - the translation helps a bit, but you still have to do a lot of interpreting. Better than nothing (though not as good as having a boss that speaks fluent Italian, like me :)).
-
In the Paint event, you're given the Graphics object. In that case, you shouldn't Dispose of it since there might be other event handlers that are counting on it. Only call Dispose on a Graphics object if you create one (outside of the Paint event usually). I'm not sure why it throws an exception, but don't do it and it will go away :) -nerseus
-
Problems Querying on Boolean Columns?
Nerseus replied to Gladimir's topic in Database / XML / Reporting
If the line above is coded the same way, then you're passing a Closed connection to the second DataAdapter. The Finally code always runs, which is probably closing the Connection after the first use. -nerseus -
It throws an exception because there are no rows? Can you paste the error message for us - I've never seen that one. I've gotten errors when trying what you try if the DataSet has a relation and you're deleting the child row, for instance. It's because GetChanges returns a new DataSet with only the rows you specify but that may break the relationship. -ner
-
I'd seen this before but didn't worry too much as I was never interested in comparing the return values - I just wanted the results. But in doing some testing, I can't seem to figure out how to see the "real" value being stored after the calculation. Meaning, as far as I can tell, the result of a-b-c should be 0. Or more importantly, a-b is 37.62 - I can see no indication that the internal representation contains extra digits anywhere. It must be the dynamic nature of the double to "move" the decimal point and exponential value around internally, so that c="37.62" can be represented as 32.62 with an exp of 0 or .3267 with an exp of -2. I wonder if it's possible to "see" how it's being stored so that you can adjust it? -Nerseus
-
If you set the Form's background image property it will embed the image for you in the EXE. Otherwise, you can include a binary file in your project (a BMP for instance), change it's property to embedded resource, and "load" it at runtime to set as the Form's background. -Nerseus
-
If it were me, I'd use the XmlDocument object to read in the file. You can use XPath query syntax to locate nodes by calling the selectSingleNode or selectNodes methods. You can read the attributes (you have none right now) using the Attributes property and its GetNamedItem method. Here's some C# code (should be easy to translate - ignore the @ for VB): XmlDocument d = new XmlDocument(); d.Load(@"c:\temp\xml.xml"); XmlNode cdNode = d.SelectSingleNode(@"/*/CD[TITLE='Hide your heart']"); if(cdNode!=null) { XmlNode artist = cdNode.SelectSingleNode("ARTIST"); if(artist!=null) Debug.WriteLine(artist.InnerText); XmlNode price = cdNode.SelectSingleNode("PRICE"); if(price!=null) Debug.WriteLine(price.InnerText); artist.Attributes.GetNamedItem } -Nerseus
-
In the project I work on, also government, we have to store not only the Federal Holidays (manually, a database or file works well - depends on your needs) but ALSO store holidays per County. This is for state work, but some counties have special holidays that they follow every year and they're different per county. And keep in mind that some holidays aren't on a specific day, but on "the 3rd Tuesday of the month" type of holidays. -Nerseus
-
Are you using Dispose as a way to stop the sound from playing? That's a .NET method for disposing of resources used by an object, no the same as a Stop method (or whatever DirectX is using). -Ner
-
In general, you don't want to do that. A surface is essentially a texture which has limits on most cards (256x256 is not uncommon, though you might find 2048x2048 on *some* cards). If you're talking about 2D or 3D with a background, you'll need to piece together multiple surfaces, usually. DirectDraw has some built-in methods, if I remember correctly, for handling large surfaces more easily thand Direct3D. But if you're talking about a game map that's bigger than the screen, you'll need some kind of tile-based layout (the most common). -Nerseus
-
Well they get it at both ends. Everyone wanted DX9 "NOW!", but others complain that it wasn't documented well enough. It's a shame they couldn't wait for some better docs as that's what most people seem to be focusing on (since it's hard to figure anything out if you're not used to DX8 or prior and not willing to look at the C++ documentation). Many of the DX9 objects have static methods and/or properties. You can browse them in the object browser or just type Matrix. and look through the intellisense. -Nerseus
-
We try a similar trick, but not using the extra variable: if(this.ActiveControl!=(Control)sender) return; Seems to work until the form is shown. Normally, you don't care about an event unless that control has the focus. This may not be true if you rely on events to either cascade or if you want to set a property and have the event fire for you. The TextChanged is a bad example, but suppose you were using the ComboBox's IndexChanged - it fires whenever you set the SelectedIndex property through code. I only mention the above because some people *hate* these types of form level flags. Me, I use them if they're needed (I call mine bInitializing :)) -Nerseus