Click here to Skip to main content
15,889,281 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: .Net Securing Connection String Clarification Pin
Richard Andrew x6410-Oct-12 12:03
professionalRichard Andrew x6410-Oct-12 12:03 
GeneralRe: .Net Securing Connection String Clarification Pin
Member 838957110-Oct-12 14:29
Member 838957110-Oct-12 14:29 
GeneralRe: .Net Securing Connection String Clarification Pin
CafedeJamaica21-Nov-12 5:33
professionalCafedeJamaica21-Nov-12 5:33 
AnswerRe: .Net Securing Connection String Clarification Pin
jschell11-Oct-12 8:53
jschell11-Oct-12 8:53 
QuestionArray of Double - Shallow vs. Deep Cloning? Pin
M-Badger5-Oct-12 7:01
M-Badger5-Oct-12 7:01 
AnswerRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen5-Oct-12 12:25
professionalEddy Vluggen5-Oct-12 12:25 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
M-Badger7-Oct-12 9:56
M-Badger7-Oct-12 9:56 
AnswerRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen8-Oct-12 0:39
professionalEddy Vluggen8-Oct-12 0:39 
Mike-MadBadger wrote:
for copy/clone of value types or arrays of a value type, shallow == deep

Thumbs Up | :thumbsup:

Mike-MadBadger wrote:
VB
Private _matrix as double(,)
Public Sub New(ByVal array As Double(,))
    Me._matrix = array
End Sub

Would assign the pointer to the array to "Me._matrix". (Both in case of value- and reference types)

Mike-MadBadger wrote:
VB
Private _matrix as double(,)
Public Sub New(ByVal array As Double(,))
    Me._matrix = array.Clone
End Sub

Would create a copy of the values (shallow, again for value and reference-types)

Mike-MadBadger wrote:
Whereas with an array of reference types there would only be a subtle difference?

In the case of value-types, the result would be identical; you'd end up with an array of values. For reference-types, it'd be similar; version one assigns a pointer to the array, version two copies the structure of the array (and thus, all pointers to references it contains) and you end up with an exact copy of the list, still pointing to the original objects.
MSDN states[^]
A shallow copy of an Array copies only the elements of the Array, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new Array point to the same objects that the references in the original Array point to.

Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
M-Badger9-Oct-12 23:04
M-Badger9-Oct-12 23:04 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen10-Oct-12 1:22
professionalEddy Vluggen10-Oct-12 1:22 
GeneralOT Pin
M-Badger10-Oct-12 2:23
M-Badger10-Oct-12 2:23 
GeneralRe: OT Pin
Eddy Vluggen10-Oct-12 9:00
professionalEddy Vluggen10-Oct-12 9:00 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
dojohansen10-Oct-12 5:36
dojohansen10-Oct-12 5:36 
GeneralRe: Array of Double - Shallow vs. Deep Cloning? Pin
Eddy Vluggen10-Oct-12 9:09
professionalEddy Vluggen10-Oct-12 9:09 
QuestionSMS forwarding through GSM modem Pin
Member 94607155-Oct-12 2:57
Member 94607155-Oct-12 2:57 
QuestionHow to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 1:13
AtALossHere5-Oct-12 1:13 
AnswerRe: How to force rendering to generate an ID? Pin
Sandeep Mewara5-Oct-12 2:24
mveSandeep Mewara5-Oct-12 2:24 
GeneralRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 3:26
AtALossHere5-Oct-12 3:26 
GeneralRe: How to force rendering to generate an ID? Pin
Sandeep Mewara5-Oct-12 3:30
mveSandeep Mewara5-Oct-12 3:30 
GeneralRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 4:51
AtALossHere5-Oct-12 4:51 
AnswerRe: How to force rendering to generate an ID? Pin
AtALossHere5-Oct-12 4:58
AtALossHere5-Oct-12 4:58 
QuestionCustom Class Exception Management / Setup Pin
M-Badger4-Oct-12 1:40
M-Badger4-Oct-12 1:40 
AnswerRe: Custom Class Exception Management / Setup Pin
Pete O'Hanlon4-Oct-12 1:50
mvePete O'Hanlon4-Oct-12 1:50 
GeneralRe: Custom Class Exception Management / Setup Pin
M-Badger4-Oct-12 2:27
M-Badger4-Oct-12 2:27 
GeneralRe: Custom Class Exception Management / Setup Pin
Pete O'Hanlon4-Oct-12 2:32
mvePete O'Hanlon4-Oct-12 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.