Posts

Calling Cpanel UAPI method -

i have following simple script list ftp accounts unable work have following error tries call constructor include '/usr/local/cpanel/php/cpanel.php'; $cpanel = new cpanel(); // connect cpanel - once. // list ftp account information. $list_ftp_accts = $cpanel->uapi('ftp', 'list_ftp'); echo "<pre>"; print_r($list_ftp_accts); fatal error: uncaught exception 'runtimeexception' message 'there problem fetching env variable containing path socket' in /usr/local/cpanel/php/cpanel.php:146 stack trace: #0 /public_html/uapi.php(4): cpanel->__construct() #1 {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146 line 146 in cpanel.php $socketfile = getenv('cpanel_phpconnect_socket'); according a post on cpanel forums , can use liveapi within cpanel's document root, meaning code need in either /usr/local/cpanel/base/frontend/ or /usr/local/cpanel/base/3rdparty/ . ran while trying use ...

android - unity game crash seems randomly when change scene -

i have 2 scene : levelselect scene , game play scene in game play scene , when user failure , can replay. make ugui button reload current scene. button code scenemanager.loadscene(1) , sometime crash. not alltime ,seems when fail game , press restart button, 3 or maybe 4 times game crash. not in android ,in wp81 or unity editor crash too. i trouble week ... help!!!! here android logcat info : ( anyway more error info ? thank link,keyword , help.) 01-28 00:32:35.205: i/aee/aed(24328): pid: 22948, tid: 22973, name: unitymain 01-28 00:32:35.205: i/aee/aed(24328): signal 11 (sigsegv), code 2 (segv_accerr), fault addr 0x80ff5fc1 01-28 00:32:35.286: i/aee/aed(24328): r0 80ff5f51 r1 000065f0 r2 a40697a0 r3 a40697a0 01-28 00:32:35.286: i/aee/aed(24328): r4 a3fc7f10 r5 00000003 r6 00000000 r7 3f800000 01-28 00:32:35.286: i/aee/aed(24328): r8 845940dc r9 000003e8 sl ffffef20 fp 89839020 01-28 00:32:35.286: i/aee/aed(24328): ip 00000000 sp 84968828 lr 83ca87a4 pc 83ca87fc cpsr 000e0010...

jquery - Onclick is being called several times even when i have called it only once -

i have put code inside resize function in jquery. click function called multiple times. when click on desired link toggle takes place many times if ($(window).width() <=768){ if ($('body').hasclass('page-search-ads')){ if ($('#-clasifika-results-simple-search-form img').hasclass('funnel')) { } else { $('#-clasifika-results-simple-search-form').append("<img class='funnel' src='" + drupal.settings.basepath + "sites/all/themes/clasifika/images/filter.png'/>"); } $('.funnel').click(function(){ $('.vehicle-cat, .vehicle-brand, .city-name-filter, .vehicle-mileage,.overall-cat,.city-name,.boat-bed,.boat-type,.boat-brand,.nautical-length,.overall-year,.airplane-type,.fashion-cat,.airplane-brand,.airframe-time,.propeller-hours,.monthly-salary,.amount-slider,.area-slider').slidetoggle(); console.log(...

how to retrieve int value from Sharedpreferences in Android -

i trying save , value sharedpreference far storing data concern working i'm helpless while retrieving value. //setting constant private static final string wallpaper_pref_file = "wallpaper"; //method storing key value pair private void savewallpaper(int wallpaperid) { pref = getsharedpreferences(wallpaper_pref_file, mode_private); editor = pref.edit(); editor.putint("wallpaperid", wallpaperid1); editor.commit(); } // call method getsharedpreferences() value in oncreate() of activity . sharedpreferences getpreff = getsharedpreferences(wallpaper_pref_file, mode_private); //default value int resid1 = r.drawable.chat_composer; int resid = getpreff.getint("wallpaperid", resid1); //do operations resid look have typo in retrieval - wallpaerid. fix , should work. (even better, use constant string in both saving , retrieving avoid problem).

c# - correct way of looping trough a list and remove items -

i wrote function go trough list , remove list items if conditions met. program crashed on it, , after while concluded outer loop, goes through items in list. while @ same routine list of item can shorter. // lijst list of struct contains value .scanned , .price (int = 0; < lijst.count; i++) { if (lijst[i].scanned == false) { // (removed deletion of list item here) if (lijst[i].price > (int)nudminimum.value) { totaal++; lbldebug.text = totaal.tostring(); } lijst.removeat(i); //<-moved here } } now wonder whats correct this, without getting index out of range errors. you might looking for (int = lijst.count - 1 ; >= 0 ; i--) { if (lijst[i].scanned == false) { if (lijst[i].price > (int)nudminimum.value) { totaal++; lbldebug.text = totaal.tostring(); } lijst.removeat(i); } } question in comment: why other direction loop wor...

serialization - How to delete Serializable entity exposed with Spring data rest and spring data mongo -

i have been experiencing error using spring data rest. cannot delete entities implement java.io.serializable. public class data implements serializable{ @id public string id; public string value; ... getters , setters here ... } my spring data repository follows: @repositoryrestresource public interface datarepository extends mongorepository<data,string>{ } the funny thing if remove "serializable" interface, can delete entities using delete http method. can delete if replace serializable interface custom interface. if introduce serializable method, when delete, gives me following error: {"cause":null,"message":"target bean not of type of persistent entity!"} java.lang.illegalargumentexception: target bean not of type of persistent entity! @ org.springframework.util.assert.istrue(assert.java:68) ~[spring-core-4.2.4.release.jar:4.2.4.release] @ org.springframework.data.mapping.model.basicpersistententity....

windows - Create file for every script instance -

i've created script below obtain folder size of c:\users linux tool du. script distributed via gpo users. xcopy \\0.0.0.0\netlogon\gnu-core-utils\du.exe c:\profile-size-script\ /i /s /y xcopy \\0.0.0.0\netlogon\gnu-core-utils\libintl3.dll c:\profile-size-script\ /i /s /y xcopy \\0.0.0.0\netlogon\gnu-core-utils\libiconv2.dll c:\profile-size-script\ /i /s /y c: cd c:\profile-size-script du -hs c:\users\* > \\0.0.0.0\userfolder\%username%.txt lines explained below: copies file called du.exe location c:\profile-size-script copies file called libintl3.dll same location. copies file called libiconv2.dll change drive c: in case cmd starts @ different drive letter. change same folder size use du folder size , echo output \0.0.0.0\userfolder\%username%.txt. the issue script not creating new file each user appending firstly created file %username%.txt i think you're looking this: xcopy \\0.0.0.0\netlogon\gnu-core-utils\du.exe c:\profile-size-script\ /i /s...