text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Cadenza;
using Gablarski.Audio;
using Gablarski.Client;
using Gablarski.Clients.Persistence;
using Gablarski.Clients.Windows.Properties;
using Gablarski.Messages;

namespace Gablarski.Clients.Windows
{
	public class UserTreeView
		: TreeView
	{
		public UserTreeView()
		{
			this.AllowDrop = true;

			this.ImageList = new ImageList
			{
				TransparentColor = Color.Transparent,
				ImageSize = new Size (16, 16),
				ColorDepth = ColorDepth.Depth24Bit
			};

			this.ImageList.Images.Add ("server",	Resources.ServerImage);
			this.ImageList.Images.Add ("connecting", Resources.HourglassImage);
			this.ImageList.Images.Add ("channel",	Resources.ChannelImage);
			this.ImageList.Images.Add ("silent",	Resources.SoundNoneImage);
			this.ImageList.Images.Add ("talking",	Resources.SoundImage);
			this.ImageList.Images.Add ("music",		Resources.MusicImage);
			this.ImageList.Images.Add ("muted",		Resources.SoundMuteImage);
			this.ImageList.Images.Add ("mutedmic",	Resources.CaptureMuteImage);
			this.ImageList.Images.Add ("afk",		Resources.UserAFKImage);
		}

		[Browsable (false)]
		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
		public GablarskiClient Client
		{
			get { return this.client; }
			set
			{
				if (this.client != null)
				{
					this.client.CurrentUser.PermissionsChanged -= OnPermissionsChanged;
					this.client.Users.UserMuted -= OnUserMuted;
					this.client.Users.UserIgnored -= OnUserMuted;
					this.client.Sources.AudioSourceMuted -= OnSourceMuted;
				}

				this.client = value;
				this.client.CurrentUser.PermissionsChanged += OnPermissionsChanged;
				this.client.Users.UserMuted += OnUserMuted;
				this.client.Users.UserIgnored += OnUserMuted;
				this.client.Sources.AudioSourceMuted += OnSourceMuted;
			}
		}

		[Browsable (false)]
		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
		public ServerEntry Server
		{
			get;
			set;
		}

		private void OnUserMuted (object sender, UserMutedEventArgs e)
		{
			TreeNode node;
			if (!this.userNodes.TryGetValue (e.User, out node))
				return;

			if (!e.Unmuted)
				MarkMuted (e.User);
			else
				MarkSilent (e.User, true);

			SetupUserContext (node);
		}

		private void OnSourceMuted (object sender, AudioSourceMutedEventArgs e)
		{
			if (!e.Unmuted)
				MarkMuted (e.Source);
			else
				MarkSilent (e.Source);

			SetupUserContext (userNodes[this.client.Users[e.Source.OwnerId]]);
		}

		public void SetServerNode (TreeNode node)
		{
			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<TreeNode>)SetServerNode, node);
				return;
			}

			this.BeginUpdate();

			this.Nodes.Clear();
			this.serverNode = node;

			if (!String.IsNullOrEmpty (node.ImageKey))
			{
				this.serverNode.ImageKey = "server";
				this.serverNode.SelectedImageKey = "server";
			}

			this.Nodes.Add (node);

			this.EndUpdate();
		}

		public void AddChannel (IChannelInfo channel)
		{
			if (channel == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<ChannelInfo>)this.AddChannel, channel);
				return;
			}

			var parent = this.serverNode.Nodes;
			if (channel.ParentChannelId != 0)
			{
				var pair = channelNodes.FirstOrDefault (kvp => kvp.Key.ChannelId == channel.ParentChannelId);
				if (!pair.Equals (default(KeyValuePair<ChannelInfo, TreeNode>)))
					parent = pair.Value.Nodes;
			}

			var node = parent.Add (channel.ChannelId.ToString(), channel.Name);
			node.Tag = channel;
			node.ImageKey = "channel";
			node.SelectedImageKey = "channel";

			SetupChannelContext (node);

			this.channelNodes.Add (channel, node);
		}

		public void AddUser (IUserInfo user, IEnumerable<AudioSource> sources)
		{
			if (user == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<IUserInfo, IEnumerable<AudioSource>>)this.AddUser, user, sources);
				return;
			}

			var channelPair = this.channelNodes.FirstOrDefault (c => c.Key.ChannelId == user.CurrentChannelId);
			if (channelPair.Equals (default(KeyValuePair<ChannelInfo,TreeNode>)))
				return;

			string displayName = user.Nickname;
			if (!user.Comment.IsNullOrWhitespace())
				displayName += " (" + user.Comment + ")";

			var node = channelPair.Value.Nodes.Add (displayName);
			node.Tag = user;

			string imageKey = "silent";
			if (user.IsMuted)
				imageKey = "muted";
			else if ((user.Status & UserStatus.AFK) == UserStatus.AFK)
				imageKey = "afk";
			else if ((user.Status & UserStatus.MutedSound) == UserStatus.MutedSound)
				imageKey = "muted";
			else if ((user.Status & UserStatus.MutedMicrophone) == UserStatus.MutedMicrophone)
				imageKey = "mutedmic";
			else if (this.client.Users.GetIsIgnored (user))
				imageKey = "muted";

			node.ImageKey = node.SelectedImageKey = imageKey;

			SetupUserContext (node);

			this.userNodes[user] = node;

			if (Settings.DisplaySources)
			{
				foreach (var source in sources)
					AddSource (source);
			}

			node.Parent.Expand();
		}

		public void AddSource (AudioSource source)
		{
			if (source == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<AudioSource>)this.AddSource, source);
				return;
			}

			var user = Client.Users[source.OwnerId];
			if (user == null)
				return;

			TreeNode userNode;
			if (!this.userNodes.TryGetValue (user, out userNode))
				return;

			var snode = userNode.Nodes.Add (source.Name);
			snode.Tag = source;
			snode.SelectedImageKey = snode.ImageKey = (!source.IsMuted) ? "silent" : "muted";

			SetupSourceContext (snode);

			this.sourceNodes[source] = snode;

			userNode.Expand();
		}

		public void RemoveUser (IUserInfo user)
		{
			if (user == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<IUserInfo>)this.RemoveUser, user);
				return;
			}

			if (!this.userNodes.ContainsKey (user))
				return;

			var node = this.userNodes[user];
			node.Remove();
			this.userNodes.Remove (user);

			foreach (var kvp in this.sourceNodes.Where (kvp => kvp.Key.OwnerId == user.UserId).ToList())
				sourceNodes.Remove (kvp.Key);
		}

		public void MarkTalking (IUserInfo user)
		{
			MarkTalking (user, false);
		}

		public void MarkTalking (IUserInfo user, bool ignoreStates)
		{
			if (user == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<IUserInfo, bool>)this.MarkTalking, user, ignoreStates);
				return;
			}

			TreeNode node;
			if (!userNodes.TryGetValue (user, out node) || (!ignoreStates && NodeInState (node)))
				return;

			node.ImageKey = "talking";
			node.SelectedImageKey = "talking";
			SetupUserContext (node);
		}

		public void MarkTalking (AudioSource source)
		{
			MarkTalking (source, false);
		}

		public void MarkTalking (AudioSource source, bool ignoreStates)
		{
			if (source == null)
				return;

			IUserInfo user = client.Users[source.OwnerId];
			if (user == null)
				return;

			if (InvokeRequired) {
				BeginInvoke ((Action<AudioSource, bool>)MarkTalking, source, ignoreStates);
				return;
			}

			TreeNode node;
			if (Settings.DisplaySources && sourceNodes.TryGetValue (source, out node))
				SetupUserContext (node.Parent);
			else if (userNodes.TryGetValue (user, out node))
				SetupUserContext (node);

			if (node != null && (ignoreStates || !NodeInState (node))) {
				node.ImageKey = "talking";
				node.SelectedImageKey = "talking";
			}
		}

		public void MarkMuted (AudioSource source)
		{
			if (source == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<AudioSource>)this.MarkMuted, source);
				return;
			}

			TreeNode node;
			if (!sourceNodes.TryGetValue (source, out node))
				return;

			node.SelectedImageKey = node.ImageKey = "muted";
			SetupUserContext (node.Parent);
		}

		public void MarkMuted (IUserInfo user)
		{
			if (user == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<IUserInfo>)this.MarkMuted, user);
				return;
			}

			TreeNode node;
			if (!userNodes.TryGetValue (user, out node))
				return;

			node.SelectedImageKey = node.ImageKey = "muted";
			SetupUserContext (node);
		}

		public void MarkSilent (AudioSource source)
		{
			MarkSilent (source, false);
		}

		public void MarkSilent (AudioSource source, bool ignoreStates)
		{
			if (source == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<AudioSource, bool>)this.MarkSilent, source, ignoreStates);
				return;
			}

			TreeNode node = null;
			if (source.IsMuted)
				return;

			if (Settings.DisplaySources && sourceNodes.TryGetValue (source, out node))
			{
				if (ignoreStates || !NodeInState (node.Parent))
					SetupUserContext (node.Parent);
			}
			else
			{
				IUserInfo user = client.Users[source.OwnerId];
				if (user != null && userNodes.TryGetValue (user, out node) && (ignoreStates || !NodeInState (node)))
					SetupUserContext (node);
			}

			if (node != null && (ignoreStates || !NodeInState (node)))
				node.ImageKey = node.SelectedImageKey = "silent";
		}

		public void MarkSilent (IUserInfo user)
		{
			MarkSilent (user, false);
		}

		public void MarkSilent (IUserInfo user, bool ignoreStates)
		{
			if (user == null)
				return;

			if (this.InvokeRequired)
			{
				this.BeginInvoke ((Action<IUserInfo, bool>)this.MarkSilent, user, ignoreStates);
				return;
			}

			TreeNode node;
			if (!userNodes.TryGetValue (user, out node) || (!ignoreStates && NodeInState (node)))
				return;

			node.ImageKey = node.SelectedImageKey = "silent";
			SetupUserContext (node);
		}

		public void Update (IEnumerable<IChannelInfo> channels, IEnumerable<IUserInfo> users, IEnumerable<AudioSource> sources)
		{
			if (InvokeRequired)
			{
				BeginInvoke ((Action<IEnumerable<IChannelInfo>, IEnumerable<IUserInfo>, IEnumerable<AudioSource>>)Update, channels, users, sources);
				return;
			}

			this.channelNodes.Clear();
			this.userNodes.Clear();
			this.sourceNodes.Clear();

			BeginUpdate();
			this.Nodes.Clear();
			if (this.serverNode == null)
				return;

			this.serverNode.Nodes.Clear();
			this.Nodes.Add (this.serverNode);

			foreach (var channel in channels.Where (c => c.ParentChannelId == 0))
			{
				AddChannel (channel);
				AddChannels (channels, channel);
			}

			this.serverNode.Expand();

			foreach (var user in users)
				AddUser (user, sources.Where (s => s.OwnerId == user.UserId));

			UpdateContextMenus (false);

			EndUpdate();
		}

		private TreeNode serverNode;
		private readonly Dictionary<IChannelInfo, TreeNode> channelNodes = new Dictionary<IChannelInfo, TreeNode>();
		private readonly Dictionary<IUserInfo, TreeNode> userNodes = new Dictionary<IUserInfo, TreeNode>();
		private readonly Dictionary<AudioSource, TreeNode> sourceNodes = new Dictionary<AudioSource, TreeNode>();

		private bool NodeInState (TreeNode node)
		{
			return node.ImageKey == "muted" || node.ImageKey == "mutedmic" || node.ImageKey == "afk";
		}

		protected override void DefWndProc (ref Message m)
		{
			if (m.Msg != 515)
				base.DefWndProc (ref m);
		}

		protected override void OnNodeMouseClick (TreeNodeMouseClickEventArgs e)
		{
			this.SelectedNode = e.Node;

			base.OnNodeMouseClick (e);
		}

		protected override void OnItemDrag (ItemDragEventArgs e)
		{
			var node = ((TreeNode)e.Item);
			if (node.Tag is IUserInfo)
				DoDragDrop (node, DragDropEffects.Move);

			base.OnItemDrag (e);
		}

		protected override void OnDragOver (DragEventArgs e)
		{
			e.Effect = DragDropEffects.Move;
			base.OnDragOver (e);
		}

		protected override void OnDragDrop (DragEventArgs e)
		{
			if (e.Data.GetDataPresent ("System.Windows.Forms.TreeNode", false))
			{
				TreeNode destinationNode = this.GetNodeAt (this.PointToClient (new Point (e.X, e.Y)));
				TreeNode movedNode = (TreeNode)e.Data.GetData ("System.Windows.Forms.TreeNode");

				if (destinationNode != null)
				{
					var channel = destinationNode.Tag as ChannelInfo;
					var user = movedNode.Tag as IUserInfo;
					if (channel != null && user != null)
					{
						if (user.CurrentChannelId.Equals (channel.ChannelId))
							return;

						Client.Users.Move (user, channel);
					}
				}
			}

			base.OnDragDrop (e);
		}

		protected override void OnNodeMouseDoubleClick (TreeNodeMouseClickEventArgs e)
		{
			var node = e.Node;
			if (node.Tag == null)
				return;

			ChannelInfo channel = node.Tag as ChannelInfo;
			if (e.Button != MouseButtons.Left || channel == null)
			{
				base.OnNodeMouseDoubleClick (e);
				return;
			}

			Client.Users.Move (Client.CurrentUser, channel);
		}

		private void AddChannels (IEnumerable<IChannelInfo> channels, IChannelInfo parent)
		{
			foreach (var c in channels.Where (c => c.ParentChannelId == parent.ChannelId))
			{
				this.AddChannel (c);
				this.AddChannels (channels, c);
			}
		}

		private void ContextDeleteChannelClick (object sender, EventArgs e)
		{
			Client.Channels.Delete (this.SelectedNode.Tag as ChannelInfo);
		}

		private void ContextEditChannelClick (object sender, EventArgs e)
		{
			ChannelForm editChannel = new ChannelForm (this.SelectedNode.Tag as IChannelInfo);
			if (editChannel.ShowDialog() == DialogResult.OK)
				Client.Channels.Update (editChannel.Channel);
		}

		private void ContextAddChannelClick (object sender, EventArgs e)
		{
			ChannelForm addChannel = new ChannelForm ();
			if (addChannel.ShowDialog() != DialogResult.OK)
				return;

			if (this.SelectedNode != null)
			{
				var parent = (this.SelectedNode.Tag as ChannelInfo);
				if (parent != null)
					addChannel.Channel.ParentChannelId = parent.ChannelId;
			}

			this.Client.Channels.Create (addChannel.Channel);
		}

		private void ContextIgnoreUserClick (object sender, EventArgs e)
		{
			Client.Users.ToggleIgnore ((IUserInfo)this.SelectedNode.Tag);
		}

		private void ContextIgnoreSourceClick (object sender, EventArgs e)
		{
			var s = ((AudioSource)((ToolStripItem)sender).Tag);
			if (Client.Sources.ToggleIgnore (s))
				MarkMuted (s);
			else if (!s.IsMuted)
				MarkSilent (s);

			SetupUserContext (userNodes[userNodes.Keys.FirstOrDefault (u => u.UserId == s.OwnerId)]);
			if (sourceNodes.ContainsKey (s))
				SetupSourceContext (sourceNodes[s]);
		}

		private void ContextMuteUserClick (object sender, EventArgs e)
		{
			Client.Users.ToggleMute ((IUserInfo)this.SelectedNode.Tag);
		}

		private void ContextMuteSourceClick (object sender, EventArgs e)
		{
			Client.Sources.ToggleMute (((AudioSource)((ToolStripMenuItem)sender).Tag));
		}

		private GablarskiClient client;
		private void OnPermissionsChanged (object sender, EventArgs e)
		{
			UpdateContextMenus (true);
		}

		private void SetupSourceContext (TreeNode snode)
		{
			snode.ContextMenuStrip = new ContextMenuStrip();

			var target = (AudioSource)snode.Tag;

			if (target.OwnerId != Client.CurrentUser.UserId)
			{
				AddSourceContext (snode.ContextMenuStrip.Items, target);
			}
		}

		private void AddSourceContext (ToolStripItemCollection items, AudioSource source)
		{
			if (!Client.Sources.GetIsIgnored (source))
			{
				var ignore = new ToolStripMenuItem ("Ignore '" + source.Name + "'", Resources.SoundMuteImage);
				ignore.ToolTipText = "Ignores the audio source";
				ignore.Click += ContextIgnoreSourceClick;
				ignore.Tag = source;

				items.Add (ignore);
			}
			else
			{
				var ignore = new ToolStripMenuItem ("Unignore '" + source.Name + "'", Resources.SoundImage);
				ignore.ToolTipText = "Unignores the audio source";
				ignore.Click += ContextIgnoreSourceClick;
				ignore.Tag = source;

				items.Add (ignore);
			}

			if (Client.CurrentUser.Permissions.CheckPermission (PermissionName.MuteAudioSource))
			{
				if (!source.IsMuted)
				{
					var mute = new ToolStripMenuItem ("Mute '" + source.Name + "'", Resources.SoundMuteImage);
					mute.ToolTipText = "Mutes the audio source for everyone";
					mute.Click += ContextMuteSourceClick;
					mute.Tag = source;

					items.Add (mute);
				}
				else
				{
					var mute = new ToolStripMenuItem ("Unmute '" + source.Name + "'", Resources.SoundImage);
					mute.ToolTipText = "Unmutes the audio source for everyone";
					mute.Click += ContextMuteSourceClick;
					mute.Tag = source;

					items.Add (mute);
				}
			}
		}

		private void SetupUserContext (TreeNode un)
		{
			if (this.InvokeRequired)
			{
				Invoke ((Action<TreeNode>)SetupUserContext, un);
				return;
			}

			un.ContextMenuStrip = new ContextMenuStrip();

			var target = (IUserInfo)un.Tag;

			if (!target.Comment.IsNullOrWhitespace())
			{
				var copy = new ToolStripMenuItem ("Copy comment", Resources.CopyCommentImage);
				copy.ToolTipText = "Copys the user's comment";
				copy.Click += ContextCopyUserCommentClick;
				un.ContextMenuStrip.Items.Add (copy);

				string comment = target.Comment.Trim();
				if (comment.StartsWith ("http://") || comment.StartsWith ("https://") || comment.StartsWith ("www."))
				{
					var gotourl = new ToolStripMenuItem ("Open web page", Resources.LinkImage);
					gotourl.ToolTipText = "Opens the URL in your web browser";
					gotourl.Click += ContextGotoUrlUserCommentClick;
					un.ContextMenuStrip.Items.Add (gotourl);
				}

				un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
			}

			if (!target.Equals (Client.CurrentUser))
			{
				var volume = new ToolStripMenuItem ("Adjust volume", Resources.SoundLowImage);
				volume.ToolTipText = "Allows you to set gain for the user";
				volume.Click += VolumeOnClick;
				un.ContextMenuStrip.Items.Add (volume);
			}

			ToolStripMenuItem menu = null;
			foreach (var source in Client.Sources[target])
			{
				if (menu == null)
				{
					menu = new ToolStripMenuItem ("Sources");
					un.ContextMenuStrip.Items.Add (menu);
				}

				AddSourceContext (menu.DropDown.Items, source);
			}

			un.ContextMenuStrip.Items.Add (new ToolStripSeparator());

			if (!Client.Users.GetIsIgnored (target))
			{
				var ignore = new ToolStripMenuItem ("Ignore user", Resources.SoundMuteImage);
				ignore.ToolTipText = "Ignores the user";
				ignore.Click += ContextIgnoreUserClick;

				un.ContextMenuStrip.Items.Add (ignore);
			}
			else
			{
				var ignore = new ToolStripMenuItem ("Unignore user", Resources.SoundImage);
				ignore.ToolTipText = "Unignores the user";
				ignore.Click += ContextIgnoreUserClick;

				un.ContextMenuStrip.Items.Add (ignore);
			}

			bool adminSep = false;

			if (Client.CurrentUser.Permissions.CheckPermission (PermissionName.ApproveRegistrations) && Client.ServerInfo.RegistrationMode == UserRegistrationMode.PreApproved)
			{
				if (!adminSep)
				{
					adminSep = true;
					un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
				}

				var approve = new ToolStripMenuItem ("Allow registration", Resources.UserAddImage);
				approve.ToolTipText = "Allow this user to register";
				approve.Click += ContextAllowRegistration;

				un.ContextMenuStrip.Items.Add (approve);
			}

			if (this.Client.CurrentUser.Permissions.CheckPermission (PermissionName.MuteUser))
			{
				if (!adminSep)
				{
					adminSep = true;
					un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
				}

				if (!target.IsMuted)
				{
					var mute = new ToolStripMenuItem ("Mute user", Resources.SoundMuteImage);
					mute.ToolTipText = "Mutes the user for everyone";
					mute.Click += ContextMuteUserClick;

					un.ContextMenuStrip.Items.Add (mute);
				}
				else
				{
					var mute = new ToolStripMenuItem ("Unmute user", Resources.SoundImage);
					mute.ToolTipText = "Unmutes the user for everyone";
					mute.Click += ContextMuteUserClick;

					un.ContextMenuStrip.Items.Add (mute);
				}
			}

			if (this.Client.CurrentUser.Permissions.CheckPermission (target.CurrentChannelId, PermissionName.KickPlayerFromChannel))
			{
				if (!adminSep)
				{
					adminSep = true;
					un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
				}

				var kickChannel = new ToolStripMenuItem ("Channel kick", Resources.KickImage);
				kickChannel.ToolTipText = "Kicks this user from the channel";
				kickChannel.Click += ContextChannelKick;

				un.ContextMenuStrip.Items.Add (kickChannel);
			}

			if (this.Client.CurrentUser.Permissions.CheckPermission (PermissionName.KickPlayerFromServer))
			{
				if (!adminSep)
				{
					adminSep = true;
					un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
				}

				var kickServer = new ToolStripMenuItem ("Server kick", Resources.KickImage);
				kickServer.ToolTipText = "Kicks this user from the server";
				kickServer.Click += ContextServerKick;

				un.ContextMenuStrip.Items.Add (kickServer);
			}

			if (!target.Equals (Client.CurrentUser) && this.Client.CurrentUser.Permissions.CheckPermission (PermissionName.BanUser))
			{
				if (!adminSep)
				{
					adminSep = true;
					un.ContextMenuStrip.Items.Add (new ToolStripSeparator());
				}

				var banUsername = new ToolStripMenuItem (String.Format ("Ban '{0}' ('{1}')", target.Username, target.Nickname), Resources.BanImage);
				banUsername.ToolTipText = "Bans this username from the server";
				banUsername.Click += ContextBanUsername;

				un.ContextMenuStrip.Items.Add (banUsername);
			}
		}

		private void ContextAllowRegistration (object sender, EventArgs eventArgs)
		{
			Client.Users.ApproveRegistration ((IUserInfo)this.SelectedNode.Tag);
		}

		private async void ContextBanUsername (object sender, EventArgs eventArgs)
		{
			var user = (IUserInfo)this.SelectedNode.Tag;

			await Client.Users.BanAsync (user, TimeSpan.MaxValue);
		}

		private void ContextServerKick (object sender, EventArgs e)
		{
			Client.Users.Kick ((IUserInfo)this.SelectedNode.Tag, true);
		}

		private void ContextChannelKick (object sender, EventArgs e)
		{
			Client.Users.Kick ((IUserInfo)this.SelectedNode.Tag, false);
		}

		private void VolumeOnClick (object sender, EventArgs eventArgs)
		{
			var user = (IUserInfo)this.SelectedNode.Tag;
			VolumeEntry entry = ClientData.GetVolumes (Server).FirstOrDefault (ve => ve.Username == user.Username)
				                    ?? new VolumeEntry { Username = user.Username, ServerId = Server.Id };

			VolumeForm volume = new VolumeForm (entry.Gain, v =>
			{
				foreach (var s in Client.Sources[user])
					Client.Audio.Update (s, new AudioEnginePlaybackOptions (v));
			},

			v =>
			{
				entry.Gain = v;
				ClientData.SaveOrUpdate (entry);
			});
			volume.ShowDialog (this.Parent);
		}

		private void ContextGotoUrlUserCommentClick(object sender, EventArgs e)
		{
			string url = ((IUserInfo) this.SelectedNode.Tag).Comment.Trim();

			if (url.StartsWith ("www."))
				url = "http://" + url;

			Process.Start (url);
		}

		private void ContextCopyUserCommentClick (object sender, EventArgs e)
		{
			Clipboard.SetText (((IUserInfo)this.SelectedNode.Tag).Comment);
		}

		private void SetupChannelContext (TreeNode cn)
		{
			var channel = (ChannelInfo)cn.Tag;
			cn.ContextMenuStrip = new ContextMenuStrip();

			if (this.client.CurrentUser.Permissions.CheckPermission (PermissionName.AddChannel))
			{
				var add = new ToolStripMenuItem ("Add Channel", Resources.ChannelAddImage);
				add.Click += ContextAddChannelClick;

				cn.ContextMenuStrip.Items.Add (add);
			}

			if (!channel.ReadOnly && this.Client.CurrentUser.Permissions.CheckPermission (PermissionName.EditChannel))
			{
				var edit = new ToolStripMenuItem ("Edit Channel", Resources.ChannelEditImage);
				edit.Click += ContextEditChannelClick;

				cn.ContextMenuStrip.Items.Add (edit);
			}

			if (!channel.ReadOnly && this.Client.CurrentUser.Permissions.CheckPermission (PermissionName.DeleteChannel))
			{
				var delete = new ToolStripMenuItem ("Delete Channel", Resources.ChannelDeleteImage);
				delete.Click += ContextDeleteChannelClick;

				cn.ContextMenuStrip.Items.Add (delete);
			}
		}

		private void UpdateContextMenus (bool full)
		{
			this.ContextMenuStrip = new ContextMenuStrip();

			if (this.client.CurrentUser.Permissions.CheckPermission (PermissionName.AddChannel))
			{
				var add = new ToolStripMenuItem ("Add Channel", Resources.ChannelAddImage);
				add.Click += ContextAddChannelClick;

				this.ContextMenuStrip.Items.Add (add);
			}

			if (full)
			{
				foreach (var cn in this.channelNodes.Values)
					SetupChannelContext (cn);

				foreach (var un in this.userNodes.Values)
					SetupUserContext (un);
			}
		}
	}
}


