Using In-band commissioning with SAMR21s ftd cli returns Join failed [InvalidArgs] - openthread

Im trying the guide at https://codelabs.developers.google.com/codelabs/openthread-hardware/#8, with two SAMR21s running the SAMR21 ftd cli examples. Everything seems to work until I need to do joiner start J01NME, which returns with Join failed [InvalidArgs].
Fresh upload of SAMR21 ftd cli examples with parameters COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 on both SAMR21s.
With the two SAMR21s I typed the following commands into the clis:
SAMR21 1:
> dataset init new
> dataset commit active
> ifconfig up
> thread start
> state
leader
> commissioner start
Commissioner: petitioning
done
> commissioner joiner add 0004251918018576 J01NME
done
SAMR21 2:
> eui64
0004251918018576
> ifconfig up
>scan
| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |
| 1 | OpenThread-f171 | 1b6239e953fd2be4 | f171 | 76144ebb984c039a | 0 | -7 | 0 |
> joiner start J01NME
done
> Join failed [InvalidArgs]
Observations
I have noticed when the commissioner times out the follow is displayed which doesnt seem right, as the eui64 being removed doesnt match what i added:
> commissioner joiner add 0004251918018576 J01NME
Done
> Commissioner: Joiner remove b34a468958787c5e
Any help would be appreciated thanks.

Related

CockroachDB: Simple SQL queries do not respond

I have setup CockroachDB according to the instructions at https://www.cockroachlabs.com/docs/stable/deploy-cockroachdb-on-premises-insecure.html. However, SQL queries take too long time and do not respond.
The procedure of setupping cluster is as follows. I used three machines running Ubuntu 19.10.
At node1
cockroach start --insecure --advertise-addr=${NODE1} --join=${NODE1},${NODE2},${NODE3} --cache=.25 --max-sql-memory=.25 --background
At node2
cockroach start --insecure --advertise-addr=${NODE2} --join=${NODE1},${NODE2},${NODE3} --cache=.25 --max-sql-memory=.25 --background
At node3
cockroach start --insecure --advertise-addr=${NODE3} --join=${NODE1},${NODE2},${NODE3} --cache=.25 --max-sql-memory=.25 --background
Here, ${NODEi} stands for the address of each node.
Then, I initialized the cluster.
cockroach init --insecure --host=${NODE1}
After that, I went into SQL shell and typed a query.
#
# Welcome to the CockroachDB SQL shell.
# All statements must be terminated by a semicolon.
# To exit, type: \q.
#
# Server version: CockroachDB CCL v20.1.1 (x86_64-unknown-linux-gnu, built 2020/05/19 14:46:06, go1.13.9) (same version as client)
# Cluster ID: 77cf3b29-f895-45ab-9592-7956a3effdb7
#
# Enter \? for a brief introduction.
#
root#192.168.10.131:26257/defaultdb> CREATE DATABASE bank;
The command CREATE DATABASE bank took more than one minute and seemed not to work. But when I try again later, the same command finished within a second.
The status of cluster is as follows:
id | address | sql_address | build | started_at | updated_at | locality | is_available | is_live
-----+----------------------+----------------------+---------+----------------------------------+----------------------------------+----------+--------------+----------
1 | 192.168.10.131:26257 | 192.168.10.131:26257 | v20.1.1 | 2020-05-28 05:00:17.725807+00:00 | 2020-05-28 05:26:01.338089+00:00 | | true | true
2 | 192.168.10.132:26257 | 192.168.10.132:26257 | v20.1.1 | 2020-05-28 05:00:18.574806+00:00 | 2020-05-28 05:26:02.121931+00:00 | | true | true
3 | 192.168.10.133:26257 | 192.168.10.133:26257 | v20.1.1 | 2020-05-28 05:00:18.729008+00:00 | 2020-05-28 05:26:02.253278+00:00 | | true | true
(3 rows)
Do you have any ideas to solve this problem?
This doesn't look expected, perhaps it's related to the network topology of your cluster or the clusters resources at the time of the statement.
If this is still an issue there are two things we could try:
a) Upgrading to the latest stable version of 20.2 which introduces a ton of stability and performance upgrades.
b) Collect a debug.zip and you could submit a ticket to www.support.cockroachlabs.com for the technical support team to check out.
I recommend upgrading to the latest stable version of v20.1 or v20.2 and giving that a shot though!

Using table inside of dynamic step definitions

