Posts

Showing posts from March, 2014

html - @font-face iPad not working -

html - @font-face iPad not working - i'm using next code embed webfont: @font-face { font-family: 'latoregular'; src: url('lato-reg-webfont.eot'); src: url('lato-reg-webfont.eot?#iefix') format('embedded-opentype'), url('lato-reg-webfont.woff') format('woff'), url('lato-reg-webfont.ttf') format('truetype'), url('lato-reg-webfont.svg#latoregular') format('svg'); font-weight: normal; font-style: normal; } it works on apart ipad, on ipad shows back-up font instead, i'm finding unusual works on iphone. has run issue before? i've tried in both chrome ipad , safari ipad , no luck. html css fonts

r - Controlling how a date-time object is printed without coercing to a character? -

r - Controlling how a date-time object is printed without coercing to a character? - imagine have info frame in columns represent dates or times. when working these columns, convenient have them formatted posixlt objects (or other explicitly date/time oriented class). however, when display these columns screen or print them out .csv, total iso8601 formatted time. realize can turn times character vector formatted want using format(col, format="%m-%y") or whatever have in mind, i'm not keen on changing class of object print. other objects in r have print methods associated them, don't have explicitly coerce them. there way of date time classes of r objects i've overlooked? edit: here's minimal illustration of i'd hope achieve: a.datetime = sys.time() a.datetime displays: 2014-06-23 09:32:12 which format out in csv write.csv(data.frame(a.datetime), "example.csv") as describe above, realize can coerce character ...

Hybrid Authentication with asp.net Identity and Android Authorization -

Hybrid Authentication with asp.net Identity and Android Authorization - i'm doing website in asp uses identity (v2.0) , android app connected web site through web api. i've configured identity utilize google oauth signins , works quite well. right i'm trying create web api app , need authenticate mobile users. i've reached point configure identity manage bearer tokens api. perform signin, way i've found through user , password documentation says: grant_type=password&username=user&password=pass or perform oauth challenge web. as android manages google oauth. there way configure identity perform signins using google oauth? i have neither found way manage external bearer tokens or utilize google authentication tokens signing web api identity. maybe i'm misunderstanding something. thanks in advance. update ok, somehow i've found how it. in android, id token using scope audience:server: ingoogle "accounts authenticati...

neo4j - How to explain the performance of Cypher's LOAD CSV clause? -

neo4j - How to explain the performance of Cypher's LOAD CSV clause? - i'm using cypher's load csv syntax in neo4j 2.1.2. far it's been huge improvement on more manual etl process required in previous versions. i'm running behavior in single case that's not i'd expect , wonder if i'm missing something. the cypher query beingness used this: using periodic commit 500 load csv 'file:///users/james/desktop/import/dependency_sets_short.csv' row match (s:sense {uid: toint(row[4])}) merge (ds:dependencyset {label: row[2]}) on create set ds.optional=(row[3] = 't') create (s)-[:has]->(ds) here's couple of lines of csv: 227303,1,to-purpose-nominal,t,73830 334471,1,at-location,t,92048 334470,1,at-time,t,92048 334469,1,on-location,t,92048 227302,1,to-purpose-infinitive,t,73830 116008,1,to-location,t,68204 116007,1,in-location,t,68204 227301,1,to-location,t,73830 334468,1,on-date,t,92048 116006,1,at-location,t,68204 334467,1,wi...

css - Stop from moving when scrolling webpage in HTML -

css - Stop <p> from moving when scrolling webpage in HTML - in page, paragraph element scroll if scroll background stays fixed. want background , paragraph elements remain fixed while next div appears. it's hard in words, want first div, landing page, deed if blind on window. scrolling replace bottom of first div corresponding bottom part of sec div, pulling blinds on window. here's jsfiddle http://jsfiddle.net/2ct4z/1/. i want create text block fixed , scroll page bottom of sec page appears going downwards up. css code: #slide-1 .bcg { background-image:url('http://1.bp.blogspot.com/_29xyrbnmna8/ti5l2xiddci/aaaaaaaaalk/gsip4fvurku/s1600/woods.jpg'); background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; height: 700px; width: 100%; } html css

node.js - Can we send data with redirect in node -

node.js - Can we send data with redirect in node - i trying send info redirect as: this.redirect("/home",{message:'hello'}); but got result like: undefined redirect home if faced problem, please help. using framework: locomotive yes, can utilize express-flash: app.use(flash()); ... app.get('/redirect', function (req, res) { req.flash('info', 'flash message added'); res.redirect('/'); }); you info acessile in res.locals.messages in views in messages var. express flash based on connect flash. uses sessions transmit messages. if using locomotive locomotive builds on express, preserving powerfulness , simplicity you've come expect node. so: module.exports = function() { ... this.use(express.bodyparser()); this.use(express.session({ secret: 'keyboard cat' })); this.use(flash()); ... } node.js

php - nginx headers set via curl -

