WordPress JSON return unknown characters fo non English characters

for a project i create an endpoint something like wp-json/HSE/v1/reports which return json file everything is okey , also Engligh words , but for non English words i have real problem that its bring back something like \u0645\u0627\u0647\u0627\u0646 \u0633\u06cc\u0631\u062c\u0627\u0646 its confusing me at all .

i also check the wp-json/wp/v2/posts and watch the same problem .English words are fine but non English words are not readable .

what should i do to fix this ? anyone can help me please ?

self extending factory: return type and serialization

I’m trying to implement a better management for the objects in my game project. With input from another thread here on S.O., I decided to implement different collections for different types for better access. Seems to be a common way. So far I #included all the class files and added containers (just maps right now) for each type I needed/wanted, as well as functions to create/add/remove etc., that take care of what is needed. That way no free objects exist (object’s constructors are private) that could be missed somewhere. But ofc that means for every new type the container/manager/factory needs to be modified and that’s error prone. So I wanted to try and make it self extending with a registration like this:

template<typename ObjectType> class Registration {     public:         Registration(const std::string& typeID)                                                                                                         {             EntMan::getInstance()->registerTypeCreator(typeID, [] (Properties* props)->Entity* {return new ObjectType(props); } );         } }; 

saving it in a std::map<std::string, std::function<Entity*(Properties* props)> >. This works, ofc it’s a common pattern, but has especially one flaw: the return type. I could add as much additional containers, defined by tags for example, as I want (shurely helps with iteration/preselection), but the contained items would always be just base class pointers. So if I get an item I still would need to dynamic_cast (or static_cast with if(object->getType == "someThing") ) it to the derived type to get full derived access to the object. Seems wasteful and error prone. Integrating all functionality with virtual functions would solve this, but in the end turns the base in a kind of blob class. Doesn’t feel right either. Let alone the fact that it would also be also pretty horrible for data locality. Not my main concern right now, but maybe will be in the future.

I’m a bit uneasy with the Properties "parameter amalgamation"-workaround aswell, to fullfill the std::function criteria of having the same signature, as it’s a bit error prone doing it "by hand" for example, but should be less of a problem once it’s abstracted away with parsing those as prefabs from files and accessing those. Still, it also would mean a lot of wasted space to save those as prefabs… So I’m at my wits end here.

How could I go on from here, if I need…

  • different collections for different types (for preselection)
  • acessors delivering the proper derived types (for avoiding casts and blobs)
  • self extending, no modification needed just for adding types
  • serializable use (ie: create("stone") for use with parsing functions of xml data etc. )

Can this be done? Or is this a dead end? No good idea at all? Thanks in advance for any help.

Can Mending return an ornamented object to a flawless state?

I have a small hand mirror broken into two. The mirror glass itself was already broken into pieces, but the important part is the ornamented back of the hand mirror, which depicts an encrypted map.

The “tear” is no more than 1 foot, but gathering all the chips from the back of the mirror is impossible. (Imagine you are piecing a broken vase back together. You would end up with a gap that should be filled with small, fine pieces.)

Assuming that those fine chips (from the back of mirror) are lost (no time to retrieve), can Mending repair the back of the mirror to its former state, with the perfect state of the encrypted map?

Mysql get records more then 3 in interval of 1 minute, return group_concat ID

Currently i have this dataset, i need to return grouped ids that are within the range of 60 seconds and have more than 3.

CREATE TABLE test  (   `id` bigint NOT NULL AUTO_INCREMENT,   created_date TIMESTAMP(1) NOT NULL,   origin_url   VARCHAR (200) NOT NULL,   client_session_id VARCHAR (50) NOT NULL,   PRIMARY KEY (`id`),   UNIQUE KEY `UC_PRE_CHAT_TALKID_COL` (`id`) ); 
INSERT INTO test VALUES (1,'2021-01-18 11:02:24.0', 'https://zendes.com/', 'znkjoc3gfth2c3m0t1klii'), (2,'2021-01-18 11:02:35.0', 'https://zendes.com/', 'znkjoc3gfth2c3m0t1klii'), (3,'2021-01-18 11:02:03.0', 'https://zendes.com/', 'znkjoc3gfth2c3m0t1klii'), (4,'2021-01-18 11:11:28.0', 'https://rarara.com/', 'znkjoc3gfth2c3m0t1klii'), (5,'2021-01-18 11:11:36.0', 'https://rarara.com/', 'znkjoc3gfth2c3m0t1klii'), (6,'2021-01-18 11:11:05.0', 'https://rarara.com/', 'znkjoc3gfth2c3m0t1klii'); 

db<>fiddle here

something like this:

ids     origin_url              client_session_id 1,2,3   https://testett.com/    znkjoc3gfth2c3m0t1klii 4,5,6   https://rarara.com/     znkjoc3gfth2c3m0t1klii 

Return product list based on current product attribute

I have modified my single-product.php and want to pop in a block of other products that share the same brand name which I have specified in a product attribute called ‘brand’.

This is my code so far but it is returning all the products and NOT filtering by the pa_brand.

<!-- Custom 4 up product filtered by Brand attribute -->         <ul class="products">                 <?php             $  args = array(                 'post_type' => 'product',                 'posts_per_page' => 4,                 'taxonomy' => 'pa_brand',                 'field'    => 'slug',                 'terms'    => $  product->get_attribute( 'brand' )                 );             $  loop = new WP_Query( $  args );             if ( $  loop->have_posts() ) {                 while ( $  loop->have_posts() ) : $  loop->the_post();                     wc_get_template_part( 'content', 'product' );                 endwhile;             } else {                 echo __( 'No products found' );             }             wp_reset_postdata();         ?>     </ul><!–/.products–> 