text:
by Ana S | Last Updated: February 9, 2021
Top 10 Most Expensive Dog Breeds
They say that you cannot buy love, but you can buy a dog, and it will love you unconditionally. Even though I firmly believe that people should adopt stray animals because those are the ones that desperately need your kindness and warm home in return for endless love and gratefulness, dog breeding is still a highly profitable business.
In fact, some are willing to pay thousands for certain types of dogs, even breeds that are relatively easy to obtain. Though costs will vary based on location and breeder, ten breeds often have the highest average price tag.
10. Irish Wolfhound ($1,500 to $2,000)
via Rob van de Peppel
Two thousand dollars might seem a small price to pay for the tallest of dogs, also known for a commanding appearance. Irish Wolfhounds are known for their athletic ability, especially in endurance running. And of course, there is an Irish proverb to describe their personality: "Gentle when stroked, fierce when provoked."
9. Saluki ($2,500)
Salukis look thin and graceful but possess impressive strength and endurance. The sighthound is a great hunter, lure courser and show dog and can appear smooth or coated with feathering on the legs in various colors.
8. Pharaoh Hound ($2,500 to $6,500)
via Marie Ek
As regal as its name implies, the Pharaoh Hound is "graceful, powerful, and, above all, fast." But they're also eager to please, making them excellent at hunting, obedience, and lure coursing. Most unique is the Pharaoh Hound's "blush": its nose and ears turn a deep rose color when it is happy or exciting.
7. Akita ($1,500 to $4,500)
Akitas originated in Japan but today can be found worldwide as successful show and therapy dogs. They have thick coats, plush tails, and a powerful build, along with a distinguished and courageous personality.
6. Tibetan Mastiff ($2,200 to $7,000)
The massive Tibetan Mastiff displays a "noble bearing" and a royal price tag to go with it. It is an aloof and watchful breed, with an immense double coat and a kind expression. But the breed's dignified personality can also translate into a reluctance to participate in organized activities like obedience.
5. Rottweiler ($2,000 to $8,000)
Rottweilers are as multi-talented as they are robust and powerful. The intelligent, patient breed often works as a police dog, herder, service dog, therapy dog, or obedience competitor. But Rottweilers are also protective and self-confident, making them excellent companions.
4. Lowchen ($5,000 to $8,000)
Löwchen means "little lion" in German, a fitting name for this small dog with an impressive mane of hair and talent for agility. The breed is often given a "lion" trim, too: clipped close to the skin at the hindquarters, with cuffs of hair around the ankles and a plumed tail.
3. Chow Chow ($3,000 to $8,500)
This powerful and sturdy Arctic breed used to be a working dog, but today can mostly be found as a companion and in shows. Not surprising, considering its "lion-like" appearances, immense coat, and uniquely blue or black tongue.
2. English Bulldog ($2,500 to $9,000)
This jowly breed is known for its "loose-jointed, shuffling gait and massive, short-faced head." Bulldogs are lovable and gentle, though often unaware of their size. Based on its continued placement on the AKC's list of most popular dogs in the U.S., many are willing to pay top dollar for this chubby companion.
1. Samoyed ($4,000 to $11,000)
Bright and alert, with a weather-resistant coat, Samoyeds excel at agility, herding, weight pulling, sledding, pack hiking, and conformation shows, among many others. But the Samoyed's premium price could also be due to its looks: a coat that ranges from pure white to biscuit, and black lips that curl into a well-known "Samoyed smile."
Top 10 Mythical Birds You Can find in Folklore and Legends
Top 10 Cutest Baby Panda Pictures Ever Taken
Top 10 Smallest Dog Breeds In The World
2 thoughts on "Top 10 Most Expensive Dog Breeds"
Milton E. Washington
Naomie Moore
Love them all! Work with dogs and English Bulldogs (also French), Akitas and Huskies are aplenty in my area. We also have Pittbulls and Rottweilers, which many establishments will not take. Love the talking dogs, such great fun to be had with them.
1 10. Irish Wolfhound ($1,500 to $2,000)
2 9. Saluki ($2,500)
3 8. Pharaoh Hound ($2,500 to $6,500)
4 7. Akita ($1,500 to $4,500)
5 6. Tibetan Mastiff ($2,200 to $7,000)
6 5. Rottweiler ($2,000 to $8,000)
7 4. Lowchen ($5,000 to $8,000)
8 3. Chow Chow ($3,000 to $8,500)
9 2. English Bulldog ($2,500 to $9,000)
10 1. Samoyed ($4,000 to $11,000)

