record

Nesting Avro schemas

泪湿孤枕 提交于 2019-12-21 09:28:31
问题 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

How to render WPF animation as a video frame by frame?

不羁的心 提交于 2019-12-21 05:24:11
问题 I've created a nice effect that I like in WPF, I'd like to be able to "record" this effect. But it is choppy during run-time. Is there a way I can convert it to a frame-by-frame process and save it as a video myself instead of trying to record it during playback? Basically I'd like to render WPF as a video, or list a series of frames saved as bitmaps. Key thing is to be able to record the animation with out the choppiness. 回答1: Have you looked at using RenderTargetBitmap to render your Visual

PostgreSQL v9.X have real “array of record”?

被刻印的时光 ゝ 提交于 2019-12-21 00:07:33
问题 This query works fine, WITH test AS ( SELECT array_agg(t) as x FROM ( SELECT 1111 as id, 'aaaaa' as cc ) AS t ) SELECT x[1] FROM test; but, can I access the recod elements? I try SELECT x[1].id ; SELECT x[1][1] ; ... nothing works. PS: with Google we see only OLD solutions... The context here is v9.X, no news about "array of record"? I try also select x[1] from (select array[row(1,2)] as x) as t; no solution to access only item 1 or only item 2. A clue that I was unable to follow: postgresql

Voice Recording/Saving in Delphi

泪湿孤枕 提交于 2019-12-20 15:29:51
问题 Is there a component or code that allows the following: Record a spoken word (or words) and save it/them to a file that can be played back. The file must be able to be played back on XP, Vista and Windows 7. The file can be either stand alone or saved to a datasource. [Using Delphi 7 for creating apps on XP and using Absolute Database.] 回答1: The functions in MMSystem.pas let you do this using Windows API. You can either use high-level functions such as the MCI functions and PlaySound, or low

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

妖精的绣舞 提交于 2019-12-20 11:07:33
问题 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

How to use enumerate in this program?

谁都会走 提交于 2019-12-20 06:49:16
问题 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?? 回答1: 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

Audio record in R

瘦欲@ 提交于 2019-12-20 04:16:15
问题 I am playing with some audio and sound packages in R for Windows (mine is Win7 x64). There is a problem when I tried to record from microphone using record() {audio} : it could record only once then cannot record some more until restart the whole console once sound is recorded, it could be save but cannot play() file recorded from above cannot be read by audio, but tuneR due to 'incomplete wave file' and the following "filename" does not work filename=paste0('abcd','.wav') save.wave(x

how to record audio as mp3 file by using AvAudiorecorder

佐手、 提交于 2019-12-19 02:38:33
问题 how to record audio as mp3 file by using AvAudiorecorder.i m using following code for recorder setting recordSetting1 = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:AVAudioQualityMin],AVEncoderAudioQualityKey, [NSNumber numberWithInt:16], AVEncoderBitRateKey, [NSNumber numberWithInt: 2], AVNumberOfChannelsKey, [NSNumber numberWithFloat:44100.0], AVSampleRateKey,nil]; 回答1: Add [NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey However it's impossible to

How to check if mysql entry is empty in PhP?

℡╲_俬逩灬. 提交于 2019-12-18 21:15:45
问题 here is the description variable I am echoing from my table: $description = mysql_result($result,$i,"description"); sometimes the $i'th record is empty and doesn't have any data in it/no description. What I want to do is echo "No description available" for records that are empty if (isset($description)){ echo "No description available";} else{ echo $desctipion;} My attempt doesn't work though as it then echoes No description available for every record even those which aren't empty. What is

Concise way of updating a nested value inside a record in Elm (0.18)

牧云@^-^@ 提交于 2019-12-18 13:07:16
问题 I am looking for a concise way of updating a nested value inside a record in Elm (0.18). Given the following example: person = { name = "Steven", address = { country = "Spain", city = "Barcelona" } } I can update person.name to "Steve" using the following expression: { person | name = "Steve" } However, I am looking for a way to update a nested value. For instance, I would like to update person.address.city to "Madrid". I tried the following: { person | address.city = "Madrid" } { person |