Gabriel Vila's Q&A profile
Visual C++ Computing for large matrices
I tried to write a file for 1e6 by 1e6 and it literally crashed. Double is too small to handle. How should I code so that I could begin to write and compute my matrices I am looking along the lines of computing values larger than 1e6. Is that realistic Also, how can I optimize on the memory space using MV.Net 2003 I am starting with a simple code, see below. Thanks. [code]int main() { int i, j, nmat; double *b, **a4; nmat = 1000000; Init_Matrix(a4, nmat); Init_Vector (b, nmat); for (i = 0; i<nmat; ++i) { if (i%2 == 0) a4 = 4; if (i%2 == 1) a4 = 4; if ((i-1)%1 ...Show All
SQL Server what is the best way to concotanate two integer fields?
one of our marketing people downloads the DNC list from the FTC or one of the other F agencies. he then screens his cold calling list against it. he wants to put it into sql to make it faster. it's a text file and imports 2 fields. The area code and the phone number. I want to import it as integers so i can put some logic to automatically screen his list against it. I can't concontanate two integers into a third column so I'm looking for some advice. should i import them as strings originally, dump to a flat file and then import the full phone number as an integer Or is there a better way You can do this all in one data-flow. No need to export to a file. Import the numbers as strings. Then you ca ...Show All
.NET Development Parsing double value from a string
Hi all, I need to parse a string which is in the following format (example): -0.0004 USD/Tonnes Basically, it will be a double value, might be preceded by the negative (-) sign and followed by <Currency>/<Unit of Measure> . The result should be just the double value (with the sign if its there), as in the above example, it should translate to -0.0004 I wanted to know if there is an easy way of doing it in C#, like using the Double.Parse() or the string.Format() methods (I tried them both but couldn't get them to work) Or do I have to parse the string character-by-character to get the required result Thanks in advance, MadMonk P.S.: Apologies if its a silly question, I'm still a newbie in .NET ...Show All
Visual Studio Tools for Office Help! 0x800a16c1 - Object has been deleted
Hi I'm working with VSTO 2005, Word Document, C#. I've done a word document where you can add lists with items inside a table. So everytime i want to a add a new list,, the C# code gets the range of a bookmark where i want to work, then it insert a row in the table, then add the xmlnodes and then add the info written by the user in an Actions Pane. the document works fine when i build it from VSTO. so i created the installer and the security policies and all that stuff. When i open the document for the first time, it works great! i create new lists with the actions pane, and everything is ok. So i save the document with another name. Then i open the new document, and when i try to insert a new list through the actions ...Show All
Windows Forms Visual Studio 2005 syntax
Can anyone please tell me how to keep a count of a certain number of times a number appears on the game that I am desgning I have three text boxes which generate 2 different numbers when the SPIN button is pressed, i know have a lable which is supposed to display the number of times the number 7 appears. Please help, i am desperate, I really need this piece of code. Thanks in advance Meggy Thank You EVER SO MUCH FOR YOUR HELP, I APPRECIATED IT. YOU SAVED MY LIFE. the code actually worked by placing the right name of variable I was using from the beggining, I have also set he counter to reset whenever the player presses the 'Restart' button. Thanks again Meggy ...Show All
SQL Server Memory Leak with sp_OACreate and EXECUTE AS OWNER
Hi, We have been encountering an "Out of Memory" issue with SQL Server 2005, and have tracked it down to the usage of sp_OACreate and sp_OADestroy in a stored procedure. We discovered that logging in and running the procedure as sa, without "EXECUTE AS OWNER" in the procedure worked fine without any memory leak, but the including "EXECUTE AS OWNER" caused the server memory usage to increase, and never be released. Has anyone else encountered this issue, or have they a solution Cheers, Chris I was able to reproduce this, as well, in SQL Server 2005 RTM (9.0.1399). I unfortunately don't have an SP1 installation handy to test with -- are you runni ...Show All
SQL Server Running Value
Hi In my report I have the total column,under the total i have two sub fields:no , Row%and i have another column Cumulative total sub fields are no,cum% For the Row % under total i write like this: =Round((Fields!Male.Value+Fields!Female.Value+Fields!Unknown.Value+Fields!Invalid.Value)/Sum(Fields!Male.Value+Fields!Female.Value+Fields!Unknown.Value+Fields!Invalid.Value)*100,2) For the cum % under cumulative total the expression is: =RunningValue((Fields!Male.Value+Fields!Female.Value+Fields!Unknown.Value+Fields!Invalid.Value)/Sum(Fields!Male.Value+Fields!Female.Value+Fields!Unknown.Value+Fields!Invalid.Value)*100, sum , "AgeByGender" ) But i am getting this error: The Value expression for the textbox 'Cum ...Show All
Visual C# save then clear event logs
Hello, i'm a freshman on C#... currently, trying to save the eventlogs of Windows to specify location then clear it. how could i save the logs of system & application thanks for your assistance Richard Hi, As the EventLogEntry class implements ISerializable you can serialize your object into a binary object and save it to a file. The way to do it is the following one: 1) You must use: using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; 2) Create a binary formatter BinaryFormatter _BinaryFormatter; _BinaryFormatter = new BinaryFormatter (); 3) Optional (if you want to use a simple serialization so if your version cha ...Show All
Visual Studio Express Editions not being able to retrive the values from a detailview once it is changed by the user
i am having an aspx page which has a detailview and a object datasource . the detailview bound to the object datasource at the runtime.as shown below DetailsView1.ChangeMode(DetailsViewMode.Edit); dr1 = NALocal.SelectNetworkAsset(ip1); DetailsView1.DataSource = dr1; here NALocal is a variable of a the object datasouce and the result of the function is placed in a datatable dr1which becomes the source for the detailview. now the problem is in the editmode of the detailview when the user makes any changes to the any of the attribute it is not reflected in the either in DetailView.Rows[0].Cells[1].text nor in the NALocal object.it shows the old values before the user makes the changes. please help meee.....any help will be appreciat ...Show All
Visual C# Object reference confusion.
I have a simple function located in Class2.cs - an auxiliary file for Form1.cs (Console Application in VS2005). It take one parameter: string. This string is supposed to serve as a switch for selecting the right string to build. public string getConnStrings ( ref string switched ) In the calling function I call the function in question as: string switched = "1"; string str1 = Class2.getConnStrings (switched); // or (ref switched); I get this error: Error 1 An object reference is required for the nonstatic field, method, or property 'tapTCPports_1.Class2.getConnStrings(ref string)' D:\VCsharp_Projects\tapTCPports_1\Form1.cs 1231 21 tapTCPports_1 When I placed the function getConnStrings into the ...Show All
Software Development for Windows Vista how to pass data between two activites
Hi, I am new to WF. In my workflow scenario, there are more than one activity. I want to pass data from one activity to next activity. Is it possible in WF If so, could you please tell me the way to pass data between two activities. Thanks & Regards, Chakri. Listing 3.10 has part of the stuff you're looking for - passing data to an activity. Another way to get the sample is download the Windows SDK from here: http://www.netfx3.com/blogs/news_and_announcements/archive/2006/11/06/.NET-Framework-3.0-has-been-released_2100_.aspx Or send me your email address and I will email you the sample files. Kavita ...Show All
Visual Studio Express Editions Adding Microsoft Chart Control to VB Express
Hi, I'm trying to add Microsoft Chart Control 6.0 to VB Express edition. When I click Projects|Add Reference|COM I can't see it there. I've tried adding Microsoft Graph 11 and looking for it in the Toolbox|Choose Options|COM menu, but I can't see it there either. Does anyone know if this function is left out of the Express edition Or is there another way to get to it Thanks Andy I just wanted to say that you so much Andy for your reply. I am taking a VB class and for some reason did not have this control with my orginal vb installation and you really saved me. Now I can turn in my assignment. Thanks so much! ...Show All
Windows Forms DataBinding with Custom Format :-)
Hi, First, thanks for taking the time to read this newbie's question. Please will someone tell me what mistake I am making to receive the following error: "This causes two bindings in the collection to bind to the same property. Parameter name: binding". The error appears when the line *** is run (see below for the line). However, I'm a little puzzled because before the Binding instance (in this case called 'b' (for simplicity)) is set to null before it is used again. I can't seem to see why this object is shared... between two proprties. I originally didn't include the line: b = null ; because I would have thought that by creating a a new instance of the class 'Binding' would return a reference that would replace the ...Show All
.NET Development Deny access to all my .mdb in a directory
how can I deny access to download to a .mdb file in a directory and If I deny access my application can open it to read data Thanks AFAIK this only applies to application specific resources served up by IIS: How To Make Application and Directory-Specific Configuration Settings in an ASP.NET Application http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpgenref/html/gngrflocationelement.asp You can try and see if something will work with an Access database but ultimately I think you will have to use NTFS permissions. ...Show All
Smart Device Development Using GIF's on a Form, do I need to dispose() them?
Hi all, I am using GIF's on a Form that sit in the PictureBox Controls. Do I need to Dispose of these when the Form is closed, or will the CLR take care of this for me Thanks If I understand correctly, you're saying you're doing something like this... using (Form1 myform = new Form1()) { if (myform.ShowDialog(this) == DialogResult.OK)) { // do some stuff } } In that case, you are correct, using a "using" statement will automatically call the form's Dispose() once it leaves that block of code. --Jeff ...Show All
