record

Invalid typecast: convert record to tobject on 64-bit platform

人走茶凉 提交于 2019-12-23 10:14:21
问题 it works on 32-bit platform.but not 64-bit here is the exzample TVerbInfo = packed record Verb: Smallint; Flags: Word; end; var VerbInfo: TVerbInfo; strList : TStringList; verb : Smallint; flags : Word; begin strList := TStringList.create(); ..... verbInfo.verb := verb; verbInfo.flags := flags; strList.addObject('verb1',TObject(VerbInfo)); //invalid typecast happened here end; can anyone help me? thank you very much 回答1: You can try something like this: function MakeVerbInfoObject(const

iOS - Record the Voice while phone call in Objective c

自古美人都是妖i 提交于 2019-12-23 05:15:10
问题 Is it possible for an app which records the voice of the user while a phone call? I searched for it and the AVFoundation Framework seems to stop recording when a phone call is incoming. I don't want to record the whole call, I am just interested in record what the user of the iPhone is saying. I know that this possibility might be a safety risk, but it would be nice for e.g an interview. In case of no possibility to do it like i want, i have to create my own VoIP connection and then i can

Recording audio output from application

被刻印的时光 ゝ 提交于 2019-12-23 04:52:29
问题 I'm currently building a project on C++ using Visual Studio on Windows 8. This application captures video from camera and triggers some virtual animations in real-time, with some sounds being played along with the animations. The user has the option to record the experience in video and sound. I already am able to record video, now I want to create a audio track of the sounds that are being played by the application, to later fuse both video and audio files. So, which is the best way to

How to set start time of video saved from RTSP stream with FFMPEG

偶尔善良 提交于 2019-12-22 08:19:37
问题 I use FFMPEG to record video from a RTSP stream. What my code does is get current day time, create a folder with this format year/month/day/hour/minute and save the video to that folder. When a new minute arrive, I create the new folder base on the new minute and run the record again to the new folder. Basically It works, but the next video start time is continue the end of previous video. For example: video1: 00:00 -> 00:55 video2: 00:56 -> ... I hope I can set for all videos start from 00

erlang mnesia - illegal record info

不问归期 提交于 2019-12-22 07:05:01
问题 I am trying to have a function that ensures the table I need is already created and if not to create it. Here's the sample: ensure_table_exists(Table, MnesiaTables, Nodes) -> case lists:member(Table, MnesiaTables) of true -> throw({error, db_might_have_already_been_created}); false -> mnesia:create_table(Table, [{disc_copies, Nodes}, {attributes, record_info(fields, Table)}]), ok end. The issue is that when compiling I get the error: illegal record info . It might have to do that record_info

Systematically applying a function to all fields of a haskell record

纵饮孤独 提交于 2019-12-22 04:32:12
问题 I have a record with fields of different types, and a function that is applicable to all of those types. As a small (silly) example: data Rec = Rec { flnum :: Float, intnum :: Int } deriving (Show) Say, I want to define a function that adds two records per-field: addR :: Rec -> Rec -> Rec addR a b = Rec { flnum = (flnum a) + (flnum b), intnum = (intnum a) + (intnum b) } Is there a way to express this without repeating the operation for every field (there may be many fields in the record)? In

F# record member evaluation

非 Y 不嫁゛ 提交于 2019-12-22 03:22:50
问题 Why is t.b evaluated on every call? And is there any way how to make it evaluate only once? type test = { a: float } member x.b = printfn "oh no" x.a * 2. let t = { a = 1. } t.b t.b 回答1: It's a property; you're basically calling the get_b() member. If you want the effect to happen once with the constructor, you could use a class: type Test(a:float) = // constructor let b = // compute it once, store it in a field in the class printfn "oh no" a * 2. // properties member this.A = a member this.B

Swift audio recording and tableview display

☆樱花仙子☆ 提交于 2019-12-22 00:04:15
问题 I am having trouble recording audio and displaying it in a tableview. I am able to record and immediately play it back, but the audio doesn't seem to actually be stored to the device permanently, so I am unable to call it from the tableview. The directory also seems to change each time the app is open. How can I correct my code for permanent save and recall when populating tableview rows? func record() { let audioSession:AVAudioSession = AVAudioSession.sharedInstance() if (audioSession

How to use record to loop a ref cursor?

独自空忆成欢 提交于 2019-12-21 20:31:53
问题 I want to write PL/SQL to test a function in a package. The package defines a cursor type TYPE ref_cursor IS REF CURSOR; I want to define a record based on that type. My code is: DECLARE cur PACKAGE_NAME.ref_cursor; rec cur%ROWTYPE; why is last line not correct? 回答1: You can't define a record type based on a weakly-typed REF CURSOR. Since the cursor type defined in the package can be used to return data from an arbitrary query with arbitrary columns, the PL/SQL compiler can't determine an

Nesting Avro schemas

走远了吗. 提交于 2019-12-21 09:28:47
问题 According to this question on nesting Avro schemas, the right way to nest a record schema is as follows: { "name": "person", "type": "record", "fields": [ {"name": "firstname", "type": "string"}, {"name": "lastname", "type": "string"}, { "name": "address", "type": { "type" : "record", "name" : "AddressUSRecord", "fields" : [ {"name": "streetaddress", "type": "string"}, {"name": "city", "type": "string"} ] }, } ] } I don't like giving the field the name address and having to give a different