php - nginx headers set via curl - i seem have nail brick wall in dealing headers. place can think problem is, nginx configuration. i making request via curl on command line: curl -h "user-id: 1" -h "user-token: $2y$10$vgxt0cfs7uozhyqouh9caenshb2kohs3vhyl1l8w01qzd2kikfogg" http://dev.api/account using http scoop can see request headers: user-agent → curl/7.30.0 user-session → $2y$10$vgxt0cfs7uozhyqouh9caenshb2kohs3vhyl1l8w01qzd2kikfogg user-id → 1 host → dev.api take → */* then response is cache-control → no-cache connection → keep-alive content-type → text/html; charset=utf-8 date → fri, 20 jun 2014 03:11:02 gmt server → nginx/1.6.0 transfer-encoding → chunked x-frame-options → sameorigin x-powered-by → php/5.4.28 is there in nginx prevent headers request passed response? i don`t know mechanism header, special headers add together directives location or server context: add_header user-session $http_user_session ad...

ssh - git commiting changes on openshift server -

ssh - git commiting changes on openshift server - i'm running statamic flat file scheme (database-less) cms on openshift. the issue i'm having when update content on server (i.e. using cms) changes made flat files (i.e. content) isn't committed git repo. so, when force new changes website local repo, wind writing on each time there's git push. if git pull, nada because remote server doesn't know changes (they haven't been committed yet) what need able create git commit changes happen on server. sadly, doesn't work. tried ssh in , has no thought there's git repo. build process use. ideally, i'd find way automatically commit changes on server can pull them downwards without ssh in commit. gets job done huge win @ point. you need store flat-file databases in ~/app-root/data directory instead of repo directory. repo directory gets removed on each git push. recommendation find out names , locations of flat files are, , symlink dir...

javascript - How can i stop my animation circle ? - JS -

javascript - How can i stop my animation circle ? - JS - i'm doing game javascript using function, know it's not best method i'm still learning prototypes before steping in utilize them. so, point, have request animatation frame calls him self function maintain executing. problem when player dies want stop enemys created , basicaly, stop functions execution. improve show code. animation function: function animate() { if (endgame() == true) { return; } requestanimationframe(animate); if(thebird == null && cancontinue == true) { thebird = getbird(); // variavel com div bird settimeout(createdrake(), math.round(math.random() * 800)); settimeout(createbrick(), math.round(math.random() * 3000)); settimeout(createboss(), math.round(1000 + math.random() * 15000)); settimeout(createpowerup(), math.round(math.random() * 15000)); document...

Accounting issues using PayPal with Recurring Payments -

Accounting issues using PayPal with Recurring Payments - i know , understand when create recurring payments profile, need supply info displayed profile , it's associated transactions... e.g. payment details item fields: l_paymentrequest_n_namem l_paymentrequest_n_descm l_paymentrequest_n_numberm but after supplying on first sale - need show item id , item title first sale, recurring sale of same original purchase , refund if client refunded portion of first sale or recurring sale. in short, total life cycle of customers sales of product should easy business relationship each transaction having same item id , item title. e.g. ideal be.... customer x buys subscription , subscription b item id , item title shown in history download next month charged subscription , subscription b again item id , item title shown in history download again then cancel subscription a next month charged subscription b again item id , item title shown in history download ...

Faster way to insert data in neo4j? -

