I'm not understanding my professor means when he says the write flag and read flag. Does 0 mean it is triggered?
He wants us to draw a state transition diagram but I think I can do that myself if I knew what was going on.
+---------+------------+-----------+----------------+
| Counter | Write flag | Read flag | Interpretation |
+---------+------------+-----------+----------------+
| 0 | 0 | 0 | Write locked |
| 0 | 0 | 1 | Invalid |
| 0 | 1 | 0 | Invalid |
| 0 | 1 | 1 | Available |
| N | 0 | 0 | Write request |
| N | 0 | 1 | Read locked |
| N | 1 | 0 | Invalid |
| N | 1 | 1 | Invalid |
+---------+------------+-----------+----------------+
The write flag and the read flag are each a boolean value, meaning it can hold a 0 or a 1. The state appears to be defined by the value of the counter and the two flags. I think your professor is asking that you draw a state diagram that shows transitions between different counter/flag value combinations. (My guess is that the intent is that you collapse all the counter>0 sub-states into a single sub-state labeled counter=N.)
Related
I have the following SCIP solver log
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |
0.0s| 1 | 0 | 4 | - | 6k| 0 | 0 | 6 | 200 | 6 | 200 |
0.0s| 1 | 0 | 7 | - | 6k| 0 | 0 | 8 | 200 | 8 | 200 |
0.0s| 1 | 0 | 10 | - | 6k| 0 | 0 | 9 | 200 | 9 | 200 |
0.0s| 1 | 0 | 10 | - | 6k| 0 | 0 | 9 | 200 | 9 | 200 |
0.0s| 1 | 0 | 10 | - | 6k| 0 | 0 | 9 | 200 | 9 | 200 |
0.0s| 1 | 0 | 10 | - | 6k| 0 | 0 | 9 | 200 | 9 | 200 |
I want the log to be more verbose, as in display a new line at each LP iteration. So far I only came across
SCIP_CALL( SCIPsetIntParam(scip, "display/verblevel", 5));
This is increasing but not as much as I want and not where I want. Essentially I would like to have lines at LP iter 4, 5, 6, 7, 8, 9 and 10 too.
You cannot print a line of SCIP output at every LP iteration. You can set display/freq to 1, then SCIP will display a line at every node.
Additionally you can set display/lpinfo to true, then the LP solver will print additional information. I don't think any LP solver will print you a line for every LP iteration though . Do you use SCIP with SoPlex?
Edit: Looked and you can set the SoPlex frequency to 1 with the parameter "--int:displayfreq". I don't think you can set this through the SCIP api though. If you only want to solve the LP you could just do it in SoPlex or you would have to edit the lpi_spx2 source code.
I'm having trouble putting the data inside a wavefront .obj file together.
These are the vec3 and vec2 definitions
template <typename T>
struct vec3 {
T x;
T y;
T z;
};
template <typename T>
struct vec2 {
T x;
T y;
};
Used in a vector:
+-----------------------------------+--------------+--------------+-------+
| std::vector<vec3<uint32_t>> f_vec | 0 | 1 | (...) |
+-----------------------------------+--------------+--------------+-------+
| | v_vec_index | v_vec_index | (...) |
| +--------------+--------------+-------+
| | vt_vec_index | vt_vec_index | (...) |
| +--------------+--------------+-------+
| | vn_vec_index | vn_vec_index | (...) |
+-----------------------------------+--------------+--------------+-------+
Where:
v_vec_index is an index of std::vector<vec3<float>> v_vec with its fields containing vertex x, y and z coordinates
vt_vec_index is an index of std::vector<vec2<float>> vt_vec containing texture u and v coordinates
vn_vec_index is an index of std::vector<vec3<float>> vn_vec with normal x, y and z coordinates
Every f_vec field is used to create a sequence of vert_x, vert_y, vert_z, tex_u, tex_v, norm_x, norm_y, norm_z float values inside std::vector<float> vertex_array.
Also, every index of f_vec's field is by default a value of std::vector<uint32_t>> element_array - that is it contains the range of integers from 0 to f_vec.size() - 1.
The problem is vec3 fields inside f_vec may repeat. So in order to assemble only the unique sequences mentioned above I planned to turn something like this:
+-----------------+---+---+---+---+---+
| f_vec | 0 | 1 | 2 | 3 | 4 |
+-----------------+---+---+---+---+---+
| | 1 | 3 | 1 | 3 | 4 |
| +---+---+---+---+---+
| | 2 | 2 | 2 | 2 | 5 |
| +---+---+---+---+---+
| | 2 | 4 | 2 | 4 | 5 |
+-----------------+---+---+---+---+---+
Into this:
+------------------------+-----------------+---+---+---+---+---+
| whatever that would be | index | 0 | 1 | 2 | 3 | 4 |
+------------------------+-----------------+---+---+---+---+---+
| | key | 0 | 1 | 0 | 1 | 2 |
| +-----------------+---+---+---+---+---+
| | | 1 | 3 | 1 | 3 | 4 |
| | +---+---+---+---+---+
| | vec3 of indices | 2 | 2 | 2 | 2 | 5 |
| | +---+---+---+---+---+
| | | 2 | 4 | 2 | 4 | 5 |
+------------------------+-----------------+---+---+---+---+---+
Where every time an element of f_vec would be put into the "whatever container"
It would be checked if it is unique
If it is then it would be pushed to the end of the container with its key being the next natural number after the biggest key - the key's value would be pushed to the element_array and new vertex would be created inside vertex_array
If it isn't then it would be pushed to the end of the container with its key being the same as the key of its duplicate - the key's value would be pushed to the element_array but vertex_array would remain unchanged
How am I supposed to do it?
I need to verify an IAX account in my C++ client and run third-party softphone if account's credentials are valid (or close an application if not).
So, the client's socket connects to Asterisk host via UDP (port 4569) and... What is the algorithm? The specification does not contains any examples and I can't understand the structure of registration procedure (headers, data order etc.)
Could somebody explain me the order and the structure of messages to perform IAX user authentication?
In the document you have pointed, you can see the procedure of registration in chapter 6.1
________________
| |
| Unregistered |<--------------------------\
|________________| |
| |
/Init | |
------------ | |
snd REGREQ | +--------+ |
| | | rec REGAUTH |
_______V____V___ | ----------- |
| | | snd REGREQ |
| Reg Sent +----+ |
|________________+----------+ |
| ^ | rec REGAUTH |
rec REGACK | | | /No Credentials|
------------ | | REG timeout | -------------- |
snd ack | | ------- | snd ack |
| | REGREQ __V___ |
_______V____|___ | | |
| | | No | |
| Registered | | Auth | |
|________________| |______| |
| ^ |
| | rec REGAUTH |
| release | /No Credentials|
| ------- | -------------- |
+-------+ | snd REGREL | snd ack |
rec REGAUTH | | | | |
----------- | _V_____V________ | |
snd REGREL | | |----------+ |
+-----+ Releasing |---------------------------+
|________________| rec ACK
-------
x
__________
rec REGREJ | |
---------- *->| Rejected |
snd ack |__________|
Messages REGAUTH, REGREQ, etc. are specified in paragraphs 6.1.2 to 6.1.5 as messasges containing Information elements.
Information elements are included in full frames that are specified in paragraph 8.1.1
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|F| Source Call Number |R| Destination Call Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| time-stamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OSeqno | ISeqno | Frame Type |C| Subclass |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
: Data :
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: Full Frame Binary Format
Frame type for REGREQ, etc. is IAX (8.2.6) and the classes of IAX frames, including registration messages are in 8.4
Information elements for registration are enumerated in 6.1.x and described in 8.6.x
Anyway, you can use wireshark if you want to see a dialog message to message
I already asked a question here (https://stackoverflow.com/questions/28658283/c-getslotlisttokenpresent-pslotlist-pulcount-return-pulcount-0) about my SmartCard (https://en.wikipedia.org/wiki/Universal_electronic_card), but I would like to know: is it possible to get a specific record from a smart card, knowing the pin code and where the record is located?
Map developed by ISO-7816, so the APDU-command must be based on the following scheme:
[CLA] [INS] [P1] [P2] [Lc field] [Data field] [Le field]
How APDU-command should look like and what the library is better to use on C++/C#, if I need the data from the field 5F20?
P.s.: here is data from file sectors.ini:
[Sector1_11]
Icon = "IDENTIFICATION SECTOR"
BlockDescr1 = "0 | 0 | The data block for sharing"
BlockDescr2 = "0 | 0 | block public access to the PIN"
DataDescr21 = "DF27 | 1 | 6 | 0,0,0 | 1 | SNILS"
DataDescr22 = "DF2B | 4 | 8 | 0,0,0 | 1 | Number of MHI"
DataDescr23 = "5F20 | 0 | 26 | 0,0,0 | 1 | Name"
DataDescr24 = "DF23 | 0 | 100 | 0,0,0 | 1 | Address of the issuer"
DataDescr25 = "5F2B | 4 | 4 | 0,0,0 | 1 | Born"
DataDescr26 = "DF24 | 0 | 100 | 0,0,0 | 1 | Birthplace"
DataDescr27 = "5F35 | 3 | 1 | 0,0,0 | 1 | Paul"
DataDescr28 = "DF2D | 0 | 40 | 0,0,0 | 1 | Last"
DataDescr29 = "DF2E | 0 | 40 | 0,0,0 | 1 | Name"
DataDescr210 = "DF2F | 0 | 40 | 0,0,0 | 1 | Middle"
I only know that the third number indicates the amount of data in bytes.
I have two nodes 8xl cluster. And today I've decided to take a look at some metrics that Amazon provides, what I've noticed is that some disks are empty.
From Amazon docs:
capacity integer Total capacity of the partition in 1 MB disk blocks.
SQL:
select owner, used, tossed, capacity, trim(mount) as mount
from stv_partitions
where capacity < 1;
owner | used | tossed | capacity | mount
-------+------+--------+----------+-----------
0 | 0 | 1 | 0 | /dev/xvdo
1 | 0 | 1 | 0 | /dev/xvdo
(2 rows)
Can someone explain to me why am I seeing this? Is that an expected behaviour?
Updated:
owner | host | diskno | part_begin | part_end | used | tossed | capacity | reads | writes | seek_forward | seek_back | is_san | failed | mbps | mount
-------+------+--------+---------------+---------------+------+--------+----------+-------+--------+--------------+-----------+--------+--------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | 1 | 13 | 0 | 1000126283776 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | /dev/xvdo
0 | 1 | 13 | 1000126283776 | 2000252567552 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | /dev/xvdo
It is due to the fact that the device has failed (=1) and hence the disk capacity is set to 0.