Add support for PHP7?

The five RC of PHP has been released, and PHP 7 is likely to be released on Nov 12 this year.

+1

+1

+1

+1

I have begun reviewing what changes need to be made to update it to PHP 7 and it doesn't look bad. Hoping to get it dive sometime in the next few weeks.

Great! Waiting for it too! Thank you for your work!

Would be great to use this, any estimation on when it might be ready?

+1

@christophermancini is there any update?

+1

+1

@christophermancini is there any update?

+1

+1

+1

+1

You can try php7 support here: https://github.com/serggp/php-protobuf/tree/php7
Pull request: https://github.com/allegro/php-protobuf/pull/63
Please let me know if something goes wrong

@serggp
https://github.com/serggp/php-protobuf/tree/php7
when i used this in production with php7,it went wrong!
/root/Downloads/php-protobuf/protobuf.c:90: error: ‘this_ptr’ undeclared (first use in this function)
/root/Downloads/php-protobuf/protobuf.c:90: error: (Each undeclared identifier is reported only once
/root/Downloads/php-protobuf/protobuf.c:90: error: for each function it appears in.)
/root/Downloads/php-protobuf/protobuf.c:104: warning: passing argument 1 of ‘_zval_ptr_dtor’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_variables.h:112: note: expected ‘struct zval *’ but argument is of typ
........

@cjhlai Looks like you were trying to compile the extension using master branch. Please make sure are yo are using php7 branch.

yes，I download from https://github.com/serggp/php-protobuf/tree/php7 ,so i am sure it is php7 branch.the errors occur when executing make && make install.

@cjhlai Your error message contains the following line: /root/Downloads/php-protobuf/protobuf.c:104
Take a look at this line in master branch: 104: zval_ptr_dtor(&val);
And then take a look at this line in php7 branch: 104:
Its empty. Call to zval_ptr_dtor(&val) was removed in php7 branch.
I tried to compile master branch I got the same error messages.
Compare your downloaded protobuf.c file with this one: https://github.com/serggp/php-protobuf/blob/php7/protobuf.c
And you will see the difference.

@serggp
yes,it is ok. thanks !

It can be build, but it will explode at least on x64.
I just took some time to create a project of it, and this is one of the many issues:
protobuf.c
86	long field_number;
87	zval **array, *value, **values, *val;
88
89	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &field_number, &value) == FAILURE) {

Now look at https://wiki.php.net/phpng-upgrading, the topic Parameters Parsing API changes.
That are x64 issues that also appeared in xdebug and pthreads.
It would be great if the PHP7 branch of serggp had a issue cue.

@techkey Thank you for pointing that out. It won't work for all platforms where sizeof(long) != sizeof(zend_long). However in most x64 cases they are equal and that's why I missed it.
I'll fix this as soon as possible.

@serggp I've replaced all long in php_protobuf.c to zend_long, and ulong to zend_ulong
At least 64bit fits, and 32bits too :)
I compile in the IDE so it's easy to spot and see function signatures. If someone is interested in the solution, project and prop files (MSVS 2015 (VC14)), just yell :)
Tests before:
> run-tests.cmd D:\_data\msvc2015\Projects\php-protobuf\tests

=====================================================================
PHP         : d:\php-sdk\phpdev\vc14\x64\7.0\php-7.0.6-src\x64\Release_TS\php.exe
PHP_SAPI    : cli
PHP_VERSION : 7.0.6
ZEND_VERSION: 3.0.0
PHP_OS      : WINNT - Windows NT TEKI-PC 10.0 build 10586 (Windows 10) AMD64
INI actual  : D:\php-sdk\phpdev\vc14\x64\7.0\php-7.0.6-src\x64\Release_TS\php-cli.ini
More .INIs  :
CWD         : D:\_data\msvc2015\Projects
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
PASS Protocol Buffers embedded message parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_embedded.phpt]
PASS Protocol Buffers parseFromString throws Exception if string is not protobuf-encoded message [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_error.phpt]
PASS Protocol Buffers repeated field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_repeated.phpt]
PASS Protocol Buffers repeated object field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_repeated_obj.phpt]
PASS Protocol Buffers simple field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_simple.phpt]
FAIL Protocol Buffers repeated field accessors [D:\_data\msvc2015\Projects\php-protobuf\tests\repeated_field_accessors.phpt]
PASS Protocol Buffers embedded message serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_embedded.phpt]
PASS Protocol Buffers serializeToString() throws Exception if required field not set [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_error.phpt]
PASS Protocol Buffers repeated field serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_repeated.phpt]
PASS Protocol Buffers simple field serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_simple.phpt]
FAIL Protocol Buffers setting floating-point value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_float_field.phpt]
FAIL Protocol Buffers setting integer value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_int_field.phpt]
FAIL Protocol Buffers setting object value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_object_value.phpt]
FAIL Protocol Buffers setting string value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_string_field.phpt]
=====================================================================
Number of tests :   14                14
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    5 ( 35.7%) ( 35.7%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    9 ( 64.3%) ( 64.3%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Protocol Buffers repeated field accessors [D:\_data\msvc2015\Projects\php-protobuf\tests\repeated_field_accessors.phpt]
Protocol Buffers setting floating-point value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_float_field.phpt]
Protocol Buffers setting integer value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_int_field.phpt]
Protocol Buffers setting object value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_object_value.phpt]
Protocol Buffers setting string value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_string_field.phpt]
=====================================================================

Tests after:
> run-tests.cmd D:\_data\msvc2015\Projects\php-protobuf\tests

=====================================================================
PHP         : d:\php-sdk\phpdev\vc14\x64\7.0\php-7.0.6-src\x64\Release_TS\php.exe
PHP_SAPI    : cli
PHP_VERSION : 7.0.6
ZEND_VERSION: 3.0.0
PHP_OS      : WINNT - Windows NT TEKI-PC 10.0 build 10586 (Windows 10) AMD64
INI actual  : D:\php-sdk\phpdev\vc14\x64\7.0\php-7.0.6-src\x64\Release_TS\php-cli.ini
More .INIs  :
CWD         : D:\_data\msvc2015\Projects
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
PASS Protocol Buffers embedded message parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_embedded.phpt]
PASS Protocol Buffers parseFromString throws Exception if string is not protobuf-encoded message [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_
error.phpt]
PASS Protocol Buffers repeated field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_repeated.phpt]
PASS Protocol Buffers repeated object field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_repeated_obj.phpt]
PASS Protocol Buffers simple field parsing [D:\_data\msvc2015\Projects\php-protobuf\tests\parse_simple.phpt]
PASS Protocol Buffers repeated field accessors [D:\_data\msvc2015\Projects\php-protobuf\tests\repeated_field_accessors.phpt]
PASS Protocol Buffers embedded message serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_embedded.phpt]
PASS Protocol Buffers serializeToString() throws Exception if required field not set [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_error.ph
pt]
PASS Protocol Buffers repeated field serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_repeated.phpt]
PASS Protocol Buffers simple field serialization [D:\_data\msvc2015\Projects\php-protobuf\tests\serialize_simple.phpt]
PASS Protocol Buffers setting floating-point value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_float_field.phpt]
PASS Protocol Buffers setting integer value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_int_field.phpt]
PASS Protocol Buffers setting object value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_object_value.phpt]
PASS Protocol Buffers setting string value [D:\_data\msvc2015\Projects\php-protobuf\tests\set_string_field.phpt]
=====================================================================
Number of tests :   14                14
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   14 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

The compiler complains a lot about conversion from 'zend_ulong' to 'uint32_t' which I plan to fix later (or you). Normally I set the warning level on 4 and treat warnings as errors. This is just a quick fix for now.
I hope this info is useful.

@techkey I've replaced all long values. Now it works for both x86 and x64.

/usr/share/protobuf/protobuf.c:78:2: warning: implicit declaration of function ‘ALLOC_INIT_ZVAL’ [-Wimplicit-function-declaration]
ALLOC_INIT_ZVAL(values);
^
In file included from /usr/include/php/20151012/main/php.h:40:0,
from /usr/share/protobuf/protobuf.c:1:
/usr/share/protobuf/protobuf.c: In function ‘zim_ProtobufMessage_append’:
/usr/share/protobuf/protobuf.c:43:35: error: ‘this_ptr’ undeclared (first use in this function)
#define RETURN_THIS() RETURN_ZVAL(this_ptr, 1, 0);

