Why does user’s sent messages appear on the right side instead of left? Why doesn’t it appear one below the other?

I did notice in many websites like messenger, WhatsApp, sending SMS on iphone, google hangouts, etc. The user’s sent messages appear on the right side. I’m wondering why don’t place it one below the other just like slack.

Is there any specific reason why do they follow this pattern?

For reference enter image description here

E: Sub-process /usr/bin/dpkg returned an error code (1) – but how do I find the meaningful error messages in APT’s output?

I have encountered various package management problems that cause APT commands to fail with output that ends with this line:

E: Sub-process /usr/bin/dpkg returned an error code (1) 

Occasionally other error codes may appear such as 100 which means dpkg is not there, but 1 is the most common error code.

Unfortunately this error code tells me almost nothing about what actually caused the error or how I should solve it. Almost every package management issue I see, regardless of its cause or solution, produces the same error!

So, where will I find the useful part of the output, which I can search for online or ask questions about on Ask Ubuntu?

Is it possible to see business page messages (inbox) in messenger

I'm an admin of a business page and during the day I check messages on a PC, by going to the inbox of the page. Is there any way to get business page inbox in my personal messenger, so that I can see customer messages alongside other messages and not have to have two tabs open, one for personal messages and one for the business page inbox?

How to send messages in the order they were queued, while ensuring that client B does not have to wait until client A has received his message?

I have a simplified producer/consumer pattern implemented below. The code outputs:


1 second delay


1 second delay


1 second delay


What approach can I take here to get rid of the 1-second delay between different letters?

What I’m looking for is something like



1 second delay



It’s important, that clients A and B receive the messages in the order the messages were queued in, but I do not want other clients to be blocked while processing for one client takes a really long time. Using two BlockingCollections and two consumer threads is not an option, because the user count is dynamic.

using System; using System.Collections.Concurrent; using System.Threading.Tasks;  namespace ConsumerProducer {     public enum ClientId     {         A,         B     }      class WebSocketMessage     {         public ClientId ClientId { get; }          public WebSocketMessage(ClientId clientId)         {             ClientId = clientId;         }          public async Task LongRunningSend()         {             Console.WriteLine(ClientId);             await Task.Delay(TimeSpan.FromSeconds(1));         }     }      class Program     {         public static BlockingCollection<WebSocketMessage> Messages = new BlockingCollection<WebSocketMessage>();          static async Task Main(string[] args)         {             var consumer = Task.Run(async () =>             {                 foreach (var message in Messages.GetConsumingEnumerable())                 {                     await message.LongRunningSend();                 }             });              ClientId clientId = ClientId.B;             while (true)             {                 // Flip between A and B                 clientId = clientId == ClientId.A ? ClientId.B : ClientId.A;                  Messages.Add(new WebSocketMessage(clientId));                  await Task.Delay(TimeSpan.FromMilliseconds(100));             }         }     } } 

I’m writing an application that needs to log error/ exception messages but should still continue execution if it not a fatal error

I’m writing an application that needs to log error/ exception messages but should still continue execution if the error is not a fatal error. I was thinking of making a method that returns a Task but calling this method as a fire and forget and not wait for response from the method. What is the recommendation, is this a good approach?

How secure is Aamazon Kinesis endpoint? Does the Kinesis Producer Library (KPL) securely sends messages to Kinesis endpoint?

I am trying to build a Amazon Kinesis based streaming data ingestion from a on-prem data soruce. I can use the Kinesis Producer Library (KPL) to produce messages to Kinesis Data Stream. I wanted to know how secure is the data transfer/ingestion through KPL. Is it using a secure endpoint underneath or using any in-transit encryption? Kinesis Data Stream offers to encrypt data at rest. But in this case how about the data security while in transit before it gets written to Kinesis Shards?

netstat command on WSL doesn’t give any messages

$   netstat -nap (No info could be read for "-p": geteuid()=1000 but you should be root.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name Active UNIX domain sockets (servers and established) Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path 

nestat command gives no information about ports are using. For example, I’m running redis-server on this PC but it is not displayed here.

How to I fix this? Linux distro is Microsoft WSL Ubuntu 18.04.

Running Time of Oral Messages Algorithm OM(m) for Byzantine Generals Fault Tolerance

Let us consider a byzantine generals problem assuming:

  • less than 1/3 of generals are traitors

  • Oral messages

  • No Crypto

One solution is the Oral Message algorithm OM(m), m being the maximum number of traitors we tolerate.

For n Generals and m = 0, the number of messages sent is in O(n) For n Genrals and m = 1, we have O(n^2) total messages sent in OM(m) solution My reading indicates that for m = 2, we have O(n ^3) and for m = 3 O(n^4). Can someone explain to me how we have O(n^3) and O(n^4) for m = 2 and 3 respectively ? Thanks in advance !

Will signing messages with key derived from password work better than sending password

I was wondering recently how to create secure mechanism for sending password while log in to the system. Then i had wicked thought why to send password at all.

Let’s imagine mechanism where client sends user id who wants to be logged in, server “welcomes with bread and salt” by sending challenge and random salt.

Client calculate hash of concatenated salt and password, and then uses it as shared secret to calculate HMAC of challenge, and sends it back to server.

In this case login details are never shared across the network, and login message cannot be replayed.

But are they any downside of this which i didn’t thought about? And why it’s bad idea (I’m assuming is bad, as nobody is doing in this way)