Posts

Showing posts from August, 2012

Check if String contains other String C# -

this question has answer here: how can check if string exists in string 8 answers i'm trying find out if string contains string this: var s1 = "test name*" var s2 = "testname" if checked should return true. try this: var exists = s1.replace(" ", "").tolower().contains(s2.tolower()); wiki

python - how can I use cython memoryview on numpy bool array? -

i used bool array quite often. in cython also. however, cannot make new memoryview interface working on numpy bool matrix. here test: def test_oldbuffer_uint8(np.ndarray[np.uint8_t, ndim=2] input): cdef size_t i, j cdef long total = 0 cdef size_t j = input.shape[0] cdef size_t = input.shape[1] j in range(j): in range(i): total +=input[i, j] return total def test_memview_uint8(np.uint8_t[:,:] input): cdef size_t i, j cdef long total = 0 cdef size_t j = input.shape[0] cdef size_t = input.shape[1] j in range(j): in range(i): total +=input[i, j] return total def test_oldbuffer_bool(np.ndarray[np.uint8_t, ndim=2, cast=true] input): cdef size_t i, j cdef long total = 0 cdef size_t j = input.shape[0] cdef size_t = input.shape[1] j in range(j): in range(i): total +=input[i, j] return total cpython cimport bool def test_memview_bool(bool[:,:] input):

php - how to create admin panel in codeigniter ? what and where do I do configuration...? -

i have created folder named admin in application/controller/cdashboard.php file. , 1 more folder in view same named admin application/view/vdashboard.php. running admin file localhost/myproject/admin/, giving 404 page not found error. how can solve error...? need make more changes...? why giving error? wiki

python - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 105: invalid continuation byte -

my code pretty following : import sqlitefts fts connection = apsw.connection('texts.db', flags=apsw.sqlite_open_readwrite) c = connection.cursor() def do_search(query): c.execute('select title, book, author, link, snippet(text_idx) text_idx text_idx match 'possumus';') #in case query='possumus' c.fetchall() --display results on html-- the query works if search more single word. when single word searches throws me decoding error. query doesn't work similar following: single word searches - select title, book, author, link, snippet(text_idx) text_idx text_idx match 'possumus'; and or searches like select title, book, author, link, snippet(text_idx) text_idx text_idx match 'quam or galliae'; the stack trace is: traceback (most recent call last): file "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response) file &qu

javascript - remove an append with click -

