Design Pattern – How do I update data and return a list of updates without interrupting the separation of command queries or DRY?

Stack Exchange network

The Stack Exchange network consists of 176 Q & A communities, including Stack Overflow, the largest and most trusted online community where developers can learn, share, and build a career.

Visit Stack Exchange

json rpc – bitcoind jsonrpc bumpfee does not return a hash of the newly created transaction

I'm trying to implement the Replace with Fees feature with the call to bictoind (v18) and bumpfee rpc described here

This means that a new transaction is created with a higher fee. The result should be:

{
"txid": "value", (string) The ID of the new transaction
"origfee": n, (numerical) fee of the replaced transaction
"fee": n, (numerical) fee of the new transaction
"Error":  [ str... ] (JSON array of strings) Error processing (possibly empty)
}

but I basically get all zero answers

{
"id": "BumpFeeRequest 1561247020661",
"error": zero,
"txid": zero,
"origfee": zero,
"Fee": zero,
"error": zero
}

This makes it difficult to identify the new transaction in the down-steam system.

How can I get the txid except to ask for the last tx?

Why does this query return a result in MySQL but not in PHP?

I have a query that does not return a PHP result for a particular search term (which I believe), but when I test it directly in MySQL, it returns one. Other keywords are okay.

SELECT ID,
CONCAT_WS (& # 39 ;,
TRIM (SUBSTRING_INDEX (
SUBSTRING (`text`, 1, INSTR (` text`, & # 39; rig & # 39;) - 1),
& # 39; & # 39 ;,
-8th)
)
TRIM (SUBSTRING_INDEX (
SUBSTRING (`text`, INSTR (` text`, & # 39; rig & # 39;),
& # 39; & # 39 ;,
7)
)
) as `sample`,` title`, `url`
FROM `Documents` WHERE TO MATCH (text)
VS ("rig" & BOOLEAN MODE) OR GAME (title)
AGAINST ("RIG" & IN BOOLEAN MODE)

PHP:

if (! $ result = $ mysqliSiteSearch-> query ($ query)) send ("3149", "e");
$ hitArray = array ();
while ($ row = $ result-> fetch_assoc ()) {$ hitArray[]= $ row; }

I have set up a TXT log file to record the result of:

print_r ($ result, true)

I have tested another search term that returns 8 results both directly in MySQL and when running the PHP script. My log file shows the following:

mysqli_result object
(
    [current_field] => 0
    [field_count] => 4
    [lengths] => 
    [num_rows] => 8
    [type] => 0
)

I then test the search term "rig", which returns a line directly in MySQL when testing the same query, but when I run my PHP script, I get no hit and my log file shows:

mysqli_result object
(
    [current_field] => 0
    [field_count] => 4
    [lengths] => 
    [num_rows] => 0
    [type] => 0
)

Sure, I miss something, but what?

Thank you for your time and your help.

if – Does ShellScript return values ​​from the bank for each value in another variable?

Hello, I am trying to return 1 value for each variable that I can return with. I'm trying to create a condition that validates with one for which true and which are fake and are displayed on the screen. Can you help me? under my code.

Read number
vartest1 = `psql -X -A -d database -U user -h host1 -t -c" Select phone from table where numerodiscado = & # 39;; number & # 39; Limit 1;
vartest2 = `psql -X -A -d database -U user -h host2 -t -c" Select the phone from the table where numerodiscated = & # 39;; $ number & # 39; Limit 1;
vartest3 = `psql -X -A -d database -U user -h host3 -t -c" Select the phone from the table where numerodiscated = & # 39;; $ number & # 39; Limit 1;
vartest4 = `psql -X -A -d database -U user -h host4 -t -c" Select phone from table, where numerodiscado = & # 39;; number & # 39; Limit 1;
clear


ap1 = & # 39; t & # 39;
ap2 = & # 39; t & # 39;
ap3 = & # 39; t & # 39;
ap4 = & # 39; t & # 39;

for ((i = 0; i <3; i ++))
from
echo "$ {vector[$i]} "
if [ $ap1 == "$vartest1" ]; then
Echo "Phone found Ap1"
otherwise
Echo "No phone found Ap1"
sleep 1
if [ $ap2 == "vartest2" ]; then
Echo "Phone is Ap2"
otherwise
Echo "No phone found Ap2"


if [ $ap3 == "vartest3" ]; then
Echo "phone is Ap3"
otherwise
Echo "No phone found Ap3"


if [ $ap4 == "vartest4" ]; then
Echo "Phone is Ap4"
otherwise
Echo "No phone found Ap4"
fi
finished

When I run, only the 1 condition is validated. If ap1 is always true, how could I execute an ifelse string where I would validate regardless of position, if I composed ap1, ap2, ap3, ap4 if any of these conditions were true then the case screen will be displayed All are wrong. Return to me on the screen. I can not test all. You could help me.

How to Write an Equation to Search for a WHAT AND Result in a Cell and Return the Value of the Adjacent Cell in Google Sheets?

I am trying to write an equation for a food form that recognizes a number of drinks that the customer wants and returns the corresponding price per cup based on a predetermined volume-dependent value in a table.

The prices in the example table are obviously not real.

Enter image description here

Ideally, I would use this to optimize our catering offerings and achieve a faster response time.

User behavior of the mobile website – return

In 2019 it is the opposite! Mobile commerce (m-commerce) is growing!

The future of mobile commerce is already here. Shopify

Surveys, studies and figures show that more and more people are shopping on their mobile devices and the numbers are likely to increase only further.

Here are some current numbers:

outer box

Enter image description here

Shopify

Enter image description here

statista

Enter image description here


Yes, there are challenges. Some examples:

1-security Questions are still to be discussed. However, as we live in a digital world, trust in online shopping has generally increased and corporate security measures and standards have increased. Security concerns do not prevent the growth of m-commerce.

It's also interesting to see recommendations for buying on mobile apps instead of on a CactusVPN desktop site:

Try to buy on the phone instead of on the desktop. Why? Because serious
Retailers have their own apps that are much harder to use
exploit as websites. Basically, cybercriminals must use certain
Attacks to compromise an app while usually compromising it
Sites with the same tactics

2- Mobile small screen Sizes made shopping difficult:
Mobile screens are getting bigger and bigger and UX designs offer great experiences on these screens.

3 speed (3G, 4G …) as people tend to shop on the move: 5G is coming / coming (in some places) and Wi-Fi spots are increasing. People are connected most of the time …

4 check-Out and payment issues: One-page checkout and the provision of options such as Apple Pay, Android Pay, Amazon Pay along with signing up with a fingerprint and confirming that this has all been made much easier …

I suggest exploring what has changed to achieve this growth and what has been done to overcome many of the challenges and concerns of m-commerce. (Please check the links provided for some ideas.)

junit – How to mock a mapper.query method when the return type is a PaginatedList of JAVA elements

I am trying to test a method that DynamoDBMapper uses to query elements from a dyamoDB table.

My method works fine, but the problem occurs during testing.

I use Junt4 and Mockito. Basically, I'm just trying to test if my method implements its logic with the results retrieved by Dynamo. In my test, I try to ridicule these results.

// what I'm trying to ridicule
mapper.query (DDBProductDocument.class, queryExpression);


// What I have in my test

@ MockBean
PaginatedQueryList paginatedQueryList;


when (mapper.query (
Mockito.any (),
Mockito.any ()
)). thenReturn (paginatedQueryList);

The paginated list should be a list of my mocked results. However, I can not simply return my desired mocked results. Has anyone mocked this successfully? Many Thanks.

mysql – Formatted date range – return from between

I do make a selection of dates, but when I formatted, I return data that in this case should not be returned months or months ago … Follow interval and query.

SELECT
id, DATE_FORMAT (created_at, & # 39;% d /% m /% Y% H:% i:% s & # 39;) as created_at
FROM
use_card
WHERE
DATE_FORMAT (created_at, & # 39;% d /% m /% Y% H:% i:% s & # 39;) BETWEEN "05/01/2019 00:00:00"
AND "13.06.2013 18:05:32"
ORDER BY
DATE_FORMAT (created_at, & # 39;% d /% m /% Y% H:% i:% s & # 39;) ASC

id created_at
15 02/04/2019 09:42:47
13 02/05/2019 09:40:50
17 02/05/2019 09:43:41
80 03/03/2019 19:48:13
117 04/06/2019 07:42:42
116 04/06/2019 08:20:21
118 04/06/2019 08:45:24
122 06/02/2019 11:58:42
119 06/06/2019 11:57:26
120 06/06/2019 11:57:57
121 06/06/2019 11:58:33
123 06/06/2019 18:07:20
124 06/06/2019 18:08:36
125 06/06/2019 19:27:38
126 06/06/2019 22:09:15
25 07/05/2019 10:07:26
27 07/05/2019 10:17:17
28 07/05/2019 10:19:08
29 07/05/2019 10:45:38
26 07/07/2019 10:14:03
57 09/05/2019 09:40:20

If someone can help, thanks.

8 – Why does not my controller return AccessResult :: forbidden ()?

I am working on a node access module. I have built my logic. I can not get my code to return AccessResult :: forbidden (). I can not even run dpm in the access method. What am I doing wrong? Below are my routing.yml and controllers.

/ * nodeaccess.routing.yml * /
nodeaccess.people:
Path: & # 39; / admin / people / list & # 39;
Default settings:
_controller: & # 39;  Drupal  nodeaccess  Controller  NodeaccessController :: content & # 39;
_title: & # 39; dashboard & # 39;
Conditions:
_custom_access: & # 39;  Drupal  nodeaccess  Controller  NodeaccessController :: access & # 39;

/ * src / Controller / NodeAccessController.php * /

I would());
$ user = Drupal  user  Entity  User :: load (explode ("/", $ _SERVER["REQUEST_URI"])[2]);
if ($ current_user-> field_department-> target_id! = $ user-> field_department-> target_id) {
return AccessResult :: forbidden ();
}
return AccessResult :: allowed ();
}
}