redpajama_set_name: RedPajamaCommonCrawl


Give you a "behind the scenes" look at conducting a pen test, step by step.
Make it interactive – I'll post all scripts/tools/screenshots so you can play along at home!
Talk about general things you can do to secure your network from common risks we see while conducting pen tests.
Warning: this will be a lot of fun. Also, be aware that this series will get pretty heavy into technical-focused discussion and tools. However, even if you don't wear a pocket protector or have a neck beard, hang in there. I will do my best to explain everything in as conversational language as possible (because that's how I prefer to learn things too!).
It's 10 p.m. Do you know what's plugged into your network?
One of the easiest ways an attacker can discover vulnerabilities on your network is by doing what is called a port scan.
Alright, back to port scans. One popular tool that is often used to scan for open ports is called nmap. It's free and available for just about every operating system. Personally, I like to use it in conjunction with Kali Linux, because nmap comes bundled along with dozens of other helpful tools. I will be using Kali for all the exercises in this blog series, so it might be easiest to install Kali if you want to follow along.
Once you have nmap installed and you are plugged into your home network, you're ready to start scanning. Wait a minute, though. Did you notice I said "plugged into your home network?" Yeah, please don't try these activities at work – they generate a lot of network traffic and could make you very unpopular with the IT department.
Nmap – calls the scanning program into action!
Pn – don't ping IPs first, just scan 'em.
–script /usr/share/nmap/scripts/banner-plus.nse – this calls a script (get it here) which pulls a "banner" (more detailed information) from any open ports it finds.
–min-parallelism=512 – helps guarantee that the scan will finish by a certain time.
-oA MyCompany – this takes all the info gathered by the scan and dumps it to several different types of files with a prefix of MyCompany. You could call this whatever you want (Work, Home, Test, etc.).
-v – this turns on verbose logging so you can watch the details of the scan as it happens.
Open up any of these, and you might recoil a little bit at the format – it's ugly!
EyeWitness.py – calls the EyeWitness tool to action!
–f MyCompany.xml – tells EyeWitness that it will be analyzing the MyCompany.xml file, which is one of the output files we generated during the nmap scan.
–all-protocols – indicates that we want to see relevant information for any open ports, not just common ports like remote desktop or FTP.
-d /eyewitness – tells EyeWitness to dump the output into a root folder called eyewitness.
Now that we are armed with a thorough scan of our network, as well as an easy-to-read roadmap of "interesting" open ports, we can start taking things to the next level. This will involve taking a closer look at the types of services running on these ports, gathering version numbers of software packages, and probably doing a lot of Googling too. So join me next month and we'll keep peeling back the pen testing layers to figure out which of our targets may be vulnerable to attacks. Then we'll even do some actual hacking!
Conclusion? Ha! We're just getting started! But if you have questions at any point during this blog series, please do not hesitate to reach out.


