Posts

php - Codeigniter - How to get Other user session -

i'm using chat in codeigniter here i'm tring active users can display in chat whether user online or offline. tried following result empty. $this->session->all_userdata(); kindly me. if using database sessions, potentially verify login status using call ci_sessions table (or whatever have named it). can use simple query validate if have been browsing within last hour (or whatever) , validate them being online. sample sql query this: select from_unixtime(timestamp) 'timestamp' ci_sessions timestamp > unix_timestamp(date_add(curdate(),interval -1 hour)) order timestamp desc this return users active in last hour (the timestamp col updated each time page requested) you can grab users details out of 'data' column... $this->session->all_userdata() will not return logged in users available data of current logged in user

ios - Response in alert view -

Image
i new ios want display response post in alert view.in nslog showed response. need when clicked button alert view can display response. coding: -(void) senddatatoserver : (nsstring *) method params:(nsstring *)str{ nsdata *postdata = [str datausingencoding:nsasciistringencoding allowlossyconversion:yes]; nsstring *postlength = [nsstring stringwithformat:@"%lu", (unsigned long)[str length]]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring:url]]; nslog(@"%@",str); [request sethttpmethod:@"post"]; [request setvalue:postlength forhttpheaderfield:@"content-length"]; [request sethttpbody:postdata]; nsurlconnection *theconnection = [nsurlconnection connectionwithrequest:request delegate:self]; if( theconnection ){ mutabledata = [[nsmutabledata alloc]init]; } } alerview: - (ibaction)butt1:(id)sender { uialertview *alert = [[uialertview allo...

java - Where does Gradle managed dependency without Maven or Ivy? -

i understand java projects using gradle publishing reusable code publishing maven's pom.xml file along side jar file. i'm wondering gradle store dependency list if library not published using neither ivy nor maven. moreover, gradle can used not jvm-based project, can used build non-jvm project, not use maven or ivy. i've read chapter 23. dependency management doesn't give clue how gradle can publish java library without maven or ivy. transitive dependencies native projects in gradle not possible of gradle 2.13. you need implement own plugin somehow store/retrieve , process such metadata , use them correctly (resolve, download , put files correct directories). we plan implement similar functionality. closest solution maven nar plugin .

Cmake install header without a specific method -

i have small library made stand along except 1 optional method in class requires imagemagick. looking make possible not compile method if machine not have imagemagick installed; rather failing. issue header still have method defined (though not compiled). there way remove method header using cmake or other approach? wrap definition in preprocessor definition: #ifdef have_imagemagick void myfunctiondefinition(void); #endif then, in cmake, if imagemagick found, add definition project. cmake pass definition command line of compiler, define preprocessor token. if(imagemagick_found) # or whatever cmake variable holds info add_definitions(-dhave_imagemagick) endif() alternatively, if have many such defines, consider include file hold of these configurations. cmake command configure_file can expand out entire file's worth of configuration statements @ once.

python - Convert mayavi mlab.contour3d plot to vtkPolyData -

i trying triangulated vtkpolydata mlab.contour3d plot. using mayavi because seems fastest way minimal surfaces triangulated properly. need vtkpolydata because want save .stl file. here mwe of code: import numpy np mayavi import mlab def fun(x, y, z): return np.cos(x) + np.cos(y) + np.cos(z) x, y, z = np.mgrid[-1:1:100j, -1:1:100j, -1:1:100j] contour = mlab.contour3d(x, y, z, fun) mlab.show() what mayavi surface triangulated , displayed using vtk (or tvtk ), should possible vtkpolydata there. way found far use mlab.savefig(test.obj) export .obj-file (which bad, because takes time save file everytime mayavi ui opens) , import file again using vtkobjreader , gives me vtkpolydata want. does know more straight-forward way this? edit: clarify problem bit more: can access data visualization e.g. mayavi.tools.pipeline.get_vtk_src() , comes in form of vtkimagedata . if knows way convert vtkpolydata , solution. by total coincidence found solution. impor...

How to design content share model for social network in Django? -

Image
this not program bug fix problem. looks silly, since don't have experience in designing website. want make sure design pattern right before began write code. i want design social network google+ or facebook(only accomplish basic function sharing content), google+, users can share different types of content texts, photos, link , video. picture below: i'm confused need design different model every type sharing content? below codes: class textpost(models.models): text=models.charfield(max_length=140) createdate=models.datetimefield(auto_now_add=true) author=models.onetoonefield(user) class gallerypost(models.model): gallerytitle=models.charfield(max_length=140) createdate=models.datetimefield(auto_now_add=true) author=models.onetoonefield(user) class images(models.models): image = models.imagefield() gallerypost=models.foreignkey(gallerypost) class linkpost(models.models): link=... createdate=... class videopost(models.models...

vb.net - Adding the Google Contacts v3 API to my project -

Image
please forgive me if sounds simple question getting myself confused. i have visual basic application uses google calendar v3 api , has been operational several months. authentication working etc.. now wanting extend cababilities of project include contact details. intially found this: https://developers.google.com/google-apps/contacts/v3/#retrieving_a_single_contact it provides several examples, although c#. eg: using google.contacts; using google.gdata.contacts; using google.gdata.client; using google.gdata.extensions; // ... requestsettings settings = new requestsettings("your_application_name"); // add authorization token. // ... contactsrequest cr = new contactsrequest(settings); // ... in visual basic application have header section instead: imports system.collections.generic imports system.io imports system.threading imports system.xml imports google.apis.calendar.v3 imports google.apis.calendar.v3.data imports google.apis.calendar.v...