Faster way to insert data in neo4j? - i trying insert unique nodes , relationship in neo4j. what using :- neo4j community edition running on amazon ec2.[amazon linux m3.large] neo4j java rest binding [ https://github.com/neo4j-contrib/java-rest-binding ] data size , type : tsv file [multiple]. each contains more 8 1000000 lines [each line represent node or relationship].there more 10 files nodes.[= 2 1000000 nodes] , 2 1000000 relations. i using uniquenodefactory inserting nodes. , inserting sequentially, couldn't find way insert batches preserving unique nodes. the problem is taking huge time insert data. illustration took day inserting 0.3 1000000 unique nodes. there way fasten insertion? don't that. java-rest-binding never made that. use either using periodic commit 1000 load csv headers "http://some.url" line create (u:user {name:line.name}) you can utilize merge (with constraints), create relationships etc. see blog post ...

angularjs - Angular service which is a require js module, is not getting the injected dependencies -

angularjs - Angular service which is a require js module, is not getting the injected dependencies - i have module 'global.services' in registered service "restservices" (function(define, angular) { "use strict"; define(["global/services/restservices"], function(restservices) { var modulename = "global.services"; angular.module(modulename, []) .config(function(restangularprovider) { restangularprovider.setbaseurl('http://localhost:8888/src/app/data/'); restangularprovider.setrequestsuffix('.json'); }) .factory('restservices', restservices); homecoming modulename; }); }(define, angular)); and "restservice" module (function(define, angular) { "use strict"; define(function() { var restservice = function($rootscope, restangular) { // body... homecoming { ...

Why is there a gear icon and not my app's logo on iOS Facebook permission confirm screen? -

Why is there a gear icon and not my app's logo on iOS Facebook permission confirm screen? - i'm requesting "public_profile", "email", "user_friends", "user_birthday", "user_location" info iphone app users' , on facebook app settings, i've configured app's 1024 x 1024 logo. when app asks first time permission, app's logo visible on permission confirm screen of facebook web login. in consequent permission requests, facebook sdk shows confirm page shown here, there's gear icon instead of app's icon , user's profile photo. in app of mine, doesn't happen , can see app's icon , user's profile photo. compared settings couldn't grab difference. must missing can't figure out. i'm using facebook-ios-sdk v3.14. do have ideas? it looks facebook intended behavior after latest sdk release. here i've found related facebook bug study , have closed "by design...

javascript - jQuery load() function not setting global variable? -

javascript - jQuery load() function not setting global variable? - this question has reply here: why variable unaltered after modify within of function? - asynchronous code reference 6 answers not sure why figured out here can educate me bit on this. looking set global variable based off jquery loaded object. in case loading original image size server can proportionally resize programatically. stumped why can alert or console log height , width cannot set variable retrieved values outside callback function? html: <img src='someimage.jpg' /> js/jquery: var imgheight, imgwidth; $("img").load(function() { imgheight = $(this).height(); imgwidth = $(this).width(); console.log(imgwidth + " x " + imgheight); // works }); console.log(imgwidth + " x " + imgheight); // not is timing issue , improve solution load ...

http post - xcode - uploading an image with form parameters to a webserver -

http post - xcode - uploading an image with form parameters to a webserver - i tring upload image 3 parameters fror form webserver unsuccessful. my code is: -(ibaction)uploadphoto:(id)sender{ nsstring *urlstring = @"https://urlwebservice"; nsurl *url = [nsurl urlwithstring:urlstring]; nsstring *servername = @"user"; nsstring *serverpassword = @"password"; // create plaintext string in format username:password nsstring *authstr = [nsstring stringwithformat:@"%@:%@", servername, serverpassword]; nsdata *authdata = [authstr datausingencoding:nsutf8stringencoding]; nsstring *authvalue = [nsstring stringwithformat:@"basic %@", [base64 encode:authdata ]]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl: url cachepolicy: nsurlrequestuseprotocolcachepolicy ...

How would I read and write from multiple files in a single directory? Python -

How would I read and write from multiple files in a single directory? Python - i writing python code , more insight on how approach issue. i trying read in multiple files in order end .log. this, hope write specific values .csv file. within text file, there x/y values extracted below: textfile.log: x/y = 5 x/y = 6 textfile.log.2: x/y = 7 x/y = 8 desiredoutput in csv file: 5 6 7 8 here code i've come far: def readfile(): import os = 0 file in os.listdir("\mydir"): if file.endswith(".log"): homecoming file def main (): import re list = [] list = readfile() line in readfile(): x = re.search(r'(?<=x/y = )\d+', line) if x: list.append(x.group()) else: break f = csv.write(open(output, "wb")) while 1: ...

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel - a pci compliance scanner balking self signed ssl certificate protecting secure access plesk panel contains name mismatch between location of plesk panel , name on certificate, namely self-signed cert's name "parallels" , domain reach plesk 'ip address:8443'. so figured go ahead , free ssl certificate seek fiddle error. when generated certificate used server domain name site name when generated certificate. if visit 'domain name:8443' fine, no ssl warning. if visit 'ip address:8443' (which believe scanner does) certificate name mismatch error, digicert's ssl checker says certificate name should ip address. can generate certificate mutual name ip address? tempted should pci scanner accepts, right mutual name use? run issue before? you can seek subject alternative name extension ip address. also, can maintain "parallels" mutual name, , add together ...

oracle - Case expression in where clause PL/SQL -

oracle - Case expression in where clause PL/SQL - how query in pl/sql? declare l_batch_type number := 1; select * table t case when l_batch_type = 1 ('a', 'b') when l_batch_type = 2 ('c', 'd') when l_batch_type = 3 ('e', 'f') when l_batch_type null null end in t.batch_type; i'm getting sql error: ora-00907: missing right parenthesis wrong ('x','y') values , in operator, can't figure out how match right syntax. thanks! you'd want utilize simple boolean logic rather putting case statement in where clause where (l_batch_type = 1 , t.batch_type in ('a', 'b')) or (l_batch_type = 2 , t.batch_type in ('c', 'd')) or (l_batch_type = 3 , t.batch_type in ('e', 'f')) since null never equal (and never unequal anything), i'm not sure whether l_batch_type null status intended add together logic. oracle plsq...

c# - Emgu CV stitching two images together of different sizes -

c# - Emgu CV stitching two images together of different sizes - i have 2 images want stitch together. images 2 different sizes (one main image , other little legend). i'm doing: [stathread] static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); long matchtime; string modelpath = "c:/emgu/emgucv-windows-universal-cuda 2.9.0.1922/emgu.cv.example/surffeature/model images"; using (image<gray, byte> observedimage = new image<gray, byte>("c:/emgu/emgucv-windows-universal-cuda 2.9.0.1922/emgu.cv.example/surffeature/test images/fridge4.jpg")) { //returns 2 different sized images image<bgr, byte>[] results = drawmatches.drawallmatches(modelpath, observedimage, out matchtime); imageviewer.show(results[0], string.format("matched using {0} in {1} milliseconds", gpuinvoke.hascuda ? "gpu" : "cpu", matchtime)); ...

Excel VBA runtime error 1004 when reading Range addresses of multiple files -

Excel VBA runtime error 1004 when reading Range addresses of multiple files - i have read several other posts related error, still can't figure out what's wrong macro. my macro loops through 1000 files in 1 folder, finding keywords , extracting columns below. it until, after checking aroun 250 files, 1 of counter variables hits number 66,593. lastcell= cells(i + rowscopied - 1, 1).address(xla1) lastcell id string type, lastly value $a$66592 long type, lastly value 66,593 rowscopied long type, lastly value 22. i tried changing varianle types double, , variant, problem persists. suggestions? in advance. excel vba excel-vba

Can't add files in perforce -

Can't add files in perforce - as far can tell, client setup correctly: $ p4 client -o # perforce client specification. # ... client: stephen-dev1-stephen update: 2014/06/26 17:41:14 access: 2014/06/26 17:45:47 owner: stephenrasku host: stephen-dev1 description: created stephenrasku. root: /home/stephen/code options: noallwrite noclobber nocompress unlocked nomodtime rmdir submitoptions: submitunchanged lineend: local view: //depot/labs/products/component/spamview-uri/... //stephen-dev1-stephen/spamview-uri/... //version/... //stephen-dev1-stephen/version/... //thirdparty/... //stephen-dev1-stephen/thirdparty/... //starteam/... //stephen-dev1-stephen/starteam/... //specs/... //stephen-dev1-stephen/specs/... //release/... //stephen-dev1-stephen/release/... //projects/... //stephen-dev1-stephen/projects/... //main/... //stephen-dev1-stephen/main/... //features/... //stephen-dev1-stephen/features/... //dev/... /...

html5 - Submit form as "multipart/form-data" but content-type is “application/x-www-form-urlencoded” on the server -

html5 - Submit form as "multipart/form-data" but content-type is “application/x-www-form-urlencoded” on the server - i'm trying submit form includes file, i'm using enctype="multipart/form-data" request content-type sent “application/x-www-form-urlencoded”, part of code: <div id="uploadtest" data-role="page" align="right"> <form id="uploadtestform" action="/upload" method="post" enctype="multipart/form-data"> <input type="text" name="text" autofocus required> <input id="imagefile" type="file" data-clear-btn="false" name="image" accept="image/*" capture> <button type="submit" data-theme="a">upload</button> </form> </div> this part of html5 application need upload file. there no js code run...

ios - iOS7 background fetch? -

ios - iOS7 background fetch? - in app want send info server using ios 7 background fetch feature.i selected background fetch check box in capabilities section of target(and of course of study flag added in plist automatically). in appdelegate did : - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [application setminimumbackgroundfetchinterval:uiapplicationbackgroundfetchintervalminimum]; //[application setminimumbackgroundfetchinterval:10]; tried homecoming yes; } and in delegate method did this: -(void)application:(uiapplication *)application performfetchwithcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler{ locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; locationmanager.desiredaccuracy = kcllocationaccuracybest; locationmanager.distancefilter = 50.0; [locationmanager startupdatinglocation]; ...

oracle - Clob column java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column -

oracle - Clob column java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column - insertsql = "insert telbp_input_log (serial_no, input_xml) values (?, ?)"; statement = connection.preparestatement(insertsql); statement.setstring(1, serialno); statement.setstring(2, inxml); //statement.setstring(2, "test"); insertcount = statement.executeupdate(); when programme run executeupdate(), error java.sql.sqlexception: ora-01461: can bind long value insert long column is thrown, if re-create value of serialno , inxml , run in sql developer, no error prompted, reason? oracle version:oracle database 10g enterprise edition release 10.2.0.4.0 - 64bi column: serial_no varchar2(22) input_xml clob websphere:websphere 5.1 jdbc: both ojdbc14 , ojdbc6 tried, both has same error you cannot write string clob column. instead of statement.setstring(2, inxml); use statement.setclob(2, xmlclob); you fi...

UnboundId - Response Control from Search Result -

UnboundId - Response Control from Search Result - i using unboundid sdk searching ldap , using simplepagedresultscontrol paging results. able search , first set of desired results based on page size, not able retrieve subsequent set of results because response command object coming searchresult null. need retrieve cookie value , set in next search request search request go on retrieving remaining results. i using similar code given in unboundid sdk website , other sites. help resolve appreciated. // perform search retrieve users in server, retrieving // 10 @ time. int numsearches = 0; int totalentriesreturned = 0; searchrequest searchrequest = new searchrequest("dc=example,dc=com", searchscope.sub, filter.createequalityfilter("objectclass", "person")); asn1octetstring resumecookie = null; while (true) { searchrequest.setcontrols( new simplepagedresultscontrol(10, resumecookie)); searchresult searchresult = connection.search(se...

c# - Can I enforce that fields in a POCO are only ever set in a type initialiser? -

c# - Can I enforce that fields in a POCO are only ever set in a type initialiser? - if have poco such this: [poco] public class mypoco { public string firstname { get; set; } public string lastname { get; set; } public string address { get; set; } } ... , it's initialised this: new mypoco { firstname = "joe", lastname="bloggs", address="123 abc st." } can i, using cql in ndepend, ensure properties ever set using object initialiser above, , not separately. i'm trying grab code this: mypoco.firstname="john"; dosomething(mypoco); ... don't want people set properties on existing poco. understand can create setters private , don't passing in properties in constructor because end signature such mypoco(string, string, string) - making easier misalign parameters (easier using object initialiser syntax) so, want grab using ndepend. here's start of cql query: from f in justmycode.fields.wh...

html - Change div content while scrolling using jQuery -

html - Change div content while scrolling using jQuery - i have fixed div box on right, , want create page scrolls, content in box changes according content on left corresponds using need help because don't know how using jquery. here illustration animation of mean: this question shows very little way of effort, started, utilize bootstrap scrollspy , hide links without active class. if doesn't meet needs, please utilize starting point inquire more focused question in future. demo in fiddle first, setup of section headers list items this: class="lang-html prettyprint-override"> <div id="sidebar"> <ul class="nav"> <li><a href="#content1">content 1</a></li> <li><a href="#content2">content 2</a></li> <li><a href="#content3">content 3</a></li> </ul> lorem ipsum </d...

php - Throw exception if value not passed to method -

php - Throw exception if value not passed to method - instead of normal php error, possible throw exception if value not passed method? $obj=new foo(); $obj->bar(null); //this okay $obj->bar(); //this should throw error class foo { public function bar($value) {} } it seems not best thought handle missing arguments ourselves (we have default values that), interested how accomplish this. after looking solutions here , there, i've came following: <?php class foo { function warning_handler($errno, $errstr) { // compare strings because don't have particular warning number if (strpos($errstr, 'missing argument 1') === 0) { // throw exception or whatever want handle situation throw new exception('custom handler: first argument missing'); } // execute original error handler homecoming false; } function __call($name, $arguments) { // if required, ...

asp.net mvc - Validation Message MVC -

asp.net mvc - Validation Message MVC - my code followed , error message not displayed: index.cshtml @model webapp.models.orderitems @using (html.beginform("savetodb", "home", formmethod.post, new { @class = "form-group", role = "form" })) { @html.partial("information") } partial : information.cshtml @model webapp.models.orderitems <div class="col-lg-4"> <div class="form-group"> <label for="input1" class="col-lg-4 control-label">@html.labelfor(model => model.clinfo.clientname)</label> @html.editorfor(model => model.clinfo.clientname, new { style = "width:250px" }) @html.validationmessagefor(model => model.clinfo.clientname) </div> </div> model : public class orderitems { public infoclinfo{ get; set; } } model : class infos public class info { [display(name = "clie...

Custom Table in html -

Custom Table in html - i need create custom table through html. html skills not best. although tried many things, couldn't want. here can see how want table. any idea? here code: <style type="text/css"> .tg {border-collapse:collapse;border-spacing:0;} .tg td{font-family:arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tg th{font-family:arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} </style> <table class="tg"> <tr> <th class="tg-031e" colspan="3">title</th> </tr> <tr> <td class="tg-031e">col 1</td> <td class="tg-031e">col 2</td> <td class="tg-031e">col 3</td> </tr> <tr> <td class="tg-031e">row...

javascript - jquery simple dropdown multiple trigger -

javascript - jquery simple dropdown multiple trigger - i'm trying build simple jquery dropdown 2 dropdown menus. here jquery code i'm using: $('.mydropdown .classes .logo').mouseenter(function(){ $('.mydropdown .classes .dropdown.class-dropdown').slideup(300, function(){ $('.mydropdown .classes .dropdown.school-dropdown').slidedown(); }); }); $('.mydropdown .classes .name').mouseenter(function(){ $('.mydropdown .classes .dropdown.school-dropdown').slideup(300, function(){ $('.mydropdown .classes .dropdown.class-dropdown').slidedown(); }); }); $('.mydropdown .classes ').mouseleave(function(){ $('.mydropdown .classes .dropdown').slideup(); }); my issue is: i'm getting multiple fires of slidedown , slideup actions how ever many times mouse moves in , out logo or name elements, giving bounce type effect until number of mouse ins , outs has finished. i tried using ...

javascript - How can i activate a second joyride tour -

javascript - How can i activate a second joyride tour - i have problem joyride tour ,when finsish 1 tour want start sec 1 .what seek execute seconde tour in postridecallback ,but end looping first tour .does knows how prepare this? function preview(){ $('#joyridetipcontent').joyride({ autostart : true, prestepcallback : function(index, tip) { console.log(index); }, poststepcallback : function(index, tip) { }, postridecallback : function(index, tip) { console.log("stop1"); preview2(); console.log("stop1.1"); }, tiplocation:"left", modal : true, expose : true }); } function preview2(){ console.log("stop2.0"); $('#joyridetipcontent2').joyride({ prestepcallback : function(index, tip) { console.log("stop21.0"); }, poststepcallback : function(...

Send email in Java via relay server -

Send email in Java via relay server - i running java web application , attempting send email notifications it. when hosting application on 1 of our servers worked fine. pointed smtp.gmail.com on port 25 , messages able sent. but hosting on 1 of our client's servers security purposes. happen block smtp domains , allow own (smtprelay.companyname.com). changed host in code, authentication failing. is possible still authenticate gmail business relationship while using company's relay server send emails? best solution? below relevant portion of code. content = "message content"; list<string> recipients = list_of_recipient_email_addresses; properties props = new properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtprelay.companyname.com"); props.put("mail.smtp.port", "25"); ...

Perl date difference which are in different formats -

Perl date difference which are in different formats - i have 2 dates below in perl code- my $asof_date; chomp($asof_date = `date +'%m/%d/%y'`); and date coming sql table - $date = $syb_row[3]; here $date in form of "dec 20 2013 12:00am" now help calculate maturity-where maturity difference in days between 2 dates(i.e $asof_date & $date in above case) divided 365. and yes have limited module installed parsedate not installed. thanks in advance. use strict; utilize warnings; utilize datetime; utilize datetime::format::strptime; ...; $db_parse = datetime::format::strptime->new( pattern => '%b %d %y %r%p', locale => 'en_us', time_zone => 'america/new york', ### olson tz name ); $asof_date = datetime->now(time_zone => 'local'); $db_date = $db_parse->parse_datetime($syb_row[3]); $maturity = $asof_date->delta_days($db_date)->days / 365; perl

ruby - Chef default nginx recipe - TypeError cant convert symbol to integer -

ruby - Chef default nginx recipe - TypeError cant convert symbol to integer - i next peepcode chef tutorial. created next nginx default.rb file - package "nginx" service "nginx" supports :status => true, :restart => true, :reload => true action[ :enable, :start] end template "/etc/nginx/nginx.conf" notifies :reload, "service[nginx]" end i run chef-solo -j /etc/chef/node.json , next error - typeerror --------- can't convert symbol integer cookbook trace: --------------- /cookbooks/nginx/recipes/default.rb:5:in `[]' /cookbooks/nginx/recipes/default.rb:5:in `block in from_file' /cookbooks/nginx/recipes/default.rb:3:in `from_file' relevant file content: ---------------------- /cookbooks/nginx/recipes/default.rb: 1: bundle "nginx" 2: 3: service "nginx" 4: supports :status => true, :restart => true, :reload => true 5>> action[ :e...

php - 404 Page wont show / no .htaccess Wordpress -

php - 404 Page wont show / no .htaccess Wordpress - i want show 404 error page when ever gets on non working / non created page. after long time of searching on web couldnt find solution post 1 myself. dont have .htaccess file either created filled in in ftp kept saying nil safed in there , didnt show bytes thats im worried of. so how can .htaccess file work , show 404 error page template? followed steps create 404.php file dont mind redirected same template made page of solutions fine. you've got rewrite rules in .htaccess file preventing 404 error every happening... rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] that states if requested resource neither file nor directory (basically 404 error), redirect /index.php try in .htaccess: # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / # delete line below have /index.php/anything trigger 404 rewriterule ^index\.php$ -...

Google Spreadsheets : Adding a list row (Example Error) -

Google Spreadsheets : Adding a list row (Example Error) - google spreadsheets api version 3.0 adding list row https://developers.google.com/google-apps/spreadsheets/#sorting_rows example(adding list row ) listentry row = feed.getentries.get(0); >>> error! you should correct listentry row = listfeed.getentries().get(0); >>> correct! p.s. don't waste time. google-apps-script

php - Functional Test in Symfony fake HTTP_ACCEPT_LANGUAGE -

php - Functional Test in Symfony fake HTTP_ACCEPT_LANGUAGE - i want functional test symfony2 check if users profile displayed , if form working: namespace dbe\ddbundle\tests\controller; use symfony\bundle\frameworkbundle\test\webtestcase; class profilecontrollertest extends webtestcase { public function testnewsletteronoff(){ // create new client browse application $client = static::createclient(); $client->request('get', '/', array(), array(), array( 'http_accept_language' => 'en', )); $crawler = $client->request('get', '/en/profile/'); after executing test in console: phpunit -c app next error message: there 1 error: 1) dbe\ddbundle\tests\controller\profilecontrollertest::testnewsletteronoff undefined index: http_accept_language i guess error comes because controller checking browsers language. how can false http_accept_language in functional tests symfony? in ad...

php - SQL insert and update in the same time -

php - SQL insert and update in the same time - hey have query insert table new info , want in same time update outher table id of new info have entered. ex: mysql_query("insert `test` (`name`) values ('mark')"); $query = mysql_query("select `id` `test` `name` = 'mark'"); $id = mysql_result($query,0); mysql_quey("update `test2` set `test_id` = $id `name` = 'mark'"); how do @ same time? because doing way insert new info , dont update other. cumps. try : mysql_query("insert `test` (`name`) values ('mark')"); $id = mysql_insert_id(); mysql_quey("update `test2` set `test_id` = $id `name` = 'mark'"); i've changed backticks single quotes in first insert values, backticks should never used field values. also i've changed utilize 2 queries, mysql_insert_id() lastly inserted id without needing query it. ref : http://www.php.net/manual/en/function.mysql-insert-id...

Add CSS class to all images in Joomla articles using PHP -

Add CSS class to all images in Joomla articles using PHP - i have installed plugin called nice watermark (on joomla 3 site) adds watermark images class (in case <img class="waterm" src="/images/wm/idx-homepage3cfotoby0.jpg" alt=""> ) possible utilize php add together css class images before site loaded? or better, target images part of article (i don't want watermark icons , other template images)? i thinking plugin finds <img src=.../> tags in code , adds class, i'm not sure how attack problem. maybe can point me in right direction? edit: i've created joomla plugin next code, , works, adds finish html construction ( <!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/tr/rec-html40/loose.dtd"> <html><body><p><img... around images. how can avoid this? <?php // no direct access defined('_jexec') or die; jimport('joomla....

c# - DependencyProperty's value is null when method in attached property's class is called -

c# - DependencyProperty's value is null when method in attached property's class is called - we have been working finish day on problem , have summed little example. converting project silverlight wpf, in silverlight both versions work, in wpf 1 does. we have simple command string-type dependencyproperty this: public class mycontrol : command { public string text { { homecoming (string)getvalue(textproperty); } set { setvalue(textproperty, value); } } public static readonly dependencyproperty textproperty = dependencyproperty.register("text", typeof(string), typeof(mycontrol), new propertymetadata(null, textchanged)); private static void textchanged(dependencyobject d, dependencypropertychangedeventargs e) { } } then have class attached property follows: public class myattachedproperty { public static readonly dependencyproperty descriptionproperty = dependencyproperty.registerattached("description", typeof...

javascript - How to re-write _.every/_.all from Underscore.js using _.reduce (and _.each) -

javascript - How to re-write _.every/_.all from Underscore.js using _.reduce (and _.each) - i'm working on re-writing underlying code many of standard underscore.js functions work on javascript skills , bit stuck _.every / _.all . appears in library itself, _.every / _.all function written using existing _.each function, beingness encouraged write version using version of _.reduce (which incorporates version of _.each ). i've provided code both functions below. the first test _.every function (see below well) fails 1 false values passed in using _.identity function (simply homecoming value entered argument) iterator: test: it('fails collection of all-falsy results', function() { expect(_.every([null, 0, undefined], _.identity)).to.equal(false); }); i have few questions why _.every function failing test shown above, along multiple other tests (e.g.; mixed true/false values, undefined values, etc.): -when calling iterator function, need ...

go - golang - Elem Vs Indirect in the reflect package -

go - golang - Elem Vs Indirect in the reflect package - from docs func (v value) elem() value elem returns value interface v contains or pointer v points to. panics if v's kind not interface or ptr. returns 0 value if v nil. func indirect(v value) value indirect returns value v points to. if v nil pointer, indirect returns 0 value. if v not pointer, indirect returns v. so can safely assume following? reflect.indirect(reflect.valueof(somex)) === reflect.valueof(somex).elem(). is indirect method convenience method right hand side of above? if reflect.value pointer, v.elem() equivalent reflect.indirect(v) . if not pointer, not equivalent: if value interface reflect.indirect(v) homecoming same value, while v.elem() homecoming contained dynamic value. if value else, v.elem() panic. the reflect.indirect helper intended cases want take either particular type, or pointer type. 1 illustration database/sql conversion routines: using reflect.i...

r - How to deal with double braces in code chunk? -

r - How to deal with double braces in code chunk? - i writing rmd files introducing whisker package. , utilize slidify compile html slides. therefore inevitable utilize {{ , }} in code. wrote next code in rmd file: ```{r} tpl <- " <b>against:</b> {{x.against}}<br/> <b>venue:</b> {{x.venue}}<br/> <b>match:</b> {{x.type}}<br/> <b>score:</b> {{x.score}}<br/> <b>result:</b> <span class={{x.result}}>{{x.result}}</span><br/> {{#x.sr}}<b>strike rate:</b> {{x.sr}} {{/x.sr}} " ``` but in parsed html file, braces , content within ignored: <pre><code class="r">tpl &lt;- &quot; &lt;b&gt;against:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;venue:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;match:&lt;/b&gt; &lt;br/&gt; &lt;b&gt;score:&lt;/b&gt; &lt;br/...

azure - Lucene BooleanQuery - Must be present in one of two columns -

azure - Lucene BooleanQuery - Must be present in one of two columns - not sure how format query in lucene. scenario search term must nowadays in 1 of 2 columns (either 1 fine). boolquery.add(query1, occur.must) 'this 1 fine boolquery.add(query2, occur.should) boolquery.add(query3, occur.should) brings results when search term not nowadays @ in column 2 , column 3. boolquery.add(query2, occur.must) boolquery.add(query3, occur.should) does not bring results when search term nowadays in column 3 not in column 2. how format query equivalent of this: where column 1= val1 , (column 2 = val2 or column 3 = val2) must, name suggests, makes occurrence mandatory. should means optional. first boolean query match documents nail first clause, if of them can nail sec or 3rd clause, score higher. results match desired linq (i assume that's is) statement, should work (using java). booleanquery q = new booleanquery(); booleanquery subquery = new boo...

android - Can not send list of objects into the intents of two activities -

android - Can not send list of objects into the intents of two activities - in 1 activity using 2 tabs, 1 of them show list of points on map. sec tab show items list. i using next code not work. still not able send the same list of service (servicelst) 2 activity (map , list). using code, bout not working. help me alter or propose else : private arraylist<service> servicelst; public class maporlist extends tabactivity { protected void oncreate(bundle savedinstancestate) { ... setuptab("liste", "tab1", getonlistintent()); setuptab("carte", "tab2", getonmapintent()); } private intent getonlistintent() { intent in = new intent(getapplicationcontext(), pharmacieproximite.class); bundle bundle = new bundle(); bundle.putparcelablearraylist("services_lst", servicelst); in.putextras(...

Decoding html entities but keeping ampersand entity encoded in ASP.NET MVC5 Razor -

Decoding html entities but keeping ampersand entity encoded in ASP.NET MVC5 Razor - when rendering html in view, i'd display html entities encoded in text i'm displaying. can accomplish @html.raw() . when comes ampersand entity though, @html.raw() rendered & , not &amp; , not valid html. possible output decoded html entities ampersand entity encoded rendered html valid? or have preprocessing before rendering text @html.raw() ? example: string text = "&lt;h3&gt;mike &amp; jane&lt;/h3&gt;"; i'd output of @html.raw(text) (or other function) be: <h3>mike &amp; jane</h3> thanks asp.net-mvc razor html-encode ampersand

unix - Cat Content after a specific line in log file -

unix - Cat Content after a specific line in log file - i cat contents of file follows , includes target line. 2014-06-23 11:01:01,001 dog 2014-06-23 12:01:01,001 cat 2014-06-23 13:01:01,001 elephant 2014-06-23 14:01:01,001 bird 2014-06-23 15:01:01,001 rabbit 2014-06-23 16:01:01,001 deer i want cat line 2014-06-23 13:01:01,001 elephant , next lines searching 2014-06-23 13:01:01,001 the desired output be: 2014-06-23 13:01:01,001 elephant 2014-06-23 14:01:01,001 bird 2014-06-23 15:01:01,001 rabbit 2014-06-23 16:01:01,001 deer thank in advance , welcome documentation links! using sed , can print pattern 2014-06-23 13:01:01,001 end of file, this: $ sed -n '/2014-06-23 13:01:01,001/,$p' file 2014-06-23 13:01:01,001 elephant 2014-06-23 14:01:01,001 bird 2014-06-23 15:01:01,001 rabbit 2014-06-23 16:01:01,001 deer unix cat

java - Order to save OneToMany relationship with JPA and Hibernate -

java - Order to save OneToMany relationship with JPA and Hibernate - i have these 2 beans: public class agentsubscription { //... @onetomany(fetch = fetchtype.eager, cascade = {cascadetype.persist, cascadetype.merge, cascadetype.remove}, mappedby = "subscription") @fetch(fetchmode.subselect) @orderby("id_subscription") private list<outputchannel> channels; //... } and public class outputchannel { //... @manytoone(fetch = fetchtype.eager) @joincolumn(name = "id_subscription", nullable = false) private agentsubscription subscription; //... } if seek utilize method: @transactional public void addchannel(agentsubscription subscription, outputchannel channel) { seek { list<outputchannel> channels = new arraylist<outputchannel>(); channels.add(channel); subscription.setchannels(channels); subscription = agentsubscriptiondao.insert(subscription); } grab (excepti...