text:
Saints to host Villarreal in pre-season
By SFC Media time Thu 09 Jun Saints vs Villarreal
Photo by Isabelle Field
Southampton Football Club's men's first-team will host Champions League semi-finalists Villarreal in a high-profile friendly at St Mary's this summer.
The fixture against Unai Emery's team, on Saturday 30th July (3pm BST), will mark the conclusion of Saints' pre-season programme and will form a key part of preparations for the 2022/23 Premier League campaign.
The La Liga side are coming off the back of another memorable campaign, in which they reached the final four of the Champions League, knocking out European giants Juventus and Bayern Munich before being beaten in the semi-finals by Liverpool.
That impressive run followed their Europa League triumph in the 2020/21 season, when they beat Manchester United in the final of the competition to secure the trophy.
Sat 30 Jul 3PM
St Mary's Stadium
Saints will face Villarreal ten days after returning from their training camp in Austria, during which they will face SK Austria Klagenfurt on Monday 18th July.
Details of further pre-season fixtures will be announced on southamptonfc.com in due course.
Please note that, due to the Villarreal friendly coinciding with the opening day of the EFL season, the game will be subject to the UK's broadcast blackout restrictions, meaning we will be unable to provide a live stream of that fixture for supporters.
That means the only way to ensure you can see the match is by securing your ticket, with information to follow.
Saints head to Austria for pre-season
Saints vs Villarreal Men's First team Pre-season Friendly
Saints vs Villarreal
Video: Access all areas for Villarreal friendly
A close up look at Saints' pre-season finale.
timeMon 01 Aug
All The Angles: Aribo's solo stunner Video: Hasenhüttl on final pre-season test


Geneva, Switzerland: Les editions de Bonvent, 1972. Bound in stiff glossy black and white boards. A 118 pp. book on oblong format with lots of photographs (both B&W and Color). Text in English.. First Edition. Hard Cover. Very Good ++/No Jacket - As Published.
U.S.A.: Viking Adult, 1977. Bound in brown boards, stamped in gold. With a five page accordian fold that contains actual specimens of 40 types of U.S. Woods. 160 pp. Scarce in this protected condition. . Third Edition. Hard Cover. Near Fine/Near Fine. 8vo - over 7¾" - 9¾" tall.
New York: Bonanza Books Revised edition, reprint with no date; crinkling to DW; previous owners book plate on ffep.; reference and textbook on early American furniture design and construction; illustrated with black & white blueprints and drawings; 124pp.. Reprint. Hard Cover. VG+/VG+. 4to - over 9¾" - 12" tall.
Woodbury, NY.: Barron's, 1980. Scarce volume in the "Furniture and Design" series; book store sticker on front DW flap; black & white photos and illustrations; 143pp.. First Edition. Hard Cover. Near Fine/VG Only.
New York: Weathervane Books, 1989. Reprint edition, originally published by Dutton in 1985; color photos by Carleton Palmer; foreword by Adele Ernest; 117pp.. Reprint. Hard Cover. Near Fine/Near Fine. 4to - over 9¾" - 12" tall.
New York: Winchester Press, 1978. Bound in green buckram, sans DW; DW flaps laid-in; 8 pages of color plates; over 800 black & white photos and line drawings; 242pp.. 11th Printing. Hard Cover. VG+/No Jacket. 4to - over 9¾" - 12" tall.
New York: Sterling Publishing Co., 2002. Bound in self-wraps; color and black & white illustrations; 192pp.. First Edition. Soft Cover. Near Fine/No Jacket. 4to - over 9¾" - 12" tall.
Boston: Bulfinch Press/Little, Brown and Co., 1999. Color and black & white; 166pp. A tight, clean copy in bright dust jacket. . First Edition. Hard Cover. Near Fine/Near Fine. 4to - over 9¾" - 12" tall.
Milwaukee: The Bruce Publishing Co., 1950. Describes 24 plates for different book ends; illustrated in black & white; nicked & chipped DW; off-setting to end=-papers; 99pp.. First Edition. Hard Cover. VG/Good Only.


The best place to start while employing landscaping contractor is looking at your individual needs. There ought to be an unmistakable thought of what you are interested in. When you begin glancing through magazines and different productions, you will learn of whom you may require. Then, you must ascertain that you express these thoughts to your landscaping firm. An expert may have recommendations that were most likely not thought about before, so it is critical to be somewhat adaptable. A professionally done landscaping job can massively transform the exterior appeal of a home from something boring to beautiful scenery via planting of magnificent trees and other vegetation. The firm can also make your exterior space look great; they can install swimming pools, patio, and many other things. Other than this, you can secure the administrations of a landscaping firm to give you some support of your yard. A landscaping firm comes in to enhance the look of your home and is an indispensable part in driving up the value of your home. Plenty of things should be considered while picking an organization to work with. Before a temporary worker is chosen, there are a few imperative things to be thought of when intending to have landscaping introduced or procuring an expert organization to watch over the current scene.
Some landscapers don't possess the necessary permit to partake in landscaping but have entered into an agreement with the architect in charge of the contract and are working under them. That is the primary reason it is crucial to pick a firm that has the correct licenses. Landscapers normally give a bundle of administrations from site investigation to outline and construction illustrations to the administration of establishment. Considering their variety of administrations, it implies that you are not going to require the help of another contractual worker when you require concrete pathways to get developed as they can assist you with such administrations. It is shrewd to request offers and think about costs, administrations and capabilities; it's a smart thought to get three offers to think about cost and work. All offers ought to be in composing. Don't forget that the cheapest cost isn't the best one as they can be offering shoddy services. All those that are presenting their bids must express all the works and expenses that they intend to complete and incur. Get the administrations of expert arranging contractual workers and guarantee that they have been authorized and confirmed to work.
After you are done choosing the perfect contractor, ensure that they possess in writing all the details of how they are going to perform the work. This way, you are going to be certain that you are hiring a professional.


Have you ever wondered what motivates individual charitable giving? Why do people behave in such an altruistic or seemingly altruistic manner? Eileen Ellsworth, President and CEO of Community Foundation for Northern Virginia, recently took the TEDx stage to deliver a fresh perspective on "Why we give – The need to connect and belong." In this thought-provoking presentation, Ellsworth shares a collection of eye-opening stories that reveal a new insight — that perhaps explains why people give.
In February 2018, the Community Foundation launched its first Opportunity Index for Northern Virginia. This is a data-rich dashboard for 29 separate indicators reflecting the region's health and well-being, which will be updated annually to illustrate emerging trends.
To view ""Why we give – The need to connect and belong." please visit here.


Dreamcatcher - It is said that in the night air there are good dreams and bad dreams. The dreamcatcher allows the good dreams to pass through the web and drift down to the one sleeping below. Bad dreams become hopelessly tangled in the web, where they perish at the first light of dawn.


text:
Q: How to make turn.js pages "clickable" I am currently working with turn.js to create a flipbook. And at the moment I am trying to figure out how to make pages clickable so it would change to next or previous page when you are hovering over the page.
I have tried searching for topics with similar issue but no luck so far, also I have checked the official documentation for turn.js but so far, nothing.
Question is: Is there a way to select pages and give them classes like .previous or .next to get the desired effect?
HTML

Headline

Chapter 1

Chapter 2

Chapter 3

The End

Jquery
$( ".container" ).click(function() {
  $("#flipbook").turn("next");
});

$( ".container" ).click(function() {
 $("#flipbook").turn("previous");
});

Since I have wrapped the flipbook into a container, I am currently selecting that one container for both events, what I am trying to achieve is that when you click on the left side of the book, it switches to previous page, and when I click the right side, it switches to next page.

A: When you create a flipbook using turn.js, each page has .odd or .even class.
You can use it to create a click event in order to turn next or previous page:
$('#flipbook .even').each(function() {
   $(this).parents().eq(1).click(function() { $("#flipbook").turn("previous") });
})

$('#flipbook .odd').each(function() {
   $(this).parents().eq(1).click(function() { $("#flipbook").turn("next") });
})

A: I was handling with 128 pages dynamically loaded flip-book which needed a just in time event binding as looping through the pages can be less efficient. Hence, on a wider scope, I used this.
$(function() {

  $(document).on("click", "#flipbook .even", function(event) {
     $("#flipbook").turn("previous");
  });

  $(document).on("click", " #flipbook .odd", function(event) {
     $("#flipbook").turn("next");
  });

});

This automatically binds to the newly created pages as well as avoids the need to have a loop.

redpajama_set_name: RedPajamaStackExchange


leader of the congregational prayer, salat, that the Muslims offer five times a day. It is sometimes used to refer to the head of an Islamic State.
faith and trust in Allah.
the revelations that were sent down during the time of Prophet Isa (Jesus). It is reffered to as the New Testament.
means establishing. It is similar to the adhan with the addition of a pharse that signifies that a compulsory prayer, fard, is about to begin.
the obligatory salat, prayer, after sunset later in the evening.
to seek Allah's forgiveness. It is something that must be done continuously in a Muslims life.


Hi! Sign in to let us know how Ice Cream Place was?
Jessica G. Jan 30 .
Very clean atmoshpere. They always have enough employees working and so the wait is never long. Also a large variety of flavors are available. Pricing is equal to any other ice cream shop.
SUZIE T. Aug 10 .
This is a very cute place. They have many flavors to offer. Very clean and friendly. Prices are similar to other ice cream parlors. Their ice cream was very good too!
If you've been to or used Ice Cream Place, leave a review.


