record

Custom Equality check for C# 9 records

送分小仙女□ 提交于 2021-02-18 21:30:08
问题 From what I understand, records are actually classes that implement their own equality check in a way that your object is value-driven and not reference driven. In short, for the record Foo that is implemented like so: var foo = new Foo { Value = "foo" } and var bar = new Foo { Value = "foo" } , the foo == bar expression will result in True , even though they have a different reference ( ReferenceEquals(foo, bar) // False ). Now with records, even though that in the article posted in .Net

How to work with records using file stream I/O instead of the 'old' I/O

好久不见. 提交于 2021-02-11 12:03:05
问题 Never learnt to work with streams for reading / writing data, instead I'm using the old Pascal way. Now everybody says this is not efficient and I would like to learn the file stream way, but can't really work with the tutorials that are available. I am using Excel to create and manage datasets (big data tables with one or two headers). I save these as *.txt files (tab delimited). These files I read with Delphi to fill my records and arrays, etc. Below a simplified code example of what I am

Error Domain=AVFoundationErrorDomain Code=-11814 “Cannot Record”

坚强是说给别人听的谎言 提交于 2021-02-08 12:31:31
问题 It keeps on giving me the error: Error Domain=AVFoundationErrorDomain Code=-11814 "Cannot Record" I am not sure what the problem is? I am trying to record the sound right when the counter reaches 1 after a picture is taken. static int counter; //counter will always be zero it think unless it is assigned. if (counter == 0){ dispatch_async([self sessionQueue], ^{ // Update the orientation on the still image output video connection before capturing. [[[self stillImageOutput]

Java Record / Mix two audio streams

两盒软妹~` 提交于 2020-12-29 07:25:07
问题 i have a java application that records audio from a mixer and store it on a byte array, or save it to a file. What I need is to get audio from two mixers simultaneously, and save it to an audio file (i am trying with .wav). The thing is that I can get the two byte arrays, but don't know how to merge them (by "merge" i don't mean concatenate). To be specific, it is an application that handles conversations over an USB modem and I need to record them (the streams are the voices for each talking

DXGI scans pixels at 10 fps and uses more memory

笑着哭i 提交于 2020-12-15 00:45:03
问题 Good afternoon. I apologize in advance for my bad code, because I have not yet brought it into a good form. The bottom line is to take pixels from the desktop at 60 fps, but mine runs at 10 fps and also uses too much memory. Please help me understand where I was wrong, thanks. I had an assumption that I was not resetting something, but I think have taken this into account by calling SAFE_RELEASE. To get the pixels, I used this code: How to access pixels data from ID3D11Texture2D? #include

DXGI scans pixels at 10 fps and uses more memory

给你一囗甜甜゛ 提交于 2020-12-15 00:44:17
问题 Good afternoon. I apologize in advance for my bad code, because I have not yet brought it into a good form. The bottom line is to take pixels from the desktop at 60 fps, but mine runs at 10 fps and also uses too much memory. Please help me understand where I was wrong, thanks. I had an assumption that I was not resetting something, but I think have taken this into account by calling SAFE_RELEASE. To get the pixels, I used this code: How to access pixels data from ID3D11Texture2D? #include