Calling the mysql procedure returns an empty result

When I call procedure, I get an empty result

   call hussian('prstate','table_1','column1,column2,column3',1)

it is running but there is empty result, please help me …

 DELIMITER // 

 CREATE PROCEDURE hussain(IN src_col varchar(20), 
                     IN tblname varchar(100), 
                     IN col_names varchar(100), 
                     IN _leadid int)

 BEGIN
    IF (col_names  = 'column1' AND col_names  = 'column2'  AND col_names = 'column3')
THEN

    SET @sql = CONCAT('insert into ', tblname, '(',col_names,')', ' select ' ,src_col,',','firstname,lastname from tbllead where id = ',_leadid); 
    PREPARE s1 from @sql;
     EXECUTE s1;
    DEALLOCATE PREPARE s1;
 END IF;
  END //
  DELIMITER ; 

it inserts data into table when i romove condition …..

Convert the result of a pymysql query to Python float using the MySQL decimal type

I'm fairly new to Python (3.x) and one of the most confusing behaviors of the language is that Decimal and Float seem to be different types (I assume the difference here is the usual between double / float …).

To make matters worse, my Python logic reads / writes MySQL records with fields that are defined as decimal (with a variety of formats).

I was wrong on the writing side pymysql Encoder like this:

import numpy as np
import pymysql

pymysql.converters.encoders(np.float64) = pymysql.converters.escape_float
pymysql.converters.conversions = pymysql.converters.encoders.copy()
pymysql.converters.conversions.update(pymysql.converters.decoders)

In my opinion, this has contributed to the fact that decimal numbers have been retained in the MySQL data sets.

But on the reading page, there doesn't seem to be an obvious way to get Python floats when we read Decimal Fields through pymysql queries. (Perhaps that would mean a fall and a possible loss of data.)

What are people doing here? Should the convention only use decimal types everywhere to avoid these down / up casting problems? And what about the MySQL interface through pymysql?

My general thought is that float / double behavior should only be automatic. That language imposes a distinction between float / double is probably a good thing; this code simply breaks completely + or - However, the operand that doesn't work properly with different types is really confusing.

Thank you very much.

root access – individual commands run properly, but shell scripts result in errors

I am trying to create a shell script to configure iptables and add some routes to my device running Android 10. I have root access.

Here is the script. I called it script.sh:

#!/system/bin/sh
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan1 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan1 scope link table 61

sysctl -w net.ipv6.conf.wlan1.disable_ipv6=1

I have a root console opened via ADB and can execute every single command manually in the console using the script:

Enter image description here

… and so on.

But that's what happens when I run my script:

Enter preformatted text here

and I don't really understand why.

I have limited knowledge of Android and Linux and tried to combine some examples, but was not lucky.
https://www.pctips4u.com/2016/03/writing-shell-scripts-in-android.html
https://gist.github.com/LouWii/9626480

Transactions – The signal transmission with the key result differs from the signal transmission

I am learning Segwit and doing a few experiments in the rain test.
I am creating a raw transaction with P2SH address.

My transaction data without signature are:

0200000001faf19017fe7e20747535ac41009922e4beb76e17a7fd5423bc60e75fbc8381c40000000000ffffffff01606b042a0100000017a914b63007b51b936175644dcf654f77c528e35f01178700000000

That is to sign my message instead of using it signrawtransactionwithkey I try to use it signmessagewithprivkey and i expect the signature, which i can find in the txwitness field (first line).

signmessagewithprivkey return base64 signature then i convert it to hex.
The result is:

20db4febb769c43c9072daf30934a345b2327b6107e701f21c7fe052a040180d4129dc3079dc7dad29db37c31fa6401013819e386beb9396e330b3b6e9f7fbcf5b

signrawtransactionwithkey return:

"txinwitness": (
      "3044022077f49ad0371ea5baf0ce60d3d15175c9bb5e37ff7f3bc023b76863b2a91d379e022073010deba5eef8619745cd79d94a73c4a4527391253731104fc734449322d85b01",            "02985586bf43d26229a97092f76086cfe6f9bf09d93bef16a92f65185c8f7f0b17"
      ),

I wonder why the result of signmessagewithprivkey is not the same at first glance.

SQL Server – rounding problem with my result

I have a rounding problem with the result of a query as shown below, where the result was truncated somewhere in the calculation. The result is

Enter image description here

The SQL query is:

SELECT      
    "wos"."ISOVERDUE" AS "Broken SLA",
    (COUNT ("wo"."WORKORDERID") )*100 / 
    (SELECT COUNT (*) FROM "WorkOrder" "wo" WHERE wo.ISPARENT='1' AND wo.CREATEDTIME >=  AND wo.CREATEDTIME <= ) 
    AS "%" 

