json – How to avoid using php: // input

I have a POST endpoint that receives a JSON load.

I am using the Magento Framework App Request Http class to try to recover my POST data.

If I run $ data = $ this-> request-> getPost ();, so $ data it will be empty

However if I run $ data = file_get_contents (& # 39; php: // input & # 39;); I can see my JSON load as a string.

Is there a way to grasp this natively through Magento?

FWIW I'm testing this through a rest point / V1 through Postman. This is a POST request with a portion of JSON data (valid) in the raw data type.

Theory of complexity. Decision problems with complex input validation.

In response to a question about input validation in decision problems, @Apass Jack wrote

It is easy to verify if a problem instance is valid or not for almost all the decision problems in which people have been interested. It is so easy and so common that people have become so sloppy or efficient that this verification step is usually omitted or even forgotten in the specification of an algorithm. That could be the source of your confusion.

Are there decision (non-pathological) problems for which input validation is as complex or more complex than calculating the actual decision for an already validated entry?

Pass parameter of the input value of the html with php


By clicking "Publish your response", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

javascript – Uncaught SyntaxError: Unexpected end of input, when I'm going to validate the code, that message always appears on line 77

I find an error in your part of JavaScript, try to delete , of events onclick of the buttons.

switch for:

I also advise changing the ID of these two buttons, they are the same.

If it does not solve it, please post the function code show something () Y showDobro (), or what line is 77.

What is the best mobile keyboard for the alphanumeric input type?

I need to configure the best keyboard for a user to enter the license plate number of their car.

In the country for which I develop, those are alphanumeric (I do not know any country where they are not, I only say).

I searched the visual guide of my platform for keyboard type options and nothing satisfied my need.

I find it very annoying to enter the number. WW1E1E, which is a valid registration number. And I'm fast on my mobile keyboard.

I can only imagine the frustration of someone inexperienced who needs to change alpha and numeric up to 4 times while writing a string of 7 characters.

What kind of keyboard should I go with?

The left side is iOS, the right side is Android (where visible password It's fine, just hacky, I guess).

enter the description of the image here

javascript – value of input returned null when called in js

but I do not know what to do, but I do not know what to do, but I do not know what to do. (in the case that it is not in the list), the value corresponding to it in the array and shows it in another place on the same page (I am doing this because these values ​​remain in a map api and for the user not having reload the page by clicking on a value and go to another page, the values ​​there msm), but when calling the function the value always comes as null regardless of the value

: in the original code and used because there are several boxes generated in a loop.

  
<input type = "text" name = "."value =""> <? php echo (" Click here ");?>
height = document.documentElement.clientHeight;
screen_height = height - 56;
document.getElementById ("map"). style.height = screen_height + "px";
document.getElementById ("main_pontos"). style.height = screen_height + "px";
("some points can be found in the wrong location or not be registered in our system, if one of the aforementioned is perceived to be in contact with us and helps us improve our system");

Line opening function (x) {


var name = "point_id";

document.getElementById (& # 39; lines & # 39;). style.height = screen_height + "px";
document.getElementById (& # 39; lines & # 39;). style.top = "0em";

var id_ponto = document.getElementById (name) .value;

document.getElementById (& # 39; id_box & # 39;). value = point_id;

}

Line closing function () {
document.getElementById (& # 39; lines & # 39;). style.height = "200px";
document.getElementById (& # 39; lines & # 39;). style.top = "-200px";

}

c ++ – Refactor program that generates input binary values

I'm looking to simplify my main function (). Nested if statements contain four lines of the same code, and I'm not sure how to refactor and simplify them. I was trying to use Boolean values, which seemed like a safe bet, but the logic gets sidetracked in the process.

#include 
#include 
#include 

int bits (unsigned d long) {
int l;

yes (d <= 255) {
        l = 8;
    }
    else if (d > 255 && d <= 65535) {
        l = 16;
    }
    else if (d > 65535 && d <= 4294967295U) {
l = 32;
}
else {
std :: cout << "32 bits (4294967295) or lower". << std :: endl;
}

std :: cout << "Bits ....................." << l << std :: endl;

returns l
}

std :: string convertToBinary (long decimal without sign) {
int l = bits (decimal);
int i, r;
std :: string str;

// create an array
for (i = 0; i <l; i ++) {
r = decimal% 2;
decimal / = 2;
str + = std :: to_string (r);
}

// invert the matrix for the binary value
reverse (str.begin (), str.end ());

std :: cout << "Binary value ............." << str << std :: endl;

back str
}

int main (void) {
std :: string input;
std :: cout << "------------ Input -----------" << std::endl;
    std::cin >> entry;

std :: cout << "Input:" << input << std :: endl;
std :: cout << "Length:" << input.length () << std :: endl;

int i, count = 0, j = 0;
int length = input.length ();
int ascii;
long unsigned numbers;

int numbers[33];
std :: binary strings;
std :: character strings;

for (i = 0; i <length; i ++) {
// if the next entry is digit
if (isdigit (input)[i])) {
numbers[j] = entry[i];
// place the digit in the next decimal place
account = (numbers[j] - & # 39; 0 & # 39;) + count * 10;
// if the next entry is char
if (i == length - 1) {
if (isdigit (input)[length - 1])) {
nums = account;
std :: cout << "------------" << nums << "------------" << std :: endl;
binary + = convertToBinary (numbers) + & # 39; & # 39 ;;
account = 0;
}
}
// next number
j ++;
}
// if the next entry is char
else {
characters[i] = entry[i];
ascii = (int) characters[i];
// if the next entry is digit
yes (count! = 0) {
nums = account;
std :: cout << "------------" << nums << "------------" << std :: endl;
binary + = convertToBinary (numbers) + & # 39; & # 39 ;;
account = 0;
}
//! = end of letters
std :: cout << "------------" << characters[i] << "------------" << std :: endl;
std :: cout << "ASCII ...................." << ascii << std :: endl;
binaries + = convertToBinary (ascii) + & # 39; & # 39 ;;
}
}

std :: cout << " n ------- Binary value of" << input << "-------" << std :: endl;
std :: cout << binaries << std :: endl;

returns 0;
}

The program takes an input and then generates the corresponding number of bits, the binary value and, if necessary, an ASCII value. If the user enters "c357g98", the program must obtain ASCII and binary values ​​of "c", then retrieve the binary value of "357" (instead of "3", "5", then "7" individually), for what any adjacent digit will be treated as a single int instead of separate integers. Every time I try to refactor, the program loses its ability to store the adjacent digits together as a single int.

Analyze BTC transactions Blockchain input and output addresses

I'm experimenting with analyzing the blockchain using rusty-blockparser. I wonder if it is possible to analyze large amounts of transactions / blocks, resulting in the entry addresses and the exit directions of the transaction, similar to using a blockchain browser to search for a specific transaction.

Due to the large number of transactions that I would like to process, using an API for this would not be possible and I have not found a suitable solution that uses a blockchain analyzer, etc. The suggestions would be very appreciated. Thank you.

Convert natural input to the executable function of Python

I have been developing a graphing calculator, and to allow the user's natural input, I have written a function that converts its input into a readable form of python.

This is the first time I use regular expressions, and I think I managed to get each of the expressions to do what I wanted.

However, as can be seen, there are several different cases to consider, so the function is relatively long considering what it does.

I was wondering if there was a better solution than this to solve my problem, but if not, can I improve my implementation?

def edit_function_string (func):
"" "Convert the input function to an executable form of Python" ""

func = re.sub (r & # 39;  s + & # 39 ;, & # 39; & # 39 ;, func) # Remove blank spaces

func = re.sub (r & # 39; ( d +) x & # 39 ;, r & # 39;  1 * x & # 39 ;, func) # replaces & # 39; nx & # 39; by & # 39; n * x & # 39;
func = re.sub (r & # 39;  ^ & # 39 ;, r & # 39; ** & # 39 ;, func) # replaces & # 39; ^ & # 39; by & # 39; ** & # 39;
func = re.sub (r & # 39; (math .)? ceil (ing)? & # 39 ;, math.ceil & # 39 ;, func) # replaces & # 39; ceil (ing) & # 39; with & # 39; math.ceil & # 39;
func = re.sub (r & # 39; (math .)? floor & # 39 ;, & # 39; math.floor & # 39 ;, func) # replaces & # 39; floor & # 39; by & math.floor & # 39;
func = re.sub (r & # 39; (math  .f)? abs (olute)? | modulus & # 39 ;, & # 39; math.fabs & # 39 ;, func) # replaces & # 39; abs ( olute) & # 39; with & # 39; math.fabs & # 39;
func = re.sub (r & # 39; (math .)? sqrt | root & # 39 ;, & # 39; math.sqrt & # 39 ;, func) # replaces & # 39; sqrt & # 39; or & # 39; root & # 39; with & math.sqrt & # 39;
func = re.sub (r & # 39; (math .)? log | ln & # 39 ;, & # 39; math.log & # 39 ;, func) # replaces & # 39; log & # 39; log & # 39; or & # 39; ln & # 39; with & math.log & # 39;
func = re.sub (r & # 39; (math .)? exp & # 39 ;, & # 39; math.exp & # 39 ;, func) # replace & # 39; exp & # 39; exp & # 39; by & math.exp & # 39;

func = re.sub (r & # 39;  | (. +?)  | & # 39 ;, r & # 39; math.fabs ( 1) & # 39 ;, func) # replaces & # 39; | x | & # 39; with & math.fabs (x) & # 39; math.fabs (x) & # 39;
func = re.sub (r & # 39; ([w]+)! |  ((. +?) )! & # 39 ;, r & # 39; math.factorial ( 1  2) & # 39 ;, func) # replaces & x 39; x! & # 39; with & math.factorial (x) & # 39;

for f in (& # 39 ;, & # 39 ;, & # 39 ;, & # 39 ;, so & # 39 ;, & # 39; sinh & # 39 ;, & # 39; cosh & # 39 ;, & # 39; tanh & # 39;):
# replaces trigonometric or hyperbolic functions with the correct syntax
func = re.sub (r & # 39; ^ ( d *) {f}  (| ([+-*/()]) ( d *) {f}  (& # 39;. format (f = f),
r & # 39;  1  2  3math. {f} (& # 39;. format (f = f), func)

# replace trigonometric or inverse hyperbolic functions with the correct syntax
func = re.sub (r & # 39; ^ ( d *) a (rc?)? {f}  (| ([+-*/()]) ( d *) a (rc?)? {f}  (& # 39;. format (f = f),
r & # 39;  3  1  4math.a {f} (& # 39;. format (f = f), func)

for f, reciprocal in ((& # 39; & # 39; sec & # 39;, & # 39; cos & # 39;), (& # 39; cosec & # 39;, & # 39; without & # 39;), (& # 39; csc & # 39 ;, & # 39;) & # 39;), (& # 39; cot & # 39 ;, & # 39; tan & # 39;),
(& # 39 ;, & & # 39 ;, & # 39; cosh & # 39;), (& cose # & # 39 ;, & # 39; sinh & # 39;), (& # 39; csch & # 39 ;, & # 39; sinh & # 39;), (& # 39; coth & # 39 ;, & # 39; tanh & # 39;)):

# replaces reciprocal trigonometric or hyperbolic functions with the correct syntax
func = re.sub (r & # 39; ^ ( d *) {f}  ((. +?) ) | ([+-*/()]) ( d *) {f}  ((. +?) ) & # 39 ;. format (f = f),
r & # 39;  3  1  4 (1 / math. {reciprocal} ( 2  5)) & # 39 ;. format (reciprocal = reciprocal), func)

# replaces reciprocal reciprocal trigonometric or hyperbolic functions with the correct syntax
func = re.sub (r & # 39; ^ ( d *) a (rc?)? {f}  ((. +?) ) | ([+-*/()]) ( d *) a (rc?)? {f}  ((. +?) ) & # 39 ;. format (f = f),
r & # 39;  4  1  5 (1 / math.a {reciprocal} ( 3  7)) & # 39 ;. format (reciprocal = reciprocal), func)

for i in the range (2): # Run twice to deal with overlapping matches
for constant in (& # 39 ;, & # 39; pi & # 39 ;, & # 39; tau & # 39;):
# replaces & # 39; e & # 39 ;, & # 39; pi & # 39; or & # 39; tau & # 39; with & math.e & # 39; math.pi & # 39; math.pi & # 39; or & # 39; math.tau & # 39; Respectfully
# unless it's in another function like: & # 39; math.ceil & # 39;
func = re.sub (r & # 39; ^ ( d *) {constant} (x?) $ | ^ ( d *) {constant} (x?) ([+-*/(]) | & # 39;
r & # 39; ([+-*/()]) ( d *) {constant} (x?) ([+-*/()]) | & # 39;
r & # 39; ([+-*/)]) ( d *) {constant} (x?) $ & # 39 ;. format (constant = constant),
r & # 39;  6  10  1  3  7  11math. {constant}  2  4  8  12  5  9 & # 39; .format (constant = constant), func)

# replaces & # 39; math.ex & # 39 ;, & # 39; math.pix & # 39; or & # 39; math.tau & # 39; with & math.e * x & # 39 ;, math.pi * x & # 39; or & # 39; math.tau * x & # 39; Respectfully
# unless it is part of another function
func = re.sub (r & # 39; math . {constant} x ([+-*/()]) | math.ex $ & # 39 ;. format (constant = constant),
r & # 39; math {constant} * x  1 & # 39; .format (constant = constant), func)

func = re.sub (r & # 39; ([dx]) math . & # 39 ;, r & # 39;  1  2 * math. & # 39 ;, func) # replaces & # 39; nmath & # 39; with & # 39; n * math & # 39;
func = re.sub (r & # 39; ([dx])  (& # 39 ;, r & # 39;  1 * (& # 39 ;, func) # replaces & # 39; n (& # 39; with & # 39; n * (& # 39;

return function

beginner: method C that gets a string from the user input

I have created a simple function that gets a string from the user and returns a char* Fix with this entry. I would like to know how to best use the C tools to adapt this code to the C standards.

char * getstr ()
{
unsigned character buffer[128];
char counter = -1;

for(;;)
{
no signature char c;

buffer[++counter] = (c = (character without sign) getchar ()) == & # 39;  n & # 39 ;? & # 39;  0 & # 39 ;: c;

yes[counter] == (unsigned character) & # 39;  0 & # 39; || counter == 127)
{
buffer[++counter] = (character without sign) & # 39;  0 & # 39 ;;
break;
}
}

without signature char str[counter];
returns strncpy (str, buffer, counter + 1);
}