record

Why can't I use record selectors with an existentially quantified type?

可紊 提交于 2019-12-03 01:11:07
When using Existential types, we have to use a pattern-matching syntax for extracting the forall ed value. We can't use the ordinary record selectors as functions. GHC reports an error and suggest using pattern-matching with this definition of yALL : {-# LANGUAGE ExistentialQuantification #-} data ALL = forall a. Show a => ALL { theA :: a } -- data ok xALL :: ALL -> String xALL (ALL a) = show a -- pattern matching ok -- ABOVE: heaven -- BELOW: hell yALL :: ALL -> String yALL all = show $ theA all -- record selector failed forall.hs:11:19: Cannot use record selector `theA' as a function due to

android AudioRecord amplitude reading from MIC

蓝咒 提交于 2019-12-03 00:58:27
I am trying to record the sound from the MIC and draw a live graph. I am able to record and draw the graph. The problem is the values that are recorded using the code below are not accurate for example ... the image below is what i get when there is no sound at all present. I have seen examples using the fft but I am noot sure if that will be of any help in my case as I am trying to draw a time domain graph and I see no purpose to convert it to frequency domain (for now). Others are using average power, this might be helpful but I am not sure. Thanks for any help. bufferSize = AudioRecord

When to use a Discriminate Union vs Record Type in F#

回眸只為那壹抹淺笑 提交于 2019-12-02 20:28:34
I am trying to get the basics of F# clear before moving on to complex examples. The material I'm learning has introduced both Discriminate Unions and Record types. I have reviewed the material for both, but it is still unclear to me why we would use one over the other. Most of the toy examples I have created seem to be implementable in both. Records seem to be very close to what I think of as an object in C#, but I am trying to avoid relying on mapping to c# as a way to understand F# So... Are there clear reason to use one over the other? Are there certain canonical cases where one applies?

How to record screen and save as gif animation? [closed]

心不动则不痛 提交于 2019-12-02 17:58:38
Is there such a software? Pale Blue Dot Try this (Size -857 KB) (trial version - only 25 frames ) Try this free tool (unlimited frames) called Cropper. Set the output as Animated Gif. http://cropper.codeplex.com/ Update: In the notification area right click the cropper icon, go to Output > Animated Gif 来源: https://stackoverflow.com/questions/1636011/how-to-record-screen-and-save-as-gif-animation

Converting COMP-3 columns in Mainframes to readable format using Record Editor tool

为君一笑 提交于 2019-12-02 17:07:37
问题 This is the file which we received as Binary from Mainframes which includes COMP-3 columns as well along with other columns And when we tried loading this Binary file into Record Editor, It is displaying Special Characters Kindly let us know step by step process from Starting to Ending on How to process COMP-3 columns and load into Record Editor. 回答1: So what have you tried ???, In the last question I suggested: You will have to update RecordEditor/JRecord The font will need to be ebcdic

How to capture the black and white video

孤者浪人 提交于 2019-12-02 15:35:56
问题 I am new in iPhone application development. I develop one iPhone application. In this application i want to develop record the black and white video using iPhone camera. Please help me how to develop this and then give some example code url also. Thanks in advance. 回答1: You want to use the kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format. adding this to your videooutput OSType format = kCVPixelFormatType_420YpCbCr8BiPlanarFullRange; videoOutput.videoSettings = [NSDictionary

How to access record properties?

心不动则不痛 提交于 2019-12-02 14:10:51
问题 I need to access, record properties, and set/get this property values. Firstly, i want to access properties. But i can't. What is wrong? Ver : Delphi XE6. sample code: type TmyRecord = record private Str : String; public property StrProp :String read Str; end; procedure TForm1.Button3Click(Sender: TObject); var c : TRttiContext; t : TRttiType; field : TRttiField; prop : TRttiProperty; begin c := TRttiContext.Create; try Memo1.Lines.Append('Fields'); for field in c.GetType(TypeInfo(TMyRecord))

Postgres Function End Loop and return Error

為{幸葍}努か 提交于 2019-12-02 13:04:55
问题 I have tried to create this function but the system is returning a "LOOP error" and I don't know how to return 3 variables at the same time. I've tried hard to figure this out but I didn't find an answer anywhere. CREATE OR REPLACE FUNCTION conta_relatos(fator_normativo integer, fator_determinativo integer) RETURNS integer AS $BODY$ DECLARE vinculos_encontrados RECORD; rel_pri INT; rel_sec INT; rel_ref INT; no_item INT; tipo_relato TEXT; BEGIN rel_pri := 0; rel_sec := 0; rel_ref := 0; FOR

Record the conversation of phone - ios [duplicate]

余生长醉 提交于 2019-12-02 10:34:42
Possible Duplicate: Is an iPhone Call Recorder theoretically possible? I am an iPhone devleoper. I want to record the conversation during phone call. I don't know apple is allowing to do this or not. If yes, than can anybody guide me how can i do this? Basically In my app ,I am recording 1 audio . Now when i call someone from my contact ,I want to play that audio as well as record the conversation. Both play and record thing I want. I am confused whether it is possible or not. There is no public API for recording the calls made (or received) by the built-in Phone app. You will have to

How to use enumerate in this program?

不羁的心 提交于 2019-12-02 10:09:47
f=open('Student.dat','r+') # opens Student.dat file roll1=input("Enter roll to be found") # to find a record in a list using a roll no rec=f.readlines() for i,lst in enumerate(rec): if lst == roll1: print rec[i] Is this the proper way to use enumerate?? or should i use another loop within?? Here enumerate doesn't help much; you could use instead (which would be simpler and clearer): for i in rec: if i == roll1: print i enumerate is useful when you really need to get at the same time values and indices, which doesn't seem to be the case here. (In your piece of code rec[i] does the same thing