Posts

javascript - Restangular getList() method not returning JSON -

Image
i have problem geting data restangular promise. promise instead of pure data in json. this response api localhost:3000/api/meal { "status": "success", "data": [ { "meal_id": 4, "meal_type_id": 2, "description": "blahblah", "price": "3.50", "info": "120/120/20g", "restaurant_id": 2 }, ... ... } ], "message": "retrieved meals" } this config method extracting data response restangularprovider.addresponseinterceptor(function(data, operation, what, url, response, deferred) { var extracteddata; // .. getlist operations if (operation === 'getlist') { // .. , handle data , meta data return data.data; } else { extracteddata = data.data; } return extracteddata; }); this how trying data api restangular.all('meal').getlist().then(function(meals) { ...

What is the maximum version of PHP that cakephp version 1.3.7 will work with? -

i have moodle course uses cake 1.3.7 has started generating errors. these 3 come up: redefining defined constructor class object in /home/eslwow87/public_html/cake/libs/object.php on line 54 non-static method configure::getinstance() should not called statically in /home/eslwow87/public_html/cake/bootstrap.php on line 38 non-static method cakelog::handleerror() should not called statically in /home/eslwow87/public_html/cake/libs/cake_log.php on line 290 i guessing these caused mis-match between cake , version of php running on server (5.3.29). guess correct? you can open file config/core.php , change error_reporting this: configure::write('error', array( 'handler' => 'errorhandler::handleerror', 'level' => e_all & ~e_deprecated & ~e_strict, 'trace' => true )); or alternatively upgrade newer 1.3.x version fix these errors instead of suppress them, i'm not sure download git...

c# - Is it possible to add an implicit operator in assembly A between types from assemblies G and M? -

let's there's graphics api g doesn't want depend on external math library , therefore defines vector parameters bare structs ( like sharpdx raw types ). let there math library m . a developer wants provide implicit operators in assembly a cast between full type math library m raw type graphics api g ( another sample sharpdx, in case operators defined in m instead of a ). note both of types have exact same memory representation. afaik, there no means in c# language provide such operators. closest comes mind extension methods, user still needs call additional method conversion. is possible or there samples of such operators being added through il rewrite? limited knowledge, i'd think possible appreciate additional feedback on matter. thanks! you rewriting il of 1 of 2 libraries, specifically, add implicit operator type (and in process add dependency on other library). but think doing bad idea: means need use own version of library (i.e. ca...

html - How do I accomplish this with url rewriting? -

i have menu, when open goes /#0 indicate menu has been opened , menu slides in , shows. want know how rewrite url instead of site.com/#0 site.com. believe can done .htaccess though i'm not quite sure how. in advance. please try if i'm getting point. # rewrite --- www.site.com/#0 => www.site.com rewriterule ^$ /?&%{query_string}

C program won't compile without warnings when GCC is called by makefile - Works otherwise -

so have program here, works when called $ gcc test.c -o test -std=c99 but when called in makefile: all: test test: test.c gcc test.c -o test -std=c99 it produces warnings instead , gives segmentation fault. terminal output: gcc -g test.c -o tester -std=c99 test.c: in function ‘test_split’: test.c:43:2: warning: implicit declaration of function‘strdup[-wimplicit-function-declaration] char *str_cpy = strdup(str); // allow mutation of original string test.c:43:18: warning: initialization makes pointer integer without cast [enabled default] char *str_cpy = strdup(str); // allow mutation of original string above error not appear otherwise , not produse segmentation fault. the code segment fails here. string.h included in header. file large file test other functions. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #define cnrm "\x1b[0m" #define cred "\x1b[31m" #define cgrn "\x1b[3...

Using VBA in excel to provide a warning on start up if a value in a column falls below an integer -

i have excel document multiple worksheets. 1 of worksheets titled "inventory". tracks how of each product have , when these products expire. in 1 of columns, lists "days until expiration" each material have. want write vba script every time open excel file, script runs , checks values in "days until expiration column". if there value in column within 14 days of expiration, want script pop-up upon excel file starting , "____ material has # days left before expiration". please advise. assuming expiration dates on column d, please consider following code added workbook_open event: private sub workbook_open() dim wb workbook dim ws worksheet dim rngused range, rngexpirationcolumn range, rngcell range dim strexpirationmessage string set wb = thisworkbook set ws = wb.sheets("inventory") set rngused = ws.usedrange set rngexpirationcolumn = intersect(ws.columns(4), rngused) each rngcell in r...

javascript - Changing the html of a td tag dynamically -

when edit function triggered td id "promo1" changes html show options save delete rule , cancel. cancel in tag onclick function called "cancel()". when clicked should revert td tag "promo1" image set. doesnt work when onclick coming cancel tag in td tag "promo1" works when cancel() function triggered cancel button, clues why occurring , fixes? function edit(stringid){ console.log (stringid); var id = '#promo' + stringid; $("#promo1").html("<div style='width:200px'><a onclick='save()' style='margin-right:10px'><b>save</b></a> <a onclick='save()' style='margin-right:10px'><b>delete rule</b></a> <a onclick='cancel()'><b>cancel</b></a><div>"); } function cancel() { $("#promo1").html("<img src='dist/img/editbutton.png'>"); } <scr...