what is the size of the packets in Solaris OS [closed] - solaris

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I need to figure out the size of the packets on solaris OS. When I run this command:
netstat -in
I get this output in terms of number of packets:
netstat -in
Ipkts Ierrs Opkts Oerrs Coll
2450315175 0 1850696874 0 0
2450315175 0 1850696874 0 0
2450315175 0 1850696874 0 0
2450315175 0 1850696874 0 0
2450315175 0 1850696874 0 0
2450315175 0 1850696874 0 0
Does anybody know the size of the packets in terms of bits/bytes?

netstat doesn't report the packets size.
You can use kstat to retrieve both the number of packets and bytes sent and received in deduce the average packet size.

Related

Why UInt64.max / 2 + 1 represented in the memory the same as Int64 value -9 223 372 036 854 775 808 but not as -1? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
UInt62.max / 2 is represented by 0100..0000 in the memory. Add 1 and it will be 0100..0001. So, the first bit for the sign. And we take -1. But CPU thinks that it's -9 223 372 036 854 775 808. Why does it work so complexly?
You can see that it's truth because of the issue in the Swift playground: Why is UInt64 max equal -1 in Swift?
var max = UInt64.max / 2 + 1 // playground shows -1 because it treats it as Int64
Yes, in fact -1 is not represented as 1 with a sign bit, but rather as all bits set to one. This is called a "two's complement" representation, and is used in most of the modern processors.
Read more about it here:
https://en.wikipedia.org/wiki/Two%27s_complement
One of the reasons for that is that this way arithmetic operations that involve both negative and positive numbers are easier. If -1 was represented as 1 with a sign bit, and we attempted to add 1 to it in a naive way, we would get 2 with a sign bit instead of zero. With two's complement representation you can just add the numbers as if they were unsigned, and get the correct result.

Compression of sparse signals [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am using Matlab and I have a sparse vector (only having about 10% of nonzero values but otherwise quite arbitrary).
I want to compress it (smallest size). I also want to know the compression ratio I obtained.
You can get the size of any variable in MATLAB using the whos function. It returns a struct containing the name, size, class, number of bytes and some other values of a variable. To get information on a variable A, you call
info = whos('A');
So you could e.g. do the following:
% Create matrices
A = [0 1 0 0; 1 0 0 0; 0 0 1 0; 0 0 0 1]
S = sparse(A)
before = whos('A')
after = whos('S')
comprRatio = before.bytes / after.bytes
which in this small examples returns
comprRatio =
1.2308
as the matrix A is 128 bytes and the sparse matrix S is 104 bytes.
If you do any other compression (I did not completely get what sort of compression you are trying to achieve), you can do exactly the same thing with whos.

Map 410874 frames to time limits between 0 and 2062637 with a length of 10ms for each frame [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have 410874 frames each of which I want to map between a time limit between 0 and 2062637 with a length of 10ms interval. so that after the process each frame will be matched against a time as given below
1 0
2 10
3 20
4 50
5 60
6 70
. .
. .
. .
410874 2062637
look at linspace(a,b,n), this should be easy for you :)
you can simply make a vector of 410874 elements which span from 0 to 2062637 by using
t=linspace(0,2062637,410874);
although the points will only be ~5ms from eachother not 10ms as you stated because 2062637 / 410874 = 5.0201, so if you want 10ms you have to reduce the number of elements
t=t(1:2:end)
or
t=0:10:2062637;
the later will give you a 1x2062640 array, again cause those numbers dont fit your specifications.

Subtracting each element of a vector from ther other in matlab? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a column vector, for example,
1
0
3
2
At each row, i want to subtract the number above it, like,
row1: null
row2: 0 - 1 = -1
row3: 3 - 0 = 3 and 3 - 1 = 2 .. etc so that to obtain something like this
null
-1
3 2
-1 2 1
Can someone guide me to an efficient MATLAB code without using a for loop, as the number of rows in my original data is too long.
Thanks in advance.
You could do something along the lines of:
V = [1;0;3;2];
tril(bsxfun(#minus,V,V'),-1);
This gives me the following:
ans =
0 0 0 0
-1 0 0 0
2 3 0 0
1 2 -1 0
The main downside of this is that it will use a lot of memory if V is very long (but that is going to be a problem regardless, I imagine). You can potentially reduce the memory usage by making V sparse.

how can I get a complete vector of residuals from an ARX model [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I used ARX function then RESID function from the System Identification Toolbox, but the resulting residuals are:
0
0
0
5
6
8
7
8
the number of zeros=the number of lags, I need a complete vector of residuals
An AR model of order N needs the previous N values to predict the next one, which is why the first N are not predicted. You can always pad the vector at the beginning (either by replication or zeros), example:
load twotankdata
order = 5;
m = arx(y, order);
r = resid([y(1:order);y], m);
r = r(order+1:end);