paypal error in codeigniter library - codeigniter

Fatal error: Call to a member function getMessage() on null in /home/satdevpr/clients.satdevpro.in/lehar/application/libraries/PayPal-PHP-SDK/paypal/rest-api-sdk-php/sample/common.php on line 119
A PHP Error was encountered
Severity: Error
Message: Call to a member function getMessage() on null
Filename: sample/common.php
Line Number: 119
Backtrace:

Related

I got error when I am running my gulp file.Any one know about this error?

events.js:174
throw er; // Unhandled 'error' event
^
Error: C:\Users\Payal\Documents\sites\vision\style.css:1:16383: Unknown word> 1 |

Function to retrieve CPUID does not compile in LAZARUS

I'm trying to port some code from old Delphi7 to Lazarus but following code just won't compile. Lazarus always complains about unknown identifiers.
function GetCPUID(Leaf, Subleaf: Integer): TCPUID;
begin
asm
{$IF Defined(CPUX86)}
push ebx
push edi
mov edi, ecx
mov ecx, edx
cpuid
mov [edi+$0], eax
mov [edi+$4], ebx
mov [edi+$8], ecx
mov [edi+$c], edx
pop edi
pop ebx
{$ELSEIF Defined(CPUX64)}
mov r9,rcx
mov ecx,r8d
mov r8,rbx
mov eax,edx
cpuid
mov [r9+$0], eax
mov [r9+$4], ebx
mov [r9+$8], ecx
mov [r9+$c], edx
mov rbx, r8
{$ELSE}
{$Message Fatal 'GetCPUID has not been implemented for this architecture.'};
{$IFEND}
end;
ERROR MESSAGES
Compile Project, Target: C:\Users\Dave\AppData\Local\Temp\project1.exe: Exit code 1, Errors: 40, Warnings: 4
unit1.pas(65,9) Error: Unknown identifier "R9"
unit1.pas(65,12) Error: Unknown identifier "RCX"
unit1.pas(66,9) Error: Unknown identifier "ECX"
unit1.pas(66,13) Error: Unknown identifier "R8D"
unit1.pas(67,9) Error: Unknown identifier "R8"
unit1.pas(67,12) Error: Unknown identifier "RBX"
unit1.pas(68,9) Error: Unknown identifier "EAX"
unit1.pas(68,13) Error: Unknown identifier "EDX"
unit1.pas(70,9) Error: Assembler syntax error in operand
unit1.pas(70,10) Error: Unknown identifier "R9"
unit1.pas(70,14) Error: Dollar token is used without an identifier
unit1.pas(70,15) Error: Invalid constant expression
unit1.pas(70,16) Error: Invalid reference syntax
unit1.pas(70,18) Error: Unknown identifier "EAX"
unit1.pas(70,18) Error: No size specified and unable to determine the size of the operands
unit1.pas(70,18) Warning: Size suffix and destination or source size do not match
unit1.pas(71,9) Error: Assembler syntax error in operand
unit1.pas(71,10) Error: Unknown identifier "R9"
unit1.pas(71,14) Error: Dollar token is used without an identifier
unit1.pas(71,15) Error: Invalid constant expression
unit1.pas(71,16) Error: Invalid reference syntax
unit1.pas(71,18) Error: Unknown identifier "EBX"
unit1.pas(71,18) Error: No size specified and unable to determine the size of the operands
unit1.pas(71,18) Warning: Size suffix and destination or source size do not match
unit1.pas(72,9) Error: Assembler syntax error in operand
unit1.pas(72,10) Error: Unknown identifier "R9"
unit1.pas(72,14) Error: Dollar token is used without an identifier
unit1.pas(72,15) Error: Invalid constant expression
unit1.pas(72,16) Error: Invalid reference syntax
unit1.pas(72,18) Error: Unknown identifier "ECX"
unit1.pas(72,18) Error: No size specified and unable to determine the size of the operands
unit1.pas(72,18) Warning: Size suffix and destination or source size do not match
unit1.pas(73,9) Error: Assembler syntax error in operand
unit1.pas(73,10) Error: Unknown identifier "R9"
unit1.pas(73,15) Error: Unknown identifier "C"
unit1.pas(73,15) Error: Invalid constant expression
unit1.pas(73,16) Error: Invalid reference syntax
unit1.pas(73,18) Error: Unknown identifier "EDX"
unit1.pas(73,18) Error: No size specified and unable to determine the size of the operands
unit1.pas(73,18) Warning: Size suffix and destination or source size do not match
unit1.pas(74,9) Error: Unknown identifier "RBX"
unit1.pas(74,14) Error: Unknown identifier "R8"
unit1.pas(83,1) Error: Illegal expression
unit1.pas(83,11) Fatal: Syntax error, ";" expected but "identifier TFORM1" found
First, from the errors of the code that you show, it is clear this was not tested in Delphi 7, for the simple reason that Delphi 7 doesn't support 64-bit registers like R8 and R9
Moreover, for Delphi compatibility enable a Delphi compatibility mode, try adding
{$mode delphi}
if you want to use default Lazarus {$mode objfpc}, add
{$asmmode intel}
after the mode command
after the program or interface keywords. In addition your IFDEF clauses (CPUX86 and x64) don't seem to match FPC's.
Btw, many CPU tests have been prepared in unit cpu:
{ returns true, if the processor supports the cpuid instruction }
function cpuid_support : boolean;
{ returns true, if floating point is done by an emulator }
function floating_point_emulation : boolean;
{ returns the contents of the cr0 register }
function cr0 : longint;
function InterlockedCompareExchange128Support : boolean;
function AESSupport : boolean;inline;
function AVXSupport: boolean;inline;
function AVX2Support: boolean;inline;
function AVX512FSupport: boolean;inline;
function AVX512DQSupport: boolean;inline;
function AVX512IFMASupport: boolean;inline;
function AVX512PFSupport: boolean;inline;
function AVX512ERSupport: boolean;inline;
function AVX512CDSupport: boolean;inline;
function AVX512BWSupport: boolean;inline;
function AVX512VLSupport: boolean;inline;
function SHASupport: boolean;inline;
function FMASupport: boolean;inline;
function POPCNTSupport: boolean;inline;
function SSE41Support: boolean;inline;
function SSE42Support: boolean;inline;
function MOVBESupport: boolean;inline;
function F16CSupport: boolean;inline;
function RDRANDSupport: boolean;inline;
function RTMSupport: boolean;inline;
function BMI1Support: boolean;inline;
function BMI2Support: boolean;inline;
var
is_sse3_cpu : boolean = false;
I suggest to use these as much as possible.

Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() When Hosting

