Posts

Showing posts from May, 2013

How to check that a value is set on a dropdown box selenium java -

i have html code. thing option names contain lots of spaces until tags closed. <select name="auth" id="auth" size=1 onchange="updatepagestate()"> <option value="0">open system </option> <option value="1">wep </option> <option value="2">wpa </option> <option value="3">wpa2 </option> i want check option selected in dropdown box using selenium in java. code: try { webdriverwait wait = new webdriverwait(driver, 20); wait.until(expectedconditions.texttobepresentinelementvalue(((by.xpath("//select [@id='auth']/option['" + authen + "']"))), authen)); system.out.println("authentification correct"); } catch (exception x) { system.out.println("authentification incorrect"); x.printstacktrace(); } where "authen" variable read file corresponds options in dropdown box. i followin...

android - Use m2crypto to print certificate in apk -

i show android apk certificate information openssl command does. like $ openssl pkcs7 -inform der -in cert.rsa -print_certs subject=... -----begin certificate----- miiebzccau+gawibagiekkpncjanbgkqhkig9w0baqsfadcbsjepma0ga1uebhmg ... 5be3oowpt+mhkewxsei9r+s7tuwkp+wopjevmbmga1uecgwm6yer5bgx572r57uc -----end certificate----- at first used pycrypto , found not include x509 format. after trying m2crypto , output error like in [7]: x509.load_cert('cert.rsa', x509.format_der) --------------------------------------------------------------------------- x509error traceback (most recent call last) <ipython-input-7-821a670a1ab6> in <module>() ----> 1 x509.load_cert('cert.rsa', x509.format_der) /usr/local/lib/python2.7/dist-packages/m2crypto/x509.pyc in load_cert(file, format) 613 cptr = m2.d2i_x509(bio._ptr()) 614 if cptr none: --> 615 raise x509error(err.get_error()) 616 r...

SWIFT OSX NSBezierPath Linewidth property not working -

i using following code draw line graph on custom nsview for var index = 0; index < (datapointsarray.count - 1); index++ { nsbezierpath().linewidth = 20.0 nsbezierpath.strokelinefrompoint(datapointsarray[index], topoint: datapointsarray[index + 1]) } this snippet contained within function called drawrect() within custom view. the line draws correctly within coordinate system of view. however, line drawn @ same width (one pixel width) regardless of .linewidth setting (e.g., 5.0, 10.0, 20.0 etc) seems have no impact on line drawn). is able advise might creating issue me. haven't been able find previous question raises issue. nsbezierpath().linewidth = 20.0 the () means initializing new instance of class , set linewidth 20.0. should create variable , use draw path: var bezierpath = nsbezierpath() bezierpath.linewidth = 20.0 bezierpath.movetopoint(datapointsarray[index]) bezierpath.linetopoint(datapointsarray[index + 1])

java - Renaming Spring csrf token variable -

my application runs under portal application. both implemented in spring , both use csrf security. my need change how csrf token named in session, both tokens can work without conflicts. tried far creating token repository , trying change parameter name , session attribute name in security config class. final httpsessioncsrftokenrepository tokenrepository = new httpsessioncsrftokenrepository(); tokenrepository.setheadername("toolbiz-csrf-token"); tokenrepository.setparametername("toolbiz_csfr"); //tokenrepository.setsessionattributename("toolbiz_csrf"); when make request spring doesn't new setup much, , log produces following line: invalid csrf token found what should more? missing something? this worked me:- @configuration @order(securityproperties.access_override_order) public class optosoftwebfrontsecurity extends websecurityconfigureradapter { @override protected void configure(httpsecurity http) throws exception { htt...

java - How can i call jar API from javascript using node.js with more implementations steps -

i trying re-use code in different technology stack. let's say: have jar contatins followng class defination: package com.gallop; import java.io.file; import java.io.ioexception; public class generatefile { public void generatefile(string filename) { file file = new file(filename); try { file.createnewfile(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } } now, code exported filegenerator.jar. now, question how can use class inside filegenerator.jar create file using javascript. basically, have import generatefile class jar. have create instance of generatefile. using instance of generatefile, should able invoke method generatefile filepath parameter.

swift - load a different view controller or tableview depending on previous button pressed -

i new swift coding. being said, i'm looking transition "home page" tableview or new view controller once menu item has been selected. curious how go using 1 view controller/tableview loading contents inherited file based on selection made previous. example: home - chores @ home - chores @ work - chores @ school a selection of chores @ home selected, 1 segue prepared loads view controller downstream in xcode, loads content differently if had selected chores @ work. hope makes sense , thank in advance. if not mistaken, considered subclasses uiviewcontroller or uitableview??? you may needs see uitableview docs, can set different datasource depends on selection apple link docs https://developer.apple.com/library/ios/documentation/uikit/reference/uitableview_class/ and here simple tutorial follow http://www.codingexplorer.com/getting-started-uitableview-swift/

