/usr/bin/cvlc -d --loop --repeat rtsp://*.*.*.*/mpeg4/media.amp --http-reconnect --no-sout-audio --sout '#transcode{vcodec=FLV1,vb=4096,fps=30,sfilter=logo}:std{access=http{mime=video/x-flv},dst=*.*.*.*:8080/live.flv,mux=ffmpeg{mux=flv}}'
UDP,
LZO,
TLS,
Auth without login/pass
public enum DamageType { Melee, Range, Magic }
public class Monster
{
public double Health { get; private set; }
public double MeleeDamage { get; private set; }
public double RangeDamage { get; private set; }
public double MagicDamage { get; private set; }
public DamageType FavoriteDamageType { get; private set; }
public Monster(double health, double meleeDamage, double rangeDamage, double magicDamage, DamageType favoriteDamageType)
{
Health = health;
MeleeDamage = meleeDamage;
RangeDamage = rangeDamage;
MagicDamage = magicDamage;
FavoriteDamageType = favoriteDamageType;
}
public void AttackTo(Monster monster, DamageType damageType)
{
switch (damageType) // используется switch
{
case MonsterType.Melee: monster.Health -= MeleeDamage; break;
case MonsterType.Range: monster.Health -= RangeDamage; break;
case MonsterType.Magic: monster.Health -= MagicDamage; break;
}
}
public void AttackTo(Monster monster)
{
AttackTo(monster, FavoriteDamageType);
}
}
public class Monster
{
public double Health { get; set; }
public double MeleeDamage { get; private set; }
public double RangeDamage { get; private set; }
public double MagicDamage { get; private set; }
public IDamageStrategy FavoriteDamageStrategy { get; private set; }
public Monster(double health, double meleeDamage, double rangeDamage, double magicDamage, IDamageStrategy favoriteDamageStrategy)
{
Health = health;
MeleeDamage = meleeDamage;
RangeDamage = rangeDamage;
MagicDamage = magicDamage;
FavoriteDamageStrategy = favoriteDamageStrategy;
}
public void AttackTo(Monster monster, IDamageStrategy damageStrategy)
{
damageStrategy.Attack(this, monster); // не используется switch
}
public void AttackTo(Monster monster)
{
AttackTo(monster, FavoriteDamageStrategy);
}
}
public interface IDamageStrategy
{
void Attack(Monster attacker, Monster defender);
}
public class MeleeDamageStrategy : IDamageStrategy
{
public void Attack(Monster attacker, Monster defender)
{
defender.Health -= attacker.MeleeDamage;
}
}
public class RangeDamageStrategy : IDamageStrategy
{
public void Attack(Monster attacker, Monster defender)
{
defender.Health -= attacker.RangeDamage;
}
}
public class MagicDamageStrategy : IDamageStrategy
{
public void Attack(Monster attacker, Monster defender)
{
defender.Health -= attacker.MagicDamage;
}
}
<comp :foo.sync="bar" :baz.sync="xyz"></comp>
<comp :foo="bar" @update:foo="val => bar = val" :baz="xyz" @update:baz="val => xyz = val"></comp>
public static void Main();
public static int Main();
public static void Main(string[] args);
public static int Main(string[] args);
public static Task Main();
public static Task<int> Main();
public static Task Main(string[] args);
public static Task<int> Main(string[] args);
var vm = new Vue({
el: '#example',
data: {
message: 'Hello'
},
computed: {
// a computed getter
reversedMessage: function () {
// `this` points to the vm instance
return this.message.split('').reverse().join('')
}
}
})
function iqTest(numbers) {
return numbers
.split(' ')
.map((v, i) => ({v: v % 2, i: i + 1}))
.find(({v}, i, arr) => i !== 0 && v !== arr[i - 1].v)
.i;
}