Posts

visual c++ - VC++ Dll Not Working On Windows XP Sp3 When Using C++ Builder -

i have created vc++ dll in visual studio 2013. extern "c" int __declspec(dllexport) __cdecl convertimagetotext(char* datapath, char* imagefilepath, char* captchacode) { // return 0; } i'm using in borland c++ builder 6 that. hmodule dllhandle = loadlibrary("captcha.dll"); int (__cdecl *convertimagetotext)(char*,char*,char*); convertimagetotext =(int (__cdecl *)(char*,char*,char*))getprocaddress(dllhandle, "convertimagetotext"); if (convertimagetotext != null ) { convertimagetotext("","",""); }else { showmessage("convertimagetotext pointer not found !"); } it's working in win7/8/8.1.there isn't problem. but can't find pointer of convertimagetotext on windows xp sp3. i have changed vc++ dll project "platform toolset" "visual studio 2013 - windows xp (v120_xp)".nothing not changed. i have checked visual c++ redistributable packages.all i...

c++ - I am stucked with this code of accessing values in 2D array using pointers -

int main() { int a[4][2] = {1,2,3,4,5,6,7,8}; printf("%d\n",*(a[2]+1)); printf("%d\n", *(*(a + 2)+1)); getch(); } two-dimensional array can thought of one-dimensional array. output of program 6 in both printf. question how printf("%d\n", *(*(a + 2)+1)); executing , how precedence of asterik * , + evaluating. let's consider both printf calls. a[2] in cell int[2] = {5,6} a[2] + 1 pointer holds address of number 6 (a[2] implicitly converted pointer), after dereference 6. a , int[4][2] array, converted pointer (after conversion holds pointer first element) a + 2 pointer holds address of pointer number 5 *(a + 2) pointer holds address of number 5 *(a + 2) + 1 pointer holds address of number 6 *(*(a + 2) + 1) number 6 edit: sorry, wrong statements. take account comments , need add in above example lvalue expression of array type implicitly converted pointer first element.

ckeditor does not rise always onSelectionChange event -

i try onselectionchange event ckeditor. when select ckeditor rise correctly event, if select else in same paragraph event not raised. is there way make creditor rise onselectionchange event time select text. ? any advice on solve issue ? thanks the answer in api documentation : fired when selection inside editor has been changed. note event fired when selection's start element (container of selecion start) changes, not on every possible selection change. selectionchange fired less frequently, on every context (the elements path holding selection's start) change. you can observe mouse , keyboard actions though ( jsfiddle ): function logselection() { console.log( this.getselection() ); } ckeditor.replace( 'editor', { on: { contentdom: function() { this.document.on( 'mouseup', logselection, ); this.document.on( 'keyup', logselection, ); } } } );

php - Expiration not specified" according to Gtmetrix -

i have website https://royzez.com,i using .htaccess leverage browser caching mentioned code in gt metrix still getting message (expiration not specified). these images coming cdn. there other configuration in cdn server? how fix issue. code using ` expiresactive on expiresdefault "access plus 1 month" # css expiresbytype text/css "access plus 1 month" # favicon (cannot renamed!) , cursor images expiresbytype image/x-icon "access plus 1 week" # html expiresbytype text/html "access plus 0 seconds" # javascript expiresbytype application/javascript "access plus 1 year" expiresbytype application/x-javascript "access plus 1 year" expiresbytype text/javascript "access plus 1 year" # manifest files expiresbytype ...

Index exceeds matrix dimensions error in matlab -

this question has answer here: index exceeds matrix dimensions when finding max value 3 answers i error index exceeds matrix dimensions when run following in matlab. doing wrong? >> = 1 2 3 4 5 6 7 8 9 >> a(:) ans = 1 4 7 2 5 8 3 6 9 >> sum(a(:)) index exceeds matrix dimensions. >> sum(a(:),1) index exceeds matrix dimensions. >> sum(a(:),2) index exceeds matrix dimensions. you did set variable under name sum a = [1 2 3 ; 4 5 6; 7 8 9] sum = 1; >> sum(a); index exceeds matrix dimensions. clear sum; >> sum(a) ans = 12 15 18

c++ - inconsistent behavior of boost spirit grammar -

this question has answer here: undefined behaviour somewhere in boost::spirit::qi::phrase_parse 1 answer i have little grammar want use work project. minimum executable example is: #pragma gcc diagnostic push #pragma gcc diagnostic ignored "-wunused-local-typedefs" #pragma gcc diagnostic ignored "-wmaybe-uninitialized" #pragma gcc diagnostic ignored "-wunused-variable" #include <boost/spirit/include/karma.hpp> #include <boost/spirit/include/qi_grammar.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/support_istream_iterator.hpp> #pragma gcc diagnostic pop // pops #include <iostream> int main() { typedef unsigned long long ull; std::string curline = "1;2;;3,4;5"; std::cout << "parsing: " << curline << "\n"; nam...

Laravel: ORM retrieving data ordered by related table -

i creating simple messenger laravel 4, fuctionality pretty same facebook messenger. have problem making eloquent query list latest messages threads logged user. consider have following db tables messenger (there users table): +-----------+ +--------------+ +----------------+ +----------------+ +-----+ |threads | |thread_users | |messages | |messages_status | |users| +-----------+ +--------------+ +----------------+ +----------------+ +-----+ |id | |id | |id | |id | |id | |title | |thread_id | |thread_id | |user_id | |name | |created_at | |user_id | |sender_id (user)| |message_id | +-----+ |deleted_at | |created_at | |content | |deleted_at | +-----------+ |deleted_at | |created_at | +----------------+ +--------------+ +----------------+ db explanation: when user writes first message creates thread. users added thread listed in ...