Hi there I got error when try make in php 7.0.0, this is the some error that I got
/Users/iqbalmaulana/Documents/Temp/php-protobuf/protobuf.c:113:3: error: use of undeclared identifier 'this_ptr'                 RETURN_THIS();                 ^ /Users/iqbalmaulana/Documents/Temp/php-protobuf/protobuf.c:62:35: note: expanded from macro 'RETURN_THIS' #define RETURN_THIS() RETURN_ZVAL(this_ptr, 1, 0);                                   ^ /Users/iqbalmaulana/Documents/Temp/php-protobuf/protobuf.c:117:3: error: use of undeclared identifier 'this_ptr'                 RETURN_THIS();                 ^ /Users/iqbalmaulana/Documents/Temp/php-protobuf/protobuf.c:62:35: note: expanded from macro 'RETURN_THIS' #define RETURN_THIS() RETURN_ZVAL(this_ptr, 1, 0);                                   ^ /Users/iqbalmaulana/Documents/Temp/php-protobuf/protobuf.c:120:3: error: use of undeclared identifier 'this_ptr'                 RETURN_THIS();
Thank you in advice

@serggp Hi again, some variable corruption occurs in file protobuf.c:
365	int expected_wire_type, str_size, pack_size, subpack_size, ret, field_repeated;
366	zval arg, *args, *field_descriptor, *field_type, field_descriptors, name, *old_value, value, *values, zret;
367	int bool_value;
368
369	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &pack, &pack_size) == FAILURE)
370		return;

The variable pack_size should be of type size_t
Reference: https://wiki.php.net/phpng-upgrading#parameters_parsing_api_changes
I was looking at a failed test, packed field serialization, in release build so I tried a debug build and suddenly got 10 failed tests and memory corruptions. After a quick peek in the code I've noticed the above. After correcting it the memory corruption was gone and still 1 failed test at which I'm looking at now.
Compiled in VS2015 Update 3 IDE on Windows 10 build 14393 x64 running PHP7.1.0RC3.

@techkey Thank you for your report. I'll try to fix it as soon as possible.
Btw, which test keeps failing besides 'packed field serialization'? I launched all the tests on ubuntu 32 and 64, and all of them succeeded.

@techkey Also I wouldn't recommend you to compile the extension for PHP 7.1.0RC3. This new version is not stable yet. I check how the extension runs with PHP 7.1 when stable version is ready. But before the release please use 7.0

php-protobuf/writer.h:26:5: note: expected ‘const char *’ but argument is of type ‘int’
int writer_write_string(writer_t *writer, uint32_t field_number, const char *st
^
Makefile:193: recipe for target 'protobuf.lo' failed
make: *** [protobuf.lo] Error 1

@serggp Thanks for the advice. I compile on the fly with all latest versions, including RC's to keep ahead of things. That's why I know already that xdebug also can expect problems very soon because of a changed error log call :)
Anyway, the failed test is serialize_packed.phpt.
 -I/root/php-protobuf -DPHP_ATOM_INC -I/root/php-protobuf/include -I/root/php-protobuf/main -I/root/php-protobuf -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/php-protobuf/protobuf.c -o protobuf.lo
