DMAR330's Q&A profile
Visual C# Indexers vs Get.Set methods
I have a class called statTable. It collects and computes a large number of statistics for a variable. One of its members is a list of ints called frequencyCounts. The statTable's constructor defines a set of intervals over the range of the variable being tracked. Every time statTable's Update() method is called with a new value of the variable the frequencyCount corresponding to the interval for that value of the variable is incremented by 1. In addition to the frequency count there are several statistics based upon frequency that the user of a statTable could be interested in accessing. For example, percent, cumulative frequency, cumulative percent. I see three different ways to design my statTable class to provide these statistics to th ...Show All
.NET Development Optimizing performance when enqueuing and dequeuing data
In an application I have the need to enqueue data from one thread while simultaneously dequeuing it from another thread. I have already implemented it using the Collections::Queue class but I am experiencing performance problems, which I believe are caused by the constant allocation of memory on the managed heap (when enqueueing) and deallocation by the garbage collector (occasionally when dequeuing). I currently have around 1200 enqueues and dequeues per second (around 6 of each every 5 ms) but I sometimes see glitches of up to 20-30 milliseconds between enqueues (and that's with an asymmetric process - the dequeues are of lower priority than the enqueues). My current approach is as expected - I allocate an object, store data in it, an ...Show All
Visual Studio 2008 (Pre-release) June CTP: A datacontract based schema is being created even though type is implementing IXmlSerializable
Hi, I have some data types that implement IXmlSerializable and I want to continue using them along with WCF. What I noticed was that WCF was calling the GetSchema() method on the data type and also displaying a corresponding "service.svc xsd=xsd x " schema, but at the same time also created a new definition of the same type in the " http://schemas.datacontract.org/2004/07/... " namespace and is using that instead of the schema returned by GetSchema(). ...Service.svc xsd=xsd0: ... < xs:import schemaLocation = " http://rkulkarnixp2.jda.corp.local/WCFServiceLibrary/Service.svc xsd=xsd2 " namespace = " http://schemas.datacontract.org/2004/07/ClassLibrary " /> < xs:import schemaLocation = " http://rkulka ...Show All
Windows Forms DatagridviewCell PointToScreen
Hello. I want to display a window form underneath a datagridview cell as a pop up box. I need to find out the location in screen cordinates where the datagridviewcell is so I can display the winform there. However, my datagridview has a scrollbar, so I cant just simply take the datagridview point to screen and adjust width and height according to row position (I would need to know the scroll position num to offset row position). Is there an easy way to do what I want to do In VB 2005 I did: Dim _pointCell As Point = Me .OrderDetailDataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, True ).Location Dim _pointGrid As Point = OrderDetailDataGridView.Location Dim _pointLocation As Point _pointLoc ...Show All
Game Technologies: DirectX, XNA, XACT, etc. DrawableGameComponent ContentManager Member ?
I was happy to see a GraphicsDevice member in the DrawableGameComponent class. This saves me from getting it through the GameServiceManager, but mostly GameComponents which can draw itself should also be able to load it's graphic contents. I think it would be a good Idea to make the game's Contentmanager also a DrawableGameComponent member like the GraphicsDevice. Made already a feature request for that: https://connect.microsoft.com/feedback/ViewFeedback.aspx FeedbackID=244332&SiteID=226 How do you think abaout that I know that the content manager is for loading and that's the point...the GameComponents should be able to load it's specific content by themselves and don't let this do the main game clas ...Show All
Visual C++ Problems Creating Win32 Console Visual C++ project template
I've been trying to create a Win32 Project template for C++. I create an empty Win32 project, add a few files to it, save it all and when I go to the file menu to export it as a template I am not allowed to. I have Visual Studio 2005 Professional and I've tried doing similar things in both C# and VB and it works with those two languages. What I'm trying to do is set up a template for students to work off to create applications that work with ILOG CPLEX libraries. If anyone could shed some light as to why I cannot create a simple template it would be greatly appreciated. dj Hello Does this help: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=927381&SiteID=1 Tha ...Show All
SQL Server Help please some data not replicating
Hello, We have four mobile devices that are set up for merge replication via the web. We are not receiving errors but some of the data is not coming over to the devices. If we manually add a record that record will come over, but there is data that is on the server that isn't on the devices. If we run the snapshot for each device (We're using host_name as a filter) nothing happens. If we do validation check we get errors. If we reinitialize all devices it works but the next days data (sql job populates data to the publisher db at night) isn't on the device after syncing the next morning. Any help would be appreciated. John Mahesh, I am waiting a response from CSS to get ba ...Show All
Visual C# I Need to Search for specific word in file without load all the text in the file to memory
Hi I try to search for specific work in more then 50000 file and I want to know witch file that content that word … I use these lines of code to search for that word StreamReader sr = new StreamReader ("C:\File.txt", System.Text. Encoding .Default); int CharIndex = sr.ReadToEnd().IndexOf( "AnyWord" ); sr.Close(); if (CharIndex > -1) { Console .WriteLine( "The File content the word" ); } these lines of code wok fine but the problem here, is the method ReadToEnd() load all the string in the file to the memory so this will make the application very slow when checking the large files so is there any way to check if the file content th ...Show All
Visual Studio Express Editions slideshow
how can I alter this code so it displays a different image every minute.....like slideshow thanks PictureBox1.Image = Image.FromFile _ (System.Environment.GetFolderPath _ (System.Environment.SpecialFolder.Personal) _ & "\Shell2.jpg" ) ok thanks I will have to play with it renee cos at the moment every time I enable the timer the pc hangs.... maybe the pc is not up to the task......cos there is smoke coming from it at the moment.....only joking ...Show All
Smart Device Development Design page like Start->programs in windows mobile
Hi guys I need to design a mobile application with icons in the main window The page that I need looks like the page when you click (Start-> programs) from your pocket pc Its very simple just view icons but my problem is which controls that I use to design this window Can any one help please Regards ...Show All
SQL Server output parameter in CLR stored procedure written in C++
How can I declare output parameter in stored procedure, written in C++/CLR In C# it is proc_name( out SqlInt32 value ). In VB.NET it is proc_name( <Out()> ByRef value As SqlInt32 ). And in C++ Thanks a lot for support. Did you try passing a reference void proc_name (SqlInt32 &value) { //... } ... just a guess, but I think it's probably a pretty good shot :) -- Adam Machanic Pro SQL Server 2005, available now http://www..apress.com/book/bookDisplay.html bID=457 -- <Sergey Jmacov@discussions.microsoft.com > wrote in message news:fef55f40-42b7-47ef-bf2c-9a2295aca65d@discussions.microsoft.com ... How ...Show All
SQL Server How to make a File Share Subscription running on Vista?
I recently migrate to Vista. I had a bunch of reports with file share subscriptions that were running fine on XP. After installing reporting services on vista (that part only was a challenge), I re-created my subscriptions using the report manager. As expected, when a subscription is executed, the ‘last run’ column shows the last time the report output has been delivered to the file share and the ‘status’ column shows ‘New Subscription’. I thought that this was the signature of a successfully configured subscription. But surprisingly, there is nothing in the file share. The directory is empty. Anybody has an idea why Anybody knows how I could possibly find information on my ...Show All
Visual Studio Express Editions how to use MessageBox in visual stdio c++ express 2005?
How to use MessaageBox in visual stdio c++ express 2005 Are all include and lib files in VC6 fold renewed in the "Platform SDK for Windows server 2003 R2" Yes, Visual C++ 2005 Express Edition has Unicode selected by default, and in the VS 2005 world, MessageBox is a macro that expands to either MessageBoxW or MessageBoxA depending on whether compilation is for Unicode or not. With regard to your first question, not all of the libraries available with Visual C++ 6.0 (and Visual Studio 6.0) are available with the express edition. There is no support for MFC (or ATL). - Dennis ...Show All
SQL Server Get date according to particular timezone
Hello, I am struggling with one algo i.e. I want to retrieve the date according to time zone I have table called TIMEZONe in which i have the information about the hours difference (+12 to -12) from GMT... now my scenario is that I want to get the date, using information from timezone area table (time difference from GMT), of any particluar time zone can any one tell me, how will I able to achieve this task. for example: it 4:00 AM in the mornign in GMT TIME and date is 11-08-2006 but in US it 11:00 PM and date is 10-08-2006 Note: Server date is set to GMT (System date) regards, Anas you can use the script task to achieve what you're attempting to accomplish. i suggest that you employ th ...Show All
Visual Studio 2008 (Pre-release) Help Help me please!!!
hi friends, I want to serialize the"System.Windows.Documents.Paragraph" object and for this purpose I have written the following code : mypara cust = new mypara(); Paragraph ph = new Paragraph(new Run(str)); cust.Para = ph; cust.Para.Foreground = System.Windows.Media.Brushes.AliceBlue; string pass = format.Serialize(cust.Para); mypara is a custom class which contains the Para as an object of Paragraph and during the execution of format.Serialize line I get the error message as Error Serializing System.Windows.Documents.Paragraph. Note that mypara class is defined having DataContract Attribute and Para is defined under DataMember attribute and I want to pass the string pass generated to the server. Can anyone guide me ...Show All
