Posts

Showing posts from April, 2011

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...

php - Paypal- Mass Pay Implementation -

have been searching mass pay found nothing..!! have read paypal guide send credentials , user information pay not able find format of data accept ?? new php , paypal ?? paypal made rest version of payouts available. here s payouts overview: https://developer.paypal.com/docs/integration/direct/payouts-overview/ to access: go dashboard on developer.paypal.com go account click started under payouts when make through you'll have mass payments capability

In codeigniter, After login if I click the browser back button, I got back to the login page -

i have created login page first line if session->userdata() exist redirect home. after login when click button, login page. expected session check work it's not, help? i think may you. add in controller function prevent caching of previous page header("cache-control: no-store, no-cache, must-revalidate"); header("cache-control: post-check=0, pre-check=0", false); header("pragma: no-cache"); header("expires: sat, 26 jul 1997 05:00:00 gmt");

r - Storing print output -

i simulating football results using r, have set loop each team plays against each other. mod3=glm(formula = score ~ attack +home+division , family = poisson, data = football) (i in 1:20){ (j in 1:20){ if (i!=j){ teamhome=levels(football$attack)[i] teamaway=levels(football$attack)[j] teamhome teamaway if(i<21){ iteam="p" } else if(i<45){ iteam="c" } else if(i<69){ iteam="1" } else{ iteam="2" } if(j<21){ jteam="p" } else if(j<45){ jteam="c" } else if(j<69){ jteam="1" } else{ jteam="2" } if(iteam==jteam) {iteam <- "s"; jteam <-"s"} divisions=paste(iteam,jteam," ",sep="") divisionj=paste(jteam,iteam," ",sep="") homescore=rpois(1,predict.glm(mod3, data.frame(attack=teamhome,home="y ",division=divisions),type="response")) awayscore=rpois(1,predict.g...

loops - Java Stack - while pop-ing check pop content -

i want repeat calling function in while(), i.e. while (temp=pop()) check temp if found return true else loop if finished looping not found return false but can't seem implement while (temp=pop()). there other way this? below attempt on coding it: while(c1=g1.pop()){ if (c1.regis.equals(r) == false) { np1.enqueue(c1.regis, 'a'); counter++; }else if (c1.regis.equals(r) == true) { while (np1.isempty() != true) { c2 = np1.dequeue(); g1.push(c2.regis, c2.status); } counter = g1.checkspace(); return true; }else{ return false; } } while(c1=g1.pop()) can't work, , can't return true or false in while loop the expression provided while must boolean in java, c1=g1.pop() evaluates new value of c1 . you need this: while (!stack.isempty()) { myobject next = stack.pop(); //... }

python - How to associate values of tags with label of the tag the using ElementTree in a Pythonic way -

i have xml files trying process. here derived sample 1 of files fileasstring = """ <?xml version="1.0" encoding="utf-8"?> <eventdocument> <schemaversion>x2</schemaversion> <eventtable> <eventtransaction> <eventtitle> <value>some event</value> </eventtitle> <eventdate> <value>2003-12-31</value> </eventdate> <eventcoding> <eventtype>47</eventtype> <eventcode>a</eventcode> <footnoteid id="f1"/> <footnoteid id="f2"/> </eventcoding> <eventcycled> <value></value> </eventcycled> <eventamounts> <eventvoltage> <value>40...

swing - java WordGame program -

i totally beginner. project school. need know, can tell me why won't run ? import javax.swing.joptionpane; public class wordgame { public static void main(string[] args) { string name; name= joptionpane.showinputdialog("enter name"); string age; age= joptionpane.showinputdialog("enter age"); string city; city= joptionpane.showinputdialog("enter name of city"); string college; college= joptionpane.showinputdialog("enter name of college"); string profession; profession= joptionpane.showinputdialog("enter profession"); string animal; animal= joptionpane.showinputdialog("enter type of animal"); string pet; pet= joptionpane.showinputdialog("enter pet name"); string str="there once person named "+ name+ " \n lived in city. @ age of "+age+ ", "+ name +" went colleg...

c# - how to deal with 2 entangled tables of a database? -

i'm trying learn asp.net web forms following "wingtip toys" tutorial made microsoft. in project, create database has 2 tables: "products" & "category". each product has category: namespace wingtiptoys.models { public class product { [scaffoldcolumn(false)] public int productid { get; set; } [required, stringlength(100), display(name = "name")] public string productname { get; set; } . . . public int? categoryid { get; set; } public virtual category category { get; set; } } public class category { [scaffoldcolumn(false)] public int categoryid { get; set; } [required, stringlength(100), display(name = "name")] public string categoryname { get; set; } public virtual icollection<product> products { get; set; } } } then create 2 tables: public class productcontext : dbcontext { public productcontext() : base("wingtiptoys") { ...

c++ - Calling convention mismatch for x64 floating point functions -

i'm having weird error. have 1 module compiled 1 compiler (msvc in case), calls code loaded module compiled seperate compiler (tcc). the tcc code provides callback function both modules defined this: typedef float( * scalefunc)(float value, float _min, float _max); the msvc code calls code this: finalvalue = extscale(val, _min, _max); 000007feecafcf52 mov rax,qword ptr [this] 000007feecafcf5a movss xmm2,dword ptr [rax+0d0h] 000007feecafcf62 mov rax,qword ptr [this] 000007feecafcf6a movss xmm1,dword ptr [rax+0cch] 000007feecafcf72 movss xmm0,dword ptr [val] 000007feecafcf78 mov rax,qword ptr [this] 000007feecafcf80 call qword ptr [rax+0b8h] 000007feecafcf86 movss dword ptr [finalvalue],xmm0 and function compiled tcc looks this: float linear_scale(float value, float _min, float _max) { return value * (_max - _min) + _min; } 0000000000503dc4 push rbp 000000...

javascript - Replacing part of an object's param value with value from an anchor? -

if you've got following: <object type="application/x-shockwave-flash" height="609" width="1000" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=jonnyflyspeed" bgcolor="#000000"> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="allownetworking" value="all" /> <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /> <param name="flashvars" value="hostname=www.twitch.tv&channel=channelnamehere&auto_play=true&start_volume=75" /> </object> is there way change value="hostname=www.twitch.tv&channel=channelnamehere&auto_play=true&start_volume=75" , channelnamehere part of value using normal text link? example: <a hre...

c - assigning struct in switch not working -

in program, i'm trying create new struct based od switch statement, when so, compiler returns error: syntax error before '{' token on row position assignment i'm using dev-c++ 4.9.9.2 ide (i think it's using mingw compiler). it's brother's programming assignment i'm helping him with, haven't seen c in few years, i'm rusty (and wasn't champion before either). here's simplified code: typedef enum{top_right = 0,top_left,bottom_right,bottom_left} diagonal_t; typedef struct { int row; int column; } position_t; ... void checkdiagonal(diagonal_t diagonal_to_check) { ... position_t position; switch(diagonal_to_check) { case top_right: position = {0,0}; //here's error, don't know how repair it. //how create new struct here without disrupting //switch? break; case top_left: position = {0,0};...

php - trying to find a solution for my undefined index -

i have table list of categories , have form search title of categories. and im getting working want im having two notices im not able find solution few days. i know if put @ before sql statments solve problem, think that´s not correct. the search form working fine when pass value, when dont pass value have notice saying: "notice: undefined index: where", because select load list of categories done without having been passed value $_session['where'] used in sql statement. somebody there see solution solve notices? im having errors: notice: undefined index: in "select * categories {$_session['where']}..." and know im having errors because my php code store in session sql statment user pass in search field: if(isset($_post['sendform'])) { $search = $_post['search']; if(!empty($search) && $search != 'search...:') { $_session['where'] = "where t '%$search%'"; heade...

c++ - OpenCV - Fit a curve to a set of points -

Image
this follows post here: opencv - remove "white" artifacts image , fit curve i removed extraneous white points in image looking points across diagonal @ given location. result looks this: now, fit curve remaining points in image. have been looking through previous posts in opencv have suggested approxpolydp . there simpler way of fitting curve , displaying in opencv? the idea here using hough curves little elaborate me since image binary: http://homepages.inf.ed.ac.uk/rbf/books/bandb/lib/bandb4_3.pdf the final image (0-255) grayscale image of w256 x h1024 . edit i connected points in image using line segments. however, connect points fitting smooth curve of them. have searched such method , not find way. i think catmul-rom spline choice task. you can find implementation here: http://www.codeproject.com/articles/30838/overhauser-catmull-rom-splines-for-camera-animatio answer ahf's comment (put here qix advice): this code sketch allows e...

html - php set username and password -

i've been trying set login system, can't set username , password. <?php session_start(); $user = “u1”; $password = “p1”; if ($_post[‘username’] == $user ) && ($_post[‘password’] == $password) { echo welcome.php; } else echo have entered wrong credentials. ?> this illustrative purposes , answer question, understand not secure system , should not used anywhere ever near production environment! i think might issue how you've set if , else statements, having syntax error echo statement. try this: <?php session_start(); $user = 'u1'; $password = 'p1'; if ($_post['username'] == $user && $_post['password'] == $password) { echo 'successfully logged in'; // changed show successful message } else { echo 'you have entered wrong credentials.'; // placed quotes around echo statement } ?>

java - Having trouble initializing an ArrayList of Objects inside a constructor -

hi have neuralnetwork class, constructor should initialize: a 2-dimensional double array, double[# of rows in .data file][# of numbers in each row] [# of numbers in each row] - 1 inputnodes 2/3 (rounded down) * # of hiddennodes 1 output node (which hiddennode object) takes in hiddennodes what having trouble with having java create inputnodes, hiddennodes, , outputnode automatically based on data given, far have manually create nodes the inputnodes stored in either array list or array, , passed constructor parameters of hiddennode, hiddennode can take parameters of: hiddennode(node[] nodes) node object superclass of hiddennode , inputnode here code have far constructor: neuralnetwork.java /* * these values neuralnetwork constructor */ private final string comma = ","; private final string qmarks = "?"; private list<inputnode> input = new arraylist<inputnode>(); // input nodes private list<hiddennode> hiddennodelay...

java - Array w/ Generics -

i have read what's reason can't create generic array types in java? . came when tried code: hashmap<string, string>[] ret = new hashmap<string, string>[arraysize]; i decided "get wild" , try else arraylist<hashmap<string, string>> ret = new arraylist<hashmap<string, string>>(); now, don't understand why first option bad/not-supported , second option compiles. what missing? in first method error , cannot compile while second method has no compiler issues. i prefer follow intelligent programming principles, not understand difference in particular case. to point out know, second 1 compiles. arraylist not array, your program won't run generic array problem. you're wondering how arraylist then. in implementation of arraylist i've seen, internally uses object array--not generic. class lot of casting.

backbone.js - Reference to HTML elements in view, a convention? -

i'm in progress of learning backbone.js , i'm using book developping backbone applications. i have questions reference html elements , how stored. example: initialize: function() { this.$input = this.$('#new-todo'); here html element id to-do stored in this.$input, why use $ in front of input, merely convention? if change this.$input this.input code works fine. find confusing because book states: the view.$el property equivalent $(view.el) , view.$(selector) equivalent $(view.el).find(selector) . i think $(view.el) different (view.el). how this.$input saved in backbone.js? if console.log it, produces: object[input#new-todo property value = "" attribute value = "null"] could give me insight? :) using $ infront of variable name naming convention. helps developer in distinguishing variable holding jquery objects others. view.$el helper variable provided backbone, can use directly, instead of explicitly fo...

ios - UITextView scrolls up after "Speak" -

Image
i have non-editable uitextview display text. users can select text in uitextview , choose ios "speak selection" functionality (speak button) read them. however, when 'speak' done reading last word, scrolls uitextview. in fact, if select last word in text, , choose 'speak', scrolls uitextview. i have scrollenabled set no, editable set no, , text nsattributedstring. how can stop uitextview scroll in case? i can't comment reputation, unfortunately don't have real answer workaround; far mine intercept [uitextview setcontentoffset:animated] via method swizzling ( http://nshipster.com/method-swizzling/ ) , avoid calling original method when needed (this method called quickspeak function). guess subclassing cleaner if can instantiate view (this not case).

javascript - Check the security of form. -

my account suspended because of spam several times , host provider told me check website security. may forms not secured enough. think form can used send spam? here code: <script type="text/javascript"> $(document).ready(function () { $('#form').ajaxform({ beforesubmit: validate }); function validate(formdata, jqform, options) { var name = $('input[name=name]').fieldvalue(); var email = $('input[name=email]').fieldvalue(); var company = $('input[name=company]').fieldvalue(); var location = $('input[name=location]').fieldvalue(); var phone = $('input[name=phone]').fieldvalue(); var message = $('textarea[name=message]').fieldvalue(); if (!name[0]) { alert('please enter name'); return false; } if (!company[0]) { alert('please enter name of organization'); ...

web - Apache - Access files from multiple different folders -

is there anyway have bunch of iframes on 1 html page link several different text files located elsewhere on server? for example, if apache server hosts html pages in: c:\apache\webdocs , there anyway link several different log files different locations like" c:\game1\logs\log.txt , c:\gameserver\logs\console.txt 1 webpage using iframes? i suggest create shortcuts current apache document root , give apache user read permission original file. personally, haven't tested on windows machine. otherwise, can use alias directive. alias /log1 c:\game1\logs\ and can call url http://localhost/log1/ should well.

javascript - Active class on sticky nav -

my sticky nav: <nav id="page-nav" class="page-nav"> <ul> <li><a href="#top" class="linky active">overview</a></li> <li><a class="linky" href="#sub-our-drainage-solutions">our drainage solutions</a></li> <li><a class="linky" href="#sub-cctv-drain-survey">cctv drain survey</a></li> <li><a class="linky" href="#sub-wet-waste-disposal">wet waste disposal</a></li> <li><a class="linky" href="#sub-blocked-drains">blocked drains</a></li> <li><a class="linky" href="#sub-cess-pit-emptying">cess pit emptying</a></li> </ul> </nav> <div id="sub-our-drainage-solutions"> </div> <div id="sub-cctv-drain-...

android - How do I set the default launcher in an AOSP build? -

i modifying aosp source code because app needs run in kiosk environment. i want android boot directly app. i've excluded launcher2 generic_no_telephony.mk , , added app there. android prompts me time choose default launcher . the 2 choices available on pop-up: home sample my app. how can exclude android home sample launcher? or there way set default launcher in aosp build? instead of modifying aosp make files (which annoying because need track changes) easier add local_overrides_packages line app's make file. for instance: local_overrides_packages := launcher2 launcher3 added android.mk file ensure packages not added build package added. following that, should a make installclean and start build same way make build. make installclean important remove packages left behind previous build. i found nice answer how in question, see: how make embedded android os 1 app?

arrays - symbol and decimal number true in php -

i have script this $number = range(0, 9); when have condition this if (in_array('@', $number) === true) { echo "true"; }else "false"; and output: true and question why symbols same whit number in array $number?? want symbols symbols not number. example want this if (in_array('@', $number) === true) { echo "true"; }else "false"; output : false from documentation in_array() : if third parameter strict set true in_array() function check types of needle in haystack. in php, casting string doesn't begin number evaluates to 0. 0 exists in array, in_array() returns true. if don't want happen, set third parameter in_array() true, performs strong comparison (equivalent === ) , consider types, too. if (in_array('@', $number, true) === true) { echo "true"; } else { echo "false"; } output: false

c - Why isn't there a "<--" operator? -

this question has answer here: what “-->” operator in c++? 21 answers i going through k&r c book , got through --> operator in precedence table. so, wondered if there similar operator i.e., <-- , wrote following program: #include<stdio.h> void main() { int x = 5; while(0 <-- x) printf("%d",x); } it worked fine. why isn't <-- not considered operator? (as not in precedence table!) , it's precedence? --> not 1 operator, two; (post) decrement , less than. c whitespace agnostic part, so: x --> y /* same */ x-- > y <-- same idea: x <-- y /* same */ x < --y perhaps confusing -> --> . -> dereferences pointer @ member of type refers to. typedef struct { int x; } foo; int main(void) { foo f = {1}; foo *fp = &f; printf("%d", fp->x...

c - converting u_int32_t to char ** -

i working functions (c language )and there variable declared u_int32_t value; and have pass function takes argument of type (char **) i have tried using value[0] etc doesnot work. how go ahead typecasting? or is there workaround it? a (char **) type means pointer (*) either 1 or else array of c-string (which pointer first char, or char * ). the solution hence generate c-string integer value, , pass reference function want call char ** argument. whether solves problem depends on details of function , trying achieve.

c# - How do Flexible vertex formats definitions define the order of the items in the struct? -

so little confused defined when type: vertexformat fvf_format = vertexformat.position | vertexformat.diffuse; from reading documentation here: http://msdn.microsoft.com/en-us/library/ms889239.aspx it seems fvf format defines information stored in struct, not order of items in struct. how directx engine know find position , color components? or vertexformat meant way signal other classes required vertex? struct my_vertex { vertexformat fvf_format = vertexformat.position | vertexformat.diffuse; public float x, y, z; public int color; public my_vertex(float x, float y, float z, int color) { this.x = -x; this.y = -y; this.z = z; this.color = color; } good question, after few minutes testing, found directx don't care fvf_format definition order, care order of vertex struct, following 2 lines same result. vertexformat fvf_format = vertexformat.position | vertexformat.diffuse; vertexformat fvf_format = vertex...

checkbox - remember me in android app -

i have checkbox in app , want know if possible app remember last state of checkbox mean when checkbox checked , app closed when app opened again checkbox still checked same unchecked. this how did it. i have code on onresume @override protected void onresume() { super.onresume(); if(checkbox.equals(true)){ checkbox.setchecked(true); }else{ checkbox.setchecked(false); } } and onchecklistener checkbox.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { // todo auto-generated method stub if(checkbox.ischecked()){ checkbox.setchecked(true); publicvar.displaymessage(login.this, "check", 0); }else{ checkbox.setcheck...

javascript - having issue with background-image not showing -

my background-image isn't showing , driving me crazy know it's easy. the div class below i'm trying background show. .sun-face{ background-image: url("./images/sun_face.svg"); } <div class="sun-face"></div> my file directory structured so. root -css -fonts -images -js index.html navbar.html signin.html use css .sun-face{ background-image: url("../images/sun_face.svg"); height:500px; }

android - Send a putExtra to an activity -

i have code: rechercher.java: public void doonresult(string json){ if ( json.equals("aucune propostion pour le mois")||json.equals("aucune propostion pour cette date")) { toast.maketext(rechercher.this, "aucune proposition actuellement.", toast.length_long).show(); finish(); } else { intent iafficher = new intent(this, afficher.class); extras.putstring("json", json); extras.putint("nbplaces", mcounter); iafficher.putextras(extras); this.startactivityforresult(iafficher, 10); } } afficher.java: integer places = extras.getint("nbplaces"); protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.afficher); listview lvtrajets = (listview)findviewbyid(r.id.lvtrajets); bundle bundle = getintent().getextras(); ....... proposition.put("date",propi...

Javascript - Jquery link not working -

i trying work on example found : http://jsfiddle.net/vz3t5/1/ but code works fine, can assume link jqueryui 1.9.2 doesn't... here code try : <html> <head> <link rel="stylesheet" href="https://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.9.1.js"></script> <script src="https://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <link href="css/ui-lightness/jquery-ui-1.9.2.custom.css" rel="stylesheet"> <script> var $accordion = $("#accordion"); $accordion.accordion(); $(".opener").on("click", function () { var $this = $(this), toopen = $this.data("panel"); $accordion.accordion("option", "active", toopen); return false; }); </script> </head> <body> <a class="opener" data-panel="0" href="#"...

mysql - Select date where there is data in-between -

i have todayrainsofar column filled db every minute, , find out maximum duration of rain month, ie when started rain , how long did last. for example started rain 2014-04-01 @ 08:00 , raining without pause until 2014-04-05 10:00 i have trouble combined queries. // select rows when there rain month select logdatetime, todayrainsofar sibeniku_monthly todayrainsofar > 0.0 , date_format(logdatetime, "%m.") = 04 now looking count maximum duration of in-between rows (logdatetime datetime , range 1 minute), smth like and max (count between rows) the approach used below keep counter of consecutive minutes of rain , row has maximum value of counter (this give maximum duration of consecutive rain). counter reset 0 if rain has ended. select date_sub(logdatetime, interval counter minute) starttime, logdatetime endtime ( select if(todayrainsofar = 0, @i:=0, @i:=@i+1) `counter`, logdatetime, todayrainsofar sibeniku_monthly, (select @i:= 0) orde...

android - How do I check if the user is connected to a wifi network or not? -

i know how check if wifi enabled or not. code: wifimanager wifi = (wifimanager)getsystemservice(context.wifi_service); if(wifi.iswifienabled()) { //code execution comes here } but how find out if user connected nearby wifi network (or wifi network matter)? edit: mean ask, if user has logged in wifi network after typing in password, able use wifi. there anyway check if has connected (logged in) wifi network? you should able use connectivitymanager state of wifi adapter. can check if connected... method check whether wifi conected or not :- public static boolean checkwifi(activity activity) { log.d("checkwifi", "checkwifi"); connectivitymanager cm = (connectivitymanager) activity .getsystemservice(context.connectivity_service); networkinfo netinfo = cm.getactivenetworkinfo(); log.d("networkinfo", "networkinfo" + netinfo); if (netinfo != null && netinfo.isconnectedorconnec...

php - FosUserBundle how to ajax login -

this first sf2 project, while framework quite easy learn (i come codeigniter), there still advanced uses i'm not fluent with. here's thing. fos userbundle installed, working fine, i've override forms login, register, check out. i want login using ajax, and... i'm totally lost. believe should overload securitycontroller way: <?php namespace biometa\userbundle\controller; use fos\userbundle\controller\securitycontroller basecontroller; class securitycontroller extends basecontroller { public function checkaction() { die('pooh'); } } but, doesn't work... is user bundle setup child bundle of fos\userbundle? //src/biometa/userbundle/biometauserbundle.php public function getparent() { return 'fosuserbundle'; } have @ documentation on how override controllers: https://symfony.com/doc/master/bundles/fosuserbundle/overriding_controllers.html it looks trying override checkaction . check action isnt handl...

c# - key does not exist in style -

i learning trigger in wpf . here trigger demo when write code similar tutorial show " the property key not exist " my code <window.resources> <style x:key="buttonstyle" targettype="{x:type button}"> </style> </window.resources> <grid> <grid.rowdefinitions> <rowdefinition height="*"></rowdefinition> <rowdefinition height="*"></rowdefinition> <rowdefinition height="*"></rowdefinition> <rowdefinition height="auto"></rowdefinition> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="*"></columndefinition> <columndefinition width="*"></columndefinition> <columndefinition width="*"></columndefinition> ...

javascript - Application is not loaded after upgrading Ember v.1.5 -

i have updated ember v1.5 v1.4. after application not getting rendered. in application, using _super() in lot of places. make problem. , using require.js well. i debug through app, , found triggered indexroute. after nothing happen. below route structure, route map: app.router.map(function() { this.resource('public', { path: '/public' }, function() { this.route('login'); this.route('logout'); }); }); ember.router.reopen({ transitionto : function(name, param) { ....... //handling own code here ....... this._super(name); } }); app.baseroute = ember.route.extend({ setup : function(context) { var thatsuper = this._super; require(_rp, function() { ....... //handling own code here ....... thatsuper.call(self, context); ........ }, function(error){ ...handling error...

mysql - Join two tables with condition on the first table -

i want make these 2 1 select statement: select * activegroupmodel groupid = ? order groupmodelid desc limit 1 select * model modelid = ? as can see first groupid not pk , want latest model table. i'v tried didn't work: select * activegroupmodel a.groupid = ? order a.groupmodelid desc limit 1 inner join model m on a.modelid = m.modelid i've read bunch of questions join none of them matches problem. knows how can solve this? best regards johan just put join before condition, this: select * activegroupmodel inner join model m on a.modelid = m.modelid a.groupid = ? order a.groupmodelid desc limit 1

CXF Rest Client - Proxy Based API vs CXF WebClient API -

i went through http://cxf.apache.org/docs/jax-rs-client-api.html documentation still not sure type of rest client should used in use cases? can point out use cases / constraints examples me in choosing right client api. cxf 3.0 implement jaxrs 2.0 client api, makes code can work other jaxrs implementation without changing anything. but if still using cxf 2.x, need chose between proxy based api , webclient api. the proxy based api cxf jaxws client api, can invoke service proxy implement interface of sei. has shortcomings, cannot specify http hears or write generic client invoke different jaxrs services. with of cxf webclient api, can invoke jaxrs services in normal http client way, fill gap of proxy based api. you can find more information clients api here .

How to extract particular block from sentence using jQuery -

i need extract particular block string. [main menu,128</main menu][gallery menu,24</gallery menu][nolcard menu,5</nolcard menu][feedback form,1</feedback form] how can [main menu,128</main menu] or [gallery menu,24</gallery menu] by considering [xxx , /xxxx] . using jquery

jquery - Selecting an option tag which is exactly equal to the search text -

i have coded setting drop down menu's option specific value when text known have encountered problem. following code use: $('#dropdownid option:contains("' + searchtext + '")').prop('selected', true).change(); the contains part of code won't serve purpose of code since drop down has 2 options sub strings of 1 another. is there way specify want exact match of given searchtext ??

Link to a document In another document library in sharepoint 2013? -

Image
link document in document library. “link document” content type not exist in option in sharepoint 2013? it you can check @ /_layouts/15/managecontenttype.aspx?ctype=0x01010a

ios - Sqlite data gets cleared while using coredata -

in application using coredata.at particular scenario data's cleared (not sure if db getting deleted).i trying find scenario past 1 week not able find root cause.i using crashlytics in app,but didn’t crash report.i haven’t faced issue in debug mode few of beta testers reported issue. posting direction on scenarios coredata behaves mentioned above

javascript - Highchart - Plot missing DateTime values on xAxis -

Image
i plotting points datetime , value using highcharts. points per minute. currently, it's drawing connecting line between points can seen below. what i'd prefer able plot point each minute inbetween (if there no value), possible highcharts? or have loop through each minute , add data series null value? you can create array every minute in , merge values have ... or use method, suggested. found using "empty" array easier.

AngularJS : Initializing isolated scope inside a directive -

i have created directive accepts attributes , initializes isolated scope these attributes. if attribute isn't specified, isolated scope should initialized calculated value. i added link function inspects scope , initializes default values (if no value has been set using attributes). scope has been initialized, if set default value overwritten later framework. a workaround use $timeout(...) , set afterwards, seems of hack. function ($timeout) { return { scope: { msg1: '@', msg2: '@' }, template: '<div>{{msg1}} {{msg2}} {{msg3}}</div>', link: function ($scope, $elt, $attr) { var action = function() { if (!$scope.msg2) $scope.msg1 = 'msg1'; if (!$scope.msg2) $scope.msg2 = 'msg2'; if (!$scope.msg3) $scope.msg3 = 'msg3'; }; action(); //$timeout(action, 0); } }; }); i have prepared jsfiddle illustrate happening. msg1 initialized ...

java - BubbleSort 2D array rows by a specific column values -

i have two- dimensional array , want bubble sort rows array second column value. i take arrival time , service time values user , want bubble sort array second column value( arrival time ). first column process number. static int[][] atst = new int[5][5]; (int = 0; < atst.length; i++) { system.out.print("arrival time process " + + ": "); atst[i][1] = in.nextint(); } (int = 0; < atst.length; i++) { system.out.print("enter service times process " + + ": "); atst[i][2] = in.nextint(); } system.out.println("before sorting: " + arrays.deeptostring(atst)); (int = 0; < atst.length; i++) { (int j = 1; j < (atst.length - 1); j++) { if (atst[j - 1][1] > atst[j][1]) { // swap! int[] temprow = atst[j - 1]; atst[j - 1] = atst[j]; atst[j] = temprow; } } } system.ou...