Posts

Showing posts from February, 2011

python - Force selenium to use the portable firefox application -

i have installed firefox 14 , has firefox portable version 25.0.1 on machine, run tests web site. due limitation in site i'm testing, cannot run tests on firefox 14 installation. cannot upgrade firefox 14 installation. so i'm looking solution can use portable firefox version instead of installed firefox 14 version. how should force selenium use portable version , not installed version? if direct me descriptive article/blog great. my code goes like:- * variables * ${selenium_hub} remote_url=http://127.0.0.1:4444/wd/hub ${browser} firefox d:\\firefox portable\\firefoxportable\\firefox.exe ${client_url} https://abcd.aline.local open browser ${client_url} ${browser} ${selenium_hub} specifying path as, d:/firefox portable/firefoxportable/firefox.exe not work because '/' get's removed. thoughts? ps: python used language you can specify path firefox binary want firefoxbinary class passed firefox_binary parameter when in

c - Where do i put CFLAGS in this makefile? Need the -g so i can use gdb debugger -

i'm not used style of makefile teacher created 1 of our homeworks because doesn't have gcc command in it. here makefile. need know put -g cflag. ### architecture choice #uncomment 64-bit library = libmtron.a #uncomment 32-bit #library = libmtron32.a ### file lists bins = simulate objs = driver.o ### phony targets all/clean .phony: clean all: $(bins) clean: $(rm) $(bins) $(objs) ### build rules # sure link in library $(bins): $(objs) $(library) # update if header file changed driver.o: driver.h mtron.h simulate: mtron.h thanks help! this makefile utilizing make's built-in set of rules create objects , link executables, rather having type them in yourself. make has default rule looks (more or less) this: %.o : %.c $(cc) $(cppflags) $(cflags) -c -o $@ $< if don't specify rule build .o , make needs build 1 , has .c , use default built-in rule. so,

Select MongoDB documents where a field either does not exist, is null, or is false? -

suppose have collection contains following documents: { "_id": 1, name: "apple" } { "_id": 2, name: "banana", "is_reported": null } { "_id": 3, name: "cherry", "is_reported": false } { "_id": 4, name: "kiwi", "is_reported": true } is there simpler query select documents "is_reported" in falsy state; is, either non-existent, null, or false? is, query selects apple, banana, , cherry, not kiwi? according mongodb faq , { "is_reported": null } select documents "is_reported" either null or nonexistent, still doesn't select documents "is_reported" false. right have following query, works fine, doesn't seem elegant. if there multiple fields need select on, gets messy fast. there better query achieves same end result? db.fruits.find({ $or: [ { "is_reported": null }, { "is_reported": false } ] })

class - C++: How to create a collection of classes at startup -

i'm using c++ 11. have n source files each containing class inherits common base class. @ startup, want each class register collection. registration include 1) data necessary identifying purpose of class, 2) class factory creating instances of class. number of source files unknown. pattern doing this? solution needs cross-platform compatible visual studio 2013, gcc , others. first things first: keep in mind possible if classes derived single base class, because can store 1 type of object per vector instance. and when comes solution... can declare object in corresponding *.cpp file (mark extern in *.h file): // someclass.h // <-- class declaration goes here extern someclass someobj; // someclass.cpp someclass someobj; and add vector inside constructor: someclass(){ myvector.push_back(*this); } note myvector needs visible in scope. your myvector should populated after include someclass.h file 1 instance of someclass . note if populating done in ba

java - Debugging UI and pause when a key is pressed -

i'm no debugging expert , lately came across problem has easy solution. when test , debug mathematica plugin idea , write code, build , run in sandbox idea. for not familiar writing plugins idea: main problem is, ui code there because comes idea. plugin implements specific interfaces required make idea understand mathematica language. therefore, setting breakpoint or throwing in onclicklistener suggested @jeroen not possible, because virtually haven't written single line of ui code*. now had situation works fine, when cancel specific action, weird happens. have no idea specific method (it none of mine!) called @ moment when press esc cancel action. current point deep inside sources of idea have , can navigate debugger!. question: easiest way in java make debugger break, wherever might when press esc in ui-program debug? *this not entirely true, sake of general solution think of way. as discussed in this question , can create own subclass of eventqueue

java - Android & Bluetooth & Arduino -

