Posts

Showing posts from September, 2014

angularjs - Why my build project Angular2 don't work in any apache server? -

i turn build angular project (ejected webpack) in server apache local in mac os sierra, , found problem resource file in index.html when turn same build in ubuntu project run correctly no error. i run build project in default server apache on mac os sierra 10.12.4 : result in mac os sierra 10.12.4 default apache (when used mamp pro in macos status of loading files 404) when run same build project in ubuntu 16.04 lts : result in ubuntu 16.04 lts default apache version used : angular: 2.4.8 angular cli: 1.0.0-rc.0 webpack: 2.2.1 its missing valid base href, make sure index.html contains <base href=".">

node.js - Individual nested subdocument Mongoose -

i'm trying embed subdocument main document,like this: this main document.js var mongoose = require('../../db/mongodb.connector'), schema = mongoose.schema; require('./document.model'); var document= mongoose.model('document'); require('./alert.model'); var alert = mongoose.model('alert'); var userschema = new schema({ name: { type: string } created: { type: date, default: date.now()}, alerts: {type: schema.objectid,ref: 'alert'}, documents: [{type: schema.objectid,ref: 'document'}], }); module.exports = mongoose.model('user', userschema); this embed document.js var mongoose = require('../../db/mongodb.connector'), schema = mongoose.schema; var alertsschema = new schema({ push: {type: string, default: "true"}, email: {type: string, default: "false"}, sms:

Extract the selected zone on a picture with opencv python -

Image
i'm using opencv detect face in picture , want ot extract it, have photo man , expected result jpg image seleted face i have detect face if can me extract face , save it! thank all you have add single line program. consider variable detected_face , , following: detected_face = img[y:y+h, x:x+w] cv2.imwrite('face.jpg', detected_face) you have .jpg file of face stored in directory

java - Split String with Spring EL -