FROM "WorkOrder" "wo"       
LEFT JOIN "ModeDefinition" "mdd" ON "wo"."MODEID"="mdd"."MODEID" 
LEFT JOIN "SDUser" "sdu" ON "wo"."REQUESTERID"="sdu"."USERID" 
LEFT JOIN "AaaUser" "aau" ON "sdu"."USERID"="aau"."USER_ID" 
LEFT JOIN "DepartmentDefinition" "dpt" ON "wo"."DEPTID"="dpt"."DEPTID" 
LEFT JOIN "WorkOrderStates" "wos" ON "wo"."WORKORDERID"="wos"."WORKORDERID" 
LEFT JOIN "CategoryDefinition" "cd" ON "wos"."CATEGORYID"="cd"."CATEGORYID" 
LEFT JOIN "WorkOrder_Queue" "woq" ON "wo"."WORKORDERID"="woq"."WORKORDERID" 
LEFT JOIN "QueueDefinition" "qd" ON "woq"."QUEUEID"="qd"."QUEUEID" 

WHERE   wo.ISPARENT='1' AND wo.CREATEDTIME >=  AND wo.CREATEDTIME <= 

GROUP BY "wos"."ISOVERDUE"

android – java – how to take a picture of a google result in real time

I have a autocomplete text view of cities and I want them to write and leave the results in the following format: a photo of this city and the name of the city. That the name comes out I solved it, but I have no idea how to upload a photo of this city in real time and put it next to the name.

I add the codes of what I did:

ArrayAdapter adapter = new ArrayAdapter<>(context, android.R.layout.select_dialog_item, Cities);

        txtInputSource.setThreshold(1);
        txtInputDestiny.setThreshold(1);

        txtInputSource.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView
        txtInputDestiny.setAdapter(adapter);//setting the adapter data into the AutoCompleteTextView 

It works well. How do I create a custom adapter of this type and upload the photo?

Enter image description here

I want to get something like that. With a picture of the city.

mysql – Additional select statement within cursor ends the loop, unless the select statement returns a result for all cursor lines

I have a simple database called & # 39; held_toys & # 39; (a held toy is a toy that is not yet for sale), which consists of a primary key and a foreign key for a toy. I have a second table called "toys_on_sale", which also consists of a primary key and a foreign key of a toy.

I have to use a cursor to scroll through all held_toys, insert unsold toys into the toys_on_sale table and delete toys that have already been sold from held_toys.

When debugging my cursor, I noticed that the infinite loop is repeated only once, unless the Toys in held_toys (after Toy ID) are in the toys_on_sale table. So the problem must be to have the following SELECT statement in my LOOP:

DROP PROCEDURE IF EXISTS sp_Toys_On_Sale
$$
CREATE PROCEDURE `sp_Toys_On_Sale`(inToyIds text)
begin

DECLARE finished INTEGER DEFAULT 0; 
DECLARE heldId BIGINT;
DECLARE heldToyId BIGINT;
DECLARE existingSaleId BIGINT;

DECLARE curHeldToys
    CURSOR FOR
        select ht.ID, ht.TOY_ID
        from held_toys as ht
        where find_in_set(ht.TOY_ID,inToyIds);

    DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 1;

    OPEN curHeldToys;

    getHeldToys: LOOP

        SET existingSaleId = 0;

        FETCH curHeldToys INTO heldId, heldToyId;
        IF finished = 1 THEN
            LEAVE getHeldToys;
        END IF;

        #LOOP only runs once if heldToyId is not found (even though there are 500 records in held_toy), I want the loop to continue regardless if the select below returns no results
        select
            tos.ID
        from toys_on_sale tos
        where tos.TOY_ID = heldToyId INTO existingSaleId;

        IF existingSaleId > 0 THEN
            DELETE FROM held_toys WHERE ID = heldId;

        ELSE
            INSERT INTO toys_on_sale (TOY_ID) VALUES (heldToyId);

        END IF;

        DELETE FROM held_toys WHERE ID = heldId;

    END LOOP getHeldToys;
    CLOSE curHeldToys;


end
$$

I know the problem is:

#LOOP only runs once if heldToyId is not found (even though there are 500 records in held_toy), I want the loop to continue regardless if the select below returns no results
        select
            tos.ID
        from toys_on_sale tos
        where tos.TOY_ID = heldToyId INTO existingSaleId;

However, I lack the knowledge of how to embed a SELECT like this in a CURSOR that can be ignored if it doesn't produce any results. Instead of getting the CURSOR to end the loop.

Any help is appreciated!

magento2 – Take the entered result value and add it to the shopping cart

I have to retrieve the result value of this calculator so that I can add it to the shopping cart for individual and configurable products from the product page.

Enter image description here
I add the calculator to catalog_product_view.xml



Then I copied the code from addtocart.phtml to calc.phtml as a button and changed the QUANTITY to my result value (var meter).

shouldRenderQuantity()) :?>
getChildHtml('', true) ?>

The block didn't even appear after I entered the code above. I would be grateful for any help