diceydawg's Q&A profile
Game Technologies: DirectX, XNA, XACT, etc. general use of XNA vertex types?
I am trying to create some methods to manipulate various parts of the XNA vertex structs. I want to be able to pass all the different vertex types as arguments to these methods. Because they are structs they don't derive from a base class other than ValueType. If I use ValueType as the parameter I don't have access to the propertys of the vertex. Is this a case where refelection would be usefull Can anyone help me find a way to write a method that can access the position property of any type of vertex. I hope I have been clear enough. Thanks. If at all possible, can you move your processing to build time At build time, you can make use of Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexContent a ...Show All
Windows Forms Split string to datatable
Hi, I have large string. I want to parse it by delimeter and input to datatable. All lines in string are ended by "\n" (vbcrlf) character. The delimeter is specified by user (like comma, tab, space or something else). So how can I do this Thank's Alexei to split a string, you can use string.Split method, for example: string names = "John,Bill,Joy,Andy" ; string [] elems = names.Split ( new char [] { ',' } ) ; How you want your datatable like hope this helps ...Show All
.NET Development Generic serialization of derived/base classes
I need to serialize to disk a data set in which all elements derive from a common base class. I need to be resilient to fields being added/removed/converted so I'm pretty sure I need to do custom serialization. What I'd like to do is to implement the serialization/deserialization in a single place. It looks like I can implement GetObjectData in my baseclass only, and have it iterate all fields and store them to the SerializationInfo. On deserialization it looks like having the base class do all the work works as well. The question is 'Is this a bad idea' It seems like it works and gives me control over what constitutes an error as far as missing/added fields go. Is there a simpler way to go about this Here's some code showing what I' ...Show All
Visual Basic Replace a menustrip programmatically
I am having difficulty replacing a MenuStrip that was dropped on the form at design time with a programatically generated one at run time. I have a MenuStrip on the form with no menu items. When the application starts, the splash screen generates a new MenuStrip and fills it with the appropriate ToolStripMenuItems. The splash screen then calls the following function on the main form: Public Sub setMainMenu( ByVal mnuStripMain As MenuStrip) msMainMenu = mnuStripMain msMainMenu.Refresh() End Sub msMainMenu is the MenuStrip that was dropped on the form at design time. If I set a breakpoint in this function after the assignment I can see that the msMainMenu contains all the menu items that were added by t ...Show All
Game Technologies: DirectX, XNA, XACT, etc. best way to do 2d parallax floor sprite
I need to do a 2d parallax floor sprite. (I want to closely emulate the style of an older game). Let me explain. I have a long, short rectangular floor texture. I'm rendering it as a texture on a 2 triangle (to make a square or rectangle) set of primitives, that is normally the same size as the texture, and the upper left corner is mapped to 0,0 of the texture, and the lower right corner to 1,1, etc. What I want to happen is when the screen scrolls to the left or right, the top line scrolls slower than the bottom line, and the lines in between scroll an appropriate amount somewhere in between. One way I could do this would be to draw one rectangle for each pixel in the texture's height, so that each can have a different x position. However ...Show All
Visual Studio Team System Merge/shelve/Source Control Explorer Strangeness???
Here is the scenario as best as I can describe it. I'm hoping someone can explain why/how these things can happen. 1. Developer#1 attempts a merge from top of tree to branches\v1.0.x, gets some type of error (maybe SQL error but it put pending changes) Any ideas of what can cause sql errors 2. Due to the error that developer was seeing I (Dev#2) did the merge with no errors and shelved my changes for that developer to unshelve, review then checkin. The developer did this. 3. Developer #3 At some point during the above did a shelve of items they were working on in the branch. 4. Developer #3 notices a branches\v1.0.1 tree with just the files from Developer #1. They also notice some items in the shelve they did show up in v1. ...Show All
SQL Server how to write this trigger
I have table T1 with the fields: ID,Type,Status,F1,F2,F3,F4 in database1. I also have T2 in Database2 which has the same fields and some extra fields. Now based on the T1.Type=Insert or Update, I need to perform either update or Insert in T2 based on where T1.ID=T2.ID and T1.Status<>’Done’. If this is a success, I need to set T1.Status=’Done’ for the updated records. So this should only be updated records. T1 is a frequently inserted table, so there might be more than one record coming there at the same time. How should I write my insert trigger and correctly set T1.Status=’Done’, any example would be greatly appreciated. Are you using SQL Server 2k5 or SQL 2k HTH, Jens K. Suessmeyer. --- http://www.sql ...Show All
.NET Development sqldatareader?
I used two sqldatareader like that cmd_1 = New SqlCommand(strsql_1, conn_1) reader1 = cmd_1.ExecuteReader do while reader1.read cmd_2 = New SqlCommand(strsql_2, conn_2) reader2 = cmd_2.ExecuteReader do while reader2.read ****** loop reader2.close() loop reader1.close() Error Warning: There is alreay an open datareader associated with this command which must be closed first any idea regards Hi, Hmmm.. Can you post the rest of the codes before the one that you posted. What reader is generating the error this error normally occurs when there are two open datareaders in a single connection object. Can you make sure that your connection obje ...Show All
Visual Studio 2008 (Pre-release) Strange menu bug with July CTP of Interactive Designer
I just installed the July CTP of Interactive Designer on top of Vista build 5472. None of the menus across the top (i.e. File, Edit, View, Format, Project, etc...) will open up. I click on it and the background turns gray as if the menu is active, but none of the menu items display. Anyone else run into this problem Anyone have a fix Thanks! I am not seeing that problem on the same build of Windows Vista. The first time I tried, it appeared that there may be a problem...but it was just delayed the first time. I'd recommend you work with the EID team on their blog or their forum . Thanks, Rob Relyea Program Manager, WPF Team http://rrelyea.spaces.msn.com ...Show All
.NET Development .Net 2.0 Configuration
Does ASP.NET 2.0 have to use the .NET Framework 2.0 Configuration via the mmc snap-in or can it work with the .NET Framework 1.1 Configuration for setting up the Code Access Security Policy. I have also noticed that the setreg.exe file only exists if the .NET 2.0 SDK is installed. In addition, why would Microsoft need to add/duplicate files such as the gacutil.exe and caspol.exe when they already exist in the .NET v 1.1.4322 Framework once the service pack get install for a Window 2003 server. All .NET Framework 2.0 components must use the .NET Framework 2.0 Configuration via mmc snap-in. There is great reference materials about ASP .NET 2.0 at http://www.microsoft.com/events/series/msdnwebdev.mspx# ...Show All
.NET Development ampersand representation
I have a stream of data that I store in a DataSet and then write in an XML file. One of the strings comes as a company name " Procter & Gamble Co ." This is how it ends up in the XML: < named > Procter & Gamble Co. </ named > What is the best way to handle such situations There might be other special symbols I now do not foresee. If I place an "@" in front of each string that I put in the DataSet (before WriteXML is executed) would it help Shall I parse every string to see if special characters are present and insert "\" in front of them or what Thanks for any advice. I read XML file into a VFP Table with XMLTOCURSOR command of Visual Fox Pro. I think it may be a bug ...Show All
Visual Studio Team System Branc Specifications
How does TFS handle files that have moved from one location within a given branch, to another folder within that same branch In Perforce, you could handle this with either a manual integration, or by setting up a branch specification. Either way maintains the branching history. Also, concerning the database. How does TFS handle storing the initial depot of branched/integrated files in the database Are the files of the new branch stored in the database in their complete form, or is just a link stored (to where they were branched from) In TFS, renames/moves are first-class change types. When you merge to another branch, TFS will pend equivalent renames on the target items. (We also throw a conflict, our way of saying “this is unusual ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Running the project builds everything...
Whenever I hit F5 to start my xna game (or the editor for it, both exists as separate projects in the same solution), it seems as if XNA GSE builds all the solution's projects dlls (at least, that's what it looks like in the Output window), even if I haven't made any changes since the last time I started. Is there a way to avoid this It takes at least a minute from hitting F5 to when I see something on the screen. It seems like it should be possible to make it only build the projects that have changed (and those that depend on them ). Also check your project setting to make sure this is on: Tools->Options->Show All Settings check box in lower left->Project and Solutions->Build and Run->make sure the "Only build st ...Show All
Visual Studio 2008 (Pre-release) Page navigation and de-serialization bug?
I think I stumbled onto a bug. I'm building a navigation-based application using WPF. In it, I have a Page with a number of controls on it, mostly TextBlocks, TextBoxes and ComboBoxes. I also have a UserControl in there, which itself has a number of the same types of controls in it. The contents of both the Page and the UserControl are defined in XAML. On the Page, I have a TextBox (say TextBox1) with some text in it. In the UserControl, there is a TextBlock (say TextBlock1) with some text in it. The values of both controls are defined in XAML. Here's the problem: If I navigate away from the page, and then return to it through the back button, the value of TextBox1 (in the Page) ends up in TextBlock1 (in the UserControl)! Here are a few t ...Show All
Smart Device Development check if clicked in region
Hi, I have an array of points. Those points form a freeform polygon. Now I want to check if the person clicks in or out that region. In the full framework i use graphicspath.addPolygon(array) and then graphicspath.isvisible(x,y); This works fine in Full Framework but in the CF2.0, graphicspath is not supported. Anybody an idea how to solve this Grtz Annihil8 You'd need to do some rather simple calculations yourself, e.g. like this . ...Show All