I have feature file with step like this
When user login with credentials
|username|password|
|blahblah|blahblah|
But then I want to use this step inside my dynamic step definitions. Is it possible? I was trying to do something like this
step 'user login with credentials
|username|password|
|blahblah|blahblah|'
or creating and passing a hash. Couldn't make it work so far.
https://github.com/cucumber/cucumber/wiki/Calling-Steps-from-Step-Definitions#calling-steps-with-multiline-step-arguments
Calling steps with multiline step arguments
Sometimes you want to call a step that has been designed to take Multiline Step Arguments, for example:
# ruby
Given /^an expense report for (.*) with the following posts:$/ do |date, posts_table|
# The posts_table variable is an instance of Cucumber::Ast::Table
end
This can easily be called from a plain text step like this:
# feature
Given an expense report for Jan 2009 with the following posts:
| account | description | amount |
| INT-100 | Taxi | 114 |
| CUC-101 | Peeler | 22 |
But what if you want to call this from a step definition? There are a couple of ways to do this:
# ruby
Given /A simple expense report/ do
step "an expense report for Jan 2009 with the following posts:", table(%{
| account | description | amount |
| INT-100 | Taxi | 114 |
| CUC-101 | Peeler | 22 |
})
end
Or, if you prefer a more programmatic approach:
# ruby
Given /A simple expense report/ do
step "an expense report for Jan 2009 with the following posts:", table([
%w{ account description amount },
%w{ INT-100 Taxi 114 },
%w{ CUC-101 Peeler 22 }
])
end

What is the meaning of the "Load" column in Apache balancer-manager?

I've set up the Apache (2.4) load-balancer which is working okay. To monitor its performance, I enabled the balancer-manager handler, which shows the status of the balancers.
I noticed a "Load" column, which was not present in version 2.2, with a value that may be negative, but I don't understand its meaning nor I was able to find documentation relative to this.
Can anyone explain the meaning of that value or point me to the right documentation?
I now understood, how the calculation of "Load" works. Here is a I think more simpler example than on the apache documents page.
Let's say we have 3 worker and a configured load factor of 1.
1) Start
a | b | c
--+---+---
0 | 0 | 0
add the load factor of 1 to all workers
a | b | c
--+---+---
1 | 1 | 1
now select the one with highest value --> a and decrease by the sum of the factor of all (=3) - this is the selected worker
a | b | c
---+---+---
-2 | 1 | 1
2) next round, add again 1 to all
a | b | c
---+---+---
-1 | 2 | 2
now select the one with highest value --> b and decrease by the sum of the factor of all (=3) - this is the selected worker
a | b | c
---+----+----
-1 | -1 | 2
3) next round, add again 1
a | b | c
---+----+----
0 | 0 | 3
now select the one with highest value --> c and decrease by the sum of the factor of all (=3) - this is the selected worker
a | b | c
---+----+----
0 | 0 | 0
startover again :)
I hope this helps others.
The Load value is populated by lbstatus based on this line of code:
ap_rprintf(r, "<td>%d</td><td>", worker->s->lbstatus);
in https://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?view=markup#l1767 (line might changed when the code modified)
Since your method is by request, lbstatus is specified by mod_lbmethod_byrequests which define:
lbstatus is how urgent this worker has to work to fulfill its quota of
work.
Details on the algorithm can be found here: https://httpd.apache.org/docs/2.4/mod/mod_lbmethod_byrequests.html
i too want to know to description for others column like BUSY, ELECTED etc.. my LB has BUSY over 100 already.. i though BUSY should not exceed 100 ( as in 100% server busyness or something )

Creating an SSIS job to split a column and insert into database

