atame's Q&A profile
.NET Development Never trust a tickcount
Hi, For those who use tickcount for any calculation on your application... DO NOT USE IT. Simply, for some idiot reason the tickcount returns an integer, so if you have a server that runs all the time or if you have a multiprocessor environment the tickcount overflows and returns 0! But for my surprise if you use Tickcount.ToString() actually returns the string version of a 64bit value, so is not 0!!! Funny when you are trying to debug your application and ToString() says 43453345345444 but the property returns 0 One of those funny things, pretty sure that tickcount internally is a 64 bit value and the property cast it to a 32bi ...Show All
Smart Device Development Linker error, newbie question
Forgive me, but I'm a bit new to windows mobile development. I wish to do the following: 1) Create an MFC based smart device application (in my case, dialog-based). 2) Create a second project which is a static library (within the same solution) 3) Link the library into the to the smart device application and be able to access functions from that library. Of course this is simple in a normal windows environment, (my background), but whenever I try to build the smart device application i get an unresolved external error (assuming I try to access functions from that library). I see no reason why I should be getting this, unles ...Show All
Visual Studio Team System Team Project Creation Fails with exception "Retrieving MSF methodology failed"
Hi All, We managed to setup the a Single Server Team server installion. Creating a new team project does completes the download process and then it fails. Detailed log is given below. Please help!!!! 06/27/2005 09:38:16.265 | Module: ELeadServiceMediator | URL for eLead web service retrieved as " http://aztecmsdts:8080/bisserver/EleadWebService.asmx " from the registration service | Completion time: 0.046875 seconds 06/27/2005 09:38:16.843 | Module: ELeadServiceMediator | eLead web service proxy constructed | Completion time: 0.53125 seconds 06/27/2005 09:38:39.890 | Module: ELea ...Show All
Visual Studio How to reliably identify a new loaded model in a shared store
I'm sorry if this has been answered before, but I can't quite make it out from previous posts on the subject. I have code that loads a model from a file into a store. At the moment I am creating a new store each time, but am looking at re-using the same store. To that end I have the two methods below. The first creates a new store for a model, the second loads the model into a store. The problem arises when I call the second method directly, passing in the current store. The store then has two (or more) models, and there seems to way for me to pick the right one reliably. public static UseCase LoadUseCase(String fileName) { Typ ...Show All
SQL Server set context_info
I have req: where i need store a string value and retrive it later on. And it should be session specific. Hence I thought of using "set context_info". But when I set the value and then retrive it the values are not similar. Here is a sample where the length are different: declare @context_info_var varbinary(128) select @context_info_var = cast ('test' as varbinary) print len(@context_info_var ) //5 IS PRINTED set context_info @context_info_var declare @name varchar(4000) select @context_info_var = context_info from master.dbo.sysprocesses where spid=@@spid select @name = cast (@context_info_var as varchar) print len(@name) //30 IS PRINTED ...Show All
Visual C++ Error with istream_iterator
Hi, I am new to using Microsoft VC++and STL . Just wrote a test program but doesnt seem to be working. Can any one tell me what the problem is #include <iostream> #include <algorithm> #include <list> using namespace std; int main(){ int a[10] = {12, 3, 25, 7, 11, 213, 7, 123, 29, -31}; int *ptr = find(&a[0], &a[10], 7); list<int> list1(&a[0], &a[10]); list<int>::iterator i = find(list1.begin(), list1.end(), 7); cout<<"type something including an x followed by one whitespace \n"; & ...Show All
Smart Device Development How to detect when Scrollbar from my DataGrid changes ?
Hi, Im doing some kind of Datalogger, and in a certain part of the app I need to detect when somebody changes the position of the scrollbar of a Datagrid Many thx in advance, Hi cgMarcos, Try this code (you can also find this snippet in the public newsgroups): foreach ( Control c in dataGrid1.Controls ) { Ty ...Show All
Visual C# turn this algorithm into code...help please
The following algorithm is for checking a person's birth date / birth number combination (an equivalent to social security number). The birth date / birth number combination consists of a 10 digit number, YYMMDDNNNN, for example 7401204933. To decide if this number is correct, you multiply each digit alternatively with 2 and 1, starting with 2. Next, you add the results together. Finally, you have to be able to evenly divide the sum by 10, for the number to be correct. For example, checking the number 7401204933 would look like this: 7 * 2 = 14 ---> 1 + 4 4 * 1 = 4 ---> 4 0 * 2 = 0 ---> 0 1 * 1 = 1 ---> 1 2 * 2 = 4 ---&g ...Show All
Windows Forms How to Populate the chunk of data (100 rows) each time to Datagrid when the user scrolls through the list of Millions rows?
I would like to achieve this with Datagrid. I have a datagrid with a table and set of columns. The dataset I dynamically generate may contain 10000 through 1000000 rows. I wanted to populate 100 rows first, and when the user navigates to 100th row and then goes next record, i wanted to populate or add next 100 rows to the datagrid and so on like this. I also have a scroller. If the user uses to scroller to reach the bottom of the first 100 rows, I wanted to add or populate next 100 rows. I know how to fetch 100 rows from my query, but do not know the event that fires at the end of datagrid row or the scrollbar event What event of the da ...Show All
SQL Server Bug?-when using nested subreports in combination with list
Someone please help me with a workaround on this issue: I have created three reports: (ReportA, ReportB and ReportC). ReportA includes a subreport (ReportB). ReportB consists of one list. The list is bound to a dataset. The list consists of one subreport (ReportC). ReportC is an empty report. What is the problem: When running Report A,The report generation fails when the dataset that is used in ReportB returns zero rows and the report is rendered across two or more pages. The same problem also occurs when the dataset returns one or more rows and every row are filtered away using a filter expression on the list in ReportB ...Show All
SQL Server How can I tell which version is installed?
One of the server admins recently installed SQL Server 2005 on a new Itamium server. I am trying to set the parameter on the services to indicate they are running on a 64 bit machine, however the changes are not taking...yes I'm stopping and restarting the services. I'm wondering if did not install the right version. Does anyone know how I can tell if the IA 64 version was installed I don't think you could install version other than ia64 on a Itanium machine. If you could start the server, try following sql, it should return a version string which indicate whether is x86/amd64/ia64. select @@versi ...Show All
SQL Server Subtotals broken in Report Builder?
Sub-totals are not working as I would like/expect in an end-user tool when dealing with data from a relational schema with cascading 1-Many relationships. Instead of performing aggregation at the level of the source table, it is blindly performing aggregation on the result set, causing incorrect results. An simplified hypothetical example will make this clear. Imagine the following relationships: Table "Patients" related 1-many on patid with Table "TreatmentsProvided" related 1-many on treatid with Table "FinancialTrans" for the following tables: Patients patid n ...Show All
Visual Basic How to halt a program???
Let say i have two program called program A and program B, i run program A, but inside program A, i use [call shell(C:\....\programB.exe)] at the 2nd line of my codes in program A, how do i stop program A at 2nd line, until i finished running program B then only continue execute the rest of the code from 2nd line in program A Please help, if you dun understand wat im saying above, u can ask ...thanks a lot!!! ReneeC, too bad to hear that ... but i dint receive anything from you... if you dun mind, can you please do it for me again many thanks to you .... Jerry ...Show All
Visual Studio 2008 (Pre-release) BitmapImage.StreamSource best practice?
I want to do this: using (Stream imageStream = webClient.OpenRead(url)) { BitmapImage bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = imageStream; bitmapImage.EndInit(); this.image.Source = bitmapImage; } but it throws an exception because the image hasn't finished downloading when the stream is closed. So instead I find myself doing this: Stream imageStream = webClient.OpenRead(url); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.DownloadCompleted += delegate { bitmapImage.StreamSource.Close(); }; bitmapImage.BeginInit(); bitmapImage.StreamSource = imageStrea ...Show All
Visual C++ Find file without knowing its full name
Hi, I'm working in a directory and I have to see whether a certain file exists (and have to do this about every one or two seconds). However I do not know the full name of the file except for this: _vcr xxxxxx .tmp (where xxxxx stands for a 32-bits integer) I tried checking for it once by using a for loop with an int i=0 to 2^32 and once found by using PathFileExists(), I'd write down the name of the file so for every other check I'd know which file to look for. Well, doing 4 billion times PathFileExists() is NOT a good idea :). I tried it out and killed the process after a few minutes (on a 2400+ cpu and 7200rpm HD). Do ...Show All
