Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
I usually start with an identity matrix and multiply by the rotation for each object (or have each object store it's current world matrix). Having to "unturn" the world matrix so the next mesh can use it is bound to cause problems. I've seen references where others use a counter and re-initialize the world matrix to an identity only after x number of iterations. Never tried it myself though. -Ner
-
I believe you can check out the docs for DirectX 8 - it would be a good start if you're having trouble finding info on DX9 (fairly common). -ners
-
I'm not sure what you're looking for in terms of duplicates so this may or may not help. Assuming you have one column in both datasets and you can use that one column as a duplicate check (you can expand this to multiple columns fairly easily): DataSet ds1; // ds1 contains the original records DataSet ds2; // ds2 contains all records, including potential dupes DataRow[] dupes; // An array of duplicate rows foreach(DataRow row in ds1.Tables["Table1"].Rows) { // Get the unique ID from the original dataset int dupeID = row["UniqueColID"]; dupes = ds2.Tables["Table1"].Select("UniqueColID = " + dupeID.ToString()); for(int i=dupes.Length-1; i>=0; i--) dupes[i].Delete(); } That loops through each row in the original dataset and finds duplicates in the new dataset. All matches found will be deleted. You can do this in one shot if you use XSLT (XML transformations), which is like a language in and of itself. But it requires more work and might not be as readable, though might be faster. Of course, I like to use actual SQL tables for this kind of thing. Insert all the rows from the new dataset, with potential dupes, into a scratch table (a table only used for this process). Then SELECT out DISTINCT rows into the real table. Or, delete the duplicates (delete from scratch table where ID's match those in the original table), then insert the rows into the real table. -Nerseus
-
Urgent!! Datagrid Column update problem
Nerseus replied to Smithbr's topic in Database / XML / Reporting
Ah, I keep forgetting that. You can do a direct compare in C#, but not in VB. -Nerseus -
They claim it took less than a week, actually. I haven't tried it out, but it looks promising. I'd bet it gets ported again to use DirectX in the near future, now that the hard part of going to Managed C++ is done. -nerseus
-
Keep in mind that all 3D games are redrawing the entire screen every time - it's not as big a deal as it once was. Back in the "old days", you wanted to use Dirty Rectangles to only update what needed updating because things were much slower to draw. On a game I was working on, I had been drawing roughly 1000 14x14 images using DirectX in fullscreen. My original design had them setup as separate buffers, each drawn through a separate call. The speed was extremely slow (20-30 FPS) on my PIII 700 with GeForce 2 GTS. I modified the code to use one buffer and jumped to 500+ FPS (no waiting on the vsync). Now I know you're not using DirectX, but the point is that there may be different ways to draw things that may speed things up (or slow them down, if done wrong). So I'd test out your theory of drawing 110 objects and see what the speed looks like in a sample app. If it looks ok then you're good to go. If not, you may have to rethink how you design the GUI parts (such as structures to store what's changed and redraw only that). -Nerseus
-
Urgent!! Datagrid Column update problem
Nerseus replied to Smithbr's topic in Database / XML / Reporting
If the field has never been initialized, regardless of the DataType (string in your case though), it won't be a default type (not "" for strings, not 0 for ints). Instead it will be a special NULL value, called System.DBNull.Value. Try this instead: If dr.Item("Paid") = System.DBNull.Value Then dr.Item("Paid") = lbltdatedisp.Text End If If you think you may have put "" in some of the records, use this: If dr.Item("Paid") = System.DBNull.Value Then dr.Item("Paid") = lbltdatedisp.Text ElseIf dr.Item("Paid") = String.Empty Then dr.Item("Paid") = lbltdatedisp.Text End If I only changed your "" to String.Empty for the second IF. -Nerseus -
A DataReader is optimized for reading so it will be faster than a DataAdapter, especially for filling tables, combos, etc. Of course, if you have multipe tables to load, a DataAdapter has the advantage of loading all tables at once, which means less calls to the database (one call can retreive 3 or more tables in one shot). I have yet to use a DataReader in production, but only because areas where I need to read data, I need to read a relatively large chunk (and always multiple tables). We've noticed no performance issues doing things this way. We DO utilize webservices to retreive data, and we do so asynchronously so parts of the form can initialize while waiting for the data to stream down from the webmethods. -Nerseus
-
Not sure what it could be. I downloaded and installed the Speech SDK 5.1 today and installed it. I then downloaded the MSM file (MikeAndMary or MaryAndMike, I can't remember). Then I did as you did, started a new Visual Studio project, chose a Setup project (not setup wizard) and added the MSM file as a merge module. Seemed to compile fine - I made NO other changes to the project. I'm not that familiar with the VS Setup program and even less familiar with merge modules. Good luck though :) -Nerseus
-
Sql server / ADO.NET interview questions
Nerseus replied to viking's topic in Database / XML / Reporting
Hopefully any SQL Server questions will be around SQL and not around managing SQL Server itself (unless you're applying to be a DBA). Things like "what is an outer/inner join" or "what is normalization, have you ever used it, why would you want to" are reasonable. Our interviews are VERY robust and we don't expect anyone to answer every question, but we ask to just to see what level everyone is. ADO.NET, I'd think you'd be asked what some of the basic objects are (DataSet, DataTable, DataView, DataReader, etc.), how much you've used them, have you run into any quirks, have you used Expression columns, have you used binding, how have you updated the database (custom SQL, DataAdapter, Command object, etc.). -Nerseus -
It says the database db1 is opened exclusively by another user. Maybe you have the file open in Access and you're trying to open it using code now? That's the usual way to get that message. Try closing Access while you run your code. -Ner
-
No, this can't be done with an Expression. An Expression can't have any IF type of logic in it. I would probably go with the ColumnChanged event like you are. -Ner
-
Never seen that, but maybe you have some servers in your Server Explorer that can't be seen anymore? Can you continue working after the error message, or does it kick you out of VS? -Nerseus
-
I created a new Windows Setup project type and added the MSM file as a Merge Module (right click the project, select Add->Merge Module). I built the project, and ran the resulting setup.exe. Now I have the new voices installed on my machine (Mike and Mary, free for download from MS). To see them, go to Control Panel, Speech, Text To Speech tab and select the new voice from the Voice Selection Combo. -Ner
-
The between didn't work for me either, but you can use the AND method. Try this: ds.Tables["Table1"].DefaultView.RowFilter = "[date] >= '" + txtStart.ToString("mm/dd/yyyy") + "' AND [date] <= '" + txtEnd.ToString("mm/dd/yyyy") + "'"; You can just add " AND name like 'jon%'" to the end (or however you want to code your customer name filter) to filter by customer name. -Ner
-
I would think using a layered approach is the best you'll get. It sounds like you want to maintain the original shape (say a rectangle) even if another shape is on top. You may want something more advanced but a simple Stack or ArrayList will work for storing your shapes. As one changes (shape or color), just redraw all of the objects in order. -Nerseus
-
Try something like: ds.Tables["Table1"].DefaultView.RowFilter = "[date] BETWEEN '" + txtStart.ToString("mm/dd/yyyy") + "' AND '" + txtEnd.ToString("mm/dd/yyyy") + "'"; I haven't tried it, but I believe the RowFilter supports BETWEEN with Dates. The rest is just formatting... If it doesn't support BETWEEN with dates, you can use a >= and <= solution. -Nerseus
-
I'm wondering if anyone's seen any reason why overriding an event on a form is better/worse than adding an event handler. Not counting the overhead of calling the base class's event and not counting the slight overhead of adding an event handler... For example, to use the Form_Load event, you can use: // In InitializeComponent this.Load += new System.EventHandler(this.Form1_Load); // Farther down, the actual function: private void Form1_Load(object sender, System.EventArgs e) { // Do something here } or you could use: protected override void OnLoad(System.EventArgs e) { // Do something here // Finally, call base class base.OnLoad(e); } At my company we've always used the event handler method, mostly because it's easier but somewhat out of ignorance (we had a lot of developers coding who didn't know you could use the override OnLoad). With hiring some new people I'm in the process of reviewing our coding standards document and wanted to get some outside opinions. Maybe Microsoft has recommended a certain method? Maybe it's like variable naming - just pick a standard and use it consistently? Or maybe there's something we're missing...? Thanks all! -Nerseus
-
Since they're overlapping you'll have to draw them both again. You might be able to use a FloodFill type of function, but it would be much slower than just drawing both rectangles, plus you'd have to do some work to find a point inside the rectangle that didn't overlap the 2nd one. Also, if you have other shapes on the screen the work gets more complicated. Similarly, you could code the logic to break apart the original rectangle into 2 or 3 smaller rectangles and draw them. But it would be greatly complicated if you were talking about more than just 2 rectangles. -Nerseus
-
Inserting 100,000's of records into SQL Server 2k
Nerseus replied to a_jam_sandwich's topic in Database / XML / Reporting
If the records aren't too big, 100,000 could be handled with insert statements. But I'd look into using bcp as that's what it's for. I know of no way to automate bcp from .NET - it's just a command line utility. You could possibly use DTS (Data Transformation Services?). I've used it from within SQL Server Enterprise Manager, but I've never tried to use the packages it creates from a programming language. There might be a COM interface to it - I doubt there is a pure .NET solution, but who knows? DTS is similar to bcp. In fact, if you don't provide any scripting in the transform layer, it acts just about as fast as bcp. -Nerseus -
Since your app knows about it's path (what directory it started in), can you not use that instead whenever you launch other EXEs or whatever it is you have to run? The only reason I can think you'd need your folder in the path is so that you can launch something by using the filename alone (minus path info). But if your program is launching it, you can use the full path... -Nerseus
-
lol (both of you :)) I don't know if I've ever mentioned this, but although I have a BS (bachelor of science) in CS, it's not acredited (or however you spell that). The University I went to didn't offer an accredited (I spelled it the other way in case it's right) degree. In my 3rd year I looked into transferring to a Univ that *was* accredited but I ran into a similar problem to you - they wanted a bunch more classes that I hadn't taken, such as advanced Biology and Chemistry (I only had the basic 101 level versions). To be accredited with a Science degree you needed a bunch of science that I didn't have. I decided to stick with my non-accredited version. At the time I was in a total panic that I wouldn't get to work where I wanted. McDonnal Douglas (in St. Louis, MO) was THE place to work as they had ALL the latest and greatest stuff, government contracts so you would never worry about your company going under, and did I mention COOL jets and related computer stuff?? Well turns out that's the only place I applied to that cared about an accredited degree. I was kinda bummed at first, but a friend of mine that did an internship there turned me around. He told me about how all of the regular employees had to write reports every week and month explaining what they did and why there were valuable. They'd be used to downsize, determine raises, and more - the whole place was cutthroat (or so it sounded)! That was all 10+ years ago but still... I didn't have any real experience coming out of college. No internship or part time work in the computer industry. My resume had Computer Lab Assistant and I did some data entry for Citi Corp (the closest I really got to computer exp. in the "real world"). It didn't really matter as all of my interviews were for entry level jobs and they ALL included using some language or tools that you would never learn in college. At the time, VB3 was big and every company using it had 3rd party controls. You weren't really expected to know VB at all since no universities were teaching it at the time. And forget about learning about 3rd party controls in school - almost impossible. Anyway, the short version is that a degree *might* matter, but probably not as much as you think. It's really more about what you know, how fast you can learn what you don't, and how personable you are (easy to get along with, do the job right, etc.). In some cases it's even about who you know, but only so far as to get you an interview. I didn't know anyone but I still did Ok. If you really want to get into Graphics and Games (in particular), I'd write emails to a few companies and see what they're looking for in programmers. Let them know you're in college and really want to get in, you're willing to learn anything but you need some guidance as to what THEY think you need. -nerseus
-
You'll get the error because .NET doesn't want to convert smallmoney to SqlMoney, apparently. With a conversion function you should be able to get around it. -Nerseus
-
Can you post your project via a zip file? Don't include the EXE please. The code won't run as you didn't include any of the graphics and some are (apparently) embedded and some are loaded from disk. Having the whole project is essential to debugging in this case. -ner