text:
Central African Republic (CAR)
Congo - Kinshasa / Democratic Republic of Congo (DRC)
Home | News Saturday 13 May 2006
Sudan to set up 42 FM radio stations
May 12, 2006 (KHARTOUM) — The managing director of the Sudan Broadcasting Corporation, Amin Hassan Omar, has announced a plan to set up 42 FM radio stations, which will cover 42 towns in all the country's states.
Addressing a meeting of cultural and sport coordinators at the corporation's HQs, Omar said the national media requires perfection, specialization and not a central administration. He said the Transitional Constitution has already catered for this provision.
According to SMC service, Omar added that specialists at the corporation are now putting in place engineering standards for the radio stations to be set up in all the Sudanese states.
The specialists will also provide technical, engineering, training and capacity building advice, to make the exchange of media services between the stations and the national corporation easy.
Comments on the Sudan Tribune website must abide by the following rules. Contravention of these rules will lead to the user losing their Sudan Tribune account with immediate effect.
- No inciting violence
- No inappropriate or offensive language
- No racism, tribalism or sectarianism
- No inappropriate or derogatory remarks
- No deviation from the topic of the article
- No advertising, spamming or links
- No incomprehensible comments
Due to the unprecedented amount of racist and offensive language on the site, Sudan Tribune tries to vet all comments on the site.
There is now also a limit of 400 words per comment. If you want to express yourself in more detail than this allows, please e-mail your comment as an article to comment@sudantribune.com
The Sudan Tribune editorial team.
GOOGLE POWERED
The following ads are provided by Google. SudanTribune has no authority on it.
Latest Comments & Analysis
Who can unlock the current impasse in Sudan? 2019-07-01 06:44:52 By Luka Biong Deng Kuol Since the eruption of the Sudanese popular uprising on 19th December 2018, the protesters have made history. Not only have they unseated one of the longest-serving (...)
Victims of Sexual Violence in Sudan Deserve Justice 2019-06-19 07:16:08 by Tchérina Jérolon, and Daisy Schmitt Today, as we commemorate the International Day for the Elimination of Sexual Violence in Conflict, we demand accountability for sexual crimes committed in (...)
Ezekiel Lol reignites political begging as a Freedom of Expression 2019-06-14 22:49:39 Gatdiet Peter Here, the question is: to what extent does a politician become a "political beggar"? A politician becomes a beggar and (re)focuses on the "politics of begging" as soon as (s)he has (...)
Sudanese lawyers and Human rights defenders back calls for civil rule 2019-04-26 10:22:06 Press statement by 55 Sudanese lawyers and Human rights defenders on Sudan Sit-in and Peaceful Protest Khartoum -24/04/2019 We, the undersigned (55) Sudanese lawyers and human rights defenders, (...)
South Sudan's Lafon youth condemn killings of civilians by Pari community 2019-04-03 21:54:29 Press Statement on the Fighting between Pari/ Pacidi and Lotuko/Lokiri on 24/3/2019 Release by The Lafon County Youth Union: We, the Lafon County Youth Union hereby condemn the atrocities and (...)
Joseph Malwal Dong joined the SPLM/A -IO 2019-04-02 08:35:02 SPLM/A (IO) Press Release 1/4/2019 On Hon. Joseph Malwal Dong Joined the SPLM/A (IO) The leadership of the SPLM/A (IO) would like to seize this precious opportunity to announce to members and (...)
About Sudan Tribune
Arabic version
Copyright © 2003-2019 SudanTribune - All rights reserved.


