Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:40
    dotnet-maestro[bot] commented #26329
  • 13:38
    dotnet-maestro[bot] commented #26328
  • 13:37
    dotnet-maestro[bot] commented #26351
  • 13:37
    dotnet-maestro[bot] commented #26327
  • 13:35
    dotnet-maestro[bot] commented #26329
  • 13:33
    dotnet-maestro[bot] commented #26328
  • 13:32
    mikedn commented #26357
  • 13:32
    dotnet-maestro[bot] commented #26351
  • 13:32
    dotnet-maestro[bot] commented #26327
  • 13:30
    dotnet-maestro[bot] commented #26329
  • 13:28
    dotnet-maestro[bot] commented #26328
  • 13:27
    dotnet-maestro[bot] commented #26351
  • 13:27
    dotnet-maestro[bot] commented #26327
  • 13:25
    dotnet-maestro[bot] commented #26329
  • 13:23
    dotnet-maestro[bot] commented #26328
  • 13:22
    dotnet-maestro[bot] commented #26351
  • 13:22
    dotnet-maestro[bot] commented #26327
  • 13:21
    NextTurn commented #26357
  • 13:21
    NextTurn commented #26357
  • 13:19
    dotnet-maestro[bot] commented #26329
Aelindgard
@Aelindgard
Hi all, apologies, anyone familiar with using .NET c# to manipulate VISIO files without calling the VISIO application. There is a tutorial on manipulating the VISIO file as an XML, https://docs.microsoft.com/en-us/office/client-developer/visio/how-to-manipulate-the-visio-file-format-programmatically but it doesn't cover insertion. Use case is a batch process in a server that will add a watermark/classification image to the files eg, "DRAFT" , "SAMPLE" , "APPROVED". Thank you.
migz123
@migz123
Hello everyone
Ganbarukamo41
@Gnbrkm41
:wave:
Ganbarukamo41
@Gnbrkm41
Does anyone have solutions to those 'SR' does not contain a definition for... errors when developing with VS? trying to work with sources in the System.Private.CoreLib solution now. It builds fine with the build script though.
image.png
Something on the line of these
Filip Navara
@filipnavara
You need to build at least once with the build script. After that it should work from VS.
Wraith2
@Wraith2
and usually you need to have done -allconfigurations, not just the config you want
Filip Navara
@filipnavara
I didn't need to do that... I just selected the appropriate configuration in VS (on top of the window) that matched the one built from command line
Ganbarukamo41
@Gnbrkm41
Odd... I did run build.cmd once prior to opening this.
I can try -allconfigurations though.
Wraith2
@Wraith2
I've tried to debug through weird build errors too many times to try using partial builds. when I update the codebase I clean and run all configs to make sure it's all working as expected without any intervention from me.
Ganbarukamo41
@Gnbrkm41
done build.cmd -skipnative -skiptests -all, the issue still persists :^(
Ganbarukamo41
@Gnbrkm41
uhhhhhhhh actually
BUILD: Builds failed:
BUILD:     x64 Checked -skipnative
BUILD:     x64 Release -skipnative
BUILD:     x86 Debug -skipnative
BUILD:     x86 Checked -skipnative
BUILD:     x86 Release -skipnative
BUILD:     arm Debug -skipnative
BUILD:     arm Checked -skipnative
BUILD:     arm Release -skipnative
BUILD:     arm64 Debug -skipnative
BUILD:     arm64 Checked -skipnative
BUILD:     arm64 Release -skipnative
does this mean these all failed
seems to be failing to find \bin\Product\Windows_NT.arm64.Debug\x64\crossgen.exe, which does not exist in the path
ugh, nevermind, looks like I may have skipped building natives
David Cotto
@dacotto1984
if i were to keep doing -> string word = "hello"; string word = "Bonjour"; string word = "Hola"; will i still be using the same block of memory and overwriting it? or would i be allocating and adding each string to memory?
ApocDev
@ApocDev
Reallocating
Strings are immutable
David Cotto
@dacotto1984
i know immutable means it does not change.. so if something is immutable that means it reuses the same block of memory?
ApocDev
@ApocDev
It means a new object is used. The GC takes care of whether or not it reuses the same block of memory
More often than not, it probably won't in the case of strings
Ganbarukamo41
@Gnbrkm41
You're using different blocks of memory for each literals, since a new object is allocated for each string
ApocDev
@ApocDev
^
David Cotto
@dacotto1984
@Gnbrkm41 so that means if i used the code above for 100 different strings it will use more memory? im trying to not increase the amount of ram i am using and simply rewrite. sorry for the noob questions
Ganbarukamo41
@Gnbrkm41
Technically it will use more memory, but it all depends on how long your string is & how much memory you're allowed to use
David Cotto
@dacotto1984
@Gnbrkm41 right that makes sense
Ganbarukamo41
@Gnbrkm41
measure before optimising
to see if it actually has meaningful impacts on your app's performance, in terms of memory usage in this case
but I'd doubt string literals will have serious impact on it to make you deal with it... but we'll see if it does
David Cotto
@dacotto1984
what would be the best practice then in my case.. should i simply intiailize the string first and then just reassign the variable down the line or should i use String myStr = new String("hola"); or should i use String mystr = "hello" once again sorry for such noob questions
right okay so i dont have much to worry about..
Ganbarukamo41
@Gnbrkm41
I'm not even sure if there's a constructor that takes a string
David Cotto
@dacotto1984
right i might have made mistake with that example i dont think either i should have checked
but i hope you get the main idea of what im trying to accomplish
ApocDev
@ApocDev
Unless you're dealing with massive strings, it's honestly not worth worrying about
Ganbarukamo41
@Gnbrkm41
The idea I get from you is trying to preemptively optimise everything :^)
ApocDev
@ApocDev
Or billions of tiny ones
David Cotto
@dacotto1984
lol
ApocDev
@ApocDev
The GC will do way better at optimizing memory than you will :P
David Cotto
@dacotto1984
yes, just as a good practice and measure.. if i gave each string its own variable name im guessing im unnecessarily creating more space in RAM but i reuse a variable then i wouldnt be wasting as much resources.. i believe this may be true for all datatypes
ApocDev
@ApocDev
You'd be saving 4-8 bytes per "object" tbh
Memory is sold by the GB now, it's really not worth worrying about unless you're doing an insane amount of allocations, or writing a game
David Cotto
@dacotto1984
got it
thanks guys!
Robin Sue
@Suchiman
@dacotto1984 also C# string literals get interned, that means there will only be one unique copy of the same string on the heap
but only the literals, not if you create strings dynamically
Stephen A. Imhoff
@Clockwork-Muse

@dacotto1984 -

if i gave each string its own variable name

Irrespective of performance concerns, you don't want to do that. You're trying to deal with internationalization/localization; all relevant strings should be in resource files, and the proper one gets loaded as necessary. You probably want this guide.

A resource file is essentially a keyed map (by a resource key - locale is usually implicit from the file itself), so if nothing else I'd recommend using maps with language-based keys.