c ++ – My function stays in enter quantity

I did a function that looks for an id and an ids, and if the 2 are equal then it means that the combination of id / ids exists, and it will ask you the amount you want to add to the "cart", and then go to take the amount to a text file, but it doesn't let me go from entering the amount

it's called createnote but actually verify that what you want to add to the "cart" exists

void crearnota(){

    char n(4);
    char m(6);
    cout<<"ID: ";
    cout<<"IDS: ";


        cout<<"Cantidad: ";



mysql – Function preset with 0x

I have a table created with

Create table log (
    ip VARBINARY(16)

I can insert on the table with Insert into log values (INET6_ATON("")).

When I use phpMyAdmin in the "Insert" tab, I choose INET6_ATON as the function and as the value When I press "Go", the query becomes

INSERT INTO `log` (`ip`) VALUES (INET6_ATON(0x127.0.0.1))

I have also tried "" Y '' as the value become INET6_ATON(0x"") Y INET6_ATON(0x'').

How can I use phpMyAdmin to insert with INET6_ATON('')?

How do you conform to a function icon style?

This question may be vague, so let me know if I need to provide details, but mainly I'm looking for some address.

I am currently working on the design of function icons for my company's dashboard. I have never done extensive work on icons before and, while exploring different styles, I am overwhelmed with the amount of directions in which I can take this. I was wondering if anyone has any advice on how to reduce the style of icons that we should have to represent our company or even how they approach icon design. Just to clarify, this is not for simple icons such as copying, saving, editing, etc., they are more complex that represent concepts. So, in general, how does one approach the design of the iconography of a product?

Thank you!

Difference between direct and indirect function calls ()

I'm curious about the difference between direct and indirect function calls ()

Could someone help in the analysis of differences?

The c source code can be found in subroutine_direct.c and subroutine_indirect.c

Note: diff could be regenerated using the command: objdump -drwC -Mintel subroutine_indirect

node.js – KISS vs DRY: is wrapping a single function in a React component an antipatron?

Keeping it simple (KISS)

I am using the npm Numeral.js package in my web project to format things like cash values ​​and percentage values. The number is very simple to implement and, when reading the code, it is very clear how the output value (formatted) will look. In essence, the Numeral.js package itself is the "auxiliary" function and (apart from importing the package) it is not necessary to create or edit other files for this format to work in an HTML view component.


// outputs $120,000.00


Don't repeat yourself (DRY)

On the other hand, a co-worker suggested that you wrap the above code in a single purpose React.js component "to keep it DRY". The only problem I see here is that it seems redundant since the component contains the exact code shown above, with the inconvenience of hiding the developer's implementation details.


// outputs $120,000.00

Is this an antipatron?

By Introduction to Software Engineering / Architecture / Anti-Patterns:

In software engineering, an antipater is a pattern that can be commonly used but is ineffective and / or counterproductive in practice.

Some say it is DRY when the implementation is likely to change over time. However, in this case, it will never be necessary to change the currency format, so it seems that KISS> DRY makes more sense.

In this example, I find that wrapping an auxiliary library (Numeral.js) in another component container is a good idea in theory, but it hides implementation and propagation across multiple files (when work can be done using the single liner above in the example of KISS) it ends up being counterproductive in the long term.

In short, should DRY theory replace KISS theory, or vice versa? Is the DRY theory taking too far to wrap an "auxiliary" library into another "auxiliary" function or component? Does taking DRY theory too seriously lead to the creation of antipatrons?

I am interested in hearing the perspective of other experienced developers when it comes to similar scenarios.

Relates to:
Battery exchange: what should I consider when the DRY and KISS principles are incompatible?

CONSULTATION Function with sorting

I need to get data from tab 1 to tab 2 but not empty cells. I think the QUERY function should work but it can't make it work. I made a proof sheet that you can check in this link: Test

How to replace values ​​in a Python function

I want to write a function that adds points iteratively.

The way I tried to do this was that if my initial points were P and Q, I calculate P + Q with some elliptic curve formulas that may or may not be correct, but that is not what this question is about.

So, I want to replace Q with P + Q, but the code doesn't do this. It only returns P + Q infinitely many times.

(Context: it is assumed that there is an integer m such that mP = Q, and the x coordinate of Q is 8)

x_1=  7
y_1 = 14

def add_points(x_2,y_2):
points = ()

    while x_2 != 8:
        num_lmbda = (y_2 - y_1)  %103
        dem_lmbda = (x_2 - x_1)  %103 
        dem = modinv(dem_lmbda, 103) 
        lmbda = (num_lmbda *dem)%103

        x_3 = (lmbda **2 - 1 - x_1 -x_2) %103
        v = y_1 - lmbda*x_1
        y_3 = (lmbda * x_3 + v) %103

        points.append (( x_3,y_3))
        x_2 == x_3
        y_2 == y_3

    return points 

For example, if I leave x_2, y_2 = (3.6), the function generates (96, 89) infinitely.

Problems converting a pow () module function from LUA to Python

I tried to rewrite a LUA function mod_pow () (which works) in python. The syntax and everything seem fine to me, so I'm not sure what I'm missing, does anyone know what I need to change in my Python code to make it work and give 81 as an answer as the LUA code does?

LUA work code:

function modPow(b,e,m)
        if m == 1 then
                return 0
                local r = 1
                b = b % m
                while e > 0 do
                        if e % 2 == 1 then
                                r = (r*b) % m
                        e = e >> 1     --use 'e = math.floor(e / 2)' on Lua 5.2 or older
                        b = (b^2) % m
                return r


Python code that does not work:

def modular_pow(b, e, m):
    if m == 1: 
       return 0
      b = b % m
      while e > 0:
        if e % 2 == 1:
           r = (r*b) % m
        e = e >> 1
        b = (b^2)% m
    return r


Reverification function failed (try again)

It has been a while, but I was wondering again if this could be easily implemented.
Only one option to recheck the failed Verification list in that pop-up list.
Some time ago I was planning to make a batch file to use to do SOMETHING. I can't remember exactly what …
Maybe I was saving the verified list BEFORE manually running the Reverify links so that after the subsequent verification, I could match to see which ones were removed and put them back in Verified just before manually rechecking next time, to recheck?
I think I did this monthly but lost the other data fields …
Searching in GSA publications; I know I mentioned it here.

Complex dynamics: Function to recover the park's capacity for visitors?

I'm getting used to Vensim to model the dynamics of the system. To train, I am busy with a dynamic system of visitors to the park. Where you have modeled the following Stock and Flowchart:

For the equation of & # 39; Maximum capacity & # 39; I have defined it as:

maximum capacity = – (0.05 * number of visitors)

And I have also set the initial value to 400,000 visitors per year maximum.

This means that the load capacity decreases by 5% of the total number of visitors from the previous year. This results in the following diagram:

Now I want to make the park regain its capacity again. Initially I thought of something like:

IF THEN MORE (Maximum capacity <250000, 0.05 * Maximum capacity, – (0.05 *
Number of visitors))

This gives the following diagram:

As you can see, in reality it not only prevents capacity from continuing to decline with 5%.

How can I get the capacity to recover again to 400,000 over time?