I have error like this when hosting :
Fatal error: Uncaught Error: Call to undefined function
sqlsrv_connect() in
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\database\drivers\sqlsrv\sqlsrv_driver.php:77
Stack trace: #0
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\database\drivers\sqlsrv\sqlsrv_driver.php(90):
CI_DB_sqlsrv_driver->db_connect() #1
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\database\DB_driver.php(116):
CI_DB_sqlsrv_driver->db_pconnect() #2
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\database\DB.php(149):
CI_DB_driver->initialize() #3
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\core\Loader.php(347):
DB() #4
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\core\Loader.php(1172):
CI_Loader->database() #5
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\core\Loader.php(153):
CI_Loader->_ci_autoloader() #6
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\core\Controller.php(52):
CI_Loader->initialize in
D:\HostingSpaces\kirapacc\kirapac.com\wwwroot\pesanclaris\system\database\drivers\sqlsrv\sqlsrv_driver.php
on line 77
but in my localhost running, without any error.

WApplication::bind() usage in combination with Wt::WServer::post

I want to bind a callback, which will be called by a thread outside the Wt event loop.
So obviously I want to use Wt::WServer::post, but I don't get how WApplication::bind should be used, since it's a nonstatic function.
First attempt was this:
auto loaded_callback = [](const decltype(Wt::WApplication::sessionId) &session){
Wt::WServer::post(session,
Wt::WApplication::bind(&table_model::member_func),)
};
Which of course didn't work because bind is nonstatic. However my next attempt
auto object_protect_bind =
Wt::WApplication::instance()->bind(&order_aggregate_table_model::load_future_in_map);
failed with a shitload of compiler errors
Error 153 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int \boost\function\function_template.hpp 922 1 MDDB_Web
Error 156 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int \boost\function\function_template.hpp 926 1 MDDB_Web
Error 160 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int \boost\function\function_template.hpp 927 1 MDDB_Web
Error 150 error C2903: 'apply' : symbol is neither a class template nor a function template \boost\function\function_template.hpp 922 1 MDDB_Web
Error 162 error C2825: 'manager_type': must be a class or namespace when followed by '::' \boost\function\function_template.hpp 934 1 MDDB_Web
Error 154 error C2653: 'handler_type' : is not a class or namespace name \boost\function\function_template.hpp 926 1 MDDB_Web
Error 158 error C2653: 'handler_type' : is not a class or namespace name \boost\function\function_template.hpp 927 1 MDDB_Web
Error 164 error C2275: 'manager_type' : illegal use of this type as an expression \boost\function\function_template.hpp 934 1 MDDB_Web
Error 165 error C2146: syntax error : missing '}' before identifier 'manage' \boost\function\function_template.hpp 934 1 MDDB_Web
Error 159 error C2146: syntax error : missing ';' before identifier 'manager_type' \boost\function\function_template.hpp 927 1 MDDB_Web
Error 155 error C2146: syntax error : missing ';' before identifier 'invoker_type' \boost\function\function_template.hpp 926 1 MDDB_Web
Error 152 error C2143: syntax error : missing ';' before '<' \boost\function\function_template.hpp 922 1 MDDB_Web
Error 163 error C2039: 'manage' : is not a member of '`global namespace'' \boost\function\function_template.hpp 934 1 MDDB_Web
Error 151 error C2039: 'apply' : is not a member of 'boost::detail::function::get_invoker0' \boost\function\function_template.hpp 922 1 MDDB_Web
Error 166 error C1903: unable to recover from previous error(s); stopping compilation \boost\function\function_template.hpp 934 1 MDDB_Web
while the overall solution I had in mind was:
auto sessionId = Wt::WApplication::instance()->sessionId();
auto server_ptr = Wt::WServer::instance();
auto object_protect_bind = Wt::WApplication::instance()->bind(&order_aggregate_table_model::load_future_in_map);
auto inner_bind = std::bind(object_protect_bind, this);
auto loaded_callback = []
(Wt::WServer* server,
const std::string &session,
boost::function<void()> widget_bind)
-> void {
server->post(session, widget_bind, boost::function<void()>());
};
this->data_future =
std::async(std::launch::async,
table_model::load_quiet_a_bunch_of_data,
query, database, std::bind(loaded_callback, server_ptr, sessionId, inner_bind));
Wt::WTimer::singleShot(20 * 1000, this, &table_model::load_future_in_map);
Any suggestions?
Thanks to Koen Deforche in the official forum, the problem was:
Wt::WApplication::bind is supposed to take the already binded method, not the method itself.
Also there is a surprising (for me at least) template detail when using lambdas, so for the sake of an example, my solution for a callback, used by a data loading thread, is:
static std::map<decltype(views::measurements_grouped_by_orders::order_number),
order_value>
order_aggregate_table_model::async_load_order_values(
const odb::query<views::measurements_grouped_by_orders> &query,
std::shared_ptr<odb::database> mddb,
std::function<void(void)> callback) {...
if (callback){ callback(); }
return map;
}
void order_aggregate_table_model::get_data(const odb::query<views::measurements_grouped_by_orders> &query){
auto sessionId = Wt::WApplication::instance()->sessionId();
auto server_ptr = Wt::WServer::instance();
auto object_protect_bind =
Wt::WApplication::instance()->bind(/*Wt::WApplication::bind
handles the case that
the widget might already been destroyed*/
std::bind(&order_aggregate_table_model::load_future_in_map,this));
auto loaded_callback = []
(Wt::WServer* server,
const std::string &session,
std::function<void()> widget_bind)
-> void {
server->post(session, widget_bind, boost::function<void()>());
//Wt::Server::post handles the case when the session is already been destroyed
};
std::function<void()> final_callback = //Because of template quirks had to stick the type
std::bind(loaded_callback, server_ptr, sessionId, object_protect_bind);
this->order_aggregate_map_future =
std::async(std::launch::async,
order_aggregate_table_model::async_load_order_values,
query, this->mddb, final_callback);
Wt::WTimer::singleShot(30 * 1000, this,
&order_aggregate_table_model::load_future_in_map); //For the case that the async loader crashed
}

