Posts

php - Laravel sql command to Laravel QueryBuilder -

i'm trying convert sql query querybuilder can't it. select a.id, a.category_name, cat.count `categories` left outer join ( select `categories`.`category_parent` , count(*) count `categories` group category_parent ) cat on a.id = cat.category_parent a.category_parent = 1 for example: db::table('users') ->join('contacts',db::raw("a.id = cat.category_parent"),function($query){ $query->select(db::raw("`categories`.`category_parent` , count( * ) count")) ->from('contacts') ->groupby('category_parent') ->where(db::raw("a.category_parent = 1")) ->get(); how fix method in laravel. thanks try getting pdo instance execute query directly: $pdo=db::connection('mysql')->getpdo(); $stmt=$pdo->prepare(" select a.id, a.category_name, cat.count `categories` left outer join ( select `categories...

Spring Security and multiple LDAP -

i have scenario have connect multiple ldaps, each 1 different country. if user tries login, have verify whether user setup in of ldap, can authenicated , granted access roles defined ldap. possible spring security framework? yes can authenticate against multiple ldap servers. if want try each ldap instance, can this: <ldap-server id="exampleldap" url="ldap://example.org:389/dc=springframework,dc=org" /> <ldap-server id="springldap" url="ldap://springframework.org:389/dc=springframework,dc=org" /> <authentication-manager> <ldap-authentication-provider user-search-filter="(uid={0})" user-search-base="ou=people" server-ref="exampleldap"/> <ldap-authentication-provider user-search-filter="(uid={0})" user-search-base="ou=people" server-ref="springldap"/> </authentication-manager>

Android: copy sms messages / gallery photos / call history to online resource -

i'm developing android security project. project sneaky calculator. when user uses programmed calculator , presses buttons, there should start background processes copy's sms messages, gallery photo's , call history phone source can grab these. but don't know how need start this. kind of backend need? to read sms can use android provided sms manager class. sms manager class read sms's 1 one. after each sms read can dump data either server or local db. to know gallery photos can access storage device gallery location.you can read via fileinputstream , write file server via multipart object type fileoutputstream object. if want store local db can use blob object. to know call history can use android provided calllog.calls method. all above 3 can implement 1 one in background service.

c++ - QModelIndex becomes invalid when removing rows -

i'm subclassing qabstractitemmodel display items in qtreeview , , within subclass ( projectmodel ), have function delete currently-selected index in tree view. component class used represent members of model: void projectmodel::deletecomponent() { qmodelindex child_index = _treeview->selectionmodel()->currentindex(); component* child = static_cast<component*>(child_index.internalpointer()); component* parent = child->parent(); qmodelindex parent_index = createindex(parent->row(), 0, parent); int row = child->row(); beginremoverows(parent_index, row, row); parent->delete_child(child); endremoverows(); } the parent , child indicies , raw pointers before call beginremoverows ; debugger shows point correct item , parent. however, program crashes after calling beginremoverows . specifically, crashes in projectmodel::parent() : qmodelindex projectmodel::parent(const qmodelindex &index) const { if (!ind...

Android/Java Instantiating a class multiple times -

i'm using sugarorm sqlite in android app. using code below add new rows table: mytable d = new mytable("row1_title",valuerow1,stockrow1); d.save(); mytable d2 = new mytable("row2_title",valuerow2,stockrow2); d2.save(); mytable d3 = new mytable("row3_title",valuerow3,stockrow3); d3.save(); mytable d4 = new mytable("row4_title",valuerow4,stockrow4); d4.save(); mytable d5 = new mytable("row5_title",valuerow5,stockrow5); d5.save(); mytable d6 = new mytable("row6_title",valuerow6,stockrow6); d6.save(); mytable d7 = new mytable("row7_title",valuerow7,stockrow7); d7.save(); mytable constructor public mytable(string title, int value, int stock){ this.title = title; this.value = value; this.stock = stock; } this works fine, right way instantiate class multiple times? seems should able combine instantiating in way? thanks not really. if want initialize different variables...

.net - VB.NET - Implement Interface in LinqToSql -

how go implementing interface linqtosql class in vb.net? i've created partial , added explicit implementation, visual studio complaining these properties exist in code created linqtosql model. error message properties have multiple definitions identical signatures. option strict , option explicit on. code in partial follows: partial public class youthresidence implements iaddress public property street1 string implements iaddress.street1 public property street2 string implements iaddress.street2 public property city string implements iaddress.city public property state string implements iaddress.state public property zipcode string implements iaddress.zipcode end class edit: know can wrap model properties different name in partial, i'd prefer avoid if possible. this problem how vb.net implements interfaces. doesn't support implicit interfaces c# does. have tie specific member interface declaration. annoying partial classes. c...

vba - Access FindFirst/FindNext returns Operation is not supported in this type of object -

i have code: sub printpdfpagestest(formname string, filename string) ''print each record separate pdf file, named according invoice number dim rs recordset dim wherecondition string dim savename string dim strtemp2 long strtemp2 = 2281821648 set rs = currentdb.openrecordset(filename) ''can pass sql in string ''add msgbox: create number input invoicenumber ''get value invoicenumber = inputbox ("enter starting invoice num"...) ''get value end invoicenumber = inputbox("enter ending invoice num"...) ''get start value starting location (findrecord) -----need plan step out. ''add if statement in while loop. if condition not end invoice number, keep going rs.findnext "[invoicenumber]=" & strtemp2 docmd.close acform, formname rs.close set rs = nothing end sub what want find position of strtemp2 invoice number in table , use move...