mkdir .libs
cc -I. -I/root/php-protobuf -DPHP_ATOM_INC -I/root/php-protobuf/include -I/root/php-protobuf/main -I/root/php-protobuf -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-protobuf/protobuf.c  -fPIC -DPIC -o .libs/protobuf.o
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_append’:
/root/php-protobuf/protobuf.c:113: error: ‘this_ptr’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:113: error: (Each undeclared identifier is reported only once
/root/php-protobuf/protobuf.c:113: error: for each function it appears in.)
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_clear’:
/root/php-protobuf/protobuf.c:142: error: ‘this_ptr’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:153: warning: passing argument 1 of ‘zend_hash_clean’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:60: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_printDebugString’:
/root/php-protobuf/protobuf.c:180: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:172: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:180: warning: passing argument 1 of ‘zend_hash_get_current_key_type_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:170: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:180: warning: passing argument 1 of ‘zend_hash_move_forward_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:166: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:181: warning: passing argument 1 of ‘zend_hash_get_current_key_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:181: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition *’ but argument is of type ‘ulong *’
/root/php-protobuf/protobuf.c:181: error: too many arguments to function ‘zend_hash_get_current_key_ex’
/root/php-protobuf/protobuf.c:182: warning: passing argument 1 of ‘zend_hash_get_current_data_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:182: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:182: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c:191: error: invalid type argument of ‘->’ (have ‘int’)
/root/php-protobuf/protobuf.c:200: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:172: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:200: warning: passing argument 1 of ‘zend_hash_get_current_key_type_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:170: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:200: warning: passing argument 1 of ‘zend_hash_move_forward_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:166: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:201: warning: passing argument 1 of ‘zend_hash_get_current_key_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:201: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition *’ but argument is of type ‘ulong *’
/root/php-protobuf/protobuf.c:201: error: too many arguments to function ‘zend_hash_get_current_key_ex’
/root/php-protobuf/protobuf.c:202: warning: passing argument 1 of ‘zend_hash_get_current_data_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:202: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:202: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_dump’:
/root/php-protobuf/protobuf.c:255: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:172: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:255: warning: passing argument 1 of ‘zend_hash_get_current_key_type_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:170: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:255: warning: passing argument 1 of ‘zend_hash_move_forward_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:166: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:256: warning: passing argument 1 of ‘zend_hash_get_current_key_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:256: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition *’ but argument is of type ‘ulong *’
/root/php-protobuf/protobuf.c:256: error: too many arguments to function ‘zend_hash_get_current_key_ex’
/root/php-protobuf/protobuf.c:257: warning: passing argument 1 of ‘zend_hash_get_current_data_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:257: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:257: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c:266: error: invalid type argument of ‘->’ (have ‘int’)
/root/php-protobuf/protobuf.c:267: error: invalid type argument of ‘->’ (have ‘int’)
/root/php-protobuf/protobuf.c:269: error: invalid type argument of ‘->’ (have ‘int’)
/root/php-protobuf/protobuf.c:270: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:172: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:270: warning: passing argument 1 of ‘zend_hash_get_current_key_type_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:170: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:270: warning: passing argument 1 of ‘zend_hash_move_forward_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:166: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:271: warning: passing argument 1 of ‘zend_hash_get_current_key_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:271: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition *’ but argument is of type ‘ulong *’
/root/php-protobuf/protobuf.c:271: error: too many arguments to function ‘zend_hash_get_current_key_ex’
/root/php-protobuf/protobuf.c:272: warning: passing argument 1 of ‘zend_hash_get_current_data_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:272: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:272: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_count’:
/root/php-protobuf/protobuf.c:312: error: invalid type argument of ‘->’ (have ‘int’)
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_get’:
/root/php-protobuf/protobuf.c:340: warning: passing argument 1 of ‘zend_hash_index_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:156: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:340: error: too many arguments to function ‘zend_hash_index_find’
/root/php-protobuf/protobuf.c:340: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:363:69: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_parseFromString’:
/root/php-protobuf/protobuf.c:363: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:365: error: lvalue required as unary ‘&’ operand
/root/php-protobuf/protobuf.c:379: error: too many arguments to function ‘zend_hash_index_find’
/root/php-protobuf/protobuf.c:379: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:430: warning: passing argument 1 of ‘zend_lookup_class_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_execute.h:45: note: expected ‘struct zend_string *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:430: warning: passing argument 2 of ‘zend_lookup_class_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_execute.h:45: note: expected ‘const struct zval *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:430: warning: passing argument 3 of ‘zend_lookup_class_ex’ makes integer from pointer without a cast
/usr/local/php/include/php/Zend/zend_execute.h:45: note: expected ‘int’ but argument is of type ‘void *’
/root/php-protobuf/protobuf.c:430: error: too many arguments to function ‘zend_lookup_class_ex’
/root/php-protobuf/protobuf.c:430: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:443:94: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c:445: warning: passing argument 2 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:450:96: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c:453:48: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c:458: warning: passing argument 2 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:458: warning: passing argument 6 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:461: error: ‘IS_BOOL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_serializeToString’:
/root/php-protobuf/protobuf.c:520: warning: passing argument 4 of ‘zend_hash_get_current_key_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:168: note: expected ‘HashPosition *’ but argument is of type ‘ulong *’
/root/php-protobuf/protobuf.c:520: error: too many arguments to function ‘zend_hash_get_current_key_ex’
/root/php-protobuf/protobuf.c:521: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:521: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c:523: warning: passing argument 1 of ‘zend_hash_index_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:156: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:523: error: too many arguments to function ‘zend_hash_index_find’
/root/php-protobuf/protobuf.c:523: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:532: warning: passing argument 1 of ‘zend_hash_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:532: warning: passing argument 2 of ‘zend_hash_find’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char *’
/root/php-protobuf/protobuf.c:532: error: too many arguments to function ‘zend_hash_find’
/root/php-protobuf/protobuf.c:532: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:548: warning: passing argument 1 of ‘zend_hash_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:548: warning: passing argument 2 of ‘zend_hash_find’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char *’
/root/php-protobuf/protobuf.c:548: error: too many arguments to function ‘zend_hash_find’
/root/php-protobuf/protobuf.c:548: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:552: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:172: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:552: warning: passing argument 1 of ‘zend_hash_get_current_key_type_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:170: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:552: warning: passing argument 1 of ‘zend_hash_move_forward_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:166: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:553: warning: passing argument 1 of ‘zend_hash_get_current_data_ex’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:553: warning: passing argument 2 of ‘zend_hash_get_current_data_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:171: note: expected ‘HashPosition *’ but argument is of type ‘void **’
/root/php-protobuf/protobuf.c:553: error: too many arguments to function ‘zend_hash_get_current_data_ex’
/root/php-protobuf/protobuf.c:564:35: error: macro "RETURN_STRINGL" passed 3 arguments, but takes just 2
/root/php-protobuf/protobuf.c:564: error: ‘RETURN_STRINGL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_set’:
/root/php-protobuf/protobuf.c:578: error: ‘this_ptr’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c: In function ‘pb_print_field_value’:
/root/php-protobuf/protobuf.c:767: error: ‘IS_BOOL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:776: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c: In function ‘pb_print_debug_field_value’:
/root/php-protobuf/protobuf.c:802: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:808:52: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/root/php-protobuf/protobuf.c:808: error: ‘ZVAL_STRING’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:810: warning: passing argument 2 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:810: warning: passing argument 6 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c: In function ‘pb_dump_field_value’:
/root/php-protobuf/protobuf.c:830: error: ‘IS_BOOL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:835: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:842:38: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/root/php-protobuf/protobuf.c:842: error: ‘ZVAL_STRING’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:844: warning: passing argument 2 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:844: warning: passing argument 6 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c: In function ‘pb_get_field_descriptor’:
/root/php-protobuf/protobuf.c:858: error: too many arguments to function ‘zend_hash_index_find’
/root/php-protobuf/protobuf.c:858: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c:881:73: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c: In function ‘pb_get_field_descriptors’:
/root/php-protobuf/protobuf.c:881: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:883: warning: passing argument 2 of ‘call_user_function_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:472: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:883: warning: passing argument 4 of ‘call_user_function_ex’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:472: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c: In function ‘pb_get_field_name’:
/root/php-protobuf/protobuf.c:897: error: ‘execute_data’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:903: warning: passing argument 1 of ‘zend_hash_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:903: warning: passing argument 2 of ‘zend_hash_find’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_hash.h:154: note: expected ‘struct zend_string *’ but argument is of type ‘char *’
/root/php-protobuf/protobuf.c:903: error: too many arguments to function ‘zend_hash_find’
/root/php-protobuf/protobuf.c:908: warning: cast to pointer from integer of different size
/root/php-protobuf/protobuf.c: In function ‘pb_get_value’:
/root/php-protobuf/protobuf.c:980: warning: passing argument 1 of ‘zend_hash_index_find’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:156: note: expected ‘const struct HashTable *’ but argument is of type ‘int’
/root/php-protobuf/protobuf.c:980: error: too many arguments to function ‘zend_hash_index_find’
/root/php-protobuf/protobuf.c:980: warning: comparison between pointer and integer
/root/php-protobuf/protobuf.c: In function ‘pb_parse_field_value’:
/root/php-protobuf/protobuf.c:1004: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1009: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1014: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1019: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1024: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1029: error: ‘IS_BOOL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:1034: error: lvalue required as left operand of assignment
/root/php-protobuf/protobuf.c:1040:41: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
/root/php-protobuf/protobuf.c:1040: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:1063:56: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
/root/php-protobuf/protobuf.c: In function ‘pb_serialize_field_value’:
/root/php-protobuf/protobuf.c:1063: error: ‘ZVAL_STRING’ undeclared (first use in this function)
/root/php-protobuf/protobuf.c:1065: warning: passing argument 2 of ‘call_user_function’ from incompatible pointer type
/usr/local/php/include/php/Zend/zend_API.h:471: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
/root/php-protobuf/protobuf.c:1103: warning: passing argument 3 of ‘writer_write_string’ makes pointer from integer without a cast
/root/php-protobuf/writer.h:26: note: expected ‘const char *’ but argument is of type ‘int’
make: *** [protobuf.lo] Error 1

@SuperYear i got the same error in the version 7.0.2 of php

@serggp
https://github.com/serggp/php-protobuf/tree/php7
when i used this in production with php7,it went wrong!
/usr/local/src/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_append’:
/usr/local/src/php-protobuf/protobuf.c:113: error: ‘this_ptr’ undeclared (first use in this function)
/usr/local/src/php-protobuf/protobuf.c:113: error: (Each undeclared identifier is reported only once
/usr/local/src/php-protobuf/protobuf.c:113: error: for each function it appears in.)
/usr/local/src/php-protobuf/protobuf.c:125: error: ‘prepared_value’ undeclared (first use in this function)
/usr/local/src/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_clear’:
/usr/local/src/php-protobuf/protobuf.c:142: error: ‘this_ptr’ undeclared (first use in this function)
/usr/local/src/php-protobuf/protobuf.c:153: warning: passing argument 1 of ‘zend_hash_clean’ makes pointer from integer without a cast
/usr/local/php/include/php/Zend/zend_hash.h:60: note: expected ‘struct HashTable *’ but argument is of type ‘int’
/usr/local/src/php-protobuf/protobuf.c: In function ‘zim_ProtobufMessage_printDebugString’:
/usr/local/src/php-protobuf/protobuf.c:180: warning: passing argument 1 of ‘zend_hash_internal_pointer_reset_ex’ makes pointer from integer without a cast
......

@huoer-charking I see that you were trying to compile anything else but not a git branch which supports PHP 7. Please make sure you switched to php7 branch before compiling.

@serggp Hi, I try to use your php7 branch with php7.1.1 but test serialize_embedded failed. It seems that the repeated field can't be cleared after function reset in __construct because the const array used to reset value has been modified by extension.
Expected
string\(19\) "\x92\x01\x10\x00\x00\x00\x00\x00\x00\xf0\x3f\x00\x00\x00\x00\x00\x00\x00\x40"
string\(11\) "\x9a\x01\x08\x00\x00\x80\x3f\x00\x00\x00\x40"
string\(11\) "\xa2\x01\x08\x01\x00\x00\x00\x02\x00\x00\x00"
string\(19\) "\xaa\x01\x10\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00"
string\(6\) "\xb2\x01\x03\x01\xff\x01"
string\(5\) "\xc2\x01\x02\x00\x01"
string\(6\) "\xba\x01\x03\x01\xfe\x03"