i needs split string value $$ in spring context xml file, have tried below things, no luck :( can please? in java it's working this, public static void main(string[] args) { system.err.println("localhost$$8080".split("\\$\\$")[1]); } my tries <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\\$\\$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('$$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\$\$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\\u0024\\u0024')[1]}" /> note : please assume config.getnode() give value "localhost$$8080". it should below: <constructor-arg name="port" value="#{config.getnode().split(

Issue running Octave on Linux cluster: cannot load libpcre.so.1 -

i'm new linux cluster , have compiled octave 3.8.0 on off-line sge server without root access. runs in interactive session on terminal, when use qsub submit batch job, received error message: /home/share/my_account/bin/octave-cli-3.8.0: error while loading shared libraries: libpcre.so.1: cannot open shared object file: no such file or directory found libpcre.so.1 in /usr/local/lib , , added echo $ld_library_path in batch job script, result turned out be: /opt/gridengine/lib/linux-x64:/opt/openmpi/lib:/lib:/usr/lib:/usr/local/lib:/opt/python/lib can fix problem?

Tpl direct print html in prestashop? -

Image
i craete custom module add textarea in product backoffice . when print textarea in tpl file in print direct html link i use print in tpl {if isset($belvg_textarea)} <div> {$belvg_textarea|unescape:'html'} {$belvg_textarea|escape:'html'} </div> {/if} and in module php file display public function hookdisplayfooterproduct($params) { $id_product = tools::getvalue('id_product'); $sampleobj = belvg_sample::loadbyidproduct($id_product); if(!empty($sampleobj) && isset($sampleobj->id)){ $this->context->smarty->assign(array( 'belvg_textarea' => $sampleobj->textarea, )); } return $this->display(__file__, 'views/frontend/sample.tpl'); } you should use nofilter beacause prestashop 1.7 escape html default html tags displayed in tpl file : {if isset($belvg_textarea)} <div> {$belvg_textarea nofilter} </

html - Length of <p> element changing position of parent? -

i have set of 'product' divs inside wrapping containers. these product divs contain image, header , p text. reason, length of p text changing position of parent product div. here screenshot: https://gyazo.com/9504729541e6bee17a27e4121af3a1c9 the p , h2 elements both have 0 padding , margins. try keep code minimal possible. html: <div id="content" class="wrapper"> <div id="content-container"> <div id="product-container"> <div class="product-wrapper"> <div id="product" class="unhidden"> <div class="image-container"> <img src="assets/home-bg.jpg" class="thumbnail"> </div> <div class="product-text">

javascript - jQuery toggling display css attribute -

i'm trying 1 of links dynamically show when anchor href link gets clicked on. the javascript code show cats link it's not showing cats link follows: $(".button").click(function() { $("#cat").show(); }); ul > li > #cat { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul> <li><a href="index.html">dogs</a></li> <li><a id="cat" href="javascript:void(0);">cats</a></li> </ul> <p>cool cats stored here</p> <a href="javascript:void(0);" class="button">press here enable cats</a> you'll need display:hidden default css #cat , $("#cat").show() have effect. if want button toggle show state use $("#cat").toggle()

Azure Integration Account Maps in Visual Studio -

Image
i using azure logic apps. have uploaded map , schema in integration account , assigned logic app project. the issue can see schema , map in logic app designer view in azure portal , not in visual studio 2017 logic app designer. screenshots can seen below. azure portal: visual studio: i have use visual studio, in our requirements. don't know why visual studio not getting maps/schema in list. any please? regards,

When is the beta version of Yoast SEO for Magento ready to test? -

does know when yoast seo plugin magento 2 ready test? at moment, extension available in beta phase. before release of version 1 @ meet magento on 10 may in utrecht. questions / comments if have questions or comments? please send e-mail question or comment yoast@maxserv.com.

javascript - Tinymce 3 - insert new content in new block after custom button click -

Image
i want ask if it's possible add new content "outside" of content has beed added recently. so, have custom button adds simple html. , want archive add same html outside of existing one, in place marked green on screenshot. i'm looking way how escape div, , add new html after existing one. below screenshot, , code - how javascript button in generated - simple. thanks advice. var oferta = '<div class="col-sm-3"><h1>test</h1></div>' setup: function (ed) { ed.addbutton('example', { title: 'example.desc', image: './/', text: 'oferta', icon: true, onclick: function () { tinymce.execcommand('mceinsertcontent', false, oferta); } }); }, edit: below how looks when hit button 3 times in row.(every next content added existing one.) is easy try change code example. setup:

ios - UITextView.text with emoji setting: cursorPosition is not correct -

Image
here, str contains emojis , set cursorposition not correct: let cursorposition = str.characters.count let cursorrange = nsrange(location: cursorposition, length: 0) textinputview.selectedrange = cursorrange textinputview.scrollrangetovisible(cursorrange) it want put cursor @ last of textview . try way. textinputview.becomefirstresponder() let cursorposition = str.utf16.count let cursorrange = nsrange(location: cursorposition, length: 0) textinputview.selectedrange = cursorrange textinputview.scrollrangetovisible(cursorrange)

php - wordpress function breaks wp-admin -

i've created function in custom woocommerce site. works great on frontend, wp-admin breaks. wp-admin shows http-500 error. this function: // set currency based on visitor country function geo_client_currency($client_currency) { $country = wc()->customer->get_shipping_country(); switch ($country) { case 'gb': return 'gbp'; break; default: return 'eur'; break; } } add_filter('wcml_client_currency','geo_client_currency'); i've set wp-debug on true , throw message: fatal error: uncaught error: call member function get_shipping_country() on null in so has with: $country = wc()->customer->get_shipping_country(); can't find it. maybe can me this. thanks in advanced. the customer property isn't set instance of wc_customer in backend can't call get_shipping_country() method. check customer isn't null (default) before using it. function

c++ - Avoiding Segmentation Fault in .oct function? -

this directed @ users of octave. in c++ api documentation octave, 1 of examples function adds 2 matrices so: */addtwomatrices.cc #include <octave/oct.h> defun_dld (addtwomatrices, args, , "add b") { if (args.length () != 2) print_usage (); ndarray = args(0).array_value (); ndarray b = args(1).array_value (); return octave_value (a + b); } link: https://www.gnu.org/software/octave/doc/interpreter/matrices-and-arrays-in-oct_002dfiles.html#matrices-and-arrays-in-oct_002dfiles which works fine , compiles without errors. when using in octave though, if function called incorrect number of arguments, seg faults , exits program , dumps octave-core. is there way keep octave open if function called incorrect number of arguments? example, addtwomatrices(5) octave 1> "incorrect number of arguments supplied. please provide 2." octave 2>' instead of invalid call addtwomatrices. correct usage is: adds 2 matrices additional built-

git - How to fast forward a branch to another non-master branch -

i on branch b. when checking out branch a, message behind branch 1 commit. git checkout switched branch 'a' branch behind 'origin/a' 1 commit, , can fast-forwarded. but when on own branch, cannot git pull because says not appear repository. i confused because when git merge a , message date. how can when i'm behind 1 commit? what can do? git pull fetch+merge, updates branch you're working on when pulls. references of branches updated, git aware local ref outdated. # on branch git merge origin/a --ff-only this update history latest status of a.

Storing JSON on android: sqlite vs SharedPreference -

for application allow members of organisation see data on mobile device need store pre-formatted data on device can see offline well. how data trough json request-response. the response formatted follows (anonymised ofc): [{ "firstname":"john", "lastname":"smith", "group":"1", "age":11, "installed":"ja", "medical":"is aan zijn linker zijde verlamd geweest.", "notes":"heimee. \r\nbeschermend opgevoed. \r\nterug getrokken persoonlijkheid.", "insignes":["test", "test2"], "parents":[] }, { "firstname":"emely", "lastname":"watson", "group":"33", "age":14, "installed":"ja", "medical":"", "notes":"test", "insignes"

caching - This Distributed Cache host may cause cache reliability problems after Sharepoint servers removed -

i removed 2 sharepoint servers 4 server farm , following errors: this distributed cache host may cause cache reliability; more cache hosts running in deployment registered sharepoint. both errors referring 2 removed servers. the cache cluster shows 2 remaining servers cache hosts. i re-provisioned distributed cache, still error. also tried listed here . any thoughts? i removed alerts sharepoint "review problems , solutions" , ran rules again. errors did not show second time.

How to convert Date object format in another Data object format in Java?(No string) -

i know maybe replicated question, want parse string convert date object.i'm able doing: simpledateformat parser = new simpledateformat("yyyy-m-d (hh:mm:ss.s)"); date date = parser.parse(propertiesvalue[i]); and returns "date" in format: fri jan 30 13:55:00 cet 2015 want return like:2015-01-30 (13:55:00.00) data object (not string object). need insert date in local google datastore. string != datetime do not conflate date-time object string may represent value. a date-time object has no format. date-time format represents moment. date-time object can generate string. date-time object can created parsing string. date-time object , string separate , distinct. avoid legacy classes you using troublesome old date-time classes legacy, supplanted java.time classes. using java.time instant instant = instant.now(); // current moment in utc zoneid z = zoneid.of( "pacific/auckland" ); zoneddatetime zdt = instant.atzon

Allow images and links in Google Caja HTML emails -

i trying display html email in webpage using caja. loading this: caja.load(document.getelementbyid('messagebox'), undefined, function(frame) { frame.code(contenturl, 'text/html').run(); }); when renders, anchor href , image src tags stripped. cannot see images or click links. guessing default behaviour prevent attacks. is there way allow html rendered intended, displaying images , having clickable links? just starting using caja today , links api docs go 404 cannot find info. thanks use policy caja.policy.net.all instead of undefined when call load

vba - Resolution changes when I hover over the data sources tab -

Image
as said in title, hovering on data sources tab in vb2008 , vs2015 causes program shrink in size , when maximize it, smaller , changes size of fonts on actual form, though font size doesn't change. sorry don't know better way of explaining it, seems weird. here screenshots: this should like: this happens when maximize after hovering on data sources tab: (notice labels left different size now)

php - Wordpress downloadable file in costume template page with headers -

i'm trying create download links file download forced , costume page have assigned download page, problem downloads empty file, , issue not in pdf format tried images has 0 bytes files , path correct ive checked , suspect has wordpress native headers conflicting , code seems correct used in other non-wordpress sites , here code: <?php /* template name: download-main-ebook */ ?> <?php $file = get_stylesheet_directory_uri(). "/homepage/ebook.pdf"; header('pragma: public'); // required header('expires: 0'); // no cache header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('cache-control: private',false); header('content-type: '.'html'); header('content-disposition: attachment; filename=ebook.pdf'); header('content-transfer-encoding: binary'); header('c

info grabbing from a column with grep, awk or sed -

i have following tabel: ^2num^5|^2score^5|^2ping^5 | ^2status ^5| ^2name players ^5| ^2address ---- ------- ------ -------- -------------------- -----------------------^7 ^5 0 ^2|^3 41 ^2|^3 100 ^2|^5 player ^2|^7just cr4zy name! ^2|^77.18.76.12:58641 ^3[^5fr^3]^7 ^5 2 ^2|^3 3 ^2|^3 57 ^2|^3 bot ^2|^7^8bot1 ^2|^7bot ^5 3 ^2|^3 7 ^2|^3 43 ^2|^3 bot ^2|^7^8bot2 ^2|^7bot ^5 4 ^2|^3 18 ^2|^3 16 ^2|^3 bot ^2|^7^8bot3 ^2|^7bot ^5 5 ^2|^3 2 ^2|^3 103 ^2|^5 player ^2|^7just ^5cr4zy n4me2! ^2|^784.18.8.144:27960 ^3[^5il^3]^7 ^5 6 ^2|^3 18 ^2|^3 102 ^2|^3 bot ^2|^7^8bot4 ^2|^7bot ^5 7 ^2|^3 29 ^2|^3 102 ^2|^3 bot ^2|^7^8bot5 ^2|^7bot ^5 8 ^2|^3 39 ^2|^3 54 ^2|^3 bot ^2|^7^8bot ^2|^7bot ^5 9 ^2|^3 24 ^2|^3 77 ^2|^3 bot ^2|^7^8bot ^2|^7bot ^510 ^2|^3 10 ^2|^3 103 ^2|^3 bot ^2|^7^8bot ^2

How to pass all but the first argument to a second bash script? -

i'm trying write bash script executes bash script first argument, can't use: bash abc.sh "$@" because pass first argument don't want. how can remove first argument? you can remove first argument shift : shift #same as: shift 1 bash abc.sh "$@" (in bash , ksh , , zsh , can use "${@:2}" without modifying "$@" array, shift work in posix shell.)

reversing dictionary in python doesn't work -

this code switching between key , value in dictionary: for k in d: d[d[k]] = k d.pop(k) the problem code makes more operations should make, , inputs return wrong result what reason of problem? the problem you're changing dictionary while iterating on it, , knows problems causes. note speaking can't reverse dictionaries: keys must unique , hashable, values don't have be. i'm assuming dictionaries have unique hashable values it's @ least possible. then use dictionary comprehension create new dictionary, , assign that: d = {value: key (key, value) in d.items()}

html - Javascript onDrop attribute not assigned -

Image
i encountered wierd problem in javascript. tried create div box in drop other divs. strangely ondrop-attribute doesn't assigned div allthough if read it, seems have it. error here? here's fiddle function creatleftrighttree(parentelement){ var lefttree = document.createelement("div"); var righttree = document.createelement("div"); lefttree.id="lefttree"; righttree.id="righttree"; lefttree.classname="dndcontainer"; righttree.classname="dndcontainer"; lefttree.ondrop="drop(event)"; righttree.ondrop="drop(event)"; righttree.ondragover="allowdrop(event)"; parentelement.appendchild(lefttree); parentelement.appendchild(righttree); righttree.innerhtml+= righttree.ondrop; //it must not possible drop in left tree }

assembly - Mips dynamic memory allocation and pointers -

i building compiler bison , encountered problem. need dynamically allocate memory , store string print content. i thought saving pointer in data section allocating memory save address in pointer, assign string val print it. problem when trying print string prints first char. here code example. .data p: .word 0 # pointer save allocated memory first address. .text li $v0,9 #allocate instruction li $a0,64 # allocate 64 byte syscall sw $v0,p #save first memory address pointer p li $t0,'a' #write first byte 'a' cahr sw $t0,0($v0) li $t0,'b' #write first byte 'a' cahr sw $t0,4($v0) li $v0,4 #print instruction lw $a0,p syscall this result in char on mars console. ideas why? i'm guessing: chars stored in bytes. b should go in 1($v0) not 4($v0) , you'll need null in 2 terminate.

ios - Can't receive notification with Firebase in foreground? -

i'm using firebase make notifications server ios. have 1 problem : when application in background, no problem, receive notification. when application in foreground, code print me notification data don't show on gui :/ that's function : // receive displayed notifications ios 10 devices. func usernotificationcenter(_ center: unusernotificationcenter, willpresent notification: unnotification, withcompletionhandler completionhandler: @escaping (unnotificationpresentationoptions) -> void){ let userinfo = notification.request.content.userinfo // print message id. if let messageid = userinfo[gcmmessageidkey]{ print("message id: \(messageid)") } // print full message. print(userinfo) // change preferred presentation option completionhandler([]) } do know how can force firebase show notification on gui ? tryed make local notification instead, without results

Last foreach loop in PowerShell fails but the previous loop works fine -

this script meant migrate 1 domain another. i'm looking of ad security groups, pull members of each group , create text file name of group , members of group. i want create new set of text files include information in users mailnickname field each group, called nid (new id). use mailnickname store nid new domain can push nid proper groups in new domain. in below script works except last foreach loop, not sure why; looks correct , i've searched internet answers no reason why shouldn't work. i don't error $b variable ends being same value $igroup variable. new text file nid never created. $iscript = "getadgroups" $strpath = "c:\temp\$iscript" $strfile = "$strpath\$iscript.txt" if(!(test-path $strpath)){new-item -itemtype directory -path $strpath} $ou1 = "ou=users,ou=oc,dc=domain,dc=com" $ou2 = "ou=users,ou=amc,dc=domain,dc=com" $ou3 = "ou=users,ou=fi,dc=domain,dc=com" get-adgroup -filter &#

go - fmt.Println calling Error instead of String() -

i have code package main import ( "fmt" "math" ) type errnegativesqrt float64 func (s errnegativesqrt) string() string { return fmt.sprintf("%f", float64(s)) } func (e errnegativesqrt) error() string { return fmt.sprintf("cannot sqrt negative number: %v", float64(e)) } func sqrt(x float64) (errnegativesqrt, error) { if x < 0 { e := errnegativesqrt(x) return e, e } else { return errnegativesqrt(math.sqrt(x)), nil } } func main() { fmt.println(sqrt(2)) fmt.println(sqrt(-2)) } and output of code is cannot sqrt negative number: 1.4142135623730951 <nil> cannot sqrt negative number: -2 cannot sqrt negative number: -2 when have implemented stringer interface errnegativesqrt, why fmt.println invoking error() method instead of string() method? i new go, might missing obvious. the documentation states how value converted string : if operand imple

csv - Python Evaluate Values on Sheet Using Pandas Read then Write on the File -

hello i'm new web app dev. i'm trying make app, manipulates csv file. let me paste code before state problem below: #!/usr/bin/env python import os import pandas pd flask import flask, request,render_template, redirect, url_for, send_from_directory werkzeug.utils import secure_filename # create app app = flask(__name__) app.config['upload_folder'] = '/home/firiyuu77/mysite/uploads' app.config['allowed_extensions'] = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif','csv','xlsx']) def allowed_file(filename): return '.' in filename , \ filename.rsplit('.', 1)[1] in app.config['allowed_extensions'] @app.route('/') def main(): return render_template('index.html') # route process file upload @app.route('/upload', methods=['post']) def upload(): # name of uploaded file file = request.files['file&#

csv - Copying data to another column in Python/Pandas -

i have ip packet csv file i'm trying extract sequence numbers info field separate column has sequence numbers. sequence numbers substring in middle of info string. here raw code.. first create new column fo sequence numbers, check if info field contains seq number, split info field sequence number out. if print after 'seq = j.split...', correct values. how write csv file seq column? file = pd.read_csv(file.csv) file['seq'] = none in file['info']: if 'seq' in i: split = i.split(' ') j in split: if 'seq=' in j: seq = j.split('seq=',1)[1] file.loc[i,'seq'] = int(seq) example csv: no. time source destination protocol length info 1 0.000000 sourceip 192.168.0.1 tcp 54 35165 > 80 [syn] seq=0 win=16384 len=0 2 0.000001 sourceip 192.168.0.1 tcp 54 14378 > 80 [syn] seq=0 win=16384 len=0

netflix hystrix and spring integration -

i have spring integration project sends data various sources via gateway , fetching data databases , updating tables. it working fine there many points of failure , wish wrap calls these gateways netflix's hystrix framework , have displayed hystrix dashboard. all ideas , suggestions welcomed. thanks you can find info need in hystrix github repo page here . documentation regarding dashboard found in same place, in master branch here there several ways use framework, commonly, wrap service/call inside hystrixcommand object, , fill run() , fallback() methods. can find example here regarding dashboard, need build project , can use "out of box"; if don't want go deep configuration. able access through web explorer, , trace calls service(s) wrapped hystrix, entering url in dashboard homepage. can find additional documentation dashboard in hystrix wiki .

ruby on rails - Elastic Beanstalk ebextensions permissions errors -

i running amazon linux ami ruby + puma elastic beanstalk setup. however, repeatedly running issues suspect related permissions. i tried change timezone of linux instance. using following config: packages: yum: git: [] postgresql95-devel: [] gcc-c++: [] make: [] tcl: [] sources: /home/ec2-user: http://download.redis.io/releases/redis-3.2.7.tar.gz commands: 0000_remove_localtime: command: rm -rf /etc/localtime 0000_link_singapore_timezone: command: - ln -f -s /usr/share/zoneinfo/asia/singapore /etc/localtime i got code updating timezone various sources, namely , amazon documentations, however, when deploy following config, deployment fails completely. upon appending sudo ln -f -s /usr/share/zoneinfo/asia/singapore /etc/localtime , deployment worked perfectly. my question is, know why case? else seems executing ln -f -s /usr/share/zoneinfo/asia/singapore /etc/localtime without sudo fine. case, fails until change command sudo ln -f -

prolog - Does an element exists in a list of lists? -

i want find if given element exists in list of lists. getting true if element exists somewhere first list of lists. any advice? memberlist(x,[[x|t1]|t2]). memberlist(x,[[h|t1]|t2]) :- memberlist(x,[t1|t2]). the problem [[h|t1]|t2] matches given first list has at least 1 element. indeed: [[],[1,4],[2,5]] instance not unify [[h|t1]|t2] . so can solve problem adding clause: memberlist(x,[[]|t2]) :- memberlist(x,t2). thus obtain: memberlist(x,[[x|_]|_]). memberlist(x,[[h|t1]|t2]) :- memberlist(x,[t1|t2]). memberlist(x,[[]|t2]) :- memberlist(x,t2). the first clause uses underscores specify "not interested" in these variables. common prolog programs (probably interpreter warned t1 , t2 mentioned once). so in case first list exhausted, move next list. your predicate lot of "packing" , "unpacking". furthermore can make use of member/2 builtin. can rewrite it: memberlist(x,[h|_]) :- member(x,h). memberlist

javascript - window.open does not work as expected, need some advice -

i'm new on javascript. have function not working expected. have input text (multiple, similar). added id each. i used javascript function value, transfer them page processed. function script gone wrong, need solution, please help. this script keeps open new tab. want open window, on frame named 'main'. this function : function addframe(fid){ var xfra= "x"+fid; var nfr= document.getelementbyid(xfra).value; var nwo= fid; var link= "http://127.0.0.1/nims/index.php/jpbgr/frame/18? xid=18&menu=new&order="+nwo+"&frame="+nfr; var util= window.open(link); } even if changed to: var util= window.open(link, "main"); but still not working. i used codeigniter. thank you. ======= index file: <!doctype html> <html> <head> <title>ims-2017</title> </head> <frameset rows="0,*" frameborder=0 noresize> <fr

tensorflow - sess.run(train, {x:x_train,y:y_train}) NameError: name 'train' is not defined -

i new tensorflow ..i trying out example on https://www.tensorflow.org/get_started/get_started have installed tensorflow on python 3.5.2 on windows 10 laptop i getting following error sess.run(train, {x:x_train,y:y_train}) name error: name 'train' not defined perhaps post nice clean short code here can out. idea forgot copy-paste these lines: optimizer = tf.train.gradientdescentoptimizer(0.01) train = optimizer.minimize(loss) good luck!

php - Error when setting up y axis from a data table that is JSON. parsed for d3 charts -

i can't seem use projectdate field set x axis. use json.parse data json , prepared data using data.foreach used d3 chart. when call page, "uncaught typeerror: t.substring not function. please let me know doing wrong. // data viewmodel var data = json.parse(<?php echo json_encode($viewmodel) ?>); data.foreach(function(d) { d.projectdate = parsedate(d.projectdate); d.cost = +d.cost; }); var y = d3.scale.linear() .domain([0, d3.max(data, function(d){ return d.cost; })]) .range([height, 0]); var x = d3.scale.ordinal() .domain(d3.extent(data, function(d){ var date = parsedate(d.projectdate); return (date); })) .range([0, width]); var ordinalcolorscale = d3.scale.category20();

BSCMAKE.EXE error BK1500 in Visual Studio 2013 -

i periodically, not always, receiving internal error in bscmake while compiling code in visual studio 2013. c++ has compiled years , others compiling without seeing these errors. the error trace in build output shows: `bscmake : error bk1500: internal error version 12.00.21005.1 exceptioncode = c0000005 exceptionflags = 00000000 exceptionaddress = 00aa5a4b (00aa0000) "c:\program files (x86)\microsoft visual studio 12.0\vc\bin\bscmake.exe" numberparameters = 00000002 exceptioninformation[ 0] = 00000000 exceptioninformation[ 1] = 01562810 context: eax = 00009a00 esp = 004f9358 ebx = 018090f6 ebp = 004ff308 ecx = 0153c010 esi = 004f9c97 edx = 004fc299 edi = 00000001 eip = 00aa5a4b eflags = 00010246 segcs = 00000023 segds = 0000002b segss = 0000002b seges = 0000002b segfs = 00000053 seggs = 0000002b dr0 = 00000000 dr3 = 00000000 dr1 = 00000000 dr6 = 00000000 dr2 = 00000000

matlab - Issue using Surf, X Y Z and C cannot be complex -

i'm trying add title surface plot, attempting add descriptive text plot results in above error. can plot data fine, attempting add title throws error. i've listed code below , can't figure out why simple text title causes problems. i'd appreciate ideas. thanks! function lwmmsweepplots(excel,cpb,rpb) data=xlsread(excel); [r,c]=size(data); iterations=round(c./cpb); i=1:iterations; power=data(1:rpb,cpb*(i-1)+1:cpb*(i-1)+cpb); xone=data(rpb*4-3:rpb*4-3+(rpb-1),cpb*(i-1)+1:cpb*(i-1)+cpb); yone=data(rpb*5-2:rpb*5-2+(rpb-1),cpb*(i-1)+1:cpb*(i-1)+cpb); xtwo=data(rpb+2,cpb*(i-1)+1); ytwo=data(rpb*2+3,cpb*(i-1)+1); xtn=num2str(xtwo);ytn=num2str(ytwo); mytitle=strcat('x2,y2 coordinates:',xtn,',',ytn); figure;surf(xone,yone,power,title(mytitle)) end end that's not how add title. if want add title need use title separately . way doing it, matlab treating output o

regex - Redirect to https but without .php -

now have https. need redirection in .htaccess. find this: rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] but find if user writes: http://mydomain/somefile it redirects to: https://mydomain/somefile.php i suppose correct should without .php how that? those rules: rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.%{http_host}/$1 [r=301,l] rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php here working code problem. have checked on server, , working fine rewriteengine on rewritebase / #for https rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] rewritecond %{the_request} ^[a-z]{3,9}\ /([^\ ]+)\.php rewriterule ^/?(.*)\.php$ /$1 [l,r=301] rewritecond %{request_filename}\.php -f rewriterule ^/?(.*)$ /$1.php [l] here lin

javascript - AngularJS Directives: Storing Scripts and Stylesheets -

is possible place of stylesheets , scripts directive? looking cleanup index file , place them couple directives so <head> <ng-stylesheets></ng-stylesheets> <ng-scripts></ng-scripts> </head> <body> <p>this test</p> </body> is unnecessary? prefer cleanliness of directive rather giant block of stylesheet references. using angular 1.x i don't think it's idea, how dynamically read (to later write) path of scripts angularjs? , if achieve this, need add angular.js , directive index.html file anyway. i suggest you, tu use grunt/gulp/webpack task dynamically add yours scripts , stylesheets index.html file on build time. or better, can concatenate yours script in single one, using task.

javascript - Circle looks jagged and not very smooth in Safari -

i created circle zooms in , fades out once reaches scale. when open on google chrome, edges of circle looks perfect , crisp. on safari, edge of circle looks bad , faded out. added "webkit" , still same. css animation not compatible safari? here code. picture of how edges in chrome https://gyazo.com/91a2faecb48703c4ed7e47bc3035b802 picture of how edges in safari https://gyazo.com/0507f9bb35eb2e0fd21b620d3ba44538 html <ul id="bubbles"> <li id="firstcircle"></li> </ul> css #bubbles li{ position: relative; list-style: none; display: block; border-radius: 100%; animation: fadeandscale 15s ease-in infinite; -webkit-animation: fadeandscale 15s ease-in infinite; -ms-animation: fadeandscale 15s ease-in infinite; -moz-animation: fadeandscale 15s ease-in infinite; -o-animation

global - PHP function written in 5.5 throws error when upgraded to 7.0 -

here function worked prior upgrading 7.0 function set_session_vars() { $nb_args=func_num_args(); $arg_list=func_get_args(); for($i=0;$i<$nb_args;$i++) { global $$arg_list[$i]; $_session[$arg_list[$i]] = $$arg_list[$i]; } } now causer error says: parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/mvyc1956/public_html/members/includes/functions.php on line 322 i believe related non backward compatable changes global , use of $$ , arrays, php not enough figure out. is there familiar why line : global $$arg_list[$i]; which line 322 being reported cause of error, failing now, , recommend change code in order have work php 7? i did googling , found this page again, im not understanding needs changed. thanks says syntax error of code in function no longer valid, take php 7 expert see it. update removed word global above code , app "seems" working fine ask: does know specifically, why global non

swift - Is it likely that Snapchat & Whatsapp use AVFoundation on iOS? -

and if yes, use class below give them jpeg image in order make compression easier? class func jpegphotodatarepresentation(forjpegsamplebuffer jpegsamplebuffer: cmsamplebuffer, previewphotosamplebuffer: cmsamplebuffer?) -> data? on question alone, "is snapchat & whatsapp use avfoundation on ios?"; answer yes. according superpowered audio framework have found there no way play audio without using avfoundation on ios. haven't seen camera app doesn't use avfoundation in form. far photo compression goes, guess multi-billion dollar apps such snapchat , kik make low level compression algorithm in c or c++ fit exact compression needs rather use avfoundation , swift/objective c. other reason have own compression algorithm because want app work in android or windows work in ios. creating own compression algorithm have standardized app looks , works same in every mobile os.

database - Load CSV with blank values in MonetDB -

i trying load csv file values should null blank. example, consider following schema: create table test ( float a, float b, float c ); i trying load file looks (some rows may have no null values, others may have several). 1.0,1.2,1.3 1.4,,1.5 1.6,,, 1.9,2.0,1.2 i empty fields (e.g., 2nd field in second row) null in database. i using following command load csv file: copy table '/path/to/file.csv' using delimiters ',','\n','"' null ''; and getting following error: failed import table line 2 field b 'double' expected in '' should passing else load command (other null '')? no, seem doing correctly. have tried replicate test , works me. error seems occur if leave out null '' part of answer. there several minor errors in code provided, correct code be: create table test ( float, b float, c float ); copy test '/path/to/file.csv' using delimiters '

How to listen for any cookie changes in Android Webview -

my application using webview open webpage updating few cookies on interactions taken on webpage. want read cookie , make ui tweaks based on value of cookie. ios has implementation of observers can attached cookies list , notifications cookie change happens. i searching similar solution long not find kind of listeners or can attached cookies , know when updated. i read in cookiemanager , cookiesyncmanger https://developer.android.com/reference/java/net/cookiemanager.html https://developer.android.com/reference/java/net/cookiemanager.html but nothing helpful. i know using javascript interface hooks better solution can't implemented website running in production. i believe need go 1 layer deeper. cookiestore - https://developer.android.com/reference/java/net/cookiestore.html you're looking for. can create own implementation overriding add(), get(), remove(), etc. , include own callback there. there's post here covers how shared preferences bac

hadoop - HIVE left join on nearest date -

i trying join 2 tables in hive using key , nearest date in 2 tables @ time of join. example: below 2 input tables <----------table a-------------> <------------table b------------> a_id a_date changed_col b_id b_date b_value a_id **** ****** *********** **** ****** ******* ***** a01 2017-03-20 abc b01 2017-04-02 200 a01 a01 2017-04-01 xyz b01 2017-04-04 500 a01 a01 2017-04-05 lll however when left join table b table a, should nearest lowest date in table same key(a_id). below expected output table: b_id b_date a_id a_date changed col b_value **** ****** **** ****** *********** ******* b01 2017-02-04 a01 2017-01-04 xyz 200 b01 2017-04-04 a01 2017-01-04 xyz 500 any appreciated. thanks

Magento 2 - Error: Attribute with attributeCode “X” does not exist -

i have created new attribute product , added default attribute set. when click navigate products > catelog can implement attribute, following error: attribute attributecode "x" not exist. any suggestions on how resolve that? i have been following tutorial: https://www.templatemonster.com/help/magento-2-x-create-manage-product-attributes.html and error occurs in step 9. run below commonds using ssh. php bin/magento cache:clean php bin/magento indexer:reindex

android - Ask in runtime permission for push notification -

i'm workin app , when app start, need ask @ user if want receive push notification. know push notification aren't dangerous permission need show popup possibility chose. manifest <uses-permission android:name="android.permission.bind_notification_listener_service"/> and runtime method should show popup public void receivenotification(view v) { boolean haspermission = (contextcompat.checkselfpermission(mainactivity.this, manifest.permission.bind_notification_listener_service) == packagemanager.permission_granted); if (haspermission) { string token = firebaseinstanceid.getinstance().gettoken(); log.d(tag, "token"+token); toast.maketext(mainactivity.this, token, toast.length_short).show(); } else { activitycompat.requestpermissions(mainactivity.this, new string[]{manifest.permission.bind_notification_listener_service}, request_code_ask_permissions); } } @override public void onrequestp

Developing using solr in Eclipse (CentOS 7) -

are there guides available using solr 6.x inside of eclipse? know since solr 5 using solr servers such tomcat no longer supported, of documentation can find refers starting server command line , indexing manually there. how can find out more progrematically accessing solr server?

html - Browse button not working as expected in IE -

i need change color of browse button when input type type="file".i've created js fiddle works fine in chrome.but color not getting changed in ie.please help. here's link it: http://jsfiddle.net/e42xa/596/ html: <form> <input type="file" id="fileupload"> </form> css: input, label { display: block; } input[type="file"] { border:none !important; background-image:none; cursor: pointer; } input[type=file]::-webkit-file-upload-button { border: none; margin: 0; padding: 0; -webkit-appearance: button; width: 100px; background-color:#003b5c !important; color:#fff; cursor: pointer; } <!--[if ie]> <style type="text/css"> input.hide { position:absolute; let:10px; -moz-opacity:0; filter:alpha(opacity:0); opacity:0; z-index:2; width:0px; border-width:0px; background-color:#003c5c !important; } </style> <

java - error after updating gradle in android studio -

i have hello world basic project in android studio . after updating gradle-wrapper , build.gradle files , can compile project without problem don't know what's error : noclassdeffounderror: update failed anaction id=mirrorasplugin.startorstopmirroraction: com/android/tools/idea/gradle/invoker/gradleinvoker$aftergradleinvocationtask. how can fix ? my 2 gradle file edited : gradle-wrapper: #sat apr 15 00:03:53 irdt 2017 distributionbase=gradle_user_home distributionpath=wrapper/dists zipstorebase=gradle_user_home zipstorepath=wrapper/dists distributionurl=https\://services.gradle.org/distributions/gradle-3.3-all.zip ======================================================== build.gradle (project): // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.1' // note: not place application depend