Posts

android - Why is my share function only working with whatsapp? -

i have full screen activity: public class fullimageactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.full_image); // intent data intent = getintent(); // selected image id int position = i.getextras().getint("id"); imageadapter imageadapter = new imageadapter(this); imageview imageview = (imageview) findviewbyid(r.id.full_image_view); imageview.setimageresource(imageadapter.mthumbids[position]); bitmapdrawable bm = (bitmapdrawable) imageview.getdrawable(); bitmap mysharebmp = bm.getbitmap(); try { bytearrayoutputstream bytes = new bytearrayoutputstream(); mysharebmp.compress(bitmap.compressformat.jpeg, 100, bytes); //you can create new file name "test.jpeg" file f = new file(environment.getexternalstor...

Creating New user in XMPP server using Java -

i trying create new user in xmpp using java getting null pointer exception . can body me this. i have tried this.connectionconfiguration connconfig = new connectionconfiguration("serverip", 5222); xmppconnection connection = new xmppconnection(connconfig); connection.login("admin@target.com", "kjbkishan"); connection.connect(); accountmanager accountmanager = connection.getaccountmanager(); map<string, string> attributes = new hashmap<string, string>(); attributes.put("username", "krishna"); attributes.put("password", "123456"); attributes.put("email", "krishna@gmail.com"); attributes.put("name", "krishnathakkar"); accountmanager.createaccount("krishna@target.local", "123456",attributes); ...

r - Using roll=TRUE with allow.cartesian=TRUE -

what best way cartesian join , use roll forward feature, applying roll feature each alternative series joining table, rather whole series. best explained example: library(data.table) = data.table(x = c(1,2,3,4,5), y = letters[1:5]) b = data.table(x = c(1,2,3,1,4), f = c("alice","alice","alice", "bob","bob"), z = 101:105) setkey(b,x) c = b[a, roll = true, allow.cartesian=true, rollends = false] b c[f == "alice"] c[f == "bob"] c so have 2 starting tables: > x y 1: 1 2: 2 b 3: 3 c 4: 4 d 5: 5 e > b x f z 1: 1 alice 101 2: 1 bob 104 3: 2 alice 102 4: 3 alice 103 5: 4 bob 105 and want join these have for each x value in a have both , alice , bob row, rolling forwards if either missing (but not rolling past end). doesn't quite work i've got it: > c[f == "alice"] x f z y 1: 1 alice 101 2: 2 alice 102 b 3: 3 alice 103 c > c[f == "bob"] ...

csv - Why am I not allowed to have repeating IDs in the Primary Key column in MySQL -

i using mysql workbench 6.0 , importing reasonably large (~55mb) .csv file. first column consists of reference ids , second dates. reference ids read in fine first day when comes second day (when reference ids should start repeat) information starts become garbled, though dates remain correct. it worth noting did not have un box ticked when made table. i wondering going on here , whether me. thanks! a primary key definition unique. that's all: cannot have non-unique primary key, if have defined primary key, cannot have repeating values. solutions: make non-primary key / index, or add uniqueness making combined primary key date.

sql - Trouble With Query Utilizing Views -

i working on database student organization. 1 feature of database record student attendance events. if student not attend event, lack of attendance not entered. in order student attend event must enrolled. following tables utilized process: student student_id int (pk), student_m, first_name, last_name, gender, email, phone, degree, grad_term, grad_year, student_enrollment enrollment_id (pk), student_id (fk), term, year, status, student_attend att_id (pk), enrollment_id (fk), event_id (fk), event event_id (pk), event_name, location, term, year, date, time, description, cost, dress_code, require, my goal write query display lack of attendance. in query trying pull student's name , email , list of events did not attend required (where event.require = 'y'). have tried multiple ways of writing this, many of include numerous views, no luck. if has creative thoughts here help! thanks you need cross join between students , events possible combinations of two. ...

java class without any method, but contains logic under static keyword -

i have few questions below code snippet: public class configuration { public static string temp_dir; public static list<string> levents; ......//some more public static members...... static{ //logic fill members of class } } i wondering when logic fills members executed? and approach different if have used actual static method execute logic , call once? the static { //logic fill members of class } code known static initializer . i wondering when logic fills members executed? the java language specification says a static initializer declared in class executed when class initialized (§12.4.2) . you ask and approach different if have used actual static method execute logic , call once? with static initializer, jvm takes care of executing code. static method, have call yourself. equivalent, want guarantee method called/executed once.

php - How to get google api 10 search result -

how can 10 search result google api, have code showing 4 search results only $query = 'akon'; $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=".$query; $body = file_get_contents($url); $json = json_decode($body); for($x=0;$x<count($json->responsedata->results);$x++){ echo "<b>result ".($x+1)."</b>"; echo "<br>url: "; echo $json->responsedata->results[$x]->url; echo "<br>visibleurl: "; echo $json->responsedata->results[$x]->visibleurl; echo "<br>title: "; echo $json->responsedata->results[$x]->title; echo "<br>content: "; echo $json->responsedata->results[$x]->content; echo "<br><br>"; } the maximum number of results can obtained api 8. can adding "&rsz=large" url below. $url = " http://ajax.googleapis.com/ajax/services/search/web?v=1.0 &rsz=la...