spring - Spock test - RESTClient: HttpResponseException: Not Found -

i want write test request when api returns 404. my test: def "should return 404 - object deleted before"() { setup: def advertisementendpoint = new restclient( 'http://localhost:8080/' ) when: def resp = advertisementendpoint.get( path: 'api/advertisement/1', contenttype: groovyx.net.http.contenttype.json ) then: resp.status == 404 } my error: 14:24:59.294 [main] debug o.a.h.impl.client.defaulthttpclient - connection can kept alive indefinitely 14:24:59.305 [main] debug groovyx.net.http.restclient - response code: 404; found handler: org.codehaus.groovy.runtime.methodclosure@312aa7c 14:24:59.306 [main] debug groovyx.net.http.restclient - parsing response as: application/json 14:24:59.443 [main] debug org.apache.http.wire - << "ba[\r][\n]" 14:24:59.444 [main] debug org.apache.http.wire - << "{"timestamp...

c# - How to convert Csharp code directly in to javascript code -

i newbie in javascript.i want convert function written in c# javascript , same functionality doing in c#. in process came across online converters like duocode,sharpkit,jsil,jsc,script# can did not work. may committing mistake while operating here c# code want convert javascript function: public static string decrypt(string data) { var rsa = new rsacryptoserviceprovider(); var dataarray = data.split(new char[] { ',' }); byte[] databyte = new byte[dataarray.length]; (int = 0; < dataarray.length; i++) { databyte[i] = convert.tobyte(dataarray[i]); } rsa.fromxmlstring(_privatekey); var decryptedbyte = rsa.decrypt(databyte, false); return _encoder.getstring(decryptedbyte); } any suggestions /help appreciated. what want not possible code have. there ways convert code 1 language another, if code simple enough , not use non...

Android :: how to quit complete application, on dialog box button click -

i using below code quit application. case if internet not available shows dialog box saying internet not available , press ok. once user press ok close app still app shows in recent apps list. below code :: alertdialog.builder builder1 = new alertdialog.builder(context); builder1.settitle("oops! internet not available."); builder1.setmessage("connect internet , restart app."); builder1.setcancelable(true); builder1.setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { intent intent = new intent(intent.action_main); intent.addcategory( intent.category_home ); intent.setflags(intent.flag_activity_clear_top); intent.addflags(intent.flag_activity_new_task); intent.addflags(intent.flag_activity_exclude_from_recents); startactivity(intent); } ...

Jetty websocket client connect to Stomp.js topic channel -

i have written spring websocket server assessible browser via stomp.js. attempting implement java client in order connect server secondary system. able connect server using following code string desturi = "ws://localhost:8080/sample"; websocketclient client = new websocketclient(); simpleechosocket socket = new simpleechosocket(); try { client.start(); uri echouri = new uri(desturi); clientupgraderequest request = new clientupgraderequest(); client.connect(socket, echouri, request); system.out.printf("connecting : %s%n", echouri); socket.awaitclose(5, timeunit.seconds); } catch (throwable t) { t.printstacktrace(); } the connection opened, , connect topic /price-stream. achieved stomp.js : stompclient.subscribe('/topic/pricechannel1', renderprice); what equivalent subscribe method jetty websocket client? cant find in documentation have found on net. additional info: i tryi...

javascript - How can I bind data (in JSON format) from local database to Kendo UI Scheduler? -

after doing tuts of kendo ui framework, i'm having problems using 1 of widgets. i've basic understanding of framework , first question ever in stackoverflow so... please spare me "advanced" answers if possible. so, here's thing: i want use scheduler widget make timeline month view data json file. data (in json format) i'm planning use comes sql server database called on client-side ajax call connects web service. sample: params.type = 'get'; params.url = 'loremipsum-yeahdomainservice.svc/json/getpeople'; params.datatype = 'json' to know if web service working fine, tried retrieve information database kendo dropdownlist , went okay. did script: var getpeople; getpeople = data.getpeopleresult.rootresults; var listpeople = []; getpeople.foreach(function(person){ var newelement = { 'name': person.name, 'value': i, 'color': '#808080' }; listpeople.push(newelement); }); after doing script,...

Vba Type-Statement conversion to C# -

this can accomplished have following statement in vba: type testtype integerarray(5 100) double end type how can accomplish same in c#? @edit 14:16 08-07-2015 in belief not same question mentioned. question how convert type statement array inside. question mentioned array it's starting index. actually c# not support kind of arrays based on other start-index zero. however may do. double[] myarray = new double[96]; alternatvily may create dictionary indexes keys , actual value: var mydict = new dictionary<int, double>();

javascript - How to get rid from ?callback=myCallback&_=1340513330866? -