this question has answer here: jquery how bind onclick event dynamically added html element 9 answers i have following code: html: <body> <div> <p class='go'> create </p> <p class='del'> remove </p> </div> </body> css: .go{ background-color: lime; width:45px; text-align: center; } .bad{ background-color:red; width: 45px; text-align:center; } .del{ background-color:pink; width: 55px; } javascript(jquery) $(document).ready(function(){ $('.go').click(function(){ $('div').append("<p class='bad'>delete</p>"); }); $('.bad').click(function(){ $(this).remove(); }); $('.del').click(function(){ $('.

Why I am getting output 0 while trying to convert a huge integer to hex in php? -

i'm trying convert big int hex in php i have tried function how convert huge integer hex in php? <?php function bcdechex($dec) { $hex = ''; { $last = bcmod($dec, 16); $hex = dechex($last).$hex; $dec = bcdiv(bcsub($dec, $last), 16); } while($dec>0); return $hex; } $int = 115792089237316195423570985008687907852837564279074904382605163141518161494336 ; $int_to_hex = strtoupper( bcdechex ( $int )) ; echo $int_to_hex ; it gives output 0 i've tried above code in wamp , lamp i've latest php , bcmath , gmp installed. what doing wrong ? i'm trying generate hex use creating bitcoin address usually int 115792089237316195423570985008687907852837564279074904382605163141518161494336 gives hex fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140 update 1 : i have verified bcmath installed , loaded. php -m | grep bcmath bcmath update 2: i tried $int = 11579208923731619

javabeans - Getting java.lang.NoSuchMethodException: Property 'xx' has no setter method in class 'class xx' while using PropertyUtils.setSimpleProperty function -

i using propertyutils.setsimpleproperty invoke setter method dynamically, reason keep on getting error. need assistance figure out root cause. here code: class filedt { string reportname=null; string reportlocation=null; public string getreportname() { return reportname; } public void setreportname(string reportname) { this.reportname = reportname; } public string getreportlocation() { return reportlocation; } public void setreportlocation(string reportlocation) { this.reportlocation = reportlocation; } } class foo { public static void main (string... args) { filedt dt = newfiledt(); // #1 propertyutilsbean.setsimpleproperty(dt, "reportname", "abc.html"); // #2 propertyutilsbean.setsimpleproperty(dt, "reportlocation", "c://"); } } both of these methods throw exception caused by: java.lang.nosuchmethodexception: p

How to remove the keys of a dictionary where the values are null in swift 3 -

hi need remove dictionary keys having no values .i tried many codes not working .i need dictionary keys have values , need in swift 3 ["h": [], "x": [], "d": ["d1\r\n\r\n"], "j": ["j1\r\n"], "i": [], "m": [], "z": [], "s": [], "a": ["a2"], "c": ["c2\r\n\r\n"], "n": [], "y": [], "r": [], "g": [], "e": ["emmm\r\n"], "v": [], "u": [], "l": [], "b": ["b2"], "k": ["king"], "f": [], "o": [], "w": [], "t": ["test", "test2"], "p": [], "q": ["queen"]] i think meant "remove kvps have [] values", not "remove kvps have nil values". a call filter work, returns array of tuples of kvps gotta add them new di

sql server - C# Linq Lambda Left Outer Join -

i need create left outer join in linq lambda syntax. sql trying create linq equivalent of is: select distinct p.partnum partnum, p.shortchar01 skutype, vv.vendorid vendorcode, p.partdescription description, p.company company part p (nolock) inner join partplant pp on p.company = pp.company , p.partnum = pp.partnum left outer join vendor vv on pp.vendornum = vv.vendornum p.refcategory = @refcategory so can see simple query joining few tables. issue happen there no vendor still want rest of information hence left outer join. my current attempt recreate is: _uow.partservice .get() .where(p => p.refcategory.equals(level2)) .join(_uow.partplantservice.get(), p => new { p.partnum, p.company }, pp => new { pp.partnum, pp.company }, (p, pp) => new { part = p, partplant = pp }) .groupjoin(_uow.vendorservice.get(), pprc => pprc.partplant.vendornum, v => v

javascript - How can I console.log to parent window? -

i've got function refreshes table, works ok, of js functions don't run. debug i'm trying pass data between popup , it's parent window. have function: $.fn.runfncs = function(isparent) { if (isparent == 1) { window.opener.$.fn.comparedates(); window.opener.$.fn.addstatusicon(); window.opener.$.fn.icontooltips(1); window.opener.$.fn.icontooltips(2); window.opener.console.log('test'); } else { $.fn.comparedates(); $.fn.addstatusicon(); $.fn.icontooltips(1); $.fn.icontooltips(2); } }; and gets run on ajax success. when hit button ajax, success message etc. no console.log in parent window. i've been able access parent window before using window.opener , seems run ok, not time reason. i tried research either query specific or simple "what console.log" questions little stuck here. is there alternative way can console.log parent window? maybe document functio

android firebase reg id recived but notification not show in phone display -

i try show personal single notification on phone tray, can't rich, help. i having issue firebase cloud messaging in token device , send notification test through google firebase notification console, however, notification never logged nor pushed android virtual device. documentation fcm code have below , little else in way of else have push notifications working firebase. have gone through of setup information (build.gradle additions, installing google play services, etc...) specified in documentation, still not have messages generating. wrong code not receiving push notifications logcat or device? please let me know further information helpful. thanks. mregistrationbroadcastreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent.getaction().equals(config.registration_complete)) { firebasemessaging.getinstance().subscribetotopic(config.topic_global);

java - Custom class loader for WAR in Jetty -

can give example having custom class loader web application 'a'. since using jetty web server, cannot use ear format. have converted application 'a' jar file , using manifest file refer it. there ways create custom class loader 'a' , refer other wars instead of using jar file? wiki

python - Use Freebusy to other calendar than 'primary' -

i creating events not primary calendar, want check if user not busy in calendar, not in primary 1 event. my query: the_datetime = tz.localize(datetime.datetime(2016, 1, 3, 0)) the_datetime2 = tz.localize(datetime.datetime(2016, 1, 4, 8)) body = { "timemin": the_datetime.isoformat(), "timemax": the_datetime2.isoformat(), "timezone": 'us/central', "items": [{"id": 'my.email@gmail.com'}] } eventsresult = service.freebusy().query(body=body).execute() it returns: {'calendars': {'my.email@gmail.com': {'busy': []}}, 'kind': 'calendar#freebusy', 'timemax': '2016-01-04t14:00:00.000z', 'timemin': '2016-01-03t06:00:00.000z'} even if have created date in x calendar, when create event in primary calendar have: {'calendars': {'my.email@gmail.com': {'busy': [{'end': '2016-

python - App Engine socket error: [Errno 98] Address already in use -

i can't seem find solution google app engine local server listening port number. have tried several port number , keep getting "address in use" error. have check availability of ports , not in use. i trying run sample hello_world app python standard app engine, have python 2.7.12 installed on system, below output: dev_appserver.py --port=8085 app.yaml info 2017-08-22 15:11:15,041 devappserver2.py:116] skipping sdk update check. info 2017-08-22 15:11:15,264 api_server.py:313] starting api server at: http://localhost:32989 info 2017-08-22 15:11:15,269 dispatcher.py:226] starting module "default" running at: http://localhost:8085 info 2017-08-22 15:11:15,271 api_server.py:945] applying pending transactions , saving datastore info 2017-08-22 15:11:15,271 api_server.py:948] saving search indexes traceback (most recent call last): file "/home/jade/dev/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in &l

Do I need to pay to change github pages domain? -

i know make repository private, need change plan paid, if want change default username.github.com custom domain? no, doesn't have upgrade github account use domain name. docs @ https://help.github.com/articles/quick-start-setting-up-a-custom-domain/ (the description doesn't mention being paid customer): pick custom domain , register dns provider (if haven't done so). dns provider company allows users buy , register unique domain name , connect name ip (internet protocol) address pointing domain name ip address or different domain name. dns provider may called domain registrar or dns host. set custom domain dns provider. our guides outline how set pages custom domain dns provider depending on type of custom domain have. however, these domain types supported github ( https://help.github.com/articles/about-supported-custom-domains/ ): www subdomain (www.example.com) 1 apex domain & 1 www subdomain (example.com & www.example

ruby - Overriding == equality operator works only in one direction -

consider next example override == operator return true constantly: class example def ==(other) return true end end however, works in 1 direction: exp = example.new puts exp == {} #=> true puts {} == exp #=> false is there way force equality method work in reverse direction? it's not possible without changing other classes. a == b equals a.==(b) . need override == operator second class if want make work. wiki

css3 - css scale background to a certain ratio of image -

is there css3 method of scaling background image of element ratio of image's dimensions? all of documentation find when searching suggests 'background-size', when percentage given there, percentage of element background belongs. want scale relative size of background image itself. is 1 need ? try link https://jsfiddle.net/beljems/dtxljmdv/ . added padding percentage value top , bottom, no height required. , uses background-size:cover . hope helps. wiki

c# - How to redirect to a asp.net core razor page (no routes) -

here have razor cs page: public iactionresult onpost(){ if (!modelstate.isvalid) { return page(); } return redirecttopage('pages/index.cshtml'); } and cshtml page: @page @using razorpages @model indexmodel <form method="post"> <input type="submit" id="submit"> </form> i want redirect same page on form submit keep getting 400 error. possible redirect without using routes , go cshtml file in url? try in view; @using (html.beginform()) { <input type="submit" id="submit"> } wiki

c++ - Unable to play video in opencv3? -

here code. unable play video file in opencv3.3. beginner opencv. please me. int main(void) { cv::videocapture capvideo; cv::mat imgframe; capvideo.open("c:\\users\\sbv\\documents\\myvideo.avi"); if (!capvideo.isopened()) { std::cout << "\nerror reading video file" << std::endl << std::endl; _getch(); return(0); } if (capvideo.get(cv_cap_prop_frame_count) < 1) { std::cout << "\nerror: video file must have @ least 1 frame"; _getch(); return(0); } capvideo.read(imgframe); char chcheckforesckey = 0; while (capvideo.isopened() && chcheckforesckey != 27) { cv::imshow("imgframe", imgframe); if ((capvideo.get(cv_cap_prop_pos_frames) + 1) < capvideo.get(cv_cap_prop_frame_count)) { capvideo.read(imgframe); } else {

javascript - load datatable from custom response -

i working on datatables. have posted 2 questions related question this , this . ajax call: api.call("getbasiccallanalysisdata.json", 'post', function(data) { basicdata = data; createtable(basicdata); }, function(error) { console.log(error); }, jsonstr); this json response server: {"msg":null,"code":null,"status":null,"result":[{"anumber":"3224193861","bnumber":"3217284244","cellid":"410-01-604-30226","datetime":"2017-06-24 23:08:09.0","duration":801,"imei":"27512671195807","imsi":"35788979525680","operatorid":1,"mscid":"2","fileid":"1"},{"anumber":"3224193861","bnumber":"3217280585","cellid":"410-01-738-13433","datetime":"2017-06-24 06:53:13.0",&qu

ios - Xcode 8.3 and Swift 3 :Display Image in Cell in UICollectionView from URL fetched and Stored in NSMutableArray -

i have fetched data web service using following piece of code func ws_getrelatedrresourcepath(_ rresourceid:int, arrrresourceids:nsarray) { let refid = arrrresourceids.object(at: rresourceid); albummodel.getrelatedrresourcepath(parameters: refid anyobject?) { (responseobject,success) in if(success){ let tempresp = responseobject; if tempresp != nil { self.arrrelatedrresource.add(tempresp!) }else { if(responseobject != nil){ print(responseobject!); } } if rresourceid < arrrresourceids.count - 1 { self.ws_getrelatedrresourcepath(rresourceid + 1, arrrresourceids: arrrresourceids); }else{ print("done.") self.collectionsameseriesmedia.reloaddata(); self.setupmediaview(); apputils.stoploading(); } } by implementing getting url of image stored in nsmutablearray named

c++ - Inserting a new Record -

using below code can display records in database now. mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); this->setcentralwidget(ui->tableview); db = qsqldatabase::adddatabase("qmysql"); db.sethostname("localhost"); db.setdatabasename("employee"); db.setusername("root"); db.setpassword("password"); db.open(); model=new qsqltablemodel(this); model->settable("employee_details"); model->select(); ui->tableview->setmodel(model); } how can insert new record? also, can insert empty record , edit in later values? thank you. wiki

bluetooth lowenergy - android ble nexus6 can not discover all services -

today, tried debug android ble program nexus6 , when called discoverservice after connection, the system found 1 service . cell phone nexus6, version android 7.0 ,i not know reason, the other mobile phone normal , can found in 5 services , hope can tell cause of problem,really thanks wiki

python - Mean of a grouped-by pandas dataframe -

i need calculate mean per day of colums duration , km rows value ==1 , values = 0. df out[20]: date duration km value 0 2015-03-28 09:07:00.800001 0 0 0 1 2015-03-28 09:36:01.819998 1 2 1 2 2015-03-30 09:36:06.839997 1 3 1 3 2015-03-30 09:37:27.659997 nan 5 0 4 2015-04-22 09:51:40.440003 3 7 0 5 2015-04-23 10:15:25.080002 0 nan 1 how can modify solution in order have means duration_value0, duration_value1, km_value0 , km_value1? df = df.set_index('date').groupby(pd.grouper(freq='d')).mean().dropna(how='all') print (df) duration km date 2015-03-28 0.5 1.0 2015-03-30 1.5 4.0 2015-04-22 3.0 7.0 2015-04-23 0.0 0.0 i think looking pivot table i.e df.pivot_table(values=['duration','km'],columns=['value'],index=df['date'].dt.date,aggfunc='mean'

html - DOMPDF: How to make image posted from user be positioned fixed on top when @page margin-top is also defined by the user? -

i've searched everywhere here in , elsewhere have issue fixed. tips , advise appreciated , in advance. kindly refer sample code below: #letterheaderdiv{ position: fixed; left: 0px; top: -220px; right: 0px; width: 100%; border: 1px solid red; overflow: hidden; } #actioniteminfo { position: fixed; left: 0px; top: -100px; right: 0px; height: 50px; } #actionitemlettersfooter{ position: fixed; bottom: 0 !important; height: 50px; line-height: 0.5 !important; padding-top: 0.5em; } .bodysection.letter{ top:0; position: relative; line-height:1.5px; } <div class="contentsection" id="letterprintbody"> <div id="letterheaderdiv"> <table style="top: 0px; padding-bottom:0px; left: 0px ; margin-left: 0px; margin-right: auto; " id="letterheadertable">

Microsoft Graph API - Updating password -

i using microsoft graph api sample project. able login fine. i trying update password of user logged in using following code: public async task<bool> updatepassword(graphserviceclient graphclient, string newpassword) { user me = await graphclient.me.request().updateasync(new user { passwordprofile = new passwordprofile { password = newpassword, forcechangepasswordnextsignin = false }, }); return true; } when execute code, following error: { status: 500 message: "no offeractions provided validating consent." internal error: "empty offeractions array." } any idea might doing incorrectly? i gave access "users" related via app registration portal @ https://apps.dev.microsoft.com thank you! there baked-in changepassword() function you'll want use this: await graphclient.me.changepassword("current-pwd, "new-pwd").request().postasync();

wordpress - WooCommerce One Page Checkout does not display attributes or variations -

Image
wordpress > woocommerce > 1 page checkout on single product 1 page checkout enabled, have 3 variations of attribute: when variation selected , added order, 1 page checkout displays product name, not include variation: the variations displayed in full shopping cart, not when using 1 page. when customer ordering multiple variations, may confusing them. i'd display variation customer has chosen alongside product name using 1 page checkout. can help? ps: apologize if incorrect place post. i'm new community, have taken 1 class in php , css, , have scoured google , stack answer. hoping can help. thank in advance! :) in woocommerce 2.x, variation attributes displayed in cart meta data, in woocommerce 3.x included in product name. requires change cart customization in plugin or theme use new wc_product method get_name() instead of get_title() . if third party plugin or theme, ideally should find out if new version available compatible woocom

shell - Bash command ls ordering options -

new here (and coding). i'm writing simple bash script helps me change character character in files of current directory. here's code: #!/bin/bash #this script changes characters in files of current directory num=$(ls -1 | wc -l | awk '{print $1}') echo "there $num files in folder." echo "changing $1 $2 in names..." echo "done! here's happened:" in $(seq 1 $num) oldname=$(ls -1 | head -$i | tail -1) newname=$(ls -1 | head -$i | tail -1 | sed -e "s/${1}/${2}/g") mv -v "$oldname" "$newname" done so if write ./ccin.sh " " "_" should changing spaces in names of files in current directory underscores. except doesn't, , think ls 's fault. for loop skipping on files because ls changes order according sorts files every time mv modifies 1 of them. need isolate names of files in way not rely on "last modified" property. thought of file size, won't wo

Error installing ionic push plugin (for iOS) on windows -

i'm developing app in ionic ios , android, added both platforms project. i'm getting following when add push plugin. installs android, not ios ionic cordova plugin add phonegap-plugin-push --save > cordova plugin add phonegap-plugin-push --save × running command - failed! [error] cordova encountered error. may more insight running cordova command above directly. [error] error occurred while running cordova plugin add phonegap-plugin-push --save (exit code 1): installing "phonegap-plugin-push" android subproject path: cordovalib installing "phonegap-plugin-push" ios failed install 'phonegap-plugin-push': undefined error: warning: cocoapods requires terminal using utf-8 encoding. consider adding following ~/.profile: export lang=en_us.utf-8 c:/ruby22-x64/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] cannot run cocoapods root. (claide::help) here ionic info ps

javascript - Stop Animation on Bootstrap Carousel starting over again when slide -

i've image slider simple animation when text appear. however, animation starts again when image slide. got idea? set animation 'forwards'. here's jsfiddle https://jsfiddle.net/w3nta1/9vnz3bg1/1/ <div id="mycarousel" class="carousel fdi-carousel slide"> <!-- carousel items --> <div class="carousel fdi-carousel slide" id="eventcarousel" data-interval="0"> <div class="carousel-inner onebyone-carosel"> <div class="item active"> <div class="col-xs-4"> <a href="#"><figure> <figcaption class="imageappear1">1</figcaption> <img src="http://www.corincloud.com/skin/1100/img/example-200x200.gif" class="

Android: How to Make For Loop Continue Loop After AsyncTask is finish (onPostExecute) -

i have value more 1, planned make loop execute each value. problem loop looping/continue asynctask not finish yet. asynctask class public class server extends asynctask<jsonobject, void, void> { @override protected void doinbackground(jsonobject... params) { ......... } @override protected void onpostexecute(void result) { ......... } } activity @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_a); for(int i=0; i<10; i++){ server myserver = new server(); myserver.execute(i); } } as @cricket_007 commented, loop won't wait asynctask asynchronous , hence loop continues without waiting asynctask finish. i've understood purpose, need this. you need define interface this. public interface responselistener { void responsereceiver(); } now modify asynctask this public class server extends asyncta

php - Laravel-excel File not found -

i have photo located under link: http://127.0.0.1:8000/photos/391987500/2.jpg i'm trying include in excel file have error. i try this: <img src="/photos/{{$car->lot_id}}/2.jpg" width="30" height="30"> it returns error: file /photos/391987500/2.jpg not found! i try this: <img src="{{ public_path() . '/photos/' . $car->lot_id . '/2.jpg'}}" width="200" height="200"> it returns error: file /users/apple/projects/asystem/public/photos/391991903/2.jpg not found! i try this: <img src="{{ asset('/photos/' . $car->lot_id . '/2.jpg')}}" width="200" height="200"> and returns error: file http://127.0.0.1:8000/photos/391987500/2.jpg not found! how can done? finally, it! no need for / need <img src="photos/{{$car->lot_id}}/2.jpg" width="30" height="30"&

destroy dependent data without destroying original record in rails -

is there easy way destroy data associated particular record, without destroying original record. example, if have class user < activerecord::base has_many: pets, dependent: :destroy has_many: houses, dependent: :destroy end class pet < activerecord::base belongs_to :user end class house < activerecord::base belongs_to :user end if wanted delete user , pets , houses, like: user = user.first user.destroy but if want keep user, want delete pets , houses? there easy way that? you have manually, callback example. class user {callback} :destroy_pets private def destroy_pets self.pets.delete_all end end wiki

asp.net - package restore failed rolling back package change for ' myproject' in vs 2017 .net mvc core project -

Image
package restore failed rolling package change ' project' in vs 2017 .net mvc core project while updating packages i have same problem. created new app asp.net core(.net framework). , wanted add library, faced error. when trying update same problem. fixed the solution simple. when creating project chose asp.net core v 1. after rebuilding project asp.net core v 2, worked. wiki

spring - java.io.IOException: Did not receive successful HTTP response: status code = 400, status message = [Bad Request] -

i calling webservice class , m getting below exception intermittently. if invoke service again getting successful response. the calling application , webservice deployed in same weblogic box , in same server. when hit webservice local class getting successful response every single time. using commonshttpinvokerrequestexecutor invoke webservice org.springframework.remoting.remoteaccessexception: cannot access http invoker remote service @ [https://alice-uat.bankofamerica.com/vandelay/issuerservice]; nested exception java.io.ioexception: did not receive successful http response: status code = 400, status message = [bad request] caused by: java.io.ioexception: did not receive successful http response: status code = 400, status message = [bad request] @ org.springframework.remoting.httpinvoker.simplehttpinvokerrequestexecutor.validateresponse(simplehttpinvokerrequestexecutor.java:139) @ org.springframework.remoting.httpinvoker.simplehttpinvokerrequestexecutor.d

c# - How do I debug an Android app on a real phone in Visual Studio 2017? -

i want make android app , debug app on phone. i have developers settings , have usb mode setting 'mtp (media transfer protocol)', can access file system on explorer. my problems are: i can't see 'debug mode' on phone. and can't select phone on visual studio because don't have option start button. visual studio 2017 android version: 6.0.1 in developers settings have enable usb debugging do have adb tools installed on computer ? have download on internet, can check when plug device in tools installer can on phone wiki

php - %% signs in like syntax in mysql doesn't work when there is an exact match -

this question has answer here: when use single quotes, double quotes, , backticks in mysql 10 answers my question simple didn't find question or answer this.i mean not solution case. here code. $characters = $_get["search"]; $characters2 = "%". $characters . "%" ; $statement = $connection->prepare( "select name,username users 'name' :username or 'username' :username"); $statement->bindparam(':username', $characters2, pdo::param_str); $statement->execute(); problem if have david in name column in database , $_get["search"] "davi" or "david" couldn't find david's row. returns empty. you're comparing string 'name' , input user 'david'. sql, need put name of column, in case name . same thing username thus, $stateme

reactjs - Use scoped packages with Jest -

i developing app react-native , typescript , doing tests jest, have problem when use scoped packages (@assets), jest can not find path , gives error. the directory structure looks this: project/ assets/ img/ foo.png package.json src/ foo.ts build/ foo.js // assets/package.json { "name": "@assets" // @assets scope } // build/foo.js const image = require('@assets/img/foo.png'); // <- error in jest so when run jest: npm run jest build/ it can not find '@assets/img/foo.png' , throws error: cannot find module '@assets/img/logo.png' 'foo.js' how can use scope package in jest? jest version: 20.0.4 thanks necessary define modulenamemapper in jest config: // package.json "jest": { "modulenamemapper": { "^@assets.+\\.(png)$": "<rootdir>/assetstransformer.js" }, } // assetstransformers.js const path = require(&#

listview - How to receive result from implicit intent from adapter in fragment? -

i working on pronunciation application have recognizer intent on every list item adapter user record pronunciation , gets percentage of accuracy. thus, need invoke implicit intent adapter. challenge is: have activity (numbersactivity) hosts fragment (numbersfragment) contains adapter. thus, receive result of intent on numbersactivity. 1) know how getback result activity list_item invoked intent.(you can see want inside code) code wordadapter public class wordadapter extends arrayadapter<word> { activity mactivity; context mcontext; boolean isenable = false; private static final int req_code_speech_input = 100; private button mspeakbtn; private boolean isconnected = true; connectiondetector connectiondetect; public wordadapter(context context, activity activity, arraylist<word> pwords, int colorid) { super(context, 0, pwords); mactivity = activity; mcontext = context; } @override public view getview(int position, view convertview, viewgroup parent

r - Rmarkdown beamer table of contents slides, plus grayed out for not current sections -

Image
i want insert table of contents slide toward beginning , not beginning. additionally, want each new section arrives, table of contents slide repeated, time grayed out except current section, example see image. ( this other answer not work because toc: true puts 1 table of contents @ beginning) some answers kind of exist in latex (see here ), don't know how operationalize these within markdown. more generally, have trouble integrating native beamer latex rmarkdown, if can show me how that, esp example, helpful. beamer preamble: output: beamer_presentation: fig_width: 7 fig_height: 6 fig_caption: false # keep_tex: true # toc: true slide_level: 3 includes: in_header: ~/google drive/.../.../../latexbeamertheme.r header-includes: - \atbeginsection[]{\begin{frame}\tableofcontents[currentsection]\end{frame}} you can solve problem via header-includes ; that's how add things we'd call preamble in latex document. here'

how to create a cron expression for every 2 weeks -

here cron expression tried 0 0 0 */14 * ? giving following schedules start time:- friday, september 8, 2017 1:25 am next scheduled :- 1. friday, september 15, 2017 12:00 2. friday, september 29, 2017 12:00 3. sunday, october 1, 2017 12:00 4. sunday, october 15, 2017 12:00 5. sunday, october 29, 2017 12:00 this expression working every 2 weeks in every month, requirement has run every 2 weeks, mean after executing sept 29th , nxt schedule should october 13 scheduling october 1 there no direct cron expression every 2 weeks kept following cron expression , similar 2 weeks not 2 weeks cron every 2weeks(on 1st , 15th of every month @ 1:30am) - 30 1 1,15 * * wiki

Equivalent of anti_join(library dplyr) of R in python -

i have 2 tables & b common column or key column "x" , want remove instances of x in table exists in table b. want able in python. equivalent in r is library(dplyr) anti_join(a,b,by = "x") can me? wiki

SQL Server WHERE clause default to all unless variable entered -

i have table of 10 columns of data , i'd able make stored procedure pulls relevant data based on user-defined parameters. simplified version of fact.spend table looks this: location | year | spendyear ----------+--------+----------- new york | 2015 | 25.00 new york | 2016 | 23.20 dallas | 2015 | 29.30 dallas | 2016 | 25.32 san fran | 2015 | 23.33 san fran | 2016 | 23.97 a basic version of i'm trying is: create procedure sppullspenddata (@location varchar(20), @spendyear smallint) select * fact.spend location = @location , spendyear = @spendyear but i'd @spendyear parameter optional, defaulting years if there no user input. tried few variations using subqueries, far nothing's worked out quite right. select * fact.spend (location = @location) , (spendyear = @spendyear or @spendyear null) wiki

android - Opening fb://messaging/{user_id} using {app_scoped_user_id} -

i understand not possible public user id of facebook user app. app scoped id's not work fb:\\ protocol. can neither open someone's profile nor chat in messenger using app scoped id's. there way can this? my app needs people connect each other using messenger. how accomplish this? wiki

handling popups with selenium using javascript -

my goal enter username , password popup box appears whenever page loads. using selenium task , far have tried not work i tried using still not open browser.get(" http://username:password@websitecom "); this first time working selenium! picture of popup try website reference solve problem: https://www.guru99.com/execute-javascript-selenium-webdriver.html wiki

xml - Generate a document template from a library of content blocks -

my company has collection of word templates different types of quotes. there 3 main types, "firm quote" being detailed. each of these templates follows same general outline , populated same boilerplate, few differences 1 document another. within firm quote category, there more boilerplate sections can added depending on product being quoted. what create library or database each boilerplate section tagged, , of templates pull same library. ideally user step through little menu , choose quote type, , additional boilerplate, , template generated customize. if update 1 boilerplate section, wouldn't have in 2 other locations. i'm open learning new software or coding languages this, or moving away word. prefer not @ expensive software can me; i'd rather spend time learning myself. any idea how can make happen? i used work company developed product did want. if you're interested in software let me know , i'll add product link. so have diffe

mysql - Knex.js migrations with unique constraint function -

i trying migrate new table database. table users table. here code have: exports.up = function(knex, promise) { return knex.schema.createtableifnotexists('users', function(table) { table.increments('id').primary(); table.string('first_name').notnullable(); table.string('last_name').notnullable(); table.string('email').unique().notnullable(); table.string('password').notnullable(); table.timestamps(false, true); }).then(() => { console.log('users table created!'); }) }; exports.down = function(knex, promies) { return knex.schema.droptable('users') .then(() => { console.log('users table has been dropped!'); }) }; this returns 2 errors: knex:warning - migrations failed error: alter tableusersadd uniqueusers_email_unique(email) - key column 'email' doesn't exist in table error: key column 'email' doesn't exist in table it appe

swift - populate tableview based on returned queryEqual(toValue) -

i having trouble populating tableview based on snapshot keys. console printing (nodetoreturn) values parent node , children called queryequal(tovalue: locationstring), know querying them correctly. reason tableview keeps populating user dictionaries database.database().reference().child("travel_experience_places"). want tableview display snapshot data "nodetoreturn" values, not every parent node "travel_experience_places" database reference - parent nodes have same value of "locationstring" in children. makes sense. in advance! // model object class user: safeuserobject { var id: string? var name: string? var email: string? var profileimageurl: string? var place: string? init(dictionary: [string: anyobject]) { super.init() self.id = dictionary["fromid"] as? string self.name = dictionary["addedby"] as? string self.email = dictionary["email"] as? string

Replace exact matching string in xml string using java -

i read many articles regex replace string in xml value. in many articles of peoples accepted answers str=str.replaceall("\\b2017\\b", "****"); but not working expected , replacing 2017 in other place also. below example. public class stringtest { public static void main(string[] args) { string str= "<ota_insurancebookrq xmlns=\"http://www.opentravel.org/ota/2003/05\" version=\"2.001\"> "+ " <pos> "+ " <source> "+ " <tpa_extensions> "+ " <productcode>101468</productcode> "+ " <purchasedate>2017-08-21</purchasedate> "+