Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. Have you read the help for the events? You have to declare an event interface (what the function, or the handler of the event, will look like) first, then raise the event in code. To hook an event, you need to add an event handler. If you've ever added an event to a control (like a Button's Click event), you can see the syntax by looking at the automatically generated code (look for "+=" in code). I'd read up on events, delegates and such before you worry about coding events. -Nerseus
  2. Do you get an error when trying to open the VSS database on the webserver (from your machine)? Or, do you open it fine but don't see the project (this would be VERY odd)? If you can't open it at all, make sure you have the folder (and all subfolders) to the remote VSS database shared. If you can open it but can't see the project then I have NO idea. SourceSafe only has two levels of security: admin or read-only. I no of no way to hide projects... -Nerseus
  3. We really need to see the rest of the code... what you have appears to be standard for doing something every 25 milliseconds. But considering that the precision is 15 or 16, you may have a lot of cycles where you don't hit anything. -Nerseus
  4. First install the DirectX SDK. Then look at the sample folder at: C:\DXSDK\Samples\C++\DirectShow There used to a sample in the Direct3D folder for showing a spinning cube and putting an AVI (as a texture) on each face of the cube. I didn't look at the code, but I assume it had a way to load each frame of the video one frame at a time and get it into a texture object. You can lock a texture and look at the color bits that way. I'd first take a look at the DirectShow samples and see what you can see. By the way, if you're not already very good at programming, DirectX may be a bit much to take in. -Nerseus
  5. The SDK download is the BIG one (not just 8 or 9 meg, but more like 150 or 200 meg). You would have a set of menus as well, to link to the samples and tutorials. -Nerseus
  6. I've never seen it tried, though I've only studied the basics of the stencil buffer. I would think using the built in alpha channel transparency (to do transluncey, like cloudy windows) would be easier, and probably supported better. Plus you could use pixel shaders to do even more complex translucency (if the card supported it). As you pointed out, it would require sorting polygons to work right, but you should already be doing that, right? :) -Ner
  7. Imagine designing it, or using it! Most of us spend our lives figuring out MS's design for managing windows and events. They built their own design that's similar, but it's own set of functions and more. CSG (Crazy Smart Guys). -Ner
  8. Is size of the database going to be an issue? I know Access has some practical limits (don't know them offhand) that might not be as big of an issue for MSDE. I'm asking because you've said you test with inserts of 10,000 or 100,000 records, but is that going to be standard? I'd strongly suggest trying to install MSDE and working with it for a week or so to get a feel for it. The difficulties in setting it up would be a one time hit that shouldn't affect your decision as much as ease of use and performance. Of course, MSDE comes with no user interface (like Access), though you could use SQL Server if you have a copy. As for transferring the database schema and data, if you have SQL Server (not just MSDE), you can use the DTS that are built into it to copy an entire database from any source to any destination. Very cool, very fast, and very good. And, if you need to convert any data, it provides a JScript or VBScript intermediate layer to do the conversion. One other consideration is that MSDE is fairly new. That *may* mean it may not stick around - maybe MS has plans to turn MSDE into something more akin to Access. Then again, maybe Access won't stick around (or stick around like FoxPro sticks around - more or less by a thread). Who knows what MS's decision will be? It's hard to make that part of your decision since it's such an unknown, but if you lean towards more "standard" platforms, Access might seem that way. Also, have you talked to your clients? Do they care what the Database is? Would they want to write reports or interfaces to the database? Would they ever buy your sourcecode and take ownership of the database? -Nerseus
  9. XML is very basic by itself. But there are related technologies, such as XSL, XSLT, Schemas and more that build on the basics of XML. If you wanted, you could build an XML file with an embedded (or external) schema. The schema could define exactly what the XML had to look like including what parameters existed, their datatypes, max lengths, whether you could have one "row" or more, what fields were required to be present, what values they could contain (maybe a list), and much much more. In an INI file you *could* do that, but you'd have to build the validation mechanism yourself. Using schemas, which follow well defined standards, you can use built in validation in the XmlValidator objects to determine whether an XML file is valid. As a simple example, say you wanted some initialization file to contain a location to a database and a timeout value. The schema could say that the DB location was a string and must be there. The timeout value is an integer from 0 to 300 and is optional (with a default of 30). The schema could be embedded in your application while the XML initialization file is loaded dynamically at runtime (like an INI file). Through a call to a validator, you could determine whether the XML file passed in was valid or not. You could do the same thing with an INI file, but you'd have to do the validation "by hand" and it's all custom code to do the validation. While it may be easier to do by hand in this example, imagine reading in 20, 50, or 100 settings. The XML schema validation is very fast and doesn't require any custom code. It *does* require knowing how to code a schema of course :) As PlausiblyDamp pointed out, XML is also hierarchical and can easily contain large chunks of data. That helps support more dynamic and user-friendly files. Also, INI files would have problems reading in values that contained carriage returns or line feeds, especially if the value of a key looked like another key. XML can embed special characters in CDATA blocks (or converting the characters to a special syntax, in some cases). -Nerseus
  10. To elaborate on ballistic's note, a DataAdapter fills a DataSet. Neither the DataAdapter nor DataSet have any kind of pointer to a "current" row. You can use a CurrencyManager (a form has this built-in, to support moving Prev/Next etc.). What do you mean by "navigate to the 80th record"? If you're already using the form's BindingContext (the built-in currency manager) to navigate, you can set it's Position property to go to any row (row 0 is the first row). You can also read the Position property to get the current row. -Nerseus
  11. For 1, do you want to know how to declare the event, raise the event, hook the event, or all three? For 3, all division by integers is, by default, rounded down (just like \). If you do division by anything other than integers, you convert the result to an Int (System.Convert.ToInt32() for example), which will round down automatically (I believe). What kind of math are you trying and what are you getting vs. what you expect? -Nerseus
  12. To have the DateTimePicker show only the time, change the Format to Time. I know of no way to get the DateTime picker to display a drop down with the time in it - it only shows the Calendar control (even if you specify the Format as Time). The dropdown used in Outlook isn't using the DateTimePicker afaik. You can tell because the button to the right is a separate button, not part of the actual control. I would guess they're just looping and filling a Combobox (or something similar) with the time values they want. As far as removing the drop-down button, the closest I can see is setting ShowUpDown to True, which changes the DropDown button to two of the tiniest up/down buttons I've ever seen. If you're really pressed for space and want to remove the button to save 16 pixels (or whatever the width is), you *might* be able to remove the button using the API. But I would definitely NOT try that unless *absolutely* necessary. And I don't think you'll find much help on how to do it. -Nerseus
  13. In the DateChanged event you can use the argument e to get the start and end date range (both as DateTime variables): textBox1.Text = e.Start.ToString("MM/dd/yyyy"); textBox2.Text = e.End.ToString("MM/dd/yyyy"); Otherwise, you can use the SelectionStart and SelectionEnd properties of the control to get the same DateTime values. If only one date is selected, both values will be the same. -Nerseus
  14. Depends on what you want, Mischamel. You can use System.DBNull.Value as that what's in the dataset as a default (unless your DataColumn has a default set). You could also use NewRow and only set those columns you want, but it takes a few extra lines of code. DataRow row = Dataset11.Table.NewRow() row("Field1") = Field1 row("Field2") = Field2 'Skip field3, go onto field 4 row("Field4") = Field4 I know you can call NewRow on a DataTable. Your syntax indicates you're using the built in DataSet builder which creates wrapper classes for each table/column. I would bet there's a way to get the equivalent of NewRow, in case the NewRow doesn't exist for you the way I used it above. If that doesn't make sense, let us know and I'm sure I can figure it out with a test project (don't have it here). -nerseus
  15. Are you talking about me, Heiko?? I only took over that ONE bad report querying/emailing/faxing/asynchronous piece of code, I didn't design... oh, nevermind. :p Yes, that bugs me, too. But I don't do that anymore (goes and cleans up his code before anyone code reviews anything...) -Nerseus
  16. The SDK contains a wealth of knowledge, including many small tutorial type projects. For Direct3D there are even 6 actual tutorials (though I didn't see any step-by-step, the code is documented thoroughly). Check out the samples folder at: C:\DXSDK\Samples\C#\ -Ner
  17. Is this pure .NET code, or something in a stored procedure? Either way, you're going to break apart each string into the individual values. In C# you could use the Split method of the string object. You could then loop through the array (or maybe use the Contains method?) for each value in the Other array and see there are any matches. In SQL you don't have arrays so you'd have to put each individual value into a temp table and do the comparison thataways :) -Nerseus
  18. Is this a one time update (I hope)? You could write some ADO.NET code to loop through each row and parse the string, inserting new records. Or you could use a cursor in SQL Server to do the same thing, thought string parsing and cursors are not SQL Server's strong point (slow and harder to write than "normal" SQL). -Nerseus
  19. It sounds like you want to pass in a comma separated string (one string) to a proc and have it treat that string as individual strings, as if you had: -- You WANT this to work SELECT * FROM Table1 WHERE Location IN (@NameString) -- But this is what it sees: SELECT * FROM Table1 WHERE Location IN ('Dallas, Boston') -- NOT This: SELECT * FROM Table1 WHERE Location IN ('Dallas', 'Boston') Unfortunately, there's no way to do that, easily. You can use the EXEC function to use dynamic SQL: EXEC ('SELECT * FROM Table1 WHERE Location IN (' + @NameString + ')') BUT, this only works with integer columns, not strings. Also, it makes debugging harder because you won't get any "compile time" error checking, such as invalid columns names. An alternative would be to use XML. You'd have to pass in your parameter "Dallas, Boston" as something like "<Root><Table1><Row>Dallas,Boston</Row></Table1></Root>". You can then use sp_xml_preparedocument and OPENXML to treat this XML as a table to which you could join. If you need a sample, let me know what your table looks like and the exact data (is it really strings like "Dallas,Boston" or more like "34, 66"?) -Nerseus
  20. I don't believe there's any easy way to keep the number that was temporarily used if you rollback. I know in SQL Server you have the ability to turn off an Identity column temporarily, but I've never wanted to use it the way you mean to AND you'd have to keep track of what the number *should* be so that you could reset the seed. I can understand from a "clean" perspective why you'd not want the number of increment, but from a usability standpoint there's no reason why having the numbers out of sequence should cause any problems. Are you relying on the number to always be sequential? If so, and you have the ability to rollback trans and get the number out of sync, you'll want to use a separate table to control the sequence. -ner
  21. Is it possible to use file references for some of the 8 projects? Do you really need access to ALL of the source in every project? We have a similar type of project here though I don't think we're quite at 300 classes, maybe a few hundred all told (including web services). I generally only have 2 or 3 projects open per solution since they all add up to more memory (I have 1 gig) and compile time (checking that they're all up to date). In the beginning, I had 5 or 6 projects open, when the code was just starting out and there were near constant changes to all projects (from different developers no less). Now that things are more "final", I removed the projects and changed the references to file references and things work much better. Are you using 1.1 or 1.0 of the framework? Do you have the 1.0 service packs on, if using 1.0? I don't know that 8 projects and 300 classes will get much faster if you're already on a P4 and plenty of memory. I noticed a definite improvement when I jumped from a PIII 700 with 512 meg to a P4 and 1 gig. At home I'm lucky to have a P4 with 1.5 gig and I've yet to see ANY performance problems. But I can't imagine what MS tests on if they DID see performance problems (dual Xeons maybe?) :) -Nerseus
  22. Motivation, as Orbity pointed out, comes from you. If you're not that interested in the project or programming in general, it's going to be a struggle to keep motivated for a long time. That will eventually hurt you professionally if you decide to become a programmer as many projects are longer than a few months (except for short term contract jobs). As a note, my first 2.5 years of professional experience was on a large, ongoing project that had no real end. It was a massive piece of VB3 software (2-tier client/server) that had constant improvement requests and programming opportunities (ie, bugs). I finally left to be closer to my wife, but I'm SO glad I did. Along with a new job, I got on some new contracts where I actually had goals, such as finishing a project :) While some of the "finished" projects are still ongoing, I felt a tremendous sense of accomplishment when the first project "went live" to the users. It's invigorating to start a new project, but I still feel proud about having completed the other ones. As Orbity mentioned, I'd try to figure out why it is you don't finish some projects. Maybe you don't like programming, maybe you don't like the projects you've chosen, maybe the fun is getting some graphics to show up, but not as much fun to add the menus, the AI logic, and such. Maybe your designs weren't quite right or you had no designs and you just got frustrated by the thought of rewriting a bunch of code. If that's the case, I'd definitely stick with it. If you're coding and think "crap, this isn't going to work" then STOP coding immediately. Don't try and fix it right there (unless it's a tiny bit of code). Think about what went wrong, what you'll need to do to fix it and then do it. Don't be afraid to scrap a bunch of code versus tweaking existing code. "Clean" code is much easier to fix later when the bugs show up (and they will, I guarantee). I've been lucky enough to work with a GREAT bunch of guys, almost all of whom like to do things the "right way". If we start discussing something and realize that we did something wrong, we don't try to get a quick hack in place to fix it. We'll take the time to get it right. Or, if there's not enough time, make sure that future code is done right and assign the cleanup of the "wrong" portions to a low priority task, to be completed as the other code is touched. Clean is one thing, being obsessive/compulsive about it is another :) /end long windedness -Nerseus
  23. I'm not sure of the English format, but in the US the last 4 digits (not 3) are optional. If the last 3 are optional, you could change the expression. Otherwise, it looks good. Personally, I'm not sure I'd want the "\s*" portions, as you'll have to manually trim off the whitespace to see the "real" data. I hate trimming, but it may be necessary for you. :) -Nerseus
  24. I'd check out these links: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69304 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=70164 From the interviews I give (quite a few recently, many more in the past), I'd say the candidate doesn't have a *strong* feeling either way. Because we interview a dozen or more people at a time and they're at all different levels of experience, we can't give them a thumbs up/down at the interview because we don't know how they compare to everyone else. Plus, the "big boss" has to talk to the candidates about salary, perks, etc. which may factor them getting in or not. So, we can't say "Wow, you're great!" and then the Big Boss says Sorry, you want too much money. Well, he can, but it makes it harder if we told someone they were coming in :) Now personally, when I've interviewed to *get* a job, I usually had a personal feeling one way or the other. I've been *very* fortunate to always get offers, though I generally do a lot of research into the company, what they do, what I'd likely be doing, etc. so I know ahead of time whether I'd fit. That's not always possible, especially if you're just starting out. -Nerseus
×
×
  • Create New...