Image
i'm trying capture data html page on website. need capture data , save site. that's why used cross domain ajax this var mycallback = function(data) { console.log(data); }; var formdata = $('.data-capture-form').serialize(); $.ajax({ url: 'http://prospectbank.co.uk/leads/capt', type: 'get', data: formdata, datatype: 'jsonp', crossdomain: true, jsonp: 'callback', jsonpcallback: 'mycallback' }).done(function(res) { console.log(res); }).fail(function(jqxhr, textstatus, errorthrown) { console.log(jqxhr, textstatus, errorthrown); }); then error any help? thanks the response http://prospectbank.co.uk/leads/capt?_=1340513330866 ? wrong formatted json. {"status":true} it should be {status:true}

ios - Getting unable to open database file while inserting bulk data in sqlite db -

i using following code insert rows more 5000 in ios app. if not using line sqlite3_close(dbv) ; statement got error unable open database . , if use statement sqlite3_close(dbv) data insertion taking around 10-15 mins. can insert record faster without getting error. -(void)insertrecordintotable:(nsstring*)sqlstatement { nsstring *sqlstr=sqlstatement; const char *sql=[sqlstr utf8string]; const char* key = [@"strongpassword" utf8string]; sqlite3_stmt *statement1; @try { int res = sqlite3_open([[self.databaseurl path] utf8string], &dbv); if (res != sqlite_ok) sqlite3_open([[self.databaseurl path] utf8string], &dbv); sqlite3_key(dbv, key, (int)strlen(key)); if(sqlite3_prepare_v2(dbv, sql, -1, &statement1, nil)==sqlite_ok) { nslog(@"done"); } else { nslog(@"the error occurred here %s ",sqlite3_errmsg(dbv)); } ...

Error in using FeatureDetector OpenCv Android -

hy use opencv android processing image; need use sift, write code: featuredetector featuredetector = featuredetector.create(featuredetector.fast); however i've got error: java.lang.unsatisfiedlinkerror: native method not found: org.opencv.features2d.featuredetector.create_0:(i)j how can fix it? this error fired if call feature detector before opencv library has finished loading. putting featuredetector featuredetector = featuredetector.create(featuredetector.fast); inside of loader callback ensure gets called after opencv has loaded. example: private baseloadercallback mloadercallback = new baseloadercallback(this) { @override public void onmanagerconnected(int status) { switch (status) { case loadercallbackinterface.success: //opencv loaded! { log.i(tag, "opencv loaded successfully"); mopencvcameraview.enableview(); featuredetector featuredetector = feat...

java - If Bootstrap class loader is responsible for loading classes from rt.jar then why String.class.getClassloader returns null -

i trying understand how class loaders work in java. far understand topmost class loader i.e. bootstrap class loader responsible loading classes rt.jar. if call string.class.getclassloader result null. isn't supposed return instance of bootstrap class loader? the javadoc says: some implementations may use null represent bootstrap class loader. method return null in such implementations if class loaded bootstrap class loader.

c# - How to read a space-delimited text file with empty columns -

i'm trying read space-delimited file using streamreader . for i'm reading file line line split them arrays , reading specific data providing index. the problem when in rows column empty. causes program reach wrong item. col1 col2 col3 b c d e f g h for example, i'm having problems second row. unless have fixed width columns wont know value should empty, if have control on format should wrap values in quotes, or have csv format quotes value wrapping, espacing inner quotes, can have luxury of view if in excel :-) free. https://en.wikipedia.org/wiki/comma-separated_values

python - Effect of using sys.path.insert(0, path) and sys.path(append) when loading modules -

i having problem python importerror, module found when running on local computer not found on ci server. solved problem swapping sys.path.append(path) in script sys.path.insert(0, path) path string module location. since module , not installed package ( related question ), why order of paths fix problem? because python checks in directories in sequential order starting @ first directory in sys.path list, till find .py file looking for. ideally, current directory or directory of script first first element in list, unless modify it, did. documentation - as initialized upon program startup, first item of list, path[0], directory containing script used invoke python interpreter. if script directory not available (e.g. if interpreter invoked interactively or if script read standard input), path[0] empty string, directs python search modules in current directory first. notice script directory inserted before entries inserted result of pythonpath. so, probably, ...

javascript - How to only show a specific number of divs on the page and load more when the user scrolls to the bottom? -

there 6 divs have same class. how make first 3 divs shown on page , when user scrolls bottom of page, other 3 divs shown? also, there may not 6 divs. let's there 12 divs, code still need show first 3 divs , keep showing 3 more when user scrolls bottom of page. <div class="post"> lorem </div> <div class="post"> lorem ipsum </div> <div class="post"> lorem ipsum .... </div> <div class="post"> lorem... </div> <div class="post"> loremsdfdsf </div> <div class="post"> lorem....... </div> i have managed find http://jscroll.com/ requires include href link @ bottom of page file display when user scrolls end. you can use jquery's convenient method scrolltop() , capture scroll event scroll(). check if scroll far enough , if yes - load new content.

spring - Inject bean map into Grails Service -

a spring bean can injected in grails application using resources.groovy. however, inject map of beans. key string, value actual bean. idea trying strategy style pattern there map , corresponding bean service invoked? is possible - thanks. i had similar issue, wanted inject list of beans. example works: bean1(bean1) {} bean2(bean2) {} beansholder (beansholder ) { beans = [bean1, bean2] } i think can same map: beans = ['first': bean1, 'second': bean2]

python - django change password form not raising error -

i have form changing password: class passwordchangeform(forms.form): old_password = forms.charfield(max_length=20) new_password1 = forms.charfield(max_length=20) new_password2 = forms.charfield(max_length=20) def __init__(self, user, *args, **kwargs): self.user = user super(passwordchangeform, self).__init__(*args, **kwargs) def clean_old_password(self): old_password = self.cleaned_data.get("old_password") if not self.user.check_password(old_password): raise forms.validationerror("your old password wrong") return old_password def clean_new_password2(self): new_password1 = self.cleaned_data.get("new_password1") new_password2 = self.cleaned_data.get("new_password2") if new_password1 , new_password2 , new_password1 != new_password2: raise forms.validationerror("your new passwords didn't match") return new_password2 in view have: class passwordchangeview(view): form_class...

Want to change the sequence/order of my classes & trainers widget on homepage (Wordpress) -

i want able change sequence / order of different group lessons (onze groepslessen) , trainers (onze instructeurs) on homepage. in wordpress end not see possiblity this. for example: want show bodypump first instead of yoga. can find website here: http://test.healthclubone.nl . if posts wp post order plugin. here's resource plugins, https://perishablepress.com/6-ways-to-customize-wordpress-post-order/ you modify code, have @ wp codex available options: https://codex.wordpress.org/class_reference/wp_query

mysql - Pulling data from database table, based on categories -

i have table has fields category,city,mobile , email data. need create report like: each category in table need count of distinct mobile , distinct email each city select category, count(distinct mobile), count(distinct city) your_table group category

javascript - Validate us number with regular expression -

i'm doing exercise on freecodecamp validate telephone number. the user may fill out form field way choose long valid number. following valid formats numbers: 555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555 i'm using regex test input.i type these expression on regex101 (([1]\s)?(\()*(\d{3})(-|\)|\)\s|\s)*(\d{3})(-|\s)*\d{4}) to test input like: 2 ** (757) 622-7382** return true - 1 (757) 622-7382 return true 10 ** (757) 622-7382** return true how test leading 2, minus sign , 10. i suggest have on owasp validation regex repository subject of validation , continuous updates for phone (at time i'm writing)the suggested regex ^\d?(\d{3})\d?\d?(\d{3})\d?(\d{4})$

javascript - Selected achor tag value on hover -

i want value of anchor tag when mouse hover , values come autocompleted function .i have added code not give me value of anchor tag.so how value of anchor tags on mouse hover please me thank advance <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function () { searchtext(); }); function searchtext() { $("#txtsearch").autocomplete({ source: function (request, response) { $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "test.aspx/getautocompletedata", ...

php - Connecting PHP5 to MS Access with pdo_odbc -

hi im trying connect php5 ms access on unix server. managed install & load pdo_odbc drivers. however, when ran code: $db = new pdo("odbc:driver={microsoft access driver (*.mdb)}; dbq=tra.mdb; uid=; pwd=;"); i error on page: fatal error: uncaught exception 'pdoexception' message 'sqlstate[01000] sqldriverconnect: 0 [unixodbc][driver manager]can't open lib 'microsoft access driver (*.mdb)' : file not found' in /usr/local/www/sks/php_access.php:1 stack trace: #0 /usr/local/www/sks/php_access.php(1): pdo->__construct('odbc:driver={mi...') #1 {main} thrown in /usr/local/www/sks/php_access.php on line 1 fyi, mdb file located within same page. for pdo work, must active 2 libs: 1 database (driver) , 1 pdo on former driver. so must find ms-access driver unix. did check: http://www.unixodbc.org/drivers.html example? lists access (paid think). this might (it lists few possibilities, tough question closed): do...

c# - Entity Framework stopped working -

i have project has been working fine long time. when tried debug project today said couldn't find entity framework. thought weird tried installing latest version of entity framework. when loads following error, never had before: invalid object name 'dbo.events'. there no table in database called events. occurs when hits following code: mymodel mmcontext = new mymodel(); datetime comparedate = new datetime(datetime.now.year, datetime.now.month, datetime.now.day); list<event> evs = mmcontext.events.where(e => e.listid == 1 && e.enddate >= comparedate).orderby(e => e.startdate).tolist(); which should use following model: public class mymodel : dbcontext { public mymodel() : base("myconnection") { } public dbset<event> events { get; set; } } [table("eventcatalog_events")] public class event { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int eventid { g...

css - Fixed left navigation scrolling horizontal -

Image
i have vertical navigation bar left position set fixed, if resize window , use horizontal scrollbar content div goes behind , editor overlaps navigation bar. image: code: /* page.php */ <?php require(abspath . 'header.php'); ?> content ... <?php require(abspath . 'footer.php'); ?> /* header.php */ <!-- css --> <link rel="stylesheet" href="css/style.css" /> <div id="header"> </div> <?php require(abspath . 'menu.php'); ?> <div id="content-wrapper"> /* menu.php */ <div id="left-menu"> <ul> <li class="menu-title"> <a href="#">title</a> </li> <li><a href="#">page 1</a></li> <li><a href="#">page 2</a></li> </ul> </div> /* footer.php */ </div><!-- close c...

resize - Qt: How to fit content to QScrollArea -

i reimplement qscrollarea , want add serveral widgets @ runtime. problem is, till scrollbars shown content of qscrollarea doesnt fit it. if add more widgets scrollbars shown content fits correctly. i tried after adding widgets this->widget()->resize(this->widget()->sizehint()); or this->widget()->adjustsize(); but doesn't worked. have resize content? why content fits after scrollbars appear? add appropriate layout scroll area before setting widget. set size constraints(min , max property ) of widgets being added i not sure widget layout inside scroll area, can make use of spacers align widgets ( when there not many widgets fill scroll area scroll bar appear)

ASP.NET edit action will not save -

i have website used complete health , safety self assessments when go edit assessment not save edited data. 1 have , ideas? this controller: // get: /wsassessment/edit public actionresult edit(int id = 0) { wsassessment wsassessment = db.wsassessments.find(id); if (wsassessment == null) { return httpnotfound(); } var view = view(wsassessment); view.viewbag.origin = "edit"; return view; } // // post: /wsassessment/edit [httppost] [validateantiforgerytoken] public actionresult edit(wsassessment wsassessment) { modelstate.clear(); if (modelstate.isvalid) { db.entry(wsassessment).state = entitystate.modified; db.savechanges(); return redirecttoaction("index"); } return view(wsassessment); } this view: @model healthy_and_safety_website.models.wsassessment @{ viewbag.title = "edit"; } <h2>edit</h2> @using (html.beginform()) { @h...

Sort by list in list in python? -

this question has answer here: how sort list of dictionaries values of dictionary in python? 16 answers i have list of type : l = [{"id":"21", "region" :['2', '6', '4']}, {"id":"12", "region" :['1', '3', '8']}] i want sort list on "region" field, , @ 2nd index. : l = [{"id":"21", "region" :['2', **'6'**, '4']}, {"id":"12", "region" :['1', **'3'**, '8']}] how do ? aware of itemgetter. couldn't also. you can use list.sort() key argument, passing lambda expression key argument - in [45]: l = [{"id":"21", "region" :['2', '6', '4']}, {"id":"12", "re...

javascript - How to set color of each slice in pie chart in high charts library? -

Image
i making pie chart high chart library. want change color of each slice in pie chart how can ? code - var colors = ["color:'#2a8482'","color:'#64decf'","color:'#bccdf8'"]; var responsedata = {"2":40,"1":30} var obj = $.parsejson(responsedata); var dataarrayfinal = array(); var value = array(); var name = array(); var j = 0; (var key in obj) { if (obj.hasownproperty(key)) { name[j] = "name:'"+key+"'"; value[j] = obj[key]; j++; } } for(k=0;k<name.length;k++) { var temp = new array(name[k],value[k],colors[k]); dataarrayfinal[k] = temp; } $(function () { new highcharts.chart({ chart...

c# - Iterate through an ExpandoObject that contains multiple ExpandoObjects -

i wondered if possible iterate on expandoobject contains array of expando objects? i parsing json file structure below: "event": [{ "name": "begin!", "count": 1 }], "context": { "customer": { "greetings": [ { "value1": "hello" }, { "value2": "bye" } ], "nicknames": [] } } i can retrieve expando object 'event' doing following: generatedictionary(((expandoobject[])dict["event"])[0], dict, "event_"); this code generatedictionary method: private void generatedictionary(system.dynamic.expandoobject output, dictionary<string, object> dict, string parent) { try { foreach (var v in output) { string key = parent + v.key; object o = v.value; if (o.g...

python - How to get django runserver to stop logging to console in pycharm -

here my logger settings logging = { 'version': 1, 'disable_existing_loggers': false, 'handlers': { # send messages console 'console': { 'level': 'info', 'class': 'logging.streamhandler', 'formatter': 'verbose', }, }, 'loggers': { '': { 'handlers': ['console'], 'level': 'info', 'propagate': true, }, }, } i have configured logging in django, logs drowned in continous get, post, put requests frontend generates i.e dont want see logs django this [08/jul/2015 11:05:59] "get /home/ http/1.1" 200 910 only logs from logger = logging.getlogger(__name__) logger.info('hello world') is there way letrunserver not display requests , show logs loggers i forgot mention in in pycharm this has no...

ios - Warning: Attempt to present UINavigationController whose view is not in the window hierarchy? -

i doing appdelegate. have 2 storyboards, main storyboard , secondstoryboard . when set main interface secondstoryboard deployment info of app target, , run project following code works charm. but when set main interface main story board deployment info of app target, , run project throwing warning , presentviewcontroller method not working. :( pls ! in advance. var storyboard: uistoryboard = uistoryboard(name: "secondstoryboard", bundle: nil) var congratulationscreen = storyboard.instantiateviewcontrollerwithidentifier("s_id_secondvc") as! secondvc var navcontroller = uinavigationcontroller(rootviewcontroller: congratulationscreen) self.window?.makekeyandvisible() self.window?.rootviewcontroller?.presentviewcontroller(navcontroller, animated: true, completion: nil) check call after delay dispatch queue let delaytime = dispatch_time(dispatch_time_now, int64(0.1*double(nsec_per_sec))) dispatch_after(delaytime, disp...

javascript - how to include reference in JSFIDDLE -

Image
bit of beginner @ using jsfiddle...trying recreate issue in code. unsure how include correct reference though. code using: <link href="/jquery-ui-1.10.3.custom/css/start/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css" /> <script src="/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script> so q being how include these files in jsfiddle. cant seem find them drop down? thanks again use external resource part. jsfiddle automatically identifies js or css based on extension: note: work if files publicly available online. if they're on local machine, feature won't work you. if wanna upload local file, can use gists , put code in it. can use rawgit working url , add there, usual.

php - File upload not working in codeigniter -

i beginner @ codeigniter. since past 2 days i've been trying build file upload system using ci's guide. problem images not getting uploaded in upload directory ./uploads/ suspect problem lies permissions of upload folder not sure. building application locally using xampp on windows 7. after pushing upload button, nothing happens. (it supposed either show display errors or redirect success page.) view- upload_form.php ` <title>upload form</title> </head> <body> <form> <?php echo $error; ?> <?php echo form_open_multipart('upload/do_upload'); ?> <input type='file' name='userfile' size='20' /> <br /><br /> <input type='submit' value='upload' /> </form> </body> </html> success page - upload_success.php <html> <head> <title>upload form</title> </head> <body> <h3>your file uploaded...

php - Form button to redirect user to specific page -

i have function on page takes user page if action equal 'add'. want create button me without typing &action=add url. the function looks this: function consultants_page() { if (isset($_get['action']) && $_get['action'] == 'add') { require( get_template_directory() . '/settings/pages/consultant_add.php' ); }else { require( get_template_directory() . '/settings/pages/consultant.php'); } } i need amend button link function, isn't working.. <form method="get" action="add"> <p class="submit"><input type="submit" name="add" id="submit" class="button button-primary" value="add"></p> </form> cheers something send variable "action" url: <form method="get" > <p class="submit"><input type="submit" name="action...

date - Teradata Get Week Number using SQL Code -

i wish week number date in teradata can see there solutions use sys calendar table use code week number week 28 example 6th 12th of july inclusive i have found code works fine when put date instead of cdate select ((cdate - ((extract(year cdate) - 1900) * 10000 + 0101 (date))) - ((cdate - date '0001-01-07') mod 7)  + 13) / 7 my date in format mm/dd/yy , when run error message select ((06/29/15 - ((extract(year 06/29/15) - 1900) * 10000 + 0101 (date))) - ((06/29/15 - date '0001-01-07') mod 7)  + 13) / 7 "user cannot perform operation on date" any appreciated a date format used casting string (= display), datatype date has no format, it's integer. 06/29/15 not date, it's calculation based on integers 6 / 29 / 15 results in integer zero. dates specified in iso format: date '2015-06-29' : ((date '2015-06-29' - ((extract(year date '2015-06-29') - 1900) * 10000 + 0101 (date))) - ((date ...

c# - How can I see Code Lens in Visual studio 2012? -

how can see code lens in visual studio 2012? don't want install vs2013.i want see how many references particular method of class same in vs2013? you can't. codelens available in vs2013 , depend on type of license (only in ultimate ). vs license compare . possibility see how many references particular method of class, think can use resharper functionality ("find usages").

Why is Google Analytics providing data when the tracking code is not yet even in place? -

i think other website using google analytics id of 1 of our websites. set new analytics property new site have not yet put tracking codes in place. when checked our analytics earlier today, new property reporting visits. how come? probably hacked our google analytics id. haven't placed codes on site i'm not sure if case. missing (probably due filter set up)? and if other website indeed using our google analytics id, there way me trace these sites? i configured our analytics monitor visits involve our hostname solve issue onwards. still, there other possible reasons?

Implement the Auth Class to the php file in laravel -

i want details of logged in user's name <?php echo auth::user()->name; ?> inside php file. the php file under views/layouts/profile.php i tried include inside profile.php make auth class available. <?php namespace app\http\controllers; require '../../../vendor/autoload.php'; use auth; ?> the autoload.php file loaded in properly. still getting error fatal error: class 'auth' not found error in profile.php . how can make available ? put use auth in respective controller.see dont need add use auth in view file , there no need add autolaod.php . then use <?php echo auth::user()->name; ?> in profile.php .

Why Magento search shows configurable products and simple products together? -

i have created configurable product , simple child products a1, a2 , a3. when search product name, search gives me a, a1, a2 , a3. however, if set child visibility not visible individually not duplicate search results, but way no longer able search child products sku. need able search products sku without getting duplicate results when searching product it's name. how achieve that? thank you. edit: i'll try put in other words: search name should output parent product. search sku should output child sku belongs to. the solution came far add new search meanings links products search term particular sku open child product sku. however, believe bad approach, requires manual creation of search term each child product. set children not visible then can add new attribute attribute sets use make configurable products, call childskus. make sure when make attribute set "use in quick search" , "use in advanced search" yes set "catalog in...

java - SPARK 1.4.0 file not found exception for truststore -

i using spark 1.4.0 hadoop-2.6.0. enabled ssl using spark.ssl.enabled . when submitting example job getting following exception in nodemanager logs. java.io.filenotfoundexception: c:\spark\conf\spark.truststore (the system cannot find path specified) when put truststore file in other drive (say d:) getting below exception java.io.filenotfoundexception: d:\spark_conf\spark.truststore (the device not ready) i have mentioned keystore , truststore location correctly. following spark configuration setup ssl , acls spark-defaults.conf spark.authenticate true spark.acls.enable true spark.admin.acls kumar spark.modify.acls kumar spark.ui.view.acls kumar spark.ssl.enabled true spark.ssl.enabledalgorithms tls_rsa_with_aes_128_cbc_sha,tls_rsa_with_aes_256_cbc_sha spark.ssl.keypassword password spark.ssl.keystore c:/spark/conf/spark.keystore spark.ssl.keystorepassword ...

Cordova Device and Application events -

i listen on events such application closing , device shut down run code (such logout feature) before application closes or device shut down / sleep events. is possible cordova/phonegap? looked plugins , found plugins powermanagement related events nothing these events. thanks you're not able listen on events onappclose nor ondeviceshutdown or onexit - these events don't exist . there events can triggered adding eventlistener code. example deviceready eventlistener document.addeventlistener("deviceready", yourcallbackfunction, false); the yourcallbackfunction fire when device has entered deviceready state. a documentation eventlisteners given cordova/phonegap can found here: cordova - eventlistener documentation as bipbip said in his answer , there possibilty trigger such events onunload attribute inside body tag, tested inside clean cordova application. <!doctype html> <html> <head> <!-- <m...

hbase - Can timerange scan skip storefiles and avoid fullscan? -

if try scan column family's data timerange, hbase avoid fullscan? speeking, hbase track anywhere timestamp range storefile? yes, keeps track of last modified time , creation time of block. so, skip scanning blocks fall out of timerange(last modified time , creation time of block). recommend using if can.

reactjs - ReferenceError: before is not defined (mocha/protractor) -

i using protractor mocha in react application. when trying use before() or after() functions gives me error: referenceerror: before not defined however using beforeeach() or aftereach() works fine. here how configured protractor.conf.js exports.config = { capabilities: { browsername: 'chrome' }, frameworks: ['mocha', 'chai'], onprepare: function() { browser.ignoresynchronization = true; } }; ps. full error: stacktrace: referenceerror: before not defined @ [object object].<anonymous> (/myapp/tests/e2e/routes.js:10:5) @ normalloader (/myapp/node_modules/babel-core/lib/babel/api/register/node.js:160:5) @ object.require.extensions.(anonymous function) [as .js] (/myapp/node_modules/babel-core/lib/babel/api/register/node.js:173:7) @ require (module.js:380:17) @ function.promise (/myapp/node_modules/protractor/node_modules/q/q.js:650:9) @ _fulfilled (/myapp/node_modules/protractor/node_modules/q...

Javascript array match with less complexity -

for example inputarray = [1, 4, 5, 9]; array1 = [1, 2, 3, 4, 5, 6, 7]; array2 = [8, 9, 10, 11, 12, 13, 14]; i match inputarray both array1 & array2.in current scenario 1,4,5 belongs array1 , 9 belongs second array.i expecting output outputarray1=[1,4,5] outputarray2=[9] suggest me best way problem.i mean less complexity.thanks in advance. at cost of space, can make hash objects , have constant time lookups contains instead of using o(n) indexof calls or loops: var inputarray = [1, 4, 5, 9]; var array1 = [1, 2, 3, 4, 5, 6, 7]; var array2 = [8, 9, 10, 11, 12, 13, 14]; var array1hash = object.create(null); var array2hash = object.create(null); var outputarray1 = []; var outputarray2 = []; array1.foreach(function(e) { array1hash[e] = true; }); array2.foreach(function(e) { array2hash[e] = true; }); inputarray.foreach(function(e) { if (e in array1hash) { outputarray1.push(e); } if (e in array2hash) { outputarray2.pus...

sql server - Passing parameters to BCP command in SSIS execute SQL task -

first of all, can pass parameters path in bcp command? i wrote query in exec sql task exec xp_cmdshell 'bcp "select * tlc.dbo.world_hosts" queryout `"c:\users\akshay.kapila\desktop\tlc\foreachlearn\dest\?.txt" -t -c -t '` i have given ? in path. want specific countries in place of that. held in variable "country".i using foreach loop creates rather should create file ex aus.txt,in.txt everytime loop runs specific value. can use way. if not, how can pass variable value path in bcp command? you can use variable sqlsourcetype in execute sql task. create variable hold bcp command, may like: "exec xp_cmdshell 'bcp \"select ''abc'' output\" queryout \"" + @[user::strfilename] + "\" -t -c -t '" here @[user::strfilename] dynamic file want generate. then in execute sql task, change sqlsourcetype variable, , select variable generated.

layout - Android - Send touch event to other views -

i trying achieve scroll effect, think can done because see apps implemented this. i have framelayout, in layout have: - recycler view - float view <framelayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.recyclerview android:layout_width="match_parent" android:layout_height="match_parent"/> <linearlayout // float layout here android:layout_width="match_parent" android:layout_height="100dp"> </linearlayout> </framelayout> when scroll recycler view, can see float view scroll also, when reaches top of screen, want stop there. have implemented after face new issue. because float view above recycler view, can not scroll when touch , scroll float view. in case float view seems consumes touch event recycler nothing. what want achieve when user want scroll recycler view should consume...

paypal - Why some Pay Pal Rest APIs are not available for some countries in LIVE transaction -

when tried integrate papal using restapis, transactions , working fine sandbox mode. in live payment api fails. when logged paypal account,the 'direct credit cards' permission not able make enable in live. shown msg : "disclaimer: unfortunately, due recent product changes in region, no longer able allow live dcc processing via restful apis canada. continually looking ways expand our services, please stay tuned. apologize inconvenience may cause."

c# - LinkedIn "The token used in the OAuth request is not valid. consumer Key: 'value of consumer key' " -

i have application in asp.net c#. in can post , post posted on users own linkedin account. getting exception the token used in oauth request not valid. consumer key:consumer key value responsereader = new streamreader(webrequest.getresponse().getresponsestream()); what meaning of exception? note: setting client api key consumer key , webrequest header contains oauth_token,realm,oauth_consumer_key,oauth_signature_method,oauth_token_secret, `oauth_signature`, `oauth_timestamp`, `oauth_nonce`, `oauth_verifier`, `oauth_version=1.0` but verifier , token secret blank. what should do? there can various events can cause access token become invalid: 1. life of access token expires: generally, lifetime of linkedin access token 60 days. in case time period elapsed, access token expires , becomes invalid. 2. user revokes permissions application linkedin.com: if user has revoked permissions application, access token becomes invalid. in both cases, applicat...

ios - Modify displayed tableview data for iphone -

i new in iphone development.i have 1 view controller contains tableview , custom cell there uitableviewcell contains favorite button twitter favorite button.i using afnetworking sending , post request , response comming in json format.after parse json displaying json in tableview.the json getting below { "user_id" = 328; "user_name" = "ios.dev";"user_lname" = "imac";} { "user_id" = 318; "user_name" = "ios.dev1";"user_lname" = "imac1";} { "user_id" = 358; "user_name" = "ios.dev2";"user_lname" = "imac2";} { "user_id" = 328; "user_name" = "ios.dev3";"user_lname" = "imac3";} { "user_id" = 338; "user_name" = "ios.dev4";"user_lname" = "imac4";} there 1 favorite button on tableview cell. when clicking on button response comming server.supp...

asp.net - Increasing application pool session time out not working -

in project, need hold session 720 minutes using forms authentication set 1440 (session*2) , when hosting iis session time out became default 20 minutes changed application pool idle time-out(minutes) 720 . suggested many , session time out happening after 20 minutes .i dont know why happening . using iis (7.5). 1 please me. been more 1 day searching through internet ,i cant find proper answer nb: forms authentication works fine website session.timeout work when less application pool session timeout value; because whenever application pool session timeout value reached, particular application pool restarted. have 2 things: application pool has own session timeout value, , web site has session timeout value. microsoft has given parameter session.timeout change website session timeout value. not application session timeout value. have understand 1 thing here: have make sure application pool session timeout value greater website session timeout value; session.timeout parameter...