|
You can multithread the multiplication if the arrays are large enough. Another option is to drop into unsafe code and use pointer arithmetic.
Antoher option is to use 64 bit multiplication but you might need a bitwise transform on the result. (Check out the the assembly for strlen for a non-application example)
I don't know about intel chips but some processors provide op codes for array based operations. Check the MMX instruction set and you may be able to multiply the entire set in two or three op codes.
http://web.cs.wpi.edu/~matt/courses/cs563/talks/powwie/p3/mmx.htm
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Hi coders
Just wanted to say thanks for all your many inputs - As expected there seems to be no magic answer to this quistion, but I will take a closer look at using pointers - I did not know this was possible in C# so thanks alot...
AL
|
|
|
|
|
hello every one,
well I was just making a windows form here and it has a column that displays a currency column. SO I know I can change the style of the column to represent a currency but by default it's showing the $ sign while I want it to display the Ruppee symbol like Rs. or something. So can any one of u tell me how to do it. It'd really be v nice u know.
thanks in advance,
Rocky
|
|
|
|
|
There are a number of ways to accomplish this. The easiest may be to change the culture and let the framework handle it. You could also apply a custom format in a data binding expression, or even tranform the column in the source before it is even bound to the datagrid.
only two letters away from being an asset
|
|
|
|
|
ahh by the way, can u tell me how do we change the culture??
and plz can u elaborate this other alternative of customizing the format of the data binding expression...
thanks.
Rocky
|
|
|
|
|
|
I am new to C# and I am having some difficulty in the following task. I have a MDI parent form that calls a child form. I need to pass a reference to an object that is instantiated in the MDI parent. Should this be passed as parameter to the child form constructor? Is there a better way?
Basically I need to create the object in the parent form and have access to the same object in the child form. If the child form makes a change to the state of the object I need the parent form to have access to that change.
Thanks
|
|
|
|
|
There are many ways you could accomplish this. Having a separate property or set it in the constructor are both fine.
The question is, what do you want the object to do?
Does the child form set properties, call methods on the object?
Should this be modelled using the Model View Controller pattern?
What will the parent do with the changed object?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The child will change properties and call events on the object. The object is a basic business object that opens, reads and writes to text streams. Properties of this object deal with file name, creation time, etc. Methods are, SaveFile(), OpenFile(), ReadFile().
I am not familiar with the Model View Controller pattern, I will look that up. What I am trying to get is the basic calling syntax. I seem to be having problems with passing an object reference to the child form constructor.
Thanks again
|
|
|
|
|
This has already been done for you, take a look at the Form.Owner property.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Thanks, I will check this out.
|
|
|
|
|
Hi Everyone,
Some of the .net dlls inh our application has to be shared with some client applications... So we are installing them in GAC , after strong naming them... However we are facing an issue. whenever we are changing the dlls installed in GAC, (We are not version number and snk), we have to rebuild all the application that use this file even id there is not apparent interface change... What are we doing wrong....
Regards
Sabarish
|
|
|
|
|
To share a dll, you do not have to install it into the GAC. Have you tried just copying the dll and referencing it in the other application?
As far as referencing assemblies in the GAC, you can click on a reference in your project (whether a reference to a GAC assembly or a non-GAC'd assembly) and specify whether the app requires a specific version.
Does that help?
|
|
|
|
|
Hi Judah,
The first otpion does not suite with the client, they do not want any of our dlls where their application is installed.... our will be in 1 folder and theris in another...
The second option we had tried, but the issue is that we have toi change in about 50 project
|
|
|
|
|
Sabarish_s wrote: but the issue is that we have toi change in about 50 project
Well, if it solves your problem, perhaps that is the best bet.
|
|
|
|
|
References to strong-named assemblies are bound to that specific version number. There's no other way because there could be multiple versions of the assembly in the GAC.
However, you can redirect the assembly bindings using a publisher policy[^].
|
|
|
|
|
i working with c# 2005
i have toolbar in the form that contain nevigations button(first row -last row -next row -previous row)
i want to select rows not by mouse but with theses buttons how?!
and if the selected row is not appear the datagrid scrollbar scrolls to show selectd row
plz answer me quickly ?!!
ma_refay
|
|
|
|
|
ma_refay wrote: plz answer me quickly ?!!
How quickly do you need it?
|
|
|
|
|
How quickly do you need it?
Today in any way
thanks alot
ma_refay
|
|
|
|
|
|
Don't be hard on him Martin
his English seems to be some how poor.
|
|
|
|
|
Are you doing anything other than scrolling the data? Are you placing data from the grid into other controls to edit them?
Either way, I'd suggest this article here[^] as a good reference.
|
|
|
|
|
Hi,
Is it possible to launch the Windows ODBC Data Source Administrator from within an application?
|
|
|
|
|
Hi,
I'm writing a COM interop interface in C# (VS2005) to be used in VC++, and got into problem of proper exporting enum-s in such interface.
When i previously used C++ for writing COM interfaces, i would just declare the enum within IDL file, and then within the library section also declare it, that way way making my enum accessible when TLB file is imported using #import in C++;
Now in C# if i declare: public enum MyEnymType {val1, val2,...}, then such object when imported into C++ project is declared as: enum MyEnymType {MyEnymType_val1, MyEnymType_val2,...} instead of enum MyEnymType {val1, val2,...}
Is there a way to make C# embed my enum type into the object in such a way that it exports original enum declaration during import instead of such an ugly Type_Value thing?
Thank you,
Vitaly
|
|
|
|
|
I don't know enough C++ to give a definite answer, but this is what I think:
I think that each enum value has to be a unique identifier in C++, while in C# they only have to be unique within the enum. That would account for the need of prepending each value with the name of the enum.
---
Year happy = new Year(2007);
|
|
|
|