i trying display sensor data on android phone (target 4.3) received transmitting arduino type device. transmission takes place via bluetooth. able connect arduino type device , share data, reason having synchronization issues. the way arduino setup right now, after successful connection waits byte received phone (unsigned byte value 255), when receives byte responds sending packet (3 bytes) containing information 3 different sensors i.e. packet: byte 1: temperature data byte 2: cadence data byte 3: speed data all have display data(which updating live) repeatedly until user terminates connection on android phone. here code feel making minor error somewhere in logic. messagehandler handler mhandler = new handler(){ public void handlemessage(message msg){ super.handlemessage(msg); switch(msg.what){ case success_connect: // something; connectedthread co

android - Adjusting to different screen sizes not working? -

i thought successful in adjusting different screen sizes(i using eclipse emulators , creating different screen sizes test app) when test app on actual devices result of app varies. example large screen size set emulator nexus s , work , fine, try on alcatel 1 touch fierce(real device) still considered large screen size app play little bit off, play on device considered large screen size app play emulator. guess mt question why? samble of how i'm checking different screen sizes below: displaymetrics displaymetrics = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics); switch(displaymetrics.densitydpi) { case displaymetrics.density_low: // layout small sized devices. break; case displaymetrics.density_medium: // layout medium-sized devices. break; case displaymetrics.density_high: // layout large devices. break; case displaymetrics.de

c# - Using SendInput to send unicode characters beyond U+FFFF -

i'm writing onscreen keyboard similar 1 in windows 8. have no problem sending of characters need using win32's sendinput. the problem when comes new windows 8 emoji's. start @ u+1f600 using segoe ui symbol font. using spy++ on windows 8 onscreen keyboard following output emoji glyphs. <00001> 000c064a p wm_keydown nvirtkey:vk_packet crepeat:1 scancode:00 fextended:0 faltdown:0 frepeat:0 fup:0 <00002> 000c064a p wm_char chcharcode:'63' (63) crepeat:1 scancode:00 fextended:0 faltdown:0 frepeat:0 fup:0 <00003> 000c064a p wm_keyup nvirtkey:vk_packet crepeat:1 scancode:00 fextended:0 faltdown:0 frepeat:1 fup:1 <00004> 000c064a p wm_keydown nvirtkey:vk_packet crepeat:1 scancode:00 fextended:0 faltdown:0 frepeat:0 fup:0 <00005> 000c064a p wm_char chcharcode:'63' (63) crepeat:1 scancode:00 fextended:0 faltdown:0 frepeat:0 fup:0 <00006> 000c064a p wm_keyup nvirtkey:vk_packet crepeat:1 scancode:00 fextended:0 faltdown:0 fr

Gradle sync issue with Android Studio 0.5.1 -

since updating 0.5.1, have been unable sync project. gradle gives me following warning: no signature of method: static com.google.common.collect.arraylistmultimap.create() applicable argument types: () values: [] possible solutions: clear(), grep(), get(java.lang.object), get(java.lang.object), getat(java.lang.string), iscase(java.lang.object) it not point in build.gradle file may causing issue, rather lost begin. edit: when attempting run gradle build , subsequently issue when applying android plugin: a problem occurred evaluating root project 'tve-android'. > not create plugin of type 'appplugin'. my build.gradle file: buildscript { repositories { mavenlocal() maven { url "http://nexus.products/nexus/content/groups/public" } } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } apply plugin: 'android' apply plugin: 'checkstyle' apply plu

ios - Commit to git after switching to workspace and adding CocoaPods in Xcode? -

Image
i've added cocoapods current project in xcode 5. of course, cocoapods created workspace , i've launched workspace in xcode. see both project , pods project in workspace. my project has been under source control (local git + remote bitbucket repository) since day one. want commit , add pod stuff think repo deep in workspace--when try commit (and i've tried various commits pod stuff take) errors out. how can add pods repo? have delete old repo , create new 1 (git init) @ workspace level? (i sure hope not because i'm not great git , have lot of historical commits in repo already.) git add . from directory enclosing xcode project, execute git add . . documentation here . explanation you had following hierarchy prior pod init : in likelihood, git setup starts @ directory enclosing .xcodeproj . after pod install , hierarchy did not change. merely have more files @ same level: the .xcworkspace next .xcodeproj , not above. free execute git

html - Centering My Nav -

i need center nav in website ( http://beautra.weebly.com/ ), ideas? here's code, tried playing inspect element tool couldn't work out. code seems simple enough work out don't know how work jsfiddle. appreciated. thanks, /* navigation --------------------------------------------------------------------------------*/ #topnav { clear: both; text-align:center; background: url(nav-left.png) no-repeat; padding-left: 8px; width: 971px; } #nav-right { background: url(nav-right.png) right top no-repeat; padding-right: 10px; } #nav-inner { background: url(nav-inner.png) repeat-x; padding: 2px 5px 3px; } #topnav ul { list-style: none; float: none; background: url(nav-sep.jpg) no-repeat left center; } #topnav ul li { list-style: none; float: left; background: url(nav-sep.jpg) no-repeat right center; padding-right: 2px; } #topnav { float: left; text-align:center; display: block; color: #989899;

backbone.js - why browser request for image after ajax? -

i'm using backbone , nodejs single page webapp. i got view, has model(a blog post) in it. when user click on 'like' button, view start ajax send user'id server let number +1. it looks this: this.model.save({ likedby: usermodel.get('_id') }, { url: '/posts/' + this.model.get('_id') + '/like', success: function() { // }, patch: true }); my problem is, when code got run. browser start http request retrieve images on screen, , re-render them. screen got "shake" after user clicked button. this not happening everywhere, caused this? how stop "shake"? thanks advance. when call this.model.save() model update data in server , call view's render function. render method create new dom element , replace old dom element, that's causing flickering (it requests images again). i assume have api call a

xml - Flex Datagrid Itemeditor: Show Label of choice, but retrieve value at commit -

(edit: see answer provided below possible solution) i have datagrid each datagridcolumn using different itemrenderers. 1 of these renderers in 1 of columns list component full of values. text shown in list component labels of it's dataprovider. what make list component column itemrenderer itemeditor. means user clicks on cell in column , list of values shows (not drop down). can choose multiple values list component. when click out of list component, column shows values chosen. when save choices (via save button outside of datagrid in question), reference data determine choice have made - - instead of label, number associated label. xml: <colors> <color label="green" value="1"/> <color label="yellow" value="2"/> <color label="red" value="3"/> </colors> now, itemeditor part great works fine visually seeing choices after have clicked outside of cell. however, identify value

android - Apply EffectFactory Effects on CameraPreview -

i trying make android application lets user take picture lomo effect. thing is, want make camera preview image effect automatically, not take picture apply effect. i learned how use camerapreview on link . found out efectfactory class here , has effect want. problem is, don't know how apply efectfactory class on camerapreview. i googled didn't find answer looking for. for code, using same how first link provided. can me on problem? thanks in advance you can below thing: 1) bitmap captured image in gls surface view and then 2) apply effects using effect factory class. more detail use link .

android - Can you put fixed tabs inside a fragment? -

right have navigation drawer main activity, holding multiple fragments. i wondering if possible have fixed tabs inside 1 of these fragments? know nested activities deprecated, how go this? this tutorial shows me how add fixed tabs on activity only. http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ update: found partial answer here ( how open new fragment navigation drawer? ). do still need create adapter tab host? using tabhost solves problem.

ios - Issue with running through NSArray - Obj C -

i have nsdictionary object returned server. using populate information on uitableviewcontroller . issue when processing each object returned, seems duplicate, lets 2 objects returned. make 2 table cells first object's data. lets title section both objects "yes" , "no". populate list first object title show, yes , yes. here happens: controller loaded: - (void)viewdidload { [super viewdidload]; // make request server [self makerequests]; } runs request server stores information follow: nsdictionary* json = [nsjsonserialization jsonobjectwithdata:returndata //1 options:kniloptions error:&error]; self.googleplacesarrayfromafnetworking = [json objectforkey:@"requested_data"]; [self.tableview reloaddata]; than cellforrowatindexpath runs: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath

Update MongoDB field using value of another field -

in mongodb, possible update value of field using value field? equivalent sql like: update person set name = firstname + ' ' + lastname and mongodb pseudo-code be: db.person.update( {}, { $set : { name : firstname + ' ' + lastname } ); you cannot refer document in update (yet). you'll need iterate through documents , update each document using function. see this answer example, or this one server-side eval() .

wordpress - Facebook comment box not displaying -

i have project in wordpress magazine theme. noticed facebook comment box not displaying on single.php page. when viewed through 'view page source' code present space left comment box between article , advertisement. i checked css display:none or other thing might have caused no solution yet. getting div data-href coming "./" please help. working sample: <html xmlns:fb="http://ogp.me/ns/fb#"> <head> <title></title> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "https://connect.facebook.net/en_us/all.js#xfbml=1"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <fb:comments href="http://stackoverflow.com/" numposts="5" colorsch

jquery - Showing alert box on `beforeunload` event -

i want show alert box on beforeunload event. using following code that. problem this, not show alert box on event. $(window).bind('beforeunload', function() { alert($(location).attr('hostname')); }); how can problem resolved? $(window).on('beforeunload', function(){ return location.host; }); this have do. basically can use without jquery window.onbeforeunload=function(){ return location.hostname; };

assembly - What's the use of subsection directive in the assembler -

i did't find explanation subsection directive in gnu assembler doc, after doing test find after compilation there mot have individual subsection section, if have section .test, define .subsection 1, no .test.1 section in object file, test section int obj, what's use of subsection, can help? from can see allows go , forth between subsections .next , .previous instructions. in cases, if write code in assembly, won't need them. that's lot more useful compilers, making easier deal situations not yet have data @ hand.

x86 Assembly. Making my console output pretty -

i pretty new programming in genreal, , having trouble figuring out how display results (numbers) in rows , columns instead of 1 per line, or spaced evenly. can me this? thanks! count digits in each of result (number), subtract count 12 , write many spaces preceeding number. write new line (crlf) after each sixth number. should result formated 6 columns, right aligned.

java - How to Make a HashMap Key Case Insentive? -

i have homework hashmaps , i'm supposed use following tester class, mistake in 2 lines: for( map.entry entry : salaries ) , hashmap accounts = new hashmap<>(new caseinsensitive()); i'm using eclipse btw import java.util.hashmap; import java.util.list; import java.util.linkedlist; import java.util.map; public class assignment { class caseinsensitive implements hashingfunction<string> { public int hashcode( string key ) { return key.tolowercase().hashcode(); } public boolean equals( string lhs, string rhs ) { return lhs.equalsignorecase(rhs); } } void test1() { system.out.println("test 1:"); hashmap<string, double> salaries = new hashmap<>(); // test #1a: verify identical keys allow same map entry replaced. salaries.put( "1000", 55000.0 ); salaries.put( "1000", 45000.0 ); system.out.println( "new value " + salaries.get("1000"))

ruby on rails - Calculator using checkbox values -

i new ruby on rails.. please me figure out.. thank u.. :) i trying create simple calculator i getting wrong number of arguments (1 0) calculator_controller.rb class calculatorcontroller < applicationcontroller def calculate pasta = params [:pasta] noodles = params [:noodles] @result = pasta.to_i + noodles.to_i redirect_to result_path end end /views/page/calculator.html.erb <%= form_tag({:controller => "calculator", :action => "calculate"}, :method => "post") %> <div> <%= check_box_tag 'pasta', '100' %>menu item 1 </div> <div> <%= check_box_tag 'noodles', '200' %>menu item 2

asp.net - How to exclude a controller from being authenticated -

i have overriden iautheticationfilter in asp.net web api project. here class: public class tokenauthentication : attribute, iauthenticationfilter { private readonly string realm; public bool allowmultiple { { return false; } } public tokenauthentication(string realm) { this.realm = "realm=" + realm; } public task authenticateasync(httpauthenticationcontext context, cancellationtoken cancellationtoken) { var request = context.request; // receive token client. here example when token in header: var token = request.headers.getvalues("token").elementat(0); ... } return task.fromresult(0); } public task challengeasync(httpauthenticationchallengecontext context, cancellationtoken cancellationtoken) { context.result = new resultwithchallenge(context.result, realm); return task.fromresult(0); } } now need exclude login controller being authenti

php - comparing different columns and rows on the same table -

we making simple database our school programme. have table this: id b 1 john stacey 2 stacey mark 3 candice rick 4 stacey rick 5 rick stacey if input stacey's name, display number of rows where: for every row (say, x , y) rowx-columna = rowy-columnb , rowy-columna = rowx-columnb in case, should output: 2 rows: 4 stacey rick 5 rick stacey thanks! have more 100 students won't able manually. again, appreciate hint. try query friend: select t1.* table1 t1 inner join table1 t2 on t1.a = t2.b , t1.b = t2.a; sql fiddle

python - Write to a file from another file and delete line from file -

my file(outputfile6.txt) is: 1à´°ാമന്‍ 2à´¸ീതയെ 3à´•à´£്à´Ÿു 4. 5അവന്‍ 6അവള്‍à´•്à´•് 7à´ªൂà´µ്‌ 8à´•ൊà´Ÿുà´¤്à´¤ു 9. 10അവള്‍ 11à´…à´¤്‌ 12à´µാà´™്à´™ി 13. 14അവര്‍ 15à´’à´°ുà´®ിà´š്à´š്‌ 16à´•ോà´Ÿ്ടയത്à´¤്‌ 17à´ªോà´¯ി 18. 19à´…à´µിà´Ÿെ 20à´µെà´š്à´š്‌ 21അവര്‍à´•്à´•്‌ 22പരീà´•്à´· 23ഉണ്à´Ÿ് 24ആയിà´°ുà´¨്à´¨ു 25. 26à´…à´µിà´Ÿെ 27à´µെà´š്à´š്‌ 28à´°ാമന്‍ 29ലക്à´·്മനനെ 30à´•à´£്à´Ÿു 31. 32അവന്‍ 33à´°ാമനോà´Ÿു 34à´¸ംà´¸ാà´°ിà´š്à´šു 35. 36ലക്à´·്മണന്‍ 37à´¸ീതയെ 38à´•à´£്à´Ÿു 39. 40അവനെ 41അവള്‍à´•്à´•്‌ 42ഇഷ്à´Ÿà´®ാà´¯ി 43. 44à´ˆ 45വഴ 46ആണ് 47അവര്‍ 48പണ്à´Ÿ് 49നടന്നത്‌ 50. is possible write these lines file on basis of line number? eg: print line no: 1 5. after want delete lines written file. should continued until eof. since above concept part of code, can't reveal whole code. work. first found starting sentence. , found final sentence want. fp = codecs.open('outputfile6.txt', encoding='utf-8') lines1 = fp.readlines() fp.close() fb = codecs.open('outputfile7.txt', 'w') write=0 l in lines1: if in l:#i search item contains in starting sentence. write=1 if write==1:

mysql - Simple PHP fetch all data in table not working -

Image
ok don't know hell going on i'm trying list data in table , it's not working have tried few different ways , i'm not getting error messages , have been on syntax many times. here code: // connect database $dbc = mysql_connect("localhost", "root"); if (!$dbc) die("could not connect" . mysql_error()); // select database $dbc_dbselect = mysql_select_db( "contactmanager", $dbc ); if (!$dbc_contactmanager) die("could not connect: " . mysql_error()); // query database $query = "select * contacts order name"; $result = mysql_query($query); // start table tag in html echo '<table>'; // create loop loop through results while($row = mysql_fetch_array($result)){ // print results echo '<tr>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['address'].'</td>'.'<td>'.$row['phone'].'&l

javascript - Review slider using CSS, HTML and/or Jquery or Java -

i trying create slider allows users move through reviews clicking arrows. go review1 review2 etc etc. have far, have set html reviews, , css hidden values time being. greatly appreciated <div class="review1"> <h1>&ldquo;this place amazing&rdquo;<br></h1> <p class= "vancouver">- georgia straight</p> </div> <div class="review2"> <h1>&ldquo;a taste of italy in vancouver&rdquo;<br></h1> <p class= "sun">- vancouver sun</p> </div> <div class="review3"> <h1>&ldquo;this real deal&rdquo;<br></h1> <p class= "yelp">- yelp.ca</p> </div> <div class="review4"> <h1>&ldquo;simply delicious&rdquo;<br></h1> <p class= "buzz">- vancity buzz</p> </div> and c

arrays - Exchanging the first word & the last word in PHP -

how can exchange first letter , last letter in php ? for e.g, if string "hello" , result must "oellh" . used str_replace , can replace 1 word. here code: $string="hello"; $first=$string[0]; $last=substr($string, -1); $result=str_replace($first, $last, $string); echo $result; try this: $string="hello"; $first=$string[0]; //get first character $last=$string[strlen($string)-1]; //get last character $string[0] = $last; // set last character first $string[strlen($string)-1] =$first; // set first character last echo $string; output: oellh live test

android - Duplicate rows in sqlite database -

i have android app local sqlite database have problem duplicate row. every time when start app, addding items db item same id exist there. problem cannot update/rewrite rows has same id. db: link declarations: // database name private static final string database_name = "foodsdb"; // contacts table name private static final string table_foods = "tablefoods"; // contacts table columns names private static final string key_id = "id"; private static final string key_foodname = "food_name"; private static final string key_alergen_no = "alergen_numbers"; private static final string key_date = "date"; private static final string key_food_number = "food_number"; db create table: // creating table @override public void oncreate(sqlitedatabase db) { string create_foods_table = "create table " + table_foods + "(" + key_id + " text," + key_foodname + " text,&q

iphone - Analyzing message ios app -

i analyze app , getting message : value stored in object during intialization never used. here code: { dataarray=[[nsmutablearray alloc]init]; dataarray=root[@"data"]; nsmutabledictionary *object=[[nsmutabledictionary alloc]init]; //here getting message searchedname=[[nsmutablearray alloc]init]; for(int i=0;i<[dataarray count];i++) { object=[dataarray objectatindex:i]; [searchedname addobject:object[@"charityname"]]; } } i don't know trying say. can 1 me? it's trying never use [[nsmutabledictionary alloc]init] value initialise object variable with. first make object point new empty dictionary, created [[nsmutabledictionary alloc]init] make point every object in dataarray actually don't need these 2 lines: dataarray=[[nsmutablearray alloc]init]; and: nsmutabledictionary *object=[[nsmutabledictionary alloc]init]; the second 1 should nsm

PHP-separate the variables value from the position of character '+' -

i have variable of type varchar having values $pointmoney=356+2311; pointmoney field in database retreiving value . now have separte 2 variable $point , $money where want store $point=356 , $money=2311 $pointmoney=356+2311 .(i.e separate values '+'). if 1 knows similar function pls answer. hope ellaborated understand query . if unclear pls feel comment . use explode() : $pointmoney = "356+2311"; list($point, $money) = explode('+', $pointmoney);

android - Phone freezes when camera.release() is called -

hi i'm trying camera functionality work on app. problem is, on 1 phone in particular - samsung galaxy mini. after take picture using camera , previews, phone freezes when call camera.release(). have remove battery reset it. this how release camera: try { mcamera.stoppreview(); mcamera.setpreviewdisplay(null); mcamera.release(); mcamera = null; } catch (exception e) { // ignore: tried stop non-existent preview } i getting weird native exception in logcat after call: 03-10 09:45:56.080: e/mm-camera(95): camera_issue_ctrl_cmd: error (bad address): type 43, length 0, status 40856 any appreciated! use below open source camera code you open camera and use on surface destroyed if(flag){ camera.release(); camera = null; previewing = false; }else{ camera.stoppreview(); }

How open native call details screen for a particular call log in Samsung and HTC android device using intent? -

i developing android application show call logs in list , when user taps on call log, need open native app's call details screen tapped call log. i have tried following code snippet , works fine in emulator (pure android os.) intent mdetailsintent = new intent(intent.action_view); mdetailsintent.settype(android.provider.calllog.calls.content_type); uri muri = uri.withappendedpath(android.provider.calllog.calls.content_uri, string.valueof(mcalllog.getid())); mdetailsintent.setdata(muri); startactivity(mdetailsintent); but when run on samsung device, shown last recent call log's details screen each time regardless of call log id. and htc devices, throws activitynotfoundexception . following log cat htc device. **03-10 14:19:00.772: d/logsfragment(20947): call log details uri==>content://call_log/calls/62 03-10 14:19:00.782: w/system.err(20947): android.content.activitynotfoundexception: no activity found handle intent { act=android.intent.action.view dat

android - PocketSphinx few words not getting recognized -

hi building app using pocketsphinx able run demo app following this tutorial. it works fine doesnt recognizes few words. inside project assests folder there dialog.gram file contains bunch of words shud recognized. added 2 words hello , help. hello seemed recognized time wasnt able recognize once. why this? i searching on net , came across making our own acoustic model seems recognize other words fine except few. how shall solve problem?

How to hide an element in jQuery -

am having following code.. <img src="" id="image1" > <img src="www" id="image1" > <img src="" id="image2" > <img src="www" id="image2" > <div id="imagesrc"></div> how can hide div id (#imagesrc) when #image1 have src="" , , show div (#imagesrc ) when #image1 have src !="" ? try $(document).ready(function () { if ($("#image1").attr("src") == "") { $("#imagesrc").hide(); } else { $("#imagesrc").show(); } }); update $("#image1").change(function () { var imgcontrolname = "#imagesrc"; readurl(this, imgcontrolname); if (jquery("#preview").attr("src") == "") { jquery("#remove").hide(); } else { jquery("#remove").show(); } })

jquery - button inside table calling javascript? -

<html> <apex:includescript value="//cdn.jsdelivr.net/jquery/1.7/jquery.min.js"/> <table width="100%"> <tr> <td width="84%"> <apex:form id="form1" > <table bgcolor="#00c4ff" style="position:fixed;" width="100%" height="80"> <tr> <td > <b style="color:white;"> :</b> </td> <td> <apex:selectlist value="{!operator}" size="1" id="operator" styleclass="input"> <apex:selectoption itemvalue="=" itemlabel="equal" /> <apex:selectoption itemvalue="!=" itemlabel="not equal to"/> <apex:selectoptio

java - Call an XMLUnit-test from another class -

i'm using xmlunit compare 2 xmls. works fine when perform test class manual junit test. but want call tests have class. can perform testmethod, nothing happens here example class test: public class tests extends xmltestcase{ public void testforequality() throws exception { string mycontrolxml = "<msg><uuid>2376</uuid><uuuid>23767</uuuid></msg>"; string mytestxml = "<msg><uuid>2376</uuid><uuuid>23767</uuuid></msg>"; assertxmlequal(mycontrolxml, mytestxml); } } here have tried call class: public class testexternalcall{ public static void main(string[] args) { tests comparetest= new tests (); comparetest.testforequality(); } } blue yes can that... test method called simple java code , there no failures simple pass test , not print in testexternalcall.java. add system.out.println("finished...");

javascript - MVC4 How to load Jquery files in areas -

i have trouble using jquery timeago in area. understand better issue here steps followed: i have simple index page using jquery timeago works perfectely on website. for reasons need have in area. created area controller , simple page. page displayed properly, area created properly i make copy/paste of "old" page "area" page. time have following error: ".../scripts/jquery.timeago.js" 0x800a1391 - javascript runtime error: 'jquery' undefined note file loaded in bundle loaded in application_start method of global.asax if has idea, me lot!

hive - HiveQL : Query to list only the views -

is there hive query list views available in particular database. in mysql query think below: select table_name information_schema.tables table_type 'view' , table_schema 'database_name'; i want similar hiveql. there no information_schema implementation in hive currently. there open jira can view @ following link: https://issues.apache.org/jira/browse/hive-1010 however, if hive metastore configured using derby mysql server can access information require. the different ways of configuring hive metastore can found at: http://www.thecloudavenue.com/2013/11/differentwaysofconfiguringhivemetastore.html here detailed e/r diagram of metastore: https://issues.apache.org/jira/secure/attachment/12471108/hivemetastore.pdf after configuring metastore, can obtain information want query like: select * tbls tbls_type = "view"

php - Bootstrap modal confirmation delete -

hello guys i'm trying delete record/row table using modal delete confirmation. i've tried far: <script type="text/javascript"> $(function(){ $(".btn-show-modal").click(function(e){ e.preventdefault(); $("#dialog-example").modal('show'); }); $("#btn-delete").click(function(e) { $("#dialog-example").modal('hide'); }); }); </script> <table class="table table-bordered"> <?php $stmt2 = $conn->prepare( "select project_code, description tblprojects" ); $stmt2->execute(); for($i=0; $row2 = $stmt2->fetch(); $i++){ $project = $row2['project_code']; $desc = $row2['description']; ?> <tr> <td><a href="project-

c++ - Align profile face image with its frontal face image -

Image
i have profile face: and frontal face image: output: aligned profile face reference frontal face. idea: need know 3 common points can take,which visible on both faces , use affinetransform , display aligned profile face or other **simple method** of doing development envi. :c++ , opencv 2.4.2 what tried: haarcascade feature detection(common detection point in both images=eye) ; wont detect ear in frontal face opencv: shift/align face image relative reference image (image registration) (i error message) as discussed here @bytefish, finding accurate position of eyes in given image far trivial. haar-cascades finding eyes in opencv produce many false positive useful, approach won't robust image rotation. you'll need robust head pose estimation aligning face images. here 2 robust ones (with code available): gary b. huang , vidit jain , , erik learned-miller . unsupervised joint alignment of complex images. international conference o

Log in to my web site using Skype and Whatsapp -

i want know whether can create login web site using skype login , whatsapp login, in google. users must able use skype login details login site. can achieved , if yes how? please make me aware this. thanks. whatsapp doesn't have external official api (neither skype ), afraid not.

JavaScript/JQuery - get src from Video Tag when it starts -

i need help. i'm developing webbrowser app , in app want play videos website in media element. so need source. problem pages write source in src="" after starting video. so need methode gives me src when video starts. i hope understand me. sorry bad english. by you add listener listens play event: document.getelementbyid('yourvideoid').addeventlistener('play', function() { console.log(this.src); }); or in jquery: $('#yourvideoid').on('play', function() { console.log($(this).attr('src')); }); if video not have id or class like: $('video').on('play', function() { console.log($(this).attr('src')); });

android - custom class method access -

i have problem accessing custom class methods handles loads , saves. while same class methods worked intend. since decided reuse save/load methods couple of times needed them in separate class, when try access method program crashes, have solution explanation why? maybe problem mode_private tried changing , still crashes package com.main.kanji_sama; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.checkbox; import com.main.customclass.sharedpreferences; public class hiragana extends activity implements onclicklistener{ checkbox cb1,cb2; button backbutton; sharedpreferences myfunction = new sharedpreferences(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_hiragana); cb1 = (checkbox) findvi

html - outline property of input control doesn't respect border-radius -

i have input field border-radius , when it's in focus outline appears has rectangular property. i'm using chrome. bug? don't want remove outline want respect border-radius. no unfortunately not possible keep outline respecting border-radius in browsers. instead easier remove outline outline: 0; , adding custom border or box-shadow css on focus. example: input[type="text"] { outline: none; } input[type="text"]:focus { box-shadow: 0 0 3px blue; } ( http://jsfiddle.net/3cggr/ )

Add element to a json in python -

i trying add element json file in python not able it. this tried untill (with variation deleted): import json data = [ { 'a':'a', 'b':(2, 4), 'c':3.0 } ] print 'data:', repr(data) var = 2.4 data.append({'f':var}) print 'json', json.dumps(data) but, is: data: [{'a': 'a', 'c': 3.0, 'b': (2, 4)}] json [{"a": "a", "c": 3.0, "b": [2, 4]}, {"f": 2.4}] which fine because need add new row instead element want this: [{'a': 'a', 'c': 3.0, 'b': (2, 4), "f":2.4}] how should add new element? you can this. data[0]['f'] = var

php - Mysqli join tables from 2 different databases -

how can use 2 connections run query joins 2 tables? yesno.table1 , sushi.table1 ? lets join id both have same id. how can that? // connect yesno database $this->yesno_db = new mysqli("red", "yesno", "***", "yesnotmp"); if ($this->yesno_db->connect_errno) { throw new exception('connection failed: '.$this->yesno_db->connect_error); } // connect sushi database $this->sushi_db = new mysqli("red", "sushi", "***", "sushi"); if ($this->sushi_db->connect_errno) { throw new exception('connection failed: '.$this->sushi_db->connect_error); } this question has nothing mysqli (or other api). to join table different database, user connects mysql, have have select rights both databases. having done, select 1 of databases in connection statement , address using usual dot syntax: select * t1 join db2.t2 to answer question literally, can

c# - ControlTemplate triggers on ToggleButton -

i trying create style many togglebuttons , need trigger when togglebutton ischecked change button's border red (originally gray when unchecked). <style x:key="togglebuttonstyle" targettype="{x:type togglebutton}"> <setter property="snapstodevicepixels" value="true" /> <setter property="template"> <setter.value> <controltemplate targettype="{x:type togglebutton}"> <border borderthickness="3" cornerradius="4" background="{templatebinding background}"> <label content="{templatebinding content}" fontfamily="../../fonts/#pokemon pixel font" horizontalalignment="center" verticalalignment="center"></label> </border> <controltemplate.tr