concat

angular 2: concat arrays in a pipe without loosing databinding

流过昼夜 提交于 2019-12-11 01:34:19
问题 I have a simple pipe: export class MergePipe implements PipeTransform { transform(first: any[], second: any[], order: Boolean): any { return order ? first.concat(second):second.concat(first); } Which I'm using on a simple button: <button *ngFor="let item of items | sort:suffix | filter:filterargs | merge:newItems:false"></button> . And then push some values into the newItems with newItems.push(values) but nothing happens. If I remove the pipe from *ngFor, I receive the expected changes. I

FFMPEG add text frames to the start of video

前提是你 提交于 2019-12-10 22:16:46
问题 I have some videos either in mp4 or webm format, and I'd like to use ffmpeg to add 4 seconds to the start of each video to display some text in the center with no sound. Some other requirements: try to avoid re-encoding the video need to maintain the quality (resolution, bitrate, etc) (optional) to make the text fade in/out I am new to ffmpeg and any help will be appreciated. thanks in advance Example ffprobe information for mp4 below: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':

Converting unordered list of tuples to pandas DataFrame

别来无恙 提交于 2019-12-10 20:48:38
问题 I am using the library usaddress to parse addresses from a set of files I have. I would like my final output to be a data frame where column names represent parts of the address (e.g. street, city, state) and rows represent each individual address I've extracted. For example: Suppose I have a list of addresses: addr = ['123 Pennsylvania Ave NW Washington DC 20008', '652 Polk St San Francisco, CA 94102', '3711 Travis St #800 Houston, TX 77002'] and I extract them using usaddress info =

JSON.NET \ how to concat two JSONs in JSon.net

夙愿已清 提交于 2019-12-10 15:05:39
问题 I have two JSONs (as simple strings) - is there neat way to concat them? As part of the infrastructure?? 回答1: string j1 = @"{""a"":1}"; string j2 = @"{""b"":2}"; var j = JsonConvert.SerializeObject(new[] { JsonConvert.DeserializeObject(j1), JsonConvert.DeserializeObject(j2) }); or var j = JsonConvert.SerializeObject(new { obj1 = JObject.Parse(j1), obj2 = JObject.Parse(j2) }); 来源: https://stackoverflow.com/questions/12913396/json-net-how-to-concat-two-jsons-in-json-net

ffmpeg concat videos with different timebase

六眼飞鱼酱① 提交于 2019-12-10 12:04:44
问题 I use ffmpeg.exe -f concat -i file_path_list_txt -c copy out_out.mp4 to concat for file in 1265_*; do ffmpeg -i $file -crf 30 -b:a 23k -b:v 96k -threads 3 -y 'out_'$file; done compressed video. When I play the generated video, the player shows the video length is much longer than the sum of compressed video pieces. And at the linkage between slices,the frame can play a very long time,time on the player is going on,but the frame is still. I use ffprobe to show the original video pieces and

Third parameter of np.r_? (numpy)

拜拜、爱过 提交于 2019-12-10 10:28:19
问题 I'm looking over the docs and I still can't figure out how the third parameter operates. np.r_['0,2,0', [1,2,3], [4,5,6]] output: array([[1], [2], [3], [4], [5], 2) np.r_['1,2,0', [1,2,3], [4,5,6]] output: array([[1, 4], [2, 5], [3, 6]]) The first parameter is the axis, second is the number of dimensions and third according to the docs means " which axis should contain the start of the arrays which are less than the specified number of dimensions" Here are the docs: https://docs.scipy.org/doc

Yii2 Gridview merge two columns

☆樱花仙子☆ 提交于 2019-12-10 10:15:33
问题 i have a gridview in Yii2 with two columns, first_name and last_name. I want to merge this two values into one single column named full_name made like tihs: 'first_name'.' '.'last_name' , searchable and filterable. How can i do it? 回答1: try this way: <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], [ 'attribute' => 'an_attributeid', 'label' => 'yourLabel', 'value' => function($model) { return $model-

concat in php codeigniter

旧巷老猫 提交于 2019-12-10 09:54:52
问题 Please help me to understand proper join syntax. I have table named inventory which has: trans_id trans_items items -> item_id trans_user employees -> person_id trans_date trans_comment trans_inventory As you can see above, trans_items is a foreign key in items table, and trans_user is a foreign key in employees table and employee id is foreign key to people table. Now what I want to do is to display in HTML the inventory table, but instead of displaying the employee id, I want the employee

More than 2 columns in a CONCAT function

一个人想着一个人 提交于 2019-12-10 03:22:44
问题 In SQL Server 2012 I want to concat 5 columns into 1 but in the query it works but when I put in in a view it gives me an error like Msg 174, Level 15, State 1, Line 3 The CONCAT function requires 2 argument(s). What's the problem so I can fix it because concat is a good function for concatenate more than 1 column because if its null they make it empty.. CODE: SELECT 'Aan ' + A.Name AS 'Naam', { fn CONCAT('T.a.v. ', C.Salutation + ' ', C.FirstName + ' ', C.MiddleName + ' ', C.LastName) } AS

What is the difference of + operator and concat() method in JavaScript

倾然丶 夕夏残阳落幕 提交于 2019-12-09 08:03:34
问题 The plus ( + ) operator and String.concat() method gives the same result. plus ( + ) operator ; str1 + str2; String concat() method ; str1.concat(str2); Addionally, it is written in w3schools ; But with JavaScript, methods and properties are also available to primitive values, because JavaScript treats primitive values as objects when executing methods and properties. So which way is better to use to combine for either we use on primitives or on String objects in JS, what are the performance