Linux kernel programming

i want to catch pipe() syscall, so i've changed source code in pipe.c
static pipe_hook_t pipe_hook;
pipe_hook_t set_pipe_hook(pipe_hook_t hook)
{
pipe_hook_t old_hook = pipe_hook;
pipe_hook = hook;
printk(KERN_INFO, "pipe hook: %p", hook);
return old_hook;
}
EXPORT_SYMBOL_GPL(set_pipe_hook);
then i tried to define pipe_hook_t in file syscalls.h (included in pipe.c)
typedef void (*pipe_hook_t)(int *filedes);
pipe_hook_t set_pipe_hook(pipe_hook_t hook);
and i have error:
fs/pipe.c:1130: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pipe_hook’
fs/pipe.c:1131: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘set_pipe_hook’
fs/pipe.c:1138: error: ‘set_pipe_hook’ undeclared here (not in a function)
fs/pipe.c:1138: warning: type defaults to ‘int’ in declaration of ‘set_pipe_hook’
fs/pipe.c: In function ‘sys_pipe2’:
fs/pipe.c:1153: error: ‘pipe_hook’ undeclared (first use in this function)
fs/pipe.c:1153: error: (Each undeclared identifier is reported only once
fs/pipe.c:1153: error: for each function it appears in.)
fs/pipe.c:1154: error: implicit declaration of function ‘pipe_hook’
i've tried to create my own .h file and define pipe_hook_t there but the error was the same
Problem has been solved. I've just confused directory where header files are.

Resources