chunks

How to read data in chunks from notepad file in Matlab?

空扰寡人 提交于 2019-12-06 12:20:12
My data is in following format: TABLE NUMBER 1 FILE: name_1 name_2 TIME name_3 day name_4 -0.01 0 364.99 35368.4 729.99 29307 1094.99 27309.5 1460.99 26058.8 1825.99 25100.4 2190.99 24364 2555.99 23757.1 2921.99 23240.8 3286.99 22785 3651.99 22376.8 4016.99 22006.1 4382.99 21664.7 4747.99 21348.3 5112.99 21052.5 5477.99 20774.1 5843.99 20509.9 6208.99 20259.7 6573.99 20021.3 6938.99 19793.5 7304.99 19576.6 TABLE NUMBER 2 FILE: name_1 name_5 TIME name_6 day name_7 -0.01 0 364.99 43110.4 729.99 37974.1 1094.99 36175.9 1460.99 34957.9 1825.99 34036.3 2190.99 33293.3 2555.99 32665.8 2921.99 32118

IOS record audio and split it into files in real time

不问归期 提交于 2019-12-06 09:25:52
I am making an app which needs to stream audio to a server. What I want to do is to divide the recorded audio into chunks and upload them while recording. I used two recorders to do that, but it didn't work well; I can hear the difference between the chunks (stops for couple of milliseconds). How can I do this? Your problem can be broken into two pieces: recording and chunking (and uploading, but who cares). For recording from the microphone and writing to the file, you can get started quickly with AVAudioEngine and AVAudioFile . See below for a sample, which records chunks at the device's

R reshape, restructure dataframe by chunks

不想你离开。 提交于 2019-12-06 07:54:57
问题 I am trying to reshape a dataframe: Currently it looks like this: ID | Gender |A1 | A2 | A3 | B1 | B2 | B3 ID_1 | m | 3 | 3 | 3 | 2 | 3 | 2 ID_2 | f | 1 | 1 | 1 | 4 | 4 | 4 I want to have something like: ID | Gender | A1 | A2 | A3 ID_1 | m | 3 | 3 | 3 <- this would be columns A1 - A3 for ID 1 ID_1 | m | 2 | 2 | 2 <- this would be columns B1 - B3 for ID 1 ID_2 | f | 1 | 1 | 1 <- this would be columns A1 - A3 for ID 2 ID_2 | f | 4 | 4 | 4 <- this would be columns B1 - B3 for ID 2 (A1 and B1 /

Netty: How to handle received chunks from a ChunkedFile

爱⌒轻易说出口 提交于 2019-12-06 06:09:45
I am new to netty and I am attempting to transfer a chunkedfile from a server to a client. Sending the chunks work just fine. The problem is on how to handle the received chunks and write them to a file. Both methods that I tried give me a direct buffer error. Any help would be greatly appreciated. Thanks! @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { System.out.println(in.toString()); //METHOD 1: write to file FileOutputStream fos = new FileOutputStream("c:\\test.txt"); fos.write(in.array()); //METHOD 2: getting desperate /

Writing memory to socket in chunks in C

旧城冷巷雨未停 提交于 2019-12-05 13:55:00
I'm attempting to write memory contents to a socket in chunks. I can write files that are smaller than my buffer, but anything else and I'm in deep water. /* allocate memory for file contents */ char fileContents = malloc(sizeof(char)*filesize); /* read a file into memory */ read(fileDescriptor, fileContents , filesize); int chunksWritten; /* Write the memory to socket? */ if (filesize > MAX_BLOCK_SIZE){ while (chunksWritten < filesize){ // what goes here? } } else { chunksWritten = writen(sd, fileContents, filesize); // this works for files < MAX_BLOCK_SIZE } writen here writes to my socket:

PHP: Split string into chunks of 8, how do I do this?

怎甘沉沦 提交于 2019-12-05 09:10:13
I have binary basically, say it's 300 in length. How would I split (much like using explode) it into 8 bit chunks? I look at chunk_split() but it only seems to have an 'end' parameter, not an option to put it into an array.. Or can it be socketed into an array? The end 8 digits can be below 8 (in case a miscopy from someone, and it's 4) so no validation is needed, just consistantly in 8 number chunks from the start to end. str_split : $chunks = str_split($data, 8); 来源: https://stackoverflow.com/questions/2191199/php-split-string-into-chunks-of-8-how-do-i-do-this

MediaRecorder - How to play chunk/blob of video while recording?

半腔热情 提交于 2019-12-05 06:19:36
I currently have a MediaStream which is being recorded using MediaRecorder . At the end of the recording after recorder.stop() , it produce a Blob and I am able to play that video back. My goal is to play not the entire video at the end, but play a chunk while recording . For the moment, a chunk is not playable while recording is not ended. How can i do that using javascript? The final objective is to send a chunk by websocket that is playable even if recording is in action. I am not able to bring new solutions. Can anyone help or at least explain me the things ? What I've tried was navigator

Mongodb: db.printShardingStatus() / sh.status() call in Java (and JavaScript)

蓝咒 提交于 2019-12-04 17:43:15
I need to get a list of chunks after sharding inside my Java code. My code is simple and looks like this: Mongo m = new Mongo( "localhost" , 27017 ); DB db = m.getDB( "admin" ); Object cr = db.eval("db.printShardingStatus()", 1); A call of eval() returns an error: Exception in thread "main" com.mongodb.CommandResult$CommandFailure: command failed [$eval]: { "serverUsed" : "localhost/127.0.0.1:27017" , "errno" : -3.0 , "errmsg" : "invoke failed: JS Error: ReferenceError: printShardingStatus is not defined src/mongo/shell/db.js:891" , "ok" : 0.0} at com.mongodb.CommandResult.getException

How to use PNG's IDAT chunk?

泄露秘密 提交于 2019-12-04 11:59:40
问题 I'm trying to understand how data are stored into IDAT chunk. I'm writing a little PHP class and I can retrieve most of chunks information but what I get for IDAT doesn't match pixels of my image : It is 2×2px truecolour with alpha (bitdepth 8). But when I interpret IDAT data like this: current(unpack('H*',gzuncompress($idat_data))); I get 00000000ffffff00ffffff000000 I don't understand how it can match pixels. Or is it my code which corrupts data? Thanks for your help! EDIT: I get

R reshape, restructure dataframe by chunks

心已入冬 提交于 2019-12-04 11:46:37
I am trying to reshape a dataframe: Currently it looks like this: ID | Gender |A1 | A2 | A3 | B1 | B2 | B3 ID_1 | m | 3 | 3 | 3 | 2 | 3 | 2 ID_2 | f | 1 | 1 | 1 | 4 | 4 | 4 I want to have something like: ID | Gender | A1 | A2 | A3 ID_1 | m | 3 | 3 | 3 <- this would be columns A1 - A3 for ID 1 ID_1 | m | 2 | 2 | 2 <- this would be columns B1 - B3 for ID 1 ID_2 | f | 1 | 1 | 1 <- this would be columns A1 - A3 for ID 2 ID_2 | f | 4 | 4 | 4 <- this would be columns B1 - B3 for ID 2 (A1 and B1 / A2 and B2 are the same variables (with regard to the content), so for example: A1 and B1 would be both