Out
string(19) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@"
string(30) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@"
string(41) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@?^A^H^A^@^@^@^B^@^@^@"
string(60) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@?^A^H^A^@^@^@^B^@^@^@?^A^P^A^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@"
string(66) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@?^A^H^A^@^@^@^B^@^@^@?^A^P^A^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@?^A^C^A?^A"
string(71) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@?^A^H^A^@^@^@^B^@^@^@?^A^P^A^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@?^A^C^A?^A?^A^B^@^A"
string(77) "?^A^P^@^@^@^@^@^@??^@^@^@^@^@^@^@@?^A^H^@^@??^@^@^@@?^A^H^A^@^@^@^B^@^@^@?^A^P^A^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@?^A^C^A?^A?^A^C^A?^C?^A^B^@^A"
```
function reset:
```
public function reset()
{
	$this->values[self::DOUBLE_FIELD] = null;
	$this->values[self::FLOAT_FIELD] = null;
	$this->values[self::INT32_FIELD] = null;
	$this->values[self::INT64_FIELD] = null;
	$this->values[self::UINT32_FIELD] = null;
	$this->values[self::UINT64_FIELD] = null;
	$this->values[self::SINT32_FIELD] = null;
	$this->values[self::SINT64_FIELD] = null;
	$this->values[self::FIXED32_FIELD] = null;
	$this->values[self::FIXED64_FIELD] = null;
	$this->values[self::SFIXED32_FIELD] = null;
	$this->values[self::SFIXED64_FIELD] = null;
	$this->values[self::BOOL_FIELD] = null;
	$this->values[self::STRING_FIELD] = null;
	$this->values[self::BYTES_FIELD] = null;
	$this->values[self::REPEATED_FIELD] = array();
	$this->values[self::EMBEDDED_FIELD] = null;
	$this->values[self::DOUBLE_PACKED_FIELD] = array();
	$this->values[self::FLOAT_PACKED_FIELD] = array();
	$this->values[self::FIXED32_PACKED_FIELD] = array();
	$this->values[self::FIXED64_PACKED_FIELD] = array();
	$this->values[self::INT32_PACKED_FIELD] = array();
	$this->values[self::SINT32_PACKED_FIELD] = array();
	$this->values[self::BOOL_PACKED_FIELD] = array();
	$this->values[self::OPTIONAL_EMBEDDED_FIELD] = null;
	$this->values[self::REPEATED_OBJ_FIELD] = array();  //this array() will be modified in extension and reused in __construct
	$this->values[self::REPEATED_STRING_FIELD] = array();
}
```
The initialization should be implemented in extension too.

@xyzhu1120 We are taking over this library over at Basho and I am pretty sure I fixed this issue within our alpha release for PHP7.
https://github.com/basho/php-protobuf/releases/tag/v2.0.0-alpha

@christophermancini It works fine for php 7.0.X but it doesn't work fort php 7.1.X.

@serggp yes, I know. As I said, I am pretty sure we fixed it in our alpha release. All tests pass.
https://travis-ci.org/basho/php-protobuf/builds/197519156

@christophermancini serggp is right. It doesn't work for php 7.1.X because the repeated fields cannot be cleared in function reset. I worked around this problem by calling function clear yesterday.  The initialization of fields should be finished in extension. I am trying this these days.

@xyzhu1120 @serggp so you are saying we do not have test coverage for this specific issue? Otherwise it should be failing for 7.1 on Travis.

@christophermancini your alpha release is Great. Thank you

@christophermancini  @xyzhu1120 I reviewed why my php7 branch fails for php 7.1 while Christopher's doesn't. The reason is one small difference in code in Christopher's branch which fixes one test but breaks everything when opcache is enabled. First run is ok (cause opcache is empty), but on the 2nd run most of the tests fail.
@christophermancini I advise you to enable opcache for cli and add this case to travis launching it twice to make sure everything works

@serggp
https://github.com/serggp/php-protobuf/tree/php7
when it'll support $messge->setFrom() method,just like the php extension:
https://github.com/chobie/php-protocolbuffers
i'm trying to set a big repeated message with foreach in php7,sadly,it's so Inefficient.

As mentioned @ https://github.com/basho/php-protobuf/commit/0adbe6cc3a143e3ba59325830d003622ea3bf0a9#commitcomment-20821803, I can't reproduce the failures you are experiencing with Opcache enabled.

@christophermancini To reproduce it you should run the same tests twice. First run always succeeds but all the following runs do not. I see in logs that tests were launched only once. Please use the following steps:

make
run tests
run tests

@serggp I attempted to reproduce the issue but could not. Here is the output of the attempt:
https://gist.github.com/christophermancini/977a87ffdb98c42ce95e817d59cba9c3

@christophermancini Looks like I found why it fails for me but not for you. My php build was configured with --enable-debug. Here is output of a test after 2nd launch:
cat tests/parse_repeated.log
cat tests/parse_repeated.log
---- EXPECTED OUTPUT
bool(true)
---- ACTUAL OUTPUT
bool(true)
[Thu Feb  9 13:55:08 2017]  Script:  '/home/serggp/php-protobuf-2.0.0-alpha/tests/parse_repeated.php'
/home/serggp/php/php71/Zend/zend_hash.c(133) :  Freeing 0x00007f7542261900 (264 bytes), script=/home/serggp/php-protobuf-2.0.0-alpha/tests/parse_repeated.php
=== Total 1 memory leaks detected ===
---- FAILED

+1

@serggp yep, that would definitely cause the tests to fail! :)

+1

What is the expected time when this will be ready? I have installed the one of sergpp, but now it runs out of memory (even with 10G memory limit)

@TNAJanssen have you tried this release on our fork yet? https://github.com/basho/php-protobuf/releases/tag/v2.0.0-alpha

@TNAJanssen Could you please provide code samples using which I can reproduce memory leaks?

@christophermancini yes i did, also php7-merge branch and the serggp_php7 branch!
@serggp how can i get in touch with you, because when i tried to debug the script it magically works again (for how long is the question haha)

@serggp: hi Sergey, could you help to fix the problem below.
-- sorry to post here but I could not find anywhere else to report the issue. Thanks a lot.
I define a proto file as below:
message BidResponse
{
required string id = 1;         // ID of the bid request.
optional string id1 = 2;         // ID of the bid request.
optional string cur = 66;        // Currency of bid, currently always USD
}
The code below is OK if cur (tag) number < 66.
But if we set the cur (tag) number >=66, it went into a infinitity loop when calling method serializeToString().
$bidresponse = new BidResponse();
$bidresponse->setId("1");
$bidresponse->setCur(3);
try {
$data = $bidresponse->serializeToString();
} catch (Exception $ex) {
echo $ex->getMessage();
}

@shuimuxiyang  you have a wrong git branch. You should checkout php7 branch after git clone this repository,  git checkout -b php7 origin/php7

@serggp when i use your protobuf, i get php fatal error. --compile error missing xxx field value, however, I have never modify the php classes generated.


how to specify classes

If using AIde as an annotator only (i.e. no AI backend) how are the classes specified? I can see there is a labelclass table but can't see where the classes are defined (except from the AI models)

Hi,
The label classes are specified in the database schema of the project (relation "labelclass"). At the moment, classes are either added with the import scripts (e.g. projectCreation/import_yolo_dataset.py), or have to be added directly to the database, e.g. through pgAdmin4. We are currently working on a GUI implementation for specifying project settings and data, including labelclasses, directly.


Improve trace during yarn install when downloading binaries

MacOS Investigated on another task, this code is nto changing anything to it


Dutch translation

Added Dutch translations to Elementary.

If you can update this so only the relevant files are included in the pull request, I can include it in the next release.

I copied the files in manually. Sorry it took so long to address this...


Change prober URL to reduce false positive alerts

Other projects running a copy of AppRTC code trigger multiple simultaneous pings to the CEOD server and cause many false positive alerts.
We've changed the prober code to check for project ID, but obviously the other projects didn't update timely.
I'm changing the prober URL, so running older code will no longer ping the CEOD server.

@chuckhays  PTAL


An utility python script to find the fastest combination of bin refine factors

Once issue #90 is fixed, an additional python routine to run through a set of bin_refine_factors for the typical use case would be very useful. The output of this helper routine would be the bin refine factors that produce the fastest calculation on the target machine (not quite as advanced as ATLAS self-tuning but similar in spirit)

Not sure if porting over to all other extensions is worth the effort. Closing this as part of the milestone v2.0 but opening a new one as a kind of feature request.


ci: Bump version to 1.2.1

Realised that #203 didn't increment the version number so didn't trigger a release.
Have bumped up the version to 1.2.1 in this PR which I assume will release an updated version to nuget.

NuGet release is trigger by tags, and since the last PR changed existing property types it I'd say it warrants bumping to 1.3.0.


Updated LanguageSelector and corrected language codes

Corrected some languages codes (sr-Latin -> sr-LATIN)
Fixed labels and comments in LanguageSelector
Added or modified dome emojis that were black flags
Corrected the order so that everything is alphabetical except, for example, the German languages (de, de-AT, gsw) which are grouped together

Tagalog and Basque are missing translation files (Also Nynorsk)
Additionally, do you think it would be better if the languages are ordered like in Wikipedia with languages with Latin script first, then Cyrillic script, and so on?

grc is not a thing. ancient Greek is referred to as ag-GR

I checked from Wikipedia and other sources that Ancient Greek's language code was grc, but I did not find anything called ag-GR. However, I may be mistaken.

Being Greek myself, I have never heard of that language code again. ag-GR is the official code for the Ancient Greek

Correction. grc is referred to as Greek until 1453(whick was a pre-mature version of the modern Greek). The pure Ancient Greek (1000 B.C.) is ag-GR.

Ok, I'll correct it then.

use agr for the Ancient Greek. It is more suitable

So i'll keep it as it is?

So i'll keep it as it is?

Keep it as it is If you are following the ISO standards for all languages.


Images throught chatwoot are not being displayed.

I made tests on:

Chatwoot/Whatsapp
Chatwoot/Telegram

and it works just fine:

It was an issue related to images's S3 storage content-type


warnings occurred during the registration via elastix 4.9

**Hi all,
I'm trying to register 2D fixed image to 2D moving image by running CMD.  (Masks were applied to both images).
There are many warnings occurred during the registration and I wasn't able to figure out why. I tried most of the trouble shooting strategies that are recommended in the manual but they didn't work.
May you please help me to find out why there are many warnings and how to fix them? (I'm not expert in using elastix. )
Here is the elastix.log content:**
Installing all components.
InstallingComponents was successful.
ELASTIX version: 4.900
Command line options from ElastixBase:
-f        C:\Users\Wadha\Documents\Elastix_IN\179_1_structurertestim.nii
-m        C:\Users\Wadha\Documents\Elastix_IN\1_179_structurertestim_moving.nii
-fMask    C:\Users\Wadha\Documents\Elastix_IN\179_1_structurertestim_Mask.nii
-mMask    C:\Users\Wadha\Documents\Elastix_IN\1_179_structurertestim_mask.nii
-out      C:\Users\Wadha\Documents\Elastix_OUT
-p        C:\Users\Wadha\Documents\Elastix_PARS\parameters__Affine_AMSradians_modified_10_0.001.txt
-priority unspecified, so NORMAL process priority
-threads  unspecified, so all available threads are used
Command line options from TransformBase:
-t0       unspecified, so no initial transform used
=============== start of ParameterFile: C:\Users\Wadha\Documents\Elastix_PARS\parameters__Affine_AMSradians_modified_10_0.001.txt ===============
// Example parameter file for rotation registration
// C-style comments: //
// The internal pixel type, used for internal computations
// Leave to float in general.
// NB: this is not the type of the input images! The pixel
// type of the input images is automatically read from the
// images themselves.
// This setting can be changed to "short" to save some memory
// in case of very large 3D images.
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
// The dimensions of the fixed and moving image
// Up to elastix 4.5 this had to be specified by the user.
// From elastix 4.6, this is not necessary anymore.
//(FixedImageDimension 2)
//(MovingImageDimension 2)
// Specify whether you want to take into account the so-called
// direction cosines of the images. Recommended: true.
// In some cases, the direction cosines of the image are corrupt,
// due to image format conversions for example. In that case, you
// may want to set this option to "false".
(UseDirectionCosines "true")
// **************** Main Components **************************
// The following components should usually be left as they are:
(Registration "MultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
// These may be changed to Fixed/MovingSmoothingImagePyramid.
// See the manual.
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
// The following components are most important:
// The optimizer AdaptiveStochasticGradientDescent (ASGD) works
// quite ok in general. The Transform and Metric are important
// and need to be chosen careful for each application. See manual.
(Optimizer "AdaptiveStochasticGradientDescent")
(Transform "AffineTransform")
//(Metric "AdvancedMattesMutualInformation")
(Metric "AdvancedMeanSquares_Radians")
// ***************** Transformation **************************
// Scales the rotations compared to the translations, to make
// sure they are in the same range. In general, it's best to
// use automatic scales estimation:
(AutomaticScalesEstimation "true")
// Automatically guess an initial translation by aligning the
// geometric centers of the fixed and moving.
(AutomaticTransformInitialization "true")
// Whether transforms are combined by composition or by addition.
// In generally, Compose is the best option in most cases.
// It does not influence the results very much.
(HowToCombineTransforms "Compose")
// ******************* Similarity measure *********************
// Number of grey level bins in each resolution level,
// for the mutual information. 16 or 32 usually works fine.
// You could also employ a hierarchical strategy:
//(NumberOfHistogramBins 16 32 64)
(NumberOfHistogramBins 32)
// If you use a mask, this option is important.
// If the mask serves as region of interest, set it to false.
// If the mask indicates which pixels are valid, then set it to true.
// If you do not use a mask, the option doesn't matter.
(ErodeMask "true")
// ******************** Multiresolution **********************
// The number of resolutions. 1 Is only enough if the expected
// deformations are small. 3 or 4 mostly works fine. For large
// images and large deformations, 5 or 6 may even be useful.
(NumberOfResolutions 4)
// The downsampling/blurring factors for the image pyramids.
// By default, the images are downsampled by a factor of 2
// compared to the next resolution.
// So, in 2D, with 4 resolutions, the following schedule is used:
//(ImagePyramidSchedule 8 8  4 4  2 2  1 1 )
// And in 3D:
//(ImagePyramidSchedule 8 8 8  4 4 4  2 2 2  1 1 1 )
// You can specify any schedule, for example:
//(ImagePyramidSchedule 4 4  4 3  2 1  1 1 )
// Make sure that the number of elements equals the number
// of resolutions times the image dimension.
// ******************* Optimizer ****************************
// Maximum number of iterations in each resolution level:
// 200-500 works usually fine for rigid registration.
// For more robustness, you may increase this to 1000-2000.
//(MaximumNumberOfIterations 250)
(MaximumNumberOfIterations 10)
// The step size of the optimizer, in mm. By default the voxel size is used.
// which usually works well. In case of unusual high-resolution images
// (eg histology) it is necessary to increase this value a bit, to the size
// of the "smallest visible structure" in the image:
//(MaximumStepLength 0.001)
// **************** Image sampling **********************
// Number of spatial samples used to compute the mutual
// information (and its derivative) in each iteration.
// With an AdaptiveStochasticGradientDescent optimizer,
// in combination with the two options below, around 2000
// samples may already suffice.
(NumberOfSpatialSamples 2048)
// Refresh these spatial samples in every iteration, and select
// them randomly. See the manual for information on other sampling
// strategies.
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
// ************* Interpolation and Resampling ****************
// Order of B-Spline interpolation used during registration/optimisation.
// It may improve accuracy if you set this to 3. Never use 0.
// An order of 1 gives linear interpolation. This is in most
// applications a good choice.
(BSplineInterpolationOrder 1)
// Order of B-Spline interpolation used for applying the final
// deformation.
// 3 gives good accuracy; recommended in most cases.
// 1 gives worse accuracy (linear interpolation)
// 0 gives worst accuracy, but is appropriate for binary images
// (masks, segmentations); equivalent to nearest neighbor interpolation.
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue 0)
// Choose whether to generate the deformed moving image.
// You can save some time by setting this to false, if you are
// only interested in the final (nonrigidly) deformed moving image
// for example.
(WriteResultImage "true")
// The pixel type and format of the resulting deformed moving image
//(ResultImagePixelType "short")
(ResultImagePixelType "float")
//ResultImageFormat "mhd")
(ResultImageFormat "nii")
=============== end of ParameterFile: C:\Users\Wadha\Documents\Elastix_PARS\parameters__Affine_AMSradians_modified_10_0.001.txt ===============
Reading images...
Reading images took 29 ms.
WARNING: the fixed pyramid schedule is not fully specified!
A default pyramid schedule is used.
WARNING: the moving pyramid schedule is not fully specified!
A default pyramid schedule is used.
WARNING: The parameter "AutomaticTransformInitializationMethod", requested at entry number 0, does not exist at all.
The default value "GeometricalCenter" is used instead.
Transform parameters are initialized as: [1, 0, 0, 1, 0, -69]
Scales are estimated automatically.
Scales for transform parameters are: [22100.25, 22100.25, 22100.25, 22100.25, 1, 1]
Initialization of all components (before registration) took: 42 ms.
Preparation of the image pyramids took: 27 ms.
Resolution: 0
WARNING: The parameter "ShowExactMetricValue", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeFixedMask", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeMovingMask", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 4 ms.
Setting the moving masks took: 3 ms.
WARNING: The parameter "UseNormalization", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "NumberOfSamplesForSelfHessian", requested at entry number 0, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SelfHessianSmoothingSigma", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SelfHessianNoiseRange", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SP_A", requested at entry number 0, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 0, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 0, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 0, does not exist at all.
The default value "1000" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 0, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 0, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 303 ms.
Initialization of AdvancedMeanSquares metric took: 0 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.001860s
NumberOfGradientMeasurements to estimate sigma_i: 8
Sampling gradients ...
Sampling the gradients took 0.019760s
Automatic parameter estimation took 0.25s
1:ItNr	2:Metric	3a:Time	3b:StepSize	4:||Gradient||	Time[ms]
0	0.360400	0.000000	41.317166	0.017277	468.3
1	0.286847	0.000000	41.317166	0.013357	1.1
2	0.333587	0.000000	41.317166	0.013474	0.9
3	0.338812	0.000000	41.317166	0.018200	1.1
4	0.262944	0.000000	41.317166	0.011771	1.2
5	0.219035	0.000000	41.317166	0.008961	1.1
6	0.270016	0.000000	41.317166	0.010089	0.9
7	0.282543	0.000000	41.317166	0.012199	1.1
8	0.251193	0.000000	41.317166	0.009555	0.9
9	0.309987	0.000000	41.317166	0.015041	1.1
Time spent in resolution 0 (ITK initialization and iterating): 0.504 s.
Stopping condition: Maximum number of iterations has been reached.
Settings of AdaptiveStochasticGradientDescent in resolution 0:
( SP_a 867.660494 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.067178 )
( SigmoidScale 0.000001 )
Resolution: 1
WARNING: The parameter "ShowExactMetricValue", requested at entry number 1, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeFixedMask", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeMovingMask", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 4 ms.
Setting the moving masks took: 4 ms.
WARNING: The parameter "UseNormalization", requested at entry number 1, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "NumberOfSamplesForSelfHessian", requested at entry number 1, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SelfHessianSmoothingSigma", requested at entry number 1, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SelfHessianNoiseRange", requested at entry number 1, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SP_A", requested at entry number 1, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 1, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 1, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 1, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 1, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 1, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 1, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 1, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 1, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 1, does not exist at all.
The default value "1000" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 1, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 1, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 305 ms.
Initialization of AdvancedMeanSquares metric took: 0 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.000483s
NumberOfGradientMeasurements to estimate sigma_i: 8
Sampling gradients ...
Sampling the gradients took 0.023453s
Automatic parameter estimation took 0.25s
1:ItNr	2:Metric	3a:Time	3b:StepSize	4:||Gradient||	Time[ms]
0	0.249414	0.000000	57.911832	0.009607	469.7
1	0.233597	0.000000	57.911832	0.007710	1.1
2	0.221900	0.000000	57.911832	0.009297	0.9
3	0.239387	0.000000	57.911832	0.008099	1.1
4	0.222711	0.000000	57.911832	0.009251	0.9
5	0.207279	0.000000	57.911832	0.009606	1.1
6	0.241069	0.000000	57.911832	0.011779	1.0
7	0.217964	0.000000	57.911832	0.010161	1.2
8	0.233371	0.000000	57.911832	0.010568	0.9
9	0.238945	0.000000	57.911832	0.012206	1.1
Time spent in resolution 1 (ITK initialization and iterating): 0.507 s.
Stopping condition: Maximum number of iterations has been reached.
Settings of AdaptiveStochasticGradientDescent in resolution 1:
( SP_a 1216.148482 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.105013 )
( SigmoidScale 0.000000 )
Resolution: 2
WARNING: The parameter "ShowExactMetricValue", requested at entry number 2, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeFixedMask", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeMovingMask", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 3 ms.
Setting the moving masks took: 4 ms.
WARNING: The parameter "UseNormalization", requested at entry number 2, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "NumberOfSamplesForSelfHessian", requested at entry number 2, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SelfHessianSmoothingSigma", requested at entry number 2, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SelfHessianNoiseRange", requested at entry number 2, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SP_A", requested at entry number 2, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 2, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 2, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 2, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 2, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 2, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 2, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 2, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 2, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 2, does not exist at all.
The default value "1000" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 2, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 2, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 291 ms.
Initialization of AdvancedMeanSquares metric took: 1 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.000652s
NumberOfGradientMeasurements to estimate sigma_i: 8
Sampling gradients ...
Sampling the gradients took 0.043817s
Automatic parameter estimation took 0.27s
1:ItNr	2:Metric	3a:Time	3b:StepSize	4:||Gradient||	Time[ms]
0	0.219443	0.000000	54.752862	0.010011	490.5
1	0.221858	0.000000	54.752862	0.009671	1.3
2	0.225277	0.000000	54.752862	0.010210	0.9
3	0.197533	0.000000	54.752862	0.008054	1.1
4	0.244061	0.000000	54.752862	0.011798	0.9
5	0.253483	0.000000	54.752862	0.010811	1.0
6	0.266736	0.000000	54.752862	0.009668	0.9
7	0.253743	0.000000	54.752862	0.010586	1.1
8	0.254324	0.000000	54.752862	0.010411	0.9
9	0.255782	0.000000	54.752862	0.012760	1.2
Time spent in resolution 2 (ITK initialization and iterating): 0.526 s.
Stopping condition: Maximum number of iterations has been reached.
Settings of AdaptiveStochasticGradientDescent in resolution 2:
( SP_a 1149.810103 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.044269 )
( SigmoidScale 0.000000 )
Resolution: 3
WARNING: The parameter "ShowExactMetricValue", requested at entry number 3, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeFixedMask", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "ErodeMovingMask", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 3 ms.
Setting the moving masks took: 3 ms.
WARNING: The parameter "UseNormalization", requested at entry number 3, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "NumberOfSamplesForSelfHessian", requested at entry number 3, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SelfHessianSmoothingSigma", requested at entry number 3, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SelfHessianNoiseRange", requested at entry number 3, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "SP_A", requested at entry number 3, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 3, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 3, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 3, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 3, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 3, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 3, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 3, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 3, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 3, does not exist at all.
The default value "1000" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 3, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 3, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 275 ms.
Initialization of AdvancedMeanSquares metric took: 7 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.000618s
NumberOfGradientMeasurements to estimate sigma_i: 8
Sampling gradients ...
Sampling the gradients took 0.117546s
Automatic parameter estimation took 0.34s
1:ItNr	2:Metric	3a:Time	3b:StepSize	4:||Gradient||	Time[ms]
0	0.232069	0.000000	58.760462	0.009344	570.1
1	0.261359	0.000000	58.760462	0.009991	1.3
2	0.224457	0.000000	58.760462	0.007200	1.0
3	0.240425	0.000000	58.760462	0.011437	1.2
4	0.250694	0.000000	58.760462	0.009372	0.9
5	0.272025	0.000000	58.760462	0.008186	1.2
6	0.235345	0.000000	58.760462	0.009675	0.9
7	0.251222	0.000000	58.760462	0.011866	1.1
8	0.287714	0.000000	58.760462	0.010157	1.0
9	0.264319	0.000000	58.760462	0.009273	1.2
Time spent in resolution 3 (ITK initialization and iterating): 0.607 s.
Stopping condition: Maximum number of iterations has been reached.
Settings of AdaptiveStochasticGradientDescent in resolution 3:
( SP_a 1233.969706 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.049272 )
( SigmoidScale 0.000000 )
=============== start of TransformParameterFile ===============
(Transform "AffineTransform")
(NumberOfParameters 6)
(TransformParameters 0.997247 0.056419 0.049189 0.998649 -11.981473 -55.294642)
(InitialTransformParametersFileName "NoInitialTransform")
(HowToCombineTransforms "Compose")
// Image specific
(FixedImageDimension 2)
(MovingImageDimension 2)
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
(Size 512 512)
(Index 0 0)
(Spacing 1.0000000000 1.0000000000)
(Origin -1.0000000000 -1.0000000000)
(Direction -1.0000000000 0.0000000000 0.0000000000 -1.0000000000)
(UseDirectionCosines "true")
// AdvancedAffineTransform specific
(CenterOfRotationPoint -256.5000000000 -256.5000000000)
// ResampleInterpolator specific
(ResampleInterpolator "FinalBSplineInterpolator")
(FinalBSplineInterpolationOrder 3)
// Resampler specific
(Resampler "DefaultResampler")
(DefaultPixelValue 0.000000)
(ResultImageFormat "nii")
(ResultImagePixelType "float")
(CompressResultImage "false")
=============== end of TransformParameterFile ===============
Creating the TransformParameterFile took 0.00s
Registration result checksum:<PHONE_NUMBER>
Applying final transform ...
Applying final transform took 0.14s
Final metric value  = 0.264319
Settings of AdaptiveStochasticGradientDescent for all resolutions:
( SP_a 867.660494 1216.148482 1149.810103 1233.969706 )
( SP_A 20.000000 20.000000 20.000000 20.000000 )
( SP_alpha 1.000000 1.000000 1.000000 1.000000 )
( SigmoidMax 1.000000 1.000000 1.000000 1.000000 )
( SigmoidMin -0.067178 -0.105013 -0.044269 -0.049272 )
( SigmoidScale 0.000001 0.000000 0.000000 0.000000 )
Time spent on saving the results, applying the final transform etc.: 378 ms.
Running elastix with parameter file 0: "C:\Users\Wadha\Documents\Elastix_PARS\parameters__Affine_AMSradians_modified_10_0.001.txt", has finished.
Current time: Wed Sep 12 01:26:19 2018.
Time used for running elastix with this parameter file:
4.3s.

Total time elapsed: 4.5s.

The warnings serve mainly to inform users about the default settings when no parameter is specified. Is there any warning in particular that concerns you? Otherwise I wouldn't worry about it.

I appreciate your quick response.
I'm facing a problem to fully activate the AffineTransform. When I tried the default settings I got an error message(Too many samples out side the moving image). So, I reduced the optimizer step length to be 0.001 instead of 1.0. I got the (result 1) as you can see. Then I increased the iterations numbers to be 2000 instead of 250. I got the (result 2). In both cases Affine didn't scale or register the moving to the fixed. It is just handling the shifting.  Is there an explanation of why Affinetransform didn't work properly ? and How can I fix that?. I attached the parameter file that I used. (I masked both images)
Your response is highly appreciated.

Parameterfile.txt

"Too many samples outside the moving images" mean that the images do not overlap.  Also, for this problem, the rigid transform might be more appropriate.

The option of (AutomaticTransformInitialization "true") is activated in the parameter file that should enable  the overlapping between two images. Too many samples could be caused by too large steps are taken during the registration. So,  initially the images have an overlap, but during the registration the moving image is moved such that the overlap disappears. Usually, this is because too large steps are taken during the registration and I solved that by decreasing the step size(length) of the optimizer to be 0.001 instead of 1.0.
The rigid are not able to scale the moving image it should handle the shifting only.
Is there a suggestion to solve this issue?

I don't think the B-spline transform does automatic initialization. You can do an affine registration first with AutomaticTransformInitialization set to "true". Sorry for the late reply. Feel free to open if this is still an issue.


Time based stream tasks in Kapacitor

I'm using Kapacitor 1.5. I want to write rule based on last time of record in measurement. I tried following but this does not seem to be possible:
dbrp "db"."rp"

var threshold = 1h
var period = 1h
var every = 1h

var data = stream
    |from()
        .measurement('last_logged')
        .groupBy('device-name')
    |window()
        .period(period)
        .every(every)
    |last('time')
        .as('last_logged_time')

var alert = data
  |alert()
    .message('Device {{ index .Tags "device-name"}} has not logged in ' + string(threshold))
    .crit(lambda: duration(unixNano(now()) - unixNano("last_logged_time"), 1u) > threshold)
    .critReset(lambda: duration(unixNano(now()) - unixNano("last_logged_time"), 1u) < threshold)

alert
  .slack()

I want to run this rule per hour. This rule is not working since last() expects a field, looks like "time" is not available as a field. Can someone suggest approach to make it work ?
I would prefer not to use batch mode since I don't want those many queries (equal to cardinality of my data) to land on InfluxDB.
Thanks in advance!

@nathanielc Can you help me figure this out ?

you can add additional TIME field in measurement last_logged .
since, this is just query i think you can get more answers on https://community.influxdata.com.

Thanks @pawan4work I'll open a topic in community!


Fix pep8 errors in ipynb_exporter

I ran first pep8 and then pylint, so I missed the pep8 errors introduced
by me shutting up pylint 😇

:) yup, that occasionally happens:
https://github.com/ARM-software/workload-automation/commit/086f03730bf0438c04c49e481b38a0aa97070d01


Is there an API?

Is it possible to control the board trough javascript code instead of the visual panels without changing the library code itself?
Something like besogo.playMove(1, 2, 0);

There is no formal API, but it is possible to interact with the editor and/or gameRoot objects to manipulate the editor or game tree state via javascript.
Josekle and Fusekle are examples of projects that do so.
For convenience, I've just made a commit (porting the similar changes made by Josekle and Fusekle) that exposes the editor object via a reference attached to the parent container.

That will do.
Thank you!


Geo based balancing

This is just something that came to my head. Do you thing it could be possible to route traffic to the nearest server? Like when you have servers in the US and Europe, the system should prefer near servers. Something like geo based load-balancing.

Yes. We will have it.
We will release a high level cluster api once everything is good.
Then, you can do it yourself too :)
On 2015 පෙබ 19, බ්‍රහස් at පෙ.ව. 2.53 zimt28<EMAIL_ADDRESS>wrote:

This is just something that came to my head. Do you thing it could be
possible to route traffic to the nearest server? Like when you have servers
in the US and Europe, the system should prefer near servers. Something like
geo based load-balancing.
—
Reply to this email directly or view it on GitHub
https://github.com/meteorhacks/cluster/issues/16.

+1


Add currency conversion

There was a currency converter already in albert (by Manuel) but it seems it's not up to date with 0.18.
<EMAIL_ADDRESS>I suppose the two plugins could be merged into one.
First suggested in #1

working as expected


(PE-34952) Add inventory library

This adds a module for parsing the inventory.txt file. This will handle any errors found in the file, and return a hash with certname as the key and the rest of the info has another hash.  Because the inventory will likely have old entries for a given certname, this records the serials for the old certnames, but the serial value will be the latest cert found.
Also fixes a couple issues found, mostly around spec files not getting cleaned up due to the way some of the tests were written.

I don't think this is needed for my current PR.  But LGTM.


WDK Version 1809, download link is broken again

I know there has been an issue with the link before early in October. However that issue has been closed and the download problem occurred in a different way.
This is the result I get when I click on the "Download WDK for Windows 10, version 1809" link.

What is going on?

Hi @PascalTNL. When I click the link, the download begins as it's supposed to. This is on https://docs.microsoft.com/windows-hardware/drivers/download-the-wdk, and the URL for the download for the WDK  for Windows 10, version 1809 is https://go.microsoft.com/fwlink/?linkid=2026156.

Hello @EliotSeattle I already used that. I tried different devices and different browsers. But all of them didn't seem to work.

The link still seems to work on a number of different machines. Perhaps remove all kits, delete the folders, restart, and try again?
I'm sorry I can't be of more help, as I cannot reproduce your issue.


Asset path normalization should be opt-out

Asset paths in stylesheets are rewritten to be absolute, but this isn't always beneficial. Distributable webapps with processed stylesheets that can be installed either at the root of a domain or within a subdirectory will break if an absolute path is used. Some behavior for opting out of this feature is critical for such cases.
I'll be happy to provide a patch to address this.

Absolute asset path are normalized and PIPELINE_URL/STATIC_URL is concatenated to it, so that you can specify whatever url (with subdirectory, other domain name) to host them.


19265 fix file cache duration phpdoc

Q
A

Is bugfix?
✔

New feature?
❌

Breaks BC?
❌

Fixed issues
#19265

Thank you.


Correct way to resize images

If I understand correctly Turicreate automatically resizes images during training. I need to use CoreML from Python. To do that the images should be scaled and cropped accordingly.

Could you please describe how exactly should I do  that?
Should the cropped image be drawn on the white background? If yes, what offset should be used?
When using CoreML from Python should I modify pixels somehow (scaling, apply bias)?

part two
I have noticed also differences in the inferring results for CoreML and and original Darknet-YOLO(object detector) model that Turicrate might save after training. Could you please answer the same questions regarding original Darknet-YOLO?

It depends on the toolkit, but TuriCreate does generally resize images before training.
This isn't the correct place to ask questions about CoreML. This is the repository for TuriCreate, not CoreML.
I would recommend taking a look at the coremltools repository, particularly their unit test. Those unit tests use CoreML from Python.


invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898>

Hello @zackhy
when I run following command
python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --clf=clf-10000
I got this error->unrecognizedflagerror:Unknown command line flag 'clf'
SO I just add following line
tf.flags.DEFINE_string('clf', 'cnn', "Type of classifiers. Default: cnn. You have four choices: [cnn, lstm, blstm, clstm]") in test.py

if i am not using clf flag as argument and run following command
python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111
Its give error->
data_helper line 38 in load data
data_helper.py line 149 in _stop_words
invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898>

@purohitvivek8 Oh I made a mistake in the README file.......Actually it should be  --checkpoint=clf-100. You don't need to add the tf.flags.DEFINE_string('clf', 'cnn', "Type of classifiers. Default: cnn. You have four choices: [cnn, lstm, blstm, clstm]") in test.py.

@purohitvivek8 And for the second error, I don't know where it comes from. Maybe you could try to run the test.py with --checkpoint=clf-xxxx and see if the error still exists. And sorry for the confusion.

@zackhy still same error invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898>

@purohitvivek8 emmm...everything works fine on my computer. So do you have a stop word file? If not, try assigning the sw_path at line 33 to None and see if this works.

@purohitvivek8 And also you are not using the command "python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --checkpoint=clf-10000", right? This command line is just an example, you should change the values of the parameters according to the files generated by train.py.

Yes @zackhy I Know its example,I am doing according to my PC's directory

I don't have stop word file

Yes after change  sw_path at line 33 to None  Now its Working,Thanks


Azure OpenAI: remove SseReader's use of subtly blocking StreamReader.EndOfStream

Problem
StreamReader.EndOfStream introduces a subtle but important bit of blocking I/O to the project's server-sent event reader that causes the underlying IAsyncEnumerator for streaming chat completions to invariantly report a completed state for its MoveNext. This causes issues in downstream consumption scenarios that block on this, e.g. via JsonSerializer:
await JsonSerializer.SerializeAsync(Console.OpenStandardOutput(), GetStrings(await client.GetChatCompletionsStreamingAsync(options)));

static async IAsyncEnumerable<string> GetStrings(IAsyncEnumerable<StreamingChatCompletionsUpdate> source)
{
    await foreach (var update in source)
    {
        //await Task.Yield();
        yield return update.ContentUpdate;
    }
}

Fix
Rather than use EndOfStream, we replace the EoS check with an implicit one performed via a null return by ReadLine*. This produces the desired behavior without inducing the blocking I/O that erroneously makes streaming output appear blocking.
fixes #41838 and thanks/credit to @stephentoub for the investigation and fix confirmation.

API change check
API changes are not detected in this pull request.

invariantly report a completed state for its MoveNext. This causes issues in downstream consumption scenarios that block on this, e.g. via JsonSerializer:

The more general impact is scalability: even though it looks like it's async, it's actually doing synchronous I/O, blocking the thread while waiting for data to arrive rather than allowing the thread to do other things in the meantime.
What you cite is also impactful to streaming latency and is how I first noticed an issue: returning one of these IAsyncEnumerables from an ASP.NET minimal API results in that blocking behavior negatively impacting how buffering happens in the implicit JSON serialization, causing the steamed tokens to be batched rather than written to the wire individually.

@trrwilson I'm trying to find a nightly build including this fix, but it seems this feed from the documentation only carries the beta.13 version without this fix. Could you help me point to where the nightly builds are published?

@joakimriedel the package feeds seemingly prioritize the beta/alpha tagging in semantic versioning over recency, which I've always found a bit odd.
If you check the full list of versions, you'll find the nightly/alpha/dev builds beneath the published beta builds:
https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-net/NuGet/Azure.AI.OpenAI/versions/1.0.0-beta.13
E.g. here's the latest:
https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-net/NuGet/Azure.AI.OpenAI/overview/1.0.0-alpha.20240214.1

@trrwilson oh 🤦♂ thanks a lot, that do make sense though with alpha < beta sort order.


Version of cf cli in pcfnorm/rootfs doesn't support buildpack stack association

Issue
We are trying to update the upgrade-buildpacks pipeline by adding stack association. We need a cf cli that is capable of running cf update-buildpack with the -s flag. The -s flag allows us to disambiguate buildpacks that have the same name but are for different stacks.
Context
See the issue text above.
Expected result
The pcfnorm/rootfs has a more recent version of the cf cli that has stack support.
Current result
We get the following error from the cf cli when we run our promote task:
Incorrect Usage: unknown flag `s'