text:
Import AI: Issue 64: What the UK government thinks about AI, DeepMind invents everything-and-the-kitchen-sink RL, and speeding up networks via mixed precision
What the UK thinks about AI:
…The UK government's Department for Digital, Culture, Media & Sport; and Department for Business, Energy & Industrial Strategy, have published an independent review on the state of AI in the UK, recommending what the UK should and shouldn't do with regards to AI.
…AI's impact on the UK economy: AI could increase the annual growth rate of the GVA in 2035 from 2.5% to 3.9%.
…Why AI is impacting the economy now: Availability of data, availability of experts with the right mix of skills, better computers.
…What the UK needs to do: Develop 'data trusts' to make it easier to share data etc, make research data machine readable, support text/data-mining "as a standard and essential tool for research". Increase the availability of PHD places studying AI by 200, get industry to fund an AI masters programme, launch an international AI Fellowship Programme for the UK (this seems to be a way to defend against the ruinous immigration effects of Brexit), promote greater diversity in the UK workforce.
…Read more: Executive Summary (HTML).
…Read more: The review's 18 main recommendations (HTML).
…Read more: Full Report (PDF).
Quote of the week (why you should study reinforcement learning):
…."In deep RL, literally nothing is solved yet," – Volodymyr Minh, DeepMind.
…From a great presentation at an RL workshop that took place in Berkeley this summer. Minh points out we'll need various 10X to 100X improvements in RL performance before we're even approaching human level.
…Check out the rest of the video lecture here.
DeepMind invents everything-and-the-kitchen-sink RL:
….Ensembles work. Take a look at pretty much any of the winning entries in a Kaggle competition and you'll typically find the key to success comes from combining multiple successful models together. The same is true for reinforcement learning, apparently, based on the scores of Rainbow, a composite system developed by DeepMind that cobbles together several recent RL techniques, like A3C, Prioritized Experience Replay, Dueling Networks, Distributional RL, and so on.
…"Their combination results in new state-of-the-art results on the benchmark suite of 57 Atari 2600 games from the Arcade Learning Environment (Bellemare et al. 2013), both in terms of data efficiency and of final performance," DeepMind writes. The new algorithm is also quite sample efficient (partially because the combination of so many techniques means it is doing more learning at each timestep).
…Notable: RAINBOW gets a score of around ~150 on Montezuma's Revenge – typical good human scores range from 2,000 to 5,000 on the game, suggesting that we'll need more structured, symbolic, explorative, or memory-intensive approaches to be able to crack it. Merely combining existing DQN extensions won't be enough.
…Read more: Rainbow: Combining Improvements in Deep Reinforcement Learning.
…Slight caveat: One thing to be aware of it that because this system gets its power from the combination of numerous, tunable sub-systems, much of the performance improvement can be explained by simply having a greater number of hyperparameter knobs which canny researchers can tune.)
Amazon speeds up machine learning with custom compilers (with a focus on the frameworks of itself and its allies):
…Amazon and the University of Washington have released the NNVM compiler, which aims to simplify and speed up deployment of AI software onto different computational substrates.
…NNVM is designed to optimize the performance of ultimately many different AI frameworks, rather than just one. Today, it supports models written in MXNet (Amazon's AI framework), along with Caffe via Core ML models (Apple's AI framework). It's also planning to add in support for Keras (a Google framework that ultimately couples to TensorFlow.) No support for TF directly at this stage, though.
…The framework is able to generate appropriate performance-enhanced interfaces between its high-level program and the underlying hardware, automatically generating LLVM IR for CPUs on x86 and ARM architectures, or being able to automatically output CUDA, OpenCL, and metal kernels for different GPUs.
…Models run via the NNVM compiler can see performance increases of 1.2X, Amazon says.
…Read more here: Introducing NNVM Compiler: A New Open End-to-End Compiler for AI Frameworks.
…Further alliances form as a consequence of TensorFlow's success:
…Amazon Web Services and Microsoft have partnered to create Gluon, an open source deep learning interface.
…Gluon a high-level framework for designing and defining machine learning models. "Developers who are new to machine learning will find this interface more familiar to traditional code, since machine learning models can be defined and manipulated just like any other data structure," Amazon writes.
…Gluon will initially be available within Apache MXNet (an Amazon-driven project), and soon in CNTK (a Microsoft framework). "More frameworks over time," Amazon writes. Though no mention of TensorFlow.
…The strategic landscape: Moves like these are driven by the apparent success of AI frameworks like TensorFlow (Google) and PyTorch and Caffe2 (Facebook) – software for designing AI systems that have gained traction thanks to a combination of corporate stewardship, earliness to market, and reasonable design. (Though TF already has its fair share of haters.) The existential threat is that if any one or two frameworks become wildly popular then their originators will be able to build rafts of complementary services that hook into proprietary systems (eg, Google offering a research cloud running on its self-designed 'Tensor Processing Units' that uses TensorFlow.) More (open source) competition is a good thing.
…Read more here: Introducing Gluon: a new library for machine learning from AWS and Microsoft.
…Check out the Gluon GitHub.
Ever wanted to turn the entirety of the known universe into a paperclip? Now's your chance!
…One of the more popular tropes within AI research is that of the paperclip maximizer – the worry that if we build a super-intelligent AI and give it overly simple objectives (eg, make paper clips), it will seek to achieve those objectives to the detriment of everything else.
…Now, thanks Frank Lantz, director of the NYU game center, it's possible to inhabit this idea, by playing a fun (and dangerously addictive) webgame.
…Maximize paperclips here.
Like reinforcement learning but dislike TensorFlow? Don't you wish there was a better way? Now there is!
…Kudos to Ilya Kostrikov at NYU for being so inspired by OpenAI Baselines to re-write the PPO, A3C, and ACKTR algorithms into PyTorch.
…Read more here on the project's GitHub page.
Want a free AI speedup? Consider Salesforce's QRNN (Quasi-Recurrent Neural Network):
…Salesforce has released a PyTorch implementation of its QRNN..
…QRNNs can be 2 to 17X faster than an (optimized) NVIDIA cuDNN LSTM baseline on tasks like language modeling, Salesforce says.
…Read more here on GitHub: PyTorch QRNN.
Half-precision neural networks, from Baidu and NVIDIA:
…AI is basically made of matrix multiplication. So figuring out how to use numbers with a slightly smaller footprint in AI software has a related massive impact on computational efficiency (though there's a tradeoff in specificity).
…Now, research from Baidu and NVIDIA details how the companies are using 16-bit rather than 32-bit floating point numbers for some AI operations.
…But if you halve the amount of bits in each number there's a risk of reducing overall accuracy to the point it damages performance of your application. Experimental results show that mixed precision doesn't have too much of a penalty, with the technology achieving good scores when used on language modeling, image generation, image classification, and so on.
…Read more: Mixed Precision Training.
Teaching robots via teleoperation takes another (disembodied) step forward:
…Berkeley robotics researchers are trying to figure out how to use the data collected during the teleoperation of robots to use as a demonstration for AI systems, letting them use human operators to teach machines to perform useful tasks.
…The research uses consumer grade virtual reality devices (Vive VR), an aging WIllow Garage PR2 robot, and custom software built for the teleoperator, to create a single system people can use to teach robots to perform tasks. The system uses a single neural network architecture that is able to map raw pixel inputs to actions.
…"For each task, less than 30 minutes of demonstration data is sufficient to learn a successful policy, with the same hyperparameter settings and neural network architecture used across all tasks."
…Tasks include: Reaching, grasping, pushing, putting a simple model plane together, removing a nail with a hammer, grasping and object and placing it somewhere, grasping an object and dropping it in a bowl then pushing the bowl, moving cloth, and performing pick and place for two objects in succession.
…Results: Competitive results with 90%+ accuracies at test time across many of the tasks, though note that pick&place for 2 objects only gets 80% (because modern AI techniques still have trouble with sequences of physical actions), and gets about ~83% on the similar task of picking up an object and dropping it into a bowl then pushing the bowl.
…(Though note that all of these tasks are accomplished with simple, oversized objects against a regular, uncluttered background. Far more work is required to make these sorts of techniques robust to the uncontrolled variety of reality.)
…Read more: Deep Imitation Learning for Complex Manipulation Tasks from Virtual Teleoperation.
Better aircraft engine prediction through ant colonies & RNNS & LSTMS, oh my!
…Research from the University of North Dakota mashes up standard deep learning components (RNNs and LSTMs), with a form of evolutionary optimization called ant colony optimization. The purpose? To better predict vibration values for an aircraft engine 1, 5, 10, and 20 seconds in the future – a useful thing to be able to predict more accurately, given its relevance to spotting problems before they down an aircraft.
…While most people are focusing on different evolutionary optimization algorithms when using deep learning (eg, REINFORCE, HYPERNEAT, NEAT, and so on), ant colony optimization is an interesting side-channel: you get a bunch of agents – 'ants' – to go and explore the problem space and, much like their real world insect counterparts, lay down synthetic pheromones for their other ant chums to follow when they find something that approximates to 'food'.
…How it all works: 'The algorithm begins with the master process generating an initial set of network designs randomly (given a user defined number of ants), and sending these to the worker processes. When the worker receives a network design, it creates an LSTM RNN architecture by creating the LSTM cells with the according input gates and cell memory. The generated structure is then trained on different flight data records using the backpropagation algorithm and the resulting fitness (test error) is evaluated and sent back along with the LSTM cell paths to the master process. The master process then compares the fitness of the evaluated network to the other results in the population, inserts it into the population, and will reward the paths of the best performing networks by increasing the pheromones by 15% of their original value if it was found that the result was better than the best in the population. However, the pheromones values are not allowed to exceed a fixed threshold of 20. The networks that did not out perform the best in the population are not penalized by reducing the pheromones along their paths.'
… The results? An RNN/LSTM baseline gets error rates of about 2.84% when projecting 1 second into the future, 3.3% for 5 seconds, 5.51% for 10 seconds, and 10.19% for 20 seconds. When they add ACO the score for the ten second prediction goes from 94.49% accurate to 95.83% accurate. A reasonable improvement, but the lack of disclosed performance figures for other time periods suggests either they ran out of resources to do it (a single rollout takes about 4 days when using ACO, they said), or they got bad scores and didn't publish them for fear of detracting from the paper (boo!).
…Read more here: Optimizing Long Short-Term Memory Recurrent Neural Networks Using Ant Colony Optimization to Predict Turbine Engine Vibration.
…Additional quirk: The researchers run some of their experiments on the North Dakota HPC rig and are able to take advantage of some of its nice networking features by using MPI and so on. Most countries have spent years investing significant amounts of money in building up large high-performance computing systems so it's intriguing to see how AI researchers can use these existing computational behemoths to further their own research.
OpenAI Bits&Pieces:
Meta-Learning for better competition:
…Research in which we extend MAML to work in scenarios where the environments and competitors are iteratively changing as well. Come for the meta-learning research, stay for the rendered videos of simulated robotic ants tussling with each other.
…Read arxiv here: Continuous Adaptation via Meta-Learning in Nonstationary and Competitive Environments.
Creating smarter agents with self-play and multi-agent competition:
…Just how powerful are existing reinforcement learning algorithms? It's hard to know, as they'll tend to fail on some environments (eg, Montezuma's Revenge), while excel at others (most Atari games). Another way to evaluate the success of these algorithms is to test their performance against successively more powerful versions of themselves, combined with simple objectives. Check out this research in which we use such techniques to teach robots to sumo wrestle, tackle each other, run, and so on.
…Emergent Complexity via Multi-Agent Competition.
[ 2031: A liquor store in a bustling Hamtramck, Detroit – rejuvenated following the success of self-driving car technology and the merger of the big three into General-Ford-Fiat, which has sufficient scale to partner with the various tech companies and hold its own against the state-backed Chinese and Japanese self-driving car titans.]
You stand there, look at the bottles, close your eyes. Run your hands over the little cameras studding your clothing, your bag, your shoes. For a second you think about turning them off. What gods don't see gods can't judge don't drink don't drink don't drink. Difficult.
"Show me what happens if I drink," you whisper quiet enough that no one else can hear.
"OK, playing forward," says the voice to you via bone conduction from an in-ear headphone.
In the top right of your vision the typical overlay of weather/emails/bank balance/data credits disappears, replaced by a view of the store from your current perspective. But the view changes. A ghostly hand of yours stretches out in the upper-right view and grabs a bottle. The view changes as the projection of you goes to the counter. The face of the teller barely resolves – it's a busy store with high staff turnover, so the generative model has just given up and decided to combine them into what people on the net call: Generic Human Face. Purchase the booze. In a pleasing MC Escher-recursion in your upper right view of your generated-future-self buying booze you can see an even smaller corner in the upper right of that generator which has your bank account. The AI correctly deducts the price of the imaginary future bottle from your imaginary future balance. You leave the liquor store and go to the street, then step into a self-driving car which takes you home. Barely any of the outside resolves, as though you're driving through fog; even the computer doesn't pay attention on your commute. Things come back into focus as you slow outside your house. Stop. Get out. Walk to the front door. Open it.
Things get bad from there. Your computer knows your house so well that everything is rendered in rich, vivid detail: the plunk of ice cubes into a tall mason jar, the glug-gerglug addition of the booze, the rapid incursion of the glass into your viewline as you down the drink whole, followed by a second. Then you pause and things start to blur because the AI has a hard time predicting your actions when you drink. So it browses through some probability distribution and shows you the thing it thinks is most likely and the thing it thinks will make you least likely to drink: ten seconds go by as it shows you a speedup of the blackout, then normal time comes back and you see a version of yourself sitting in a bathtub, hear underwater-whale-sound crying imagined and conducted into you via the bone mic. Throw your glass against the wall erupting in a cloud of shards. Then a black screen. "Rollout ended," says the AI. "Would you like to run again."
"No thanks," you whisper.
Switch your view back to reality. Reach for the shelf. And instead of grabbing the booze you grab some jerky, pistachios, and an energy bar. Go to the counter. Go home. Eat. Sleep.
Technologies that inspired this story: generative models, transfer learning, multi-view video inference systems, robot psychologists, Google Glass, GoPro.


Sorry Love Beautiful Cake Pictures Sent Online Write Name. My Name Sorry Images. Greeting Cake Sorry Name Photo. Status Sorry Love Name Pics. Sorry Cake With Name. I Love You With Sorry. Love U And Sorry Picture. Create Sorry Name Cards. Amazing Love Heart Sorry. New Sorry Love Pix. Sorry Card Sent. Sending Status Sorry. Profile Sorry Love. Free Sorry Name Love Cards. Sorry Wallpapers Free. Latest Sorry Sad Pics. Love Sorry Name DP. Your Name Sorry Cards. I Am Sorry Cake With Love. Lover Name Sorry Cakes. His Her Name Sorry Cake. BF GF Name Sorry Cakes. Love You Dear Sorry Cakes.


Sitemap-Ningbo Kaxite Sealing Materials Co., Ltd.
Can I customize my logo or package? | Can I be your agent or dealer? | Where is your factory located? | How long it will be take from Ningbo to Your factory? | How far is your factory from the airport? | How are if your factory from the City hotel? | How many staff you have in your factory? | When will you leave your factory and to have your spring festival holidays? | Which certificate you have to your equipment? | What standard of your equipment produce?


OPEC has managed to secure an output reduction deal with non-OPEC members, sending oil prices to an 18-month high. Ameera David has the details. Then, Lindsay France takes a look at Donald Trump's latest Twitter attack on a private company, this time targeting Lockheed Martin and its troubled F-35 program, and Bianca Facchinei reports on Boeing and Airbus inking jetliner deals with Iran.
After the break, Marshall Auerback, research associate at the Levy Economics Institute, talks about everything from the reported pick of Exxon CEO Rex Tillerson as Secretary of State, to Europe's bond buying program. And finally, in The Big Deal, Edward Harrison examines why the US bond market is going bear.


"The worse you're performing, the more you must work mentally and emotionally. The greatest and toughest art in golf is playing badly well. All the true greats have been masters at it."
There's no debating Jack Nicklaus had tremendous talent when it came to the game of golf. His 18 wins in golf's major events stands as a record that looks unbeatable at the moment.
manage that. He didn't allow his frustration to spiral from one hole to the next.
Think for a minute about the power in that kind of mindset. When something doesn't go the way you wanted it to today -- and we all know that things don't go exactly the way we planned or hoped they would -- how are you going to respond? Will you allow a negative performance or outcome in the morning to spill over into the rest of your day? Or will you find a way to manage your emotions and play badly well?
Today, work on developing the ability to not let single events cascade into the rest of your day. Accept that you might not be feeling your best, or at your best and rather than be frustrated or angry about it, find a way to get through your tasks as best you can.


The National Rifle Association is suing the state of Florida after Gov. Rick Scott signed Senate Bill 7026 into law, the first gun control legislation enacted in the state after the Parkland school massacre.
By the hundreds, Florida students protested and demanded gun control laws. The majority of Americans want more gun control laws. Florida passed legislation increasing the age from 18 to 21 to buy firearms in response to the slaughter of 17 Florida students.
The fact that the NRA is now suing Florida in direct opposition to the "will of the people" shows the NRA to be a BULLY, THUG, Terrorist Organization which don't give a DAMN what the American people want. They want to the cram what THEY want down the American people's throats. That's my opinion and I'm entitled to it.
Governor Malloy joins Rev. Al Sharpton to discuss the NRA and their impact on our government and how we need to get control back from them.
The NRA is always ready for their next legal battle. Cenk Uygur, Ana Kasparian, Jimmy Dore, and Brett Erlich, hosts of The Young Turks, discuss.
90% of Americans and 92% of gun owners want gun reform, but the NRA has found clever ways to block that in Washington.


text:
Tag: public health
New generation of PhD researchers to tackle the world's biggest public health issues
£5 million funding for a new PhD programme in public health economics at the University of Sheffield to address the world's most critical public health issues A new generation of 35 students will conduct research that will inform public health policy and decision making at a global level The programme will widen access to those…
Sheffield researchers lead new SIPHER consortium to drive policy reform and tackle health inequalities
A new national public health research consortium, co-led by Professor Petra Meier from ScHARR, is set to drive policy reform in order to tackle inequalities and improve the population's health. The innovative SIPHER consortium – a new centre for Systems science In Public Health Economic Research – will provide evidence to support cost-effective action across…
How Yorkshire Fit Are You? Join Yorkshire's largest health study and find out.
Whether improving your health is your top New Year's resolution or you are already a regular at the gym, have you ever wondered how fit – or unfit – you are? The University of Sheffield has now created a calculator allowing you to compare your health to the average Yorkshire man or woman. The calculator is…
Tackling Obesity in Secure Mental Health Settings
One of the first MRC funded "Proximity to Discovery" to be awarded in the Faculty involves collaborative work between ScHARR and Public Health England to explore ways of addressing a growing problem in specialised settings. People with severe mental illness are at increased risk of obesity, compared to the demographically matched population. Rates of obesity…


text:
What The Dub?! Review
If you're a fan of Jackbox party games, you'll get a kick out of What The Dub?!.
One of my personal favourites of all Jackbox's games is Quiplash. Providing players with prompts to then fill in the blanks, it encourages silliness and – when I'm playing it – utter filth. Sorry mum; it's the only real way to play. What The Dub?! from Wide Right Interactive allows for the same sort of lexical shenanigans. But this time, you're filling in the blanks from an old movie clip.
A short clip will play, complete with dialogue – but a chunk will be missing. You and your fellow players will need to come up with something to fill the gap. Sure, you could play it straight-laced if you want, thinking up the most logical phrase that the character might actually say. Or you could be completely obscene and ridiculous, and think up the funniest thing that comes to your warped little mind. Obviously, the latter leads to more hilarity.
Like Jackbox games, What The Dub?! requires each player to use their own smartphone to connect to a bespoke website. You'll type in a room code in order to connect to the correct game, and away you go. You'll need at least three people to play, and as with all games of this type, the more players on board, the more fun you're likely to have. By default one game consists of five different clips, with players voting for their favourite 'dub' between each round. The player with the most votes at the end of the game wins. You can choose to play a game with more or less clips if you wish.
Once each player has typed their 'dub' into their phone and clicked 'submit', you'll get to watch each dub play through. As to be expected, they're voiced by a jarring AI voice that isn't at all in keeping with the rest of the movie clip – but somehow that just adds to the absurdity of the game. With up to 12 players allowed in one game, you might tire of seeing the same clip a dozen times, but if your friends have come up with clever or ridiculous dubs, you're sure to laugh your way through them.
It's a shame there isn't a two-player mode, but the nature of the scoring system means you need at least three players. It makes sense, but it would be nice to simply play through a series of clips and come up with dubs without worrying about scoring and choosing a winner. Still, it's hardly a dealbreaker; just bear in mind that you'll likely need to gather some extra friends before you can play. Of course, streaming is an easy option that allows you to play remotely. As long as you can share your screen, anyone can access your game via the room code.
While my preferred way to play games like What The Dub?! is to be as rude as possible, it's not everyone's cup of tea – and for those people (or for younger players), there's a language filter that can be applied in the options. But other than that, there's not much else to fiddle with here – simply hit 'start' and get everyone to log in via their smartphones.
What The Dub?! isn't the sort of game that will keep you entertained for hours on end. But it is the sort of thing you'll pull out for half an hour at a party or gathering, and have a laugh with. With over 300 movie clips included in the game, it'll be a while until you start seeing repeats, too. The more ridiculous or rude you get, the more hilarity is likely to ensue. Needless to say, if you're a fan of Jackbox's games, then What The Dub?! is worth checking out.
What The Dub?! Review: GameSpew's Score
What The Dub?! is available on PC, PS4, Xbox One and Switch. We reviewed the PS4 version of the game (played on PS5) via a code provided by the publisher.
The Best Party Games on Xbox
The Best Party Games on PS4 (2022)
The Best Party Games on PS5
The Jackbox Party Pack 9 Review
Jackbox Party Pack 9 Gets the Party Started This October
The Best Party Games on Nintendo Switch


Meet Jesula Difficile. She is 31 and has one five year old. She has also lost two children during pregnancy. She's currently expecting again.
Her life is filled with challenges we cannot even begin to imagine. She lives close to the edge.
In spite of that she carries herself with dignity and courage. She experiences joy in the midst of her struggles. Her story is just one of many women in Haiti that bear incredibly heavy loads.
A pregnant woman is being abused by her husband. She has no one to go live with and she understands that reporting him won't accomplish anything that will result in improvements in her life.
A family of eight informs us that it is a 'non-dinner night'. They eat dinner every other night. On Friday at four p.m. they know that their next meal will be Saturday night. They're not fasting on purpose, they're fasting because their family budget allows for meals to be made and consumed approximately every-other day.
A newborn baby comes down with a high fever and no hospital with room can be found to admit the baby.
It has been a few months since Jesula joined the Prenatal program. From the day I wrote her name on her file it has become a regular part of our vernacular. Jesula translates: "Jesus is here". Difficile (difisil) translates: "difficult".
When Troy and I have our nightly debriefing and discuss the joys and sorrows from the day we tend to go round and round and round. Sometimes the best way to sum it all up is to simply add in one quick statement. "Jesula Difficile, wi?"
Pray for the justice of Jesus to come quickly.


text:
#ifndef IAUNS_RENDER_COMPONENT_CAMERA_SELECT_HPP
#define IAUNS_RENDER_COMPONENT_CAMERA_SELECT_HPP

#include <es-cereal/ComponentSerialize.hpp>

namespace gen {

struct CameraSelect
{
  enum Selection
  {
    PERSPECTIVE_CAMERA,
    ORTHOGONAL_CAMERA
  };

  // -- Data --
  Selection cam;

  // -- Functions --
  CameraSelect()
  {
    cam = PERSPECTIVE_CAMERA;
  }

  static const char* getName() {return "gen:CameraSelect";}

  bool serialize(CPM_ES_CEREAL_NS::ComponentSerialize& s, uint64_t /* entityID */)
  {
    /// Nothing needs to be serialized. This is context specific.
    int32_t camValue = static_cast<int32_t>(cam);
    if (s.isDeserializing())
    {
      s.serialize("cam", camValue);
      cam = static_cast<Selection>(camValue);
    }
    else
    {
      s.serialize("cam", camValue);
    }
    return true;
  }
};

} // namespace gen

#endif

redpajama_set_name: RedPajamaGithub


On November 6th, 2015, Syrian artist Liwaa Yazji visited UnionDocs for the New York City premiere of her film HAUNTED (Maskoon). Follow the screening, she joined a conversation with filmmaker and professor Jason Fox.
HAUNTED is a portrait of exile. It captures the experience of displacement and profound uncertainty in the midst of Syria's civil war. When the bombs fell, people escaped, leaving behind not only their homes but also innumerable memories. They were left with a physical and mental nowhere, a non-space between yesterday and tomorrow. Visiting this landscape via skype conversations and owner's tours of their devastated residences, HAUNTED tells of the loss security and of the meanings that a home has in one's life.
This screening at UnionDocs was supported by CEC Arts Link and the Vera List Center for Art and Politics, The New School, in conjunction with the exhibition and conference Abounaddara: The Right to the Image, presented at Parsons from October 22 through November 11, 2015.
Jason: Professionally you work in theater. You are a poet; and it is my understanding that this is the first time that you picked up a camera. What was the force that motivated you to start to work on this project?
Liwaa: online Yes, I come from a theater background, but it's a tricky issue because in Syria we don't have an audiovisual faculty. If you're going to be involved in drama, whether it is TV, theater, cinema or radio even, you start in the theater faculty. Theater is not the form to really fulfill what I wanted for certain projects and ideas. I knew that for the ideas that I developed, I really need to go in with a camera. That's where I started to educate myself. I went to visit friends on their shooting locations to start accumulating this kind of understanding and relation to the camera.
But I have to do it on my own. I had to learn a lot of things. I had to shoot, to work with the sound, to work as a producer: I had to work with everything – even the sculpting. I didn't have a production manager with me, so I have to do everything on my own. It was a big motivation for me to just dive in.
Jason: One of the things I admire formally about the project, is the way that it sort of collapses temporality. We have very little sense of time and progression. I am curious to hear, over how long did you shoot it?
Liwaa: The idea started in late 2011 and the archiving of stories started in 2012. Shooting started late 2012/ early 2013 and post-production started late 2013 until 2014. It was a very long process. I was not shooting every day. The situation in Syria was very difficult and I had to be very submissive to what was happening. Sometimes I am talking to people about going to do a shoot the next day, and then the next day they have gone to a different country, you know.
is urispas over the counter They have a different fate that I didn't really have any control over – things were not under my control the whole time. I had to be very flexible. I was just telling Jason today that there are stories that I really wanted to have in this film, but the moment I went to the place the whole building was not there anymore. So, that was really important for me, sadly, and this is part of the process. The whole thing started out as a very personal question: What do I do if I am myself subjected to this question? What do I do, personally, if I have to leave my home? So that's where it started. I started to talk to people before even telling them "I'm going to make a film".
Whenever I go, I just sit with people. Everybody has a plan B and that was really very sad. It was a kind of pressure that everybody was denying in Damascus. Because, the situation still in Damascus is that you have the luxury to think about this idea. Some other cities don't have the luxury to to even question: "what do we do?" – they just find themselves out in the street. So I started to see my extended family who live in a different city; I started to see that they are like, all at once fleeing without anything; and they have to start from scratch.
That was really like a nightmare for me, so I started asking people in Damascus. "What would you do if for example you went to work and you came back and the whole building was not there?" I started to pursue this idea, because it was giving me nightmares.
Then I started to archive stories. At the beginning I just wrote down stories because I thought: at a certain moment you really need to have this kind of archive. It's also a psychological archive of how people are acting and how surreal the situation is; you know, you go to a house, somebody is talking about the weather in Sweden, and just like, studying the flight plans, how to run away, how to pack your bag. So, it was very surreal; people are living here – one foot here and one in no-man's-land. It took a very long time in the process of preparing until I reached the moment where I could build bridges with the people that were moving.
Jason: In some ways, the film feels like a crowd-sourced project in the sense that many different sections are shot with many different cameras, through Skype, DSLR-footage, cameraphone footage; and at times where there is no footage. There are still photos. I would think it was coming from many different sources. Is it all coming from you? How do all these different camera choices point to the logistics of shooting this project and putting it together?
Liwaa: Actually, I didn't have permission to make the film. I started to make the film in Syria in the areas that are still under control of the regime. So, that means I am moving secretly; I am not allowed to do this. But it's not a secret anymore — I already did it. At that moment I had to hide everything I carried with me. For example, I am having a camera that I borrowed from someone on the other side of the checkpoint and then I do a shoot in that area. I pack up stuff, and take back my stuff and find a way to smuggle it through the checkpoint.
So, sometimes when I get to the area, I really cannot bring the camera in. It depends on the whole technical issue of security. Sometimes when I'm not allowed even to have my camera with me, I leave Purchase it behind. Knowing that I just need to shoot this person, there is no other way than using the mobile phone.
I have had better situations when I went to Lebanon to shoot there, but not far better. Actually, because the people in the camps are afraid, they are not free. They are also afraid of being shot, if they — you know there are secret agents — yeah, the whole security question was the issue. With the Skype couple, I really wanted to be there, but being under siege, we went immediately to what is possible. Sometimes we were only 2 km away, but I just couldn't get there.
Muhammad who is in the film shared a lot of the Skype meetings with the people. We lived together with them. We were also under siege with them. And, really, the question of technical issues was the last thing, you know, when you want to get something… whatever is there. Twice I had the luxury of having a DOP, but not the luxury of having light equipment or sound equipment. Also, it was kind of aggressive to go into the camp with all this equipment to see how miserable people are.
Audience comment: Pills buy allicin capsules at walmart This film brought back the question of how contingencies dictate what you see. If you had one camera it would have been a very different, and probably a much less interesting and complex piece of work. But we actually see, when you describe the process, you actually see it was cobbled together because it had to be cobbled together. That becomes the aesthetic.
Liwaa: That's exactly what happened. Also, sometimes I had to make the decision: if I did not have a camera with me, would I go and shoot? – I would say "no, I will go and shoot even if I…." [don't have anything but my mobile phone]. I remember once we were in Beirut. We wanted to shoot people living on the street. They were so afraid just to even see the mobile phone. So we went and talked to them.I didn't have the chance to take out a camera or anything because the mobile phone was frightening for them. So, we asked them if we could just have some words, because we wanted to communicate. In that moment, we put everything away, and just spent time talking to them. Sometimes you forget about the whole project and you approach reality as a person; you forget that there is something else that should be done in that moment.
Jason: Your comment about hearing media narratives about hundreds of thousands of Syrians migrating to Sweden, for example. You've talked about how to produce alternative forms of representation to mainstream or broadcast representations of the ongoing war in Syria. Could you talk more about how you consciously approached this project in opposition to other forms that are circulating?
Liwaa: It was also another risk; I also got used to seeing Syrian people as stereotypes in media, TV and films, and even in normal life. There is now all of a sudden a stereotype to fit in as a Syrian. You are a refugee or pathetic. As if we have been born like that. All the history and culture is gone and you just have a stereotype left of… let's not analyze what is the stereotype.
So, when I started doing this, this was not actually in my mind, but it was very clear that I would not go to the narrative that I am used to: which is talking about politics, political stands, and mainly about being pathetic. You are not crying for losing the houses. If we are crying in this film, we are crying because we want to make fun. "Take a tissue" – the Syrian spirit. I was very conscious that I would not have the film include dead bodies, or deformed people. I did not want to have Syrians as numbers. It's stories that I can identity with. If you see hundreds of people dying you wouldn't identify with them.
My colleague from Abounnadara said,: "You look at them in TV, you don't recognize faces, (…) you don't feel any kind of relation to them. It could happen to them but not to you. But if you look in the eyes of somebody you can identify yourself with, you understand him more and you feel more that you could be in his shoes." So, that was very conscious for me. I didn't want to have anybody who is lamenting pathetically or saying what we hear on the news. I wanted to escape from this.
Jason: That position also was stated in the prologue of the film. One of the subjects, who I think has an iPad open –we are not really given the context— but we get the sense that he is watching Youtube footage of something horrible and then he shuts it off.
Audience question: How did you get access to the country?
Liwaa: I can still go to Damascus. One of the protagonists is still in Syria, and that is a big responsibility for me.
Audience question: The protagonists all seemed to be in various forms of shock. They were negotiating reality on a day to day basis. How did you cross paths with your protagonists; are they people you knew already? What led you to the people that you ended up picturing?
Liwaa: Some of them were acquaintances of others. Some I just met at a certain time in 2012 in Damascus. I started to get to know people that I didn't know before. Because maybe they are the only ones left in that avenue, my circle of acquaintances started to change. Social circles are different. There is immediately a new code between people. We are here. We are under the same pressure. There is a kind of "Yes, I didn't know you before, but I know how you are passing your days – I am doing the same." So, in a way, some of them are my friends. I also got to know people to whom I developed this kind of curiosity – towards their stories. The choice of what is in the film, what is outside the film, depended on the film itself, on the artistic choices of the variations of the idea of home. If I shot somebody who did not want to show his face, I could not force him to be in the film. Also, the artistic choices of the form itself.
Liwaa: The very first shot of the film where we are looking at the building in front of us – it is just like a shaky mosaic of looking at somebody else's life. I knew from the very beginning that I wanted to go for fragments. That was the beginning of my idea that you are looking at the building, that everything is shaking and you have one glance here and one glance there. The electricity here is high, some places are red, somebody is shaving, somewhere someone is doing the dishes. Then you go back to the same room, where it is empty. So that kind of looking at a building in front of you, you are kind of looking at life, while it's — I don't want to be pessimistic — while it is fading. The last moments of looking at something is not always fixed, it is not always clear. Depicting different lives. But there is one destiny.
Audience question: Is there any way for us to understand the people that were continually trying to leave from the part of Damascus that was under the regime control?
Liwaa: It's very complicated. Where they live is exactly the bordering line between the battlefield and Damascus. So the battlefield, that is, what is called the frontier, the outskirt, where the city ends and the suburbs start. There is a very tricky situation in Damascus, because from one side they belong to the so-called "everything-is-normal" zone. From the other side, they belong to the war. At one point, before the siege, they were still under this kind of hazy situation where they can go to work, but they cannot stay late. They have some kinds of food, but not everything. They can live, but this is not a life. So, they are still on the borders of being in-war and out of war. That all changed once they were under the siege.
The free army or the opposition took over a little bit more, and so the regime laid siege to this area; people were not allowed to go outside. The area was being bombed. So, people wanted to run away, but they couldn't. The opposition cannot use heavy weapons because, for one they didn't really have them, but also because the civilians in that area are their families and neighbors. So, in this case, the regime was stronger. They wouldn't let people escape the area. That is why she says "we are used as human shields". That was the situation: they don't want to leave, but they have to leave. I understand the confusion, because every two kilometers has a different stories now in Syria. So, this is story of living on the border.
Audience question: I wanted to ask about ideas about distribution – is it already distributed across Europe?
Liwaa: Yes, I have a distributor, and the film is screened at festivals. I appreciate that it has this exposure, because I feel some kind of a mission to screen it as much as I can. I always welcome possibilities of screening and my distributor understands the idea completely. She is not going more with the money issue rather than with the ethical issues. She's very flexible with this. I have offered my film to many free screenings. I started to understand the kind of questions that the film raises, and I feel I have a mission to get this message out to as many people as possible. I guess, so far, the film is doing rather well and I am looking forward.
Jason: Going back to a previous comment about geography. No particular geographies are ascribed to individuals in the film. Individuals are not identified by name. The editing is not very causal. Can you talk about those editorial decisions that have a rather profound shape on the final work?
Liwaa : I felt like any mentioning of geographical locations is something that would also contribute to providing different stereotypes. I wanted to take out the stereotype as much as I could, so I can leave the stories of the people. That was on purpose. There is a sentence somewhere when you see a destroyed car, and I just say "is this your car?" I knew that you don't know who I am asking this question – but is it important? I guess that the image is much more important than finding out who's car this is. That was a very essential approach. Does it really matter whether he lives in Damascus or in Tartus? Would it makes any difference for you? Or would it make a stereotype? It would answer what you really know about the city. So then you will impose something rather than hearing what he is saying, that was something I really didn't want, because sometimes that creates political stereotypes. Let's say, if someone is living in Tartus it means that he is most likely to be with that regime. If you are still living in Damascus, would that mean, for example, that you are still with the regime? So all these kinds of analyses I wanted to cut off. That was the approach, really just to listen to them and what they are saying rather than helping to fill in the gaps.
Jason: Are you planning to go back to Syria? What is your next project? How will having made this project affect your ability to start a new project?
Liwaa: I still go to Syria. I try to defend this right and the advantage as much as I can. I might not be able to hold it for a long time, but I will try. For a long time, I used to work from Beirut, then back to Syria. I have been moving back and forth. I have to think about where to go next. I have another project, but I have to also be reasonable because it was supposed to be in Aleppo. I am just giving myself some time, because now Aleppo is under siege and the situation there is very bad. I want to go there to make a film, not just to jump into a battlefield with no reason and with no calculation of the situation. Right now, I cannot go there. So basically, right now I am just on stand-by. Yes, the film might make things more difficult for me, but I have to find solutions because I have no answer. In this moment, if I go back to Syria, I still can go. I have several ideas to start from, but I prefer to go to the idea I am more passionate about and unfortunately it is in a place that is not possible to enter at the moment.
I would like to say thanks to all the people in the film. The film is them. The effort of everybody and the trust of these people. It was a matter of life sometimes.
Liwaa Yazji was born in Moscow in 1977. She is a graduate of Theater Studies in Damascus/Syria and worked in the fields of theater dramaturgy, playwriting, and screen writing. She acted in Abdullatif Abulhamid's September Rain (Syria 2009) and was assistant director of Allyth Hajjo and Ammar Alani's docudrama Windows of the Soul (Syria 2011). In 2012, she published her first play "Here in the Garden" and is currently preparing the second one with the Royal Court. In 2014, her poetry book Peacefully, we leave home was published in Beirut. She wrote the screen play for the TV drama series The Brothers (2013) which was broadcast on Abu Dhabi TV, CBC Egypt, and LBC Lebanon. Haunted (Syria/Germany 2014) is Liwaa's directorial debut.


Hey, SOOO sorry I have not replied, I do not though.
Wall Triana in Madison in the small shopping center on the left after you pass Sonic.
Yeah you on fb? There's an event created for it. One this Friday at Crickets.
I think that's about as cheap as it gets. I got mine from customcarscentral.com along with the art pipes and swaybars. They're an official reseller of MD. Maybe you can get them and b2autodesigns.com to get in a price war with you, but I didn't try.
Ok sweet dude. Yeah im booked for wedding stuff this weekend. And out of town next weekend also.
Hey bro, I wanted to do a shoot with two Zs and your G. I got both Zs potentially. Also, I have two models I'd like to use in "classy clubwear" for a night shoot in either downtown Huntsville or Research park area. Somewhere between Labor day and Halloween is when I want to do the shoot. Would you want to calobrate and do it?


So…. I cut my hair. I went out and took a few pictures of myself so they aren't the best but I wanted to share. The bangs are different and most of the time I brush them to the side because I can't stand how they feel. You get the point though, I hope.
I don't like it right now. I think it is because I had it long for the last 6 years. My sister is the one that talked me into it. She told me I needed to change it up. This one is for you Kim. I guess with any change, it takes some getting used to. I had been thinking about it for awhile but I finally got the courage to make a change. I keep reminding myself, it is just hair and it grows back.
I've been thinking a lot about change lately. I know for me, some things have to change as I talked about a few posts back when I talked about confidence. I think that is what made me decide to just do it.
If you ask most people who they are they will tell you a wife, a teacher, a friend, a photographer etc… That says what you do but not really who you are. When you go through a loss such as a job or a divorce, who are you then? Change isn't easy for anyone and right now, I am figuring out how to embrace change. Change is opportunity to learn and to grow. In change, you find yourself.