In my app where one peer (A) has one media stream, and other side (B) has two media streams.
I am not understanding why there are more m= line in offer from B to A:
1) The offer from A to B is as follows:
v=0
o=- 298896314257884346 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
...
a=mid:0
...
a=sendrecv
a=msid:BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe 982eedc1-919b-450f-80e3-2fb173cbc5ae'
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
c=IN IP4 0.0.0.0
...
a=mid:1
...
a=sendrecv
a=msid:BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe 4112fe2c-24b3-4135-9ad6-7e2f38a6692f
2) The offer from B to A is as follows:
v=0
o=- 6641223000983904101 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2 3 4
a=msid-semantic: WMS
m=audio 54011 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
...
a=mid:0
...
a=sendrecv
a=msid:- 4fb1ecb1-86e7-4529-a5b6-1dddd6f77ce0
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:1
...
a=sendrecv
a=msid:- b3b97f66-8a7a-4aaf-857b-e011648a4a64
...
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
...
a=mid:2
...
a=sendrecv
a=msid:LukrKSP3g6xYlKFbI9DhHXmE22ZEwNz3Shpo 06363625-089b-49f8-ab23-ec04ac0499c0
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:3
...
a=sendrecv
a=msid:LukrKSP3g6xYlKFbI9DhHXmE22ZEwNz3Shpo 108478fa-20a9-4393-aaf2-3d27ac641258
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:4
...
a=sendrecv
a=msid:zCWSiL1IMAhK6skk975lr4IIPf4LBoh2chQI 4600414c-8faf-451c-b6d4-7d8310ab63f8
In 2nd case the m= line is 5 which is in (BUNDLE 0 1 2 3 4)
Why there are 5 lines when we have only two video streams?
session description includes information about the kind of media being sent, its format, the transfer protocol being used, the endpoint's IP address and port, and other information needed to describe a media transfer endpoint.
Since B has two media streams SDP will contain 4 m lines (2 per stream).
In Unified Plan every single media track is assigned to a separate “m=” section. If you use multiple media tracks, multiple “m=” sections are created.
Chrome is migrating to unified plan from plan-b
If you want more details about unified plan you can see this blog - https://www.callstats.io/blog/what-is-unified-plan-and-how-will-it-affect-your-webrtc-development
Related
I'm trying to fill the path of this Path in an SVG which is a hexagon.
<Path d="M205 3521 l-200 -117 -2 -240 -3 -239 204 -117 204 -116 204 118 203 118 0 243 0 243 -195 113 c-107 62 -199 112 -205 112 -5 0 -100 -53 -210 -118z m395 -38 l170 -98 -3 -214 -2 -214 -178 -104 -179 -104 -179 103 -179 102 0 211 1 210 177 102 c97 56 183 103 189 103 7 0 89 -44 183 -97z" fill="red" />
I'm using React Native but the syntax is the same. Filling the path red applies to the outside border.
You already have a path with a fill. However it's a path with a hole.
One solution to your problem would be deleting everything in your path's d attribute from m395 -38 to the end. (This is the hole part)
svg{border:1px solid;width:85vh;}
<svg viewBox ="0 2690 820 950">
<path id = "kk"
d="M205 3521
l-200 -117
-2 -240
-3 -239
204 -117
204 -116
204 118
203 118
0 243
0 243
-195 113
c-107 62 -199 112 -205 112
-5 0 -100 -53 -210 -118z
" fill="red" />
</svg>
However if you need to keep the actual shape and fill it with a different color, in this case you may copy everything in your path's d from the beginning to the first z and create an other path using the copied part as the d attribute. Put this new path before the old one.
svg{border:1px solid;width:85vh}
<svg viewBox ="0 2690 820 950">
<path d="M205 3521
l-200 -117
-2 -240
-3 -239
204 -117
204 -116
204 118
203 118
0 243
0 243
-195 113
c-107 62 -199 112 -205 112
-5 0 -100 -53 -210 -118z" fill="skyBlue"/>
<path
d="M205 3521
l-200 -117
-2 -240
-3 -239
204 -117
204 -116
204 118
203 118
0 243
0 243
-195 113
c-107 62 -199 112 -205 112
-5 0 -100 -53 -210 -118z
m395 -38
l170 -98
-3 -214
-2 -214
-178 -104
-179 -104
-179 103
-179 102
0 211
1 210
177 102
c97 56 183 103 189 103
7 0 89 -44 183 -97z" fill="red" />
</svg>
have a schema with 9 fields and i want to take only two fields(6,7 i.e $5,$6) and i want to calculate the average of $5 and i want to sort the $6 in ascending order so how to do this task can some one help me.
Input Data:
N368SW 188 170 175 17 -1 MCO MHT 1142
N360SW 100 115 87 -10 5 MCO MSY 550
N626SW 114 115 90 13 14 MCO MSY 550
N252WN 107 115 84 -10 -2 MCO MSY 550
N355SW 104 115 85 -1 10 MCO MSY 550
N405WN 113 110 96 14 11 MCO ORF 655
N456WN 110 110 92 24 24 MCO ORF 655
N743SW 144 155 124 7 18 MCO PHL 861
N276WN 142 150 129 -2 6 MCO PHL 861
N369SW 153 145 134 30 22 MCO PHL 861
N363SW 151 145 137 5 -1 MCO PHL 861
N346SW 141 150 128 51 60 MCO PHL 861
N785SW 131 145 118 -15 -1 MCO PHL 861
N635SW 144 155 127 -6 5 MCO PHL 861
N242WN 298 300 276 68 70 MCO PHX 1848
N439WN 130 140 111 -4 6 MCO PIT 834
N348SW 140 135 124 7 2 MCO PIT 834
N672SW 136 135 122 9 8 MCO PIT 834
N493WN 151 160 136 -9 0 MCO PVD 1073
N380SW 170 155 155 13 -2 MCO PVD 1073
N705SW 164 160 147 6 2 MCO PVD 1073
N233LV 157 160 143 1 4 MCO PVD 1073
N786SW 156 160 139 6 10 MCO PVD 1073
N280WN 160 160 146 1 1 MCO PVD 1073
N282WN 104 95 81 10 1 MCO RDU 534
N694SW 89 100 77 3 14 MCO RDU 534
N266WN 94 95 82 9 10 MCO RDU 534
N218WN 98 100 77 12 14 MCO RDU 534
N355SW 47 50 35 15 18 MCO RSW 133
N388SW 44 45 30 37 38 MCO RSW 133
N786SW 46 50 31 4 8 MCO RSW 133
N707SA 52 50 33 10 8 MCO RSW 133
N795SW 176 185 153 -9 0 MCO SAT 1040
N402WN 176 185 161 4 13 MCO SAT 1040
N690SW 123 130 107 -1 6 MCO SDF 718
N457WN 135 130 105 20 15 MCO SDF 718
N720WN 144 155 131 13 24 MCO STL 880
N775SW 147 160 135 -6 7 MCO STL 880
N291WN 136 155 122 96 115 MCO STL 880
N247WN 144 155 127 43 54 MCO STL 880
N748SW 179 185 159 -4 2 MDW ABQ 1121
N709SW 176 190 158 21 35 MDW ABQ 1121
N325SW 110 105 97 36 31 MDW ALB 717
N305SW 116 110 90 107 101 MDW ALB 717
N403WN 145 165 128 -6 14 MDW AUS 972
N767SW 136 165 125 59 88 MDW AUS 972
N730SW 118 120 100 28 30 MDW BDL 777
i have written the code like this but it is not working properly:
a = load '/path/to/file' using PigStorage('\t');
b = foreach a generate (int)$5 as field_a:int,(chararray)$6 as field_b:chararray;
c = group b all;
d = foreach c generate b.field_b,AVG(b.field_a);
e = order d by field_b ASC;
dump e;
I am facing error at order by:
grunt> a = load '/user/horton/sample_pig_data.txt' using PigStorage('\t');
grunt> b = foreach a generate (int)$5 as fielda:int,(chararray)$6 as fieldb:chararray;
grunt> describe #;
b: {fielda: int,fieldb: chararray}
grunt> c = group b all;
grunt> describe #;
c: {group: chararray,b: {(fielda: int,fieldb: chararray)}}
grunt> d = foreach c generate b.fieldb,AVG(b.fielda);
grunt> e = order d by fieldb ;
2017-01-05 15:51:29,623 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025:
<line 6, column 15> Invalid field projection. Projected field [fieldb] does not exist in schema: :bag{:tuple(fieldb:chararray)},:double.
Details at logfile: /root/pig_1483631021021.log
I want output like(not related to input data):
(({(Bharathi),(Komal),(Archana),(Trupthi),(Preethi),(Rajesh),(siddarth),(Rajiv) },
{ (72) , (83) , (87) , (75) , (93) , (90) , (78) , (89) }),83.375)
If you have found the answer, best practice is to post it so that others referring to this can have a better understanding.
I have a sample records for a particular trialid from a table like below:
Personid Trial orgid Orgtypeid
90 106 72001 4
682 106 188787 4
717 106 187761 4
830 106 64776 4
845 106 71795 3
1130 106 215441 22
1199 106 25148 22
1488 106 84256 4
1656 106 31456 22
2427 106 71864 22
2535 106 40687 3
2558 106 93306 4
2792 106 114207 18
3105 106 13967 22
3267 106 22634 18
3352 106 22
3516 106 9847 12
3981 106 2341 4
3993 106 126593 3
4025 106 29789 4
4395 106 75068 3
4433 106 17622 3
4662 106 45286 4
4887 106 18350 22
5272 106 46979 18
5381 106 82499 3
5518 106 72958 3
5593 106 93363 3
5634 106 49553 18
5686 106 82504 22
6036 106 79250 3
6047 106 46228 4
6260 106 52492 4
6365 106 31196 3
6443 106 1980 4
6492 106 72940 3
6539 106 45287 4
6641 106 124592 4
6659 106 184510 4
6768 106 3950 4
7172 106 93065 22
7183 106 71916 4
7285 106 181783 22
8030 106 31044 4
8071 106 84539 22
8350 106 73263 4
8395 106 14974 4
8612 106 33084 12
8785 106 52983 4
8837 106 18335 4
8852 106 182042 3
8902 106 191396 3
8909 106 44678 12
8982 106 19
9318 106 149996 4
9538 106 31827 4
9570 106 85130 4
10028 106 159192 18
10105 106 38784 4
10226 106 80419 4
10459 106 79827 22
10518 106 71836 12
10733 106 71876 4
10843 106 78913 4
10853 106 140548 22
10880 106 71923 4
11301 106 72020 4
11522 106 33167 3
11595 106 71624 22
11699 106 91917 4
11714 106 93150 3
12200 106 34207 4
12226 106 71649 4
12308 106 136005 4
12832 106 71841 4
13468 106 71580 4
13745 106 92433 4
13907 106 164068 3
13935 106 39943 3
14122 106 130995 3
14146 106 101833 18
14520 106 38050 4
14542 106 39616 4
14560 106 85695 3
14712 106 95460 4
14806 106 30621 22
15479 106 72778 4
15549 106 130557 3
15790 106 39652 4
15982 106 52193 3
16046 106 62592 4
16064 106 75808 18
16268 106 51957 12
16908 106 78731 4
17198 106 53941 3
17248 106 44436 18
17830 106 80244 4
18585 106 396 22
18621 106 77528 4
18723 106 35721 22
19112 106 4928 4
19413 106 172057 3
19729 106 10096 3
19772 106 181063 3
19774 106 9858 4
19849 106 213470 4
19880 106 184341 4
20051 106 10388 3
20330 106 964 22
20337 106 162349 4
20574 106 216255 4
20619 106 42352 4
20666 106 10830 4
20746 106 19308 3
21123 106 114302 22
21190 106 41878 22
21261 106 33084 4
21264 106 84340 3
21651 106 52210 4
21682 106 167293 3
21775 106 80419 4
21930 106 154783 4
22017 106 78213 12
22026 106 11815 4
22924 106 57492 4
23149 106 46928 4
23775 106 141288 22
23831 106 162443 3
24887 106 9831 3
25279 106 71598 3
25357 106 75448 22
25468 106 98249 4
25651 106 4
25807 106 93306 4
26318 106 44212 22
26347 106 1143 3
26551 106 53264 3
27414 106 18
27424 106 126205 4
27556 106 147586 3
27582 106 145836 3
27774 106 7471 3
28004 106 119457 22
28684 106 3058 22
28686 106 16625 3
30026 106 144890 3
30031 106 32934 3
30035 106 40801 4
30039 106 177508 22
30238 106 72646 4
30430 106 82810 4
30471 106 46299 3
30944 106 184183 4
31482 106 42368 4
32296 106 196312 4
33801 106 13704 3
34903 106 347 3
35332 106 206713 3
36386 106 71612 4
38208 106 36293 3
38749 106 77258 18
38827 106 72071 4
39561 106 140106 4
39722 106 46471 3
39849 106 125641 18
40599 106 53061 4
42614 106 28447 18
42691 106 183045 22
43152 106 73580 19
43638 106 10321 3
47110 106 29789 4
47112 106 98308 4
48608 106 45292 4
48856 106 6700 4
48947 106 185045 3
48948 106 73515 4
49642 106 164536 4
49735 106 78342 4
50352 106 75696 12
50353 106 33699 4
51985 106 82265 12
52671 106 142891 4
52777 106 84193 22
52778 106 18406 3
53561 106 11674 3
53563 106 81427 4
53564 106 28320 4
54409 106 27689 4
54411 106 33761 3
54412 106 11695 22
54470 106 39649 4
54858 106 91972 22
55129 106 73820 4
55130 106 11815 22
55566 106 203178 9
55569 106 157517 4
55570 106 124075 4
56871 106 63954 3
57726 106 13484 3
60131 106 75956 3
61074 106 21444 3
61335 106 24403 4
63049 106 42236 3
65447 106 43170 22
65450 106 39728 22
65453 106 22211 22
65454 106 46546 3
67232 106 27052 18
68494 106 47882 3
68495 106 816 22
68936 106 106618 22
70192 106 173595 3
70193 106 115501 22
70197 106 34341 3
72606 106 18418 4
73104 106 144374 19
73685 106 51520 22
74397 106 102254 3
76808 106 44391 18
81334 106 34705 4
82894 106 45223 4
89882 106 154988 3
93661 106 51278 4
100468 106 4
100694 106 45358 18
100722 106 22
100789 106 9
100853 106 3
101307 106 159932 12
101326 106 39675 3
103620 106 48956 3
103668 106 44771 22
104706 106 142662 4
105923 106 76883 10
105961 106 75959 10
106555 106 72111 10
112996 106 71618 10
128637 106 138211 22
170771 106 117977 4
199749 106 72703 22
202961 106 32966 4
348476 106 49553 4
420379 106 21642 22
421422 106 24547 4
Here the personid is the id of the person. Trailid is the id we are looking at, orgid is the id of an organization, orgtypeid is the type of org.
Now what we want is for each group of trialid(this example only has one trailid but the base table has multiple trialids),I want to create 6 new variables as indicated below:
Non Academic_fraction_orgs Academic_frac_orgs Others_frac_orgs Non Academic_fraction_ppl Academic_frac_ppl Others_frac_ppl
orgtypeid : 9, 18, 3 are grouped as Academic, while 4,22,17 are grouped as Non-Academic while remaining are grouped as Others. Now we need the above variables with following values:
Non Academic_fraction_orgs: Total orgids in Non-Academic in that trialid/Total Orgids in that trialid
Academic_fraction_orgs: Total orgids in Academic in that trialid/Total Orgids in that trailed
Others_frac_orgs: Total orgids in Other in that trialid/Total Orgids in that trailed
Non Academic_fraction_ppl: Total distinct Personid in Non-Academic in that trialid/Total Orgids in that trailed
Academic_fraction_ppl: Total distinct Personid in Academic in that trialid/Total Orgids in that trailed
and so on..
How to get this done in sql.
EDIT:
strorganizationtype is the string of respective orgtypeid.
select trialid, count(CASE WHEN strorganizationtype in ('Academic Institution - office','Academic Institution - research facility',
'Academic Hospital / Clinic')
THEN 1 ELSE 0 END) /(count(*)*1.0) as Academic_frac_orgs,
count(CASE WHEN strorganizationtype in ('Medical Practice','Clinical Trial Center',
'Rehabilitation/Extended Care Facility','Non-academic Hospital / Clinic')
THEN 1 Else 0 END)/(count(*)*1.0) as Non_Academic_fraction_orgs,
count(CASE WHEN strorganizationtype in ('Company','Other')
THEN 1 ELSE 0 END)/(count(*)*1.0) as Other_fraction_orgs
from table
group by trailid
order by trialid
The problem is that count(CASE WHEN strorganizationtype in ('Company','Other')
THEN 1 ELSE 0 END) is counting all records for that trial and not those which belong to this particular case statement. I need a variable which is a fraction of records which belong to this group of orgs by total orgs which belong to that group.
I have an rsa.PublicKey object (retrieved from an rsa.PrivateKey). And I'm trying to export it into the OpenSSH format, to display it in a web page.
I've noticed the go.crypto/ssh library, which seems to be doing this.
And there's the discussion about it's implementation (it's actually exactly what I need to do)
Unfortunately, I'm getting a bit stuck, as the byte array returned is in an unknown encoding and I can't just transform it to a string to display it.
func PublicKey(rsaKey rsa.PublicKey) string {
key, _ := ssh.NewPublicKey(&rsaKey)
marshalled := ssh.MarshalPublicKey(key)
return string(marshalled)
}
This seems to work as it adds the ssh-rsa at the beginning of the string. However, most characters aren't recognized.
Here's the bytes array I'm retrieving for a lambda public key:
[0 0 0 7 115 115 104 45 114 115 97 0 0 0 3 1 0 1 0 0 0 65 0 178 153 15 73 196 125 250 140 212 0 174 106 77 27 138 59 106 19 100 43 35 242 139 0 59 251 151 121 10 222 154 76 200 43 139 42 129 116 125 222 192 139 98 150 229 58 8 195 49 104 126 242 92 75 244 147 107 161 192 230 4 30 157 21]
Any hint on properly displaying this bytes array as a string?
Marshaling a key is for the wire format. You just need to base64 encode the bytes:
base64.StdEncoding.EncodeToString(marshalled) + "\n"
I have 3 tables: Deliveries, IssuedWarehouse, ReturnedStock.
Deliveries: ID, OrderNumber, Material, Width, Gauge, DelKG
IssuedWarehouse: OrderNumber, IssuedKG
ReturnedStock: OrderNumber, IssuedKG
What I'd like to do is group all the orders by Material, Width and Gauge and then sum the amount delivered, issued to the warehouse and issued back to stock.
This is the SQL that is really quite close:
SELECT
DELIVERIES.Material,
DELIVERIES.Width,
DELIVERIES.Gauge,
Count(DELIVERIES.OrderNo) AS [Orders Placed],
Sum(DELIVERIES.DeldQtyKilos) AS [KG Delivered],
Sum(IssuedWarehouse.[Qty Issued]) AS [Film Issued],
Sum([Film Retns].[Qty Issued]) AS [Film Returned],
[KG Delivered]-[Film Issued]+[Film Returned] AS [Qty Remaining]
FROM (DELIVERIES
INNER JOIN IssuedWarehouse
ON DELIVERIES.OrderNo = IssuedWarehouse.[Order No From])
INNER JOIN [Film Retns]
ON DELIVERIES.OrderNo = [Film Retns].[Order No From]
GROUP BY Material, Width, Gauge, ActDelDate
HAVING ActDelDate Between [start date] And [end date]
ORDER BY DELIVERIES.Material;
This groups the products almost perfectly. However if you take a look at the results:
Material Width Gauge Orders Placed Delivered Qnty Kilos Film Issued Film Returned Qty Remaining
COEX-GLOSS 590 75 1 534 500 124 158
COEX-MATT 1080 80 1 4226 4226 52 52
CPP 660 38 8 6720 2768 1384 5336
CPP 666 47 1 5677 5716 536 497
CPP 690 65 2 1232 717 202 717
CPP 760 38 3 3444 1318 510 2636
CPP 770 38 4 4316 3318 2592 3590
CPP 786 38 2 672 442 212 442
CPP 800 47 1 1122 1122 116 116
CPP 810 47 1 1127 1134 69 62
CPP 810 47 2 2250 1285 320 1285
CPP 1460 38 12 6540 4704 2442 4278
LD 975 75 1 502 502 182 182
LDPE 450 50 1 252 252 50 50
LDPE 520 70 1 250 250 95 95
LDPE 570 65 2 504 295 86 295
LDPE 570 65 2 508 278 48 278
LDPE 620 50 1 252 252 67 67
LDPE 660 50 1 256 256 62 62
LDPE 670 75 1 248 248 80 80
LDPE 690 47 1 476 476 390 390
LDPE 790 38 2 2104 1122 140 1122
LDPE 790 50 1 286 286 134 134
LDPE 790 50 1 250 250 125 125
LDPE 810 30 1 4062 4062 100 100
LDPE 843 33 1 408 408 835 835
LDPE 850 80 1 412 412 34 34
LDPE 855 30 1 740 740 83 83
LDPE 880 60 1 304 304 130 130
LDPE 900 70 2 1000 650 500 850
LDPE 1017 60 1 1056 1056 174 174
OPP 25 1100 1 381 381 95 95
OPP 1000 30 2 1358 1112 300 546
OPP 1000 30 1 1492 1491 100 101
OPP 1200 20 1 418 417 461 462
PET 760 12 3 1227 1876 132 -517
You'll see that there are some materials that have the same width and gauge yet they are not grouped. I think this is because the delivered qty is different on the orders. For example:
Material Width Gauge Orders Placed Delivered Qnty Kilos Film Issued Film Returned Qty Remaining
LDPE 620 50 1 252 252 67 67
LDPE 660 50 1 256 256 62 62
I would like these two rows to be grouped. They have the same material, width and gauge but the delivered qty is different therefore it hasn't grouped it.
Can anyone help me group these strange rows?
Your "problem" is that the deliveries occurred on different dates, and you're grouping by ActDelDate so the data splits, but because you haven't selected the ActDelDate column, this isn't obvious.
The fix is: Remove ActDelDate from the group by list
You should also remove the unnecessary brackets around the first join, and change
HAVING ActDelDate Between [start date] And [end date]
to
WHERE ActDelDate Between [start date] And [end date]
and have it before the GROUP BY
You are grouping by the delivery date, which is causing the rows to be split. Either omit the delivery date from the results and group by, or take the min/max of the delivery date.