I have a column called Description:
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Description/Title |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Liszt, Hungarian Rhapsody #6 {'Pesther Carneval'}; 2 Episodes from Lenau's 'Faust'; 'Hunnenschlacht' Symphonic Poem. (NW German Phil./ Kulka) |
| Beethoven, Piano Sonatas 8, 23 & 26. (Justus Frantz) |
| Puccini, Verdi, Gounod, Bizet: Arias & Duets from Butterfly, Tosca, Boheme, Turandot, I Vespri, Faust, Carmen. (Fiamma Izzo d'Amico & Peter Dvorsky w.Berlin Radio Symph./Paternostro) |
| Puccini, Ponchielli, Bizet, Tchaikovsky, Donizetti, Verdi: Arias from Boheme, Manon Lescaut, Tosca, Gioconda, Carmen, Eugen Onegin, Favorita, Rigoletto, Luisa Miller, Ballo, Aida. (Peter Dvorsky, ten. w.Hungarian State Opera Orch./ Mihaly) |
| Thomas, Leslie: 'The Virgin Soldiers' (Hywel Bennett reads abridged version. Listening time app. 2 hrs. 45 mins. DOLBY) |
| Katalsky, A. {1856-1926}: Liturgy for A Cappella Chorus. Rachmaninov, 6 Choral Songs w.Piano. (Bolshoi Theater Children's Choir/ Zabornok. DOLBY) |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Please note that above I'm only showing 1 field.
Also, the output that I would like is:
+-------+-------+
| Word | Count |
+-------+-------+
| Arias | 3 |
| Duets | 2 |
| Liszt | 10 |
| Tosca | 1 |
+-------+-------+
I want this output to encompass EVERY record. I do not want a separate one of these for each record, just one global one.
I am choosing to use SSIS to do this job. I'd like your input on which controls to use to help with this task:
I'm not looking for a solution, but simply some direction on how to get started with this. I understand this can be done many different ways, but I cannot seem to think of a way to do this most efficiently. Thank you for any guidance.
FYI:
This script does an excellent job of concatenating everything:
select description + ', ' as 'data()'
from [BroincInventory]
for xml path('')
But I need guidance on how to work with this result to create the required output. How can this be done with c# or with one of the SSIS components?
edit: As siyual points out below I need a script task. The script above obviously will not work since there's a limit to the size of a data point.
I think term extraction might be the component you are looking for. Check this out: http://www.mssqltips.com/sqlservertip/3194/simple-text-mining-with-the-ssis-term-extraction-component/

Rails, SQL: private chat, how to find last message in each conversation

I'v got the folowing schema
+----+------+------+-----------+---------------------+--------+
| id | from | to | message | timestamp | readed |
+----+------+------+-----------+---------------------+--------+
| 46 | 2 | 6 | 123 | 2013-11-19 19:12:19 | 0 |
| 44 | 2 | 3 | 123 | 2013-11-19 19:12:12 | 0 |
| 43 | 2 | 1 | ????????? | 2013-11-19 18:37:11 | 0 |
| 42 | 1 | 2 | adf | 2013-11-19 18:37:05 | 0 |
+----+------+------+-----------+---------------------+--------+
from/to is the ID of the user's, message – obviously, the message, timestamp and read flag.
When user open's his profile I want him to see the list of dialogs he participated with last message in this dialog.
To find a conversation between 2 people I wrote this code, it's simple (Message model):
def self.conversation(from, to)
where(from: [from, to], to: [from, to])
end
So, I can now sort the messages and get the last one. But it's not cool to fire a lot of queries for each dialog.
How could I achieve the result I'm looking for with less queries?
UPDATE:
Ok, looks like it's not really clear, what I'm trying to achieve.
For example, 4 users – Kitty, Dandy, Beggy and Brucy used that chat.
When Brucy entered in dialogs, she shall see
Beggy: hello brucy haw ar u! | <--- the last message from beggy
-------
Dandy: Hi brucy! | <---- the last message from dandy
--------
Kitty: Hi Kitty, my name is Brucy! | <–– this last message is from current user
So, three separated dialogs. Then, Brucy can enter anyone dialog to continue private conversation.
And I can't figured out how could I fetch this records without firing a query for each dialog between users.
This answer is a bit late, but there doesn't seem to be a great way to do this, in Rails 3.2.x at least.
However, here is the solution I came up with
(as I had the same problem on my website).
#sender_ids =
Message.where(recipient_id: current_user.id)
.order("created_at DESC")
.select("DISTINCT owner_id")
.paginate(per_page: 10, page: params[:page])
sql_queries =
#sender_ids.map do |user|
user_id = user.owner_id
"(SELECT * FROM messages WHERE owner_id = #{user_id} "\
"AND recipient_id = #{current_user.id} ORDER BY id DESC "\
"LIMIT 1)"
end.join(" UNION ALL ")
#messages = Message.find_by_sql(sql_queries)
ActiveRecord::Associations::Preloader.new(#messages, :owner).run
This gets the last 10 unique people you sent messages to.
For each of those people, it creates a UNION ALL query to get the last message sent to each of those 10 unique people. With 50, 000 rows, the query completes in about ~20ms. And of course to get assocations to preload, you have to use .includes will not work when using .find_by_sql
def self.conversation(from, to)
order("timestamp asc").last
end
Edit:
This railscast will be helpful..
http://railscasts.com/episodes/316-private-pub?view=asciicast
EDIT2:
def self.conversation(from, to)
select(:from, :to, :message).where(from: [from, to], to: [from, to]).group(:from, :to, :country).order("timestamp DESC").limit(1)
end