Steps to Reproduce

docker run -it pcfnorm/rootfs:latest bash
cf version -> reports an older version.
cf update-buildpack -> help text does not include the -s flag.

Possible Fix
Rebuild and publish the docker image with a more recent cf cli binary.
Logs and Screenshots
N/A (but we can provide some if necessary)

merged. Closing


Pre-trained download links

First of all, I want to thank you for sharing your incredible work — it's truly impressive how fast technology is advancing, and your project is a great example of that!
I am currently trying to download the pretrained weights, but I am finding it difficult to access them through Baidu, as I’m not based in China and do not have a Chinese phone number. Would it be possible for you to upload the file to a different file-sharing provider, such as Google Drive, to make it easier for international users to download?
I really appreciate your help, and thank you again for all the effort you’ve put into this project.

Thanks, we've updated the link to Google Drive

First of all, I want to thank you for sharing your incredible work — it's truly impressive how fast technology is advancing, and your project is a great example of that!
I am currently trying to download the pretrained weights, but I am finding it difficult to access them through Baidu, as I’m not based in China and do not have a Chinese phone number. Would it be possible for you to upload the file to a different file-sharing provider, such as Google Drive, to make it easier for international users to download?
I really appreciate your help, and thank you again for all the effort you’ve put into this project.

Thanks, we've updated the link to Google Drive