How can I call a SQL Server stored procedure from Oracle and retrieve a scalar return value?

I’m developing a PL/SQL solution in Oracle Database Enterprise Edition I’m calling stored procedures in Microsoft SQL Server 2014.

I am using DG4ODBC with the DBMS_HS_PASSTHROUGH package to call those stored procedures.

For stored procedures that return a tabular result set, I am able to use PARSE, FETCH_ROW, and GET_VALUE to retrieve the values. (My solution uses hard parsing, but it works for the volume we’re expecting. I’m open to tips if you know how I can use binds, but that’s not my question.)

DECLARE    sql_server_cursor_     BINARY_INTEGER;    sql_server_statement_  VARCHAR2(32767);    fetched_value_col1_    whatever_type_from_col1;    fetched_value_col2_    whatever_type_from_col2; BEGIN    sql_server_statement_ := 'EXEC "myDatabase"."dbo"."myProcedure" @p_one = N''' || sanitize__(my_argument_) || ''';';    sql_server_cursor_ := dbms_hs_passthrough.open_cursor@sql_server_link_;    dbms_hs_passthrough.parse@sql_server_link_(sql_server_cursor_, sql_server_statement_);    WHILE dbms_hs_passthrough.fetch_row@sql_server_link_(sql_server_cursor_) > 0    LOOP       dbms_hs_passthrough.get_value@sql_server_link_(sql_server_cursor_,  1, fetched_value_col1_);       dbms_hs_passthrough.get_value@sql_server_link_(sql_server_cursor_,  2, fetched_value_col2_);       dbms_output.put_line('fetched_value_col1_  ' || fetched_value_col1_);       dbms_output.put_line('fetched_value_col2_  ' || fetched_value_col2_);    END LOOP;    dbms_hs_passthrough.close_cursor@sql_server_link_(sql_server_cursor_); END; / 

I have a stored procedure in SQL Server that returns a scalar integer.

DECLARE @return_value int; EXEC @return_value = "myDatabase"."dbo"."myProcedure" @p_one = N'HelloWorld', @p_two = 42; SELECT @return_value; 

From Oracle, how would I call this procedure and retrieve that scalar value?

Problem with return 2 libc in 64 bit arch

Good day guys I want to perform return to libc in 64 bit architecture using execve. I found a gadget with /bin/sh in it (the /bin/sh offset is 18a143):

   cbcd8:       00 00     cbcda:       4c 89 ea                mov    rdx,r13    cbcdd:       4c 89 e6                mov    rsi,r12    cbce0:       48 8d 3d 5c e4 0b 00    lea    rdi,[rip+0xbe45c]        # 18a143 <_libc_intl_domainname@@GLIBC_2.2.5+0x17e>    cbce7:       e8 94 f9 ff ff          call   cb680 <execve@@GLIBC_2.2.5> --    cbd92:       48 85 c0                test   rax,rax 

now I fill the return address (RIP) with (address of libc + 0xcbce0) with this payload:

r $  (python -c 'print "A"*120 + {libc+-xcbce0}') 

. Here are the registers:

RAX: 0xffffffffffffffff  RBX: 0x0  RCX: 0xffffffffffffff80  RDX: 0x0  RSI: 0x555555555060 (<_start>:  xor    ebp,ebp) RDI: 0x7ffff7f79143 --> 0x68732f6e69622f ('/bin/sh') RBP: 0x4141414141414141 ('AAAAAAAA') RSP: 0x0  RIP: 0x7ffff7ebacef (<maybe_script_execute+175>:        mov    rax,QWORD PTR [rbp-0x28]) R8 : 0xffffffff  R9 : 0x8a  R10: 0x7fffffffdfb0 ('A' <repeats 120 times>, "443777") R11: 0x202  R12: 0x555555555060 (<_start>:  xor    ebp,ebp) R13: 0x0  R14: 0x0  R15: 0x0 

and here are tho codes around execve:

 0x7ffff7ebace0 <maybe_script_execute+160>:   lea    rdi,[rip+0xbe45c]        # 0x7ffff7f79143    0x7ffff7ebace7 <maybe_script_execute+167>:   call   0x7ffff7eba680 <execve>    0x7ffff7ebacec <maybe_script_execute+172>:   mov    rsp,rbx  0x7ffff7ebacef <maybe_script_execute+175>:   mov    rax,QWORD PTR [rbp-0x28]    0x7ffff7ebacf3 <maybe_script_execute+179>:   sub    rax,QWORD PTR fs:0x28    0x7ffff7ebacfc <maybe_script_execute+188>:   jne    0x7ffff7ebad4b <maybe_script_execute+267>    0x7ffff7ebacfe <maybe_script_execute+190>:   lea    rsp,[rbp-0x18]    0x7ffff7ebad02 <maybe_script_execute+194>:   pop    rbx 

but it not works and gives Bus Error.Thanks for help.

How does the cache / memory know where to return results of read requests to?

The pipeline of a modern processor has many stages that may issue read requests to main memory, e.g. in fetching the next command or loading some memory location into a register. How is the result of a read request returned to the right pipeline stage, given that there are more than one possible recipients? Since most CPUs access main memory via a cache hierarchy, the question becomes: how does the L1 cache know which part of the pipeline to return a result to?

I imagine that access to the L1 cache is queued, but each access presumably needs a ‘return address’. How is this typically handled?