Tablet Layout Options

I have recently acquired a Samsung Tablet and think it would be a good idea to have some simple options regarding the layout.
I think the recipes would look better with a 2 column layout rather than 3 (or an option to completely hide some sections e.g. Nutrition Information) to give more space to the Ingredients and Instructions sections

@psleep, I second the option of hiding the Nutrition Information column.
Devs, can we just get a simple toggle on the recipe page to hide that column? Or even remove the column completely and have a button that we click where the Nutrition Information is shown in an overlay window? I'd be happy with either one.

@mygeek911 Did you have a look at the proposed changes of #185 do you think this will suit the need for "cleaner" tablet solution?

@Teifun2 That would be great! I'm not picky.


NO-ISSUE: Fixing deployement on ocp

This pr fixes postgresql issue on ocp by adding postgres container, map, service and pvc so notification and workflow service can use it.
Change type

[ ] New feature
[ ] Bug fix
[ ] Unit tests
[ ] Integration tests
[ ] CI
[x] Documentation
[ ] Auto-generated SDK code

Impacted services

[x] Workflow Service
[x] Notification Service

Checklist

[x] Subject and description added to both, commit and PR.
[x] Relevant issues have been referenced.

I update ocp deployment documentation as well: https://github.com/parodos-dev/parodos-dev.github.io/pull/16