Posts

Showing posts from June, 2011

java - How to get original password from BCryptPasswordEncoder -

i'm using spring security application. when user register first time, passwords encrypted bcryptpasswordencoder . bcryptpasswordencoder passwordencoder = new bcryptpasswordencoder(); string hashedpassword = passwordencoder.encode(password); now, in case of password changing, users enter current password , need check if current password same against encrypted password saved in database. i know not possible generate 2 same encrypted hash same string bcryptpasswordencoder . way compare passwords if same original password saved in database , compare current entered password. so, there way compare passwords or original password database saved hashed password? you need check raw password against encoded password in db. example, bcryptpasswordencoder bcryptpasswordencoder = new bcryptpasswordencoder(); string p = bcryptpasswordencoder.encode("somecoolpassword"); system.out.println(bcryptpasswordencoder.matches("somecoolpassword", p));

Nginx + Systemd/Systemctl + Django not working (502 bad gateway) -

i've been @ hours , yet cannot figure out why setup isn't working. if run command that's in exec on own, can access page through browser fine. when try run service, 502: bad gateway. i first tried using unix sockets, when didn't work, plugged in ip , port directly, still no luck. gunicorn.service: [unit] description=gunicorn daemon after=network.target [service] user=username workingdirectory=/home/username/naomiselect environment="path=/home/username/naomiselect/naomienv/bin" execstart=/home/username/naomiselect/naomienv/bin/gunicorn --workers 3 --bind local_ip:8000 naomiselect.wsgi:application [install] wantedby=multi-user.target nginx.conf: user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # basic settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; ...

swift - UITableView.insertRowsAtIndexPaths not working -

i'm using core data , have problem. app crashes because when insert new element try access cell doesn't exist should. the code matters: func controllerwillchangecontent(controller: nsfetchedresultscontroller) { tableview.beginupdates() } func controllerdidchangecontent(controller: nsfetchedresultscontroller) { tableview.endupdates() } func controller(controller: nsfetchedresultscontroller, didchangeobject anobject: anyobject, atindexpath indexpath: nsindexpath?, forchangetype type: nsfetchedresultschangetype, newindexpath: nsindexpath?) { switch type { case .insert: if let indexpath = newindexpath { self.tableview.insertrowsatindexpaths([indexpath], withrowanimation: .fade) // doesn't work print(indexpath) // returns row 0 section 0 print(tableview.numberofrowsinsection(0)) // returns 0 print(tableview.cellforrowatindexpath(indexpath)) // returns nil ...

jquery - How to add a transition to a navbar dropdown -

i finished making navbar mobile , add transition drops down slower currently. here jquery: (function( $ ){ $(document).ready(function(){ $(".burguer-nav").on("click", function(){ $("header nav ul").toggleclass("open"); }); }); })(jquery); and css: span.burguer-nav { display: none; } @media screen , (max-width: 845px){ .main-navigation li { display: block; text-align:center; } .burguer-nav{ display: block !important; height: 40px; cursor: pointer; font-size: 18pt; } header nav ul{ overflow:hidden; height:0; background-color: #505050; } header nav ul.open{ height:auto; } } how , can add transition? @media screen , (max-width: 845px){ .main-navigation li { display: block; text-align:center; } .burguer-nav{ display: block !important; ...

java - Handle clicks on Image in ImageViewer (Codenameone) -

we try make image clickable time within image viewer. in view, there no listener it? we have gallery of images. after clicking on image opened in separate window. in thread found opportunity put image on button. need restructure our gallery, want avoid here code opening image. works far: form picture = (form) createcontainer(res, "imageviewer"); beforeimageviewer(picture, currentobjektmodel); picture.showback(); postimageviewer(picture, iv.getimagelist().getitemat(iv.getimagelist().getselectedindex())); the problem doing image viewer handles pointer events swipe/pan rely on. can use scaleimagebutton cases since need swiping not option. you can derive image viewer , override pointerpressed & pointerreleased . if pressed called released after , distance between 2 x/y coordinates (from pressed/released) small that's click.

multithreading - C++ Fork Join Parallelism Blocking -

suppose wish run section in parallel, merge main thread section in parallel, , on. similar childhood game red light green light. i've given example of i'm trying do, i'm using conditional variable block threads @ start wish start them in parallel block them @ end can printed out serially. *= operation larger operation spanning many seconds. reusing threads important. using task queue might heavy. i need use kind of blocking construct isn't plain busy loop, because know how solve problem busy loops. in english: thread 1 creates 10 threads blocked thread 1 signals threads start (without blocking eachother) thread 2-11 process exclusive memory thread 1 waiting until 2-11 complete (can use atomic count here) thread 2-11 complete, each can notify 1 check condition if necessary thread 1 checks condition , prints array thread 1 resignals 2-11 process again, continuing 2 example code (naive adapted example on cplusplus.com): // condition_variable example...

php - cant send an email on cakephp3 -

i can't cakephp3 send emails. in cakephp2 no problem. using latest wamp, , cakephp3.3 on windows 7. tried follow directions looks getting basic wrong. need configure wamp checked php.ini -development file there no smtp entry change error- stream_socket_client(): ssl operation failed code 1. openssl error messages: error:14090086:ssl routines:ssl3_get_server_certificate:certificate verify failed stream_socket_client(): failed enable crypto stream_socket_client(): unable connect ssl://smtp.gmail.com:465 (unknown error) controller public function singletutoremail(){ $email = new email(); $email->transport('gmail3'); $to='jjxxx@gmail.com'; $subject='testing'; $message='hello, dfsfsdfsdf sdfsdf'; $email->from(['jjxxx@gmail.com' => 'test']) ->to($to) ->subject( $subject) ->send($m...

Effect of mixing commas and semicolons in javascript variable declaration -

in code below, horiz being declared , run through loop fills empty arrays. same verti on second line etc. "var" declaration apply horiz (i.e semicolon breaks "var" declaration) or "var" declaration initialize horiz , verti , here , path , unvisited ? var horiz =[]; (var j= 0; j<x+1; j++) horiz[j]= [], verti =[]; (var j= 0; j<x+1; j++) verti[j]= [], here = [math.floor(math.random()*x), math.floor(math.random()*y)], path = [here], unvisited = []; edit: added full function here clarity. variables in function not global or being initialized outside function. edit 2: code here: http://rosettacode.org/wiki/maze_generation#javascript function maze(x,y) { var n=x*y-1; if (n<0) {alert("illegal maze dimensions");return;} var horiz =[]; (var j= 0; j<x+1; j++) horiz[j]= [], verti =[]; (var j= 0; j<x+1; j++) verti[j]= [], here = [math.floor(math.random()*x), math.floor(math.random()...

javascript - What does it mean for an action to travel through an entire middleware chain in redux? -

looking @ react-redux docs , don't below how why having action travel whole middleware useful: it bit of trickery make sure if call store.dispatch(action) middleware instead of next(action), action travel whole middleware chain again, including current middleware. useful asynchronous middleware, have seen previously. what mean action travel through middleware? how affect dispatch? understanding dispatch changes through each layer of middleware goes through, , next refers previous middlware's dispatch, whereas dispatch refers original store.dispatch. as can see in the middleware example , there multiple middleware items create pipe: rafscheduler -> timeoutscheduler -> thunk -> vanillapromise -> etc... an action travels middleware items before getting base reducer or being intercepted 1 of middleware items. each middleware item can decide move action next middleware in chain using next() . however, want action travel chain start. f...

java - Resume a stopped build process with Apache Ant -

yesterday had stop ant build process of pentaho-kettle taking long; , today starts processes (tests, packaging, ..) beginning. there way can resume building process point stopped? tests could not skipped option: ant dist -dmaven.test.skip=true and didn't find out how tell ant, not build packages if exist . have successful build on machine? have not indicated steps taking long time. i notice project using apache ivy manage dependencies. first time build runs longest since dependencies must first downloaded , cached. subsequent builds should run faster. as setting "maven.test.skip" applies maven based builds. maven different build tool.

c# - Directory.Exists not working in wix installer custom action -

i have customaction wix installer in checking whether directory exists. though directory exists, if condition resolving false. strange thing same snippet works in console application. here code. string msonline = path.combine(environment.systemdirectory, "windowspowershell", "v1.0", "modules", "msonline"); session.log(msonline); //'c:\windows\system32\windowspowershell\v1.0\modules\msonline'. if (directory.exists(msonline)) { session.log("msonline module installed"); session["azure_module"] = "installed"; } not being able head around why not working when same code works in console app.

amazon web services - Setting .authorize_egress() with protocol set to all -

i trying execute following code def createsecuritygroup(self, securitygroupname): conn = boto3.resource('ec2') response = conn.create_security_group(groupname=securitygroupname, description = 'test') vpc_nat_securityobject = createsecuritygroup("mysecurity_group") response_egress_all = vpc_nat_securityobject.authorize_egress( ippermissions=[{'ipprotocol': '-1'}]) and getting below exception exception : an error occurred (invalidparametervalue) when calling authorizesecuritygroupegress operation: amazon vpc security groups may used operation. i tried several different combinations not able set protocol . used '-1' explained in boto3 documentation. can pls suggest how done. (update) 1.boto3.resource("ec2") class high level class wrap around client class. must create extract class instantiation using boto3.resource("ec2").vpc in order attach specific vpc id e.g. im...

get another xml value located in another path using xslt -

i want convert input xml output xml. xml conversion using xslt. input xml , supporing xml files in local path(same path only). xsl , saxon9.jar in server path. output xml created in local path(same input xml path). using xslt2.0 can input xml values not able supporting xml values(present in local) d:\test>java -jar saxon9.jar -s:"d:\tools\masterrefs.xml" -xsl:"iop-new.xsl" -o:"d:\tools\out.xml" below xsl getting values supporting.xml < xsl:variable name="fpath" select="document('supporting.xml')" /> <journal-title> <xsl:value-of select="$fpath/item-info/titles/journal-title"/> </journal-title> can me this... try <xsl:variable name="fpath" select="document('supporting.xml', /)"/> resolve relative uri 'supporting.xml' main input document ( / ) providing base uri.

javascript - How to Access / Read any Text / Tag Value from the Webpage using Chrome Extension -

i writing first chrome plugin , want text present on current webpage , show alert when click extension. lets using any webpage on www.google.com after search query, google shows "about 1,21,00,00,000 results (0.39 seconds) " . want show text alert when execute plugin. doing. here manifest.json using { "manifest_version": 2, "name": "getting started example", "description": "this extension shows google image search result current page", "version": "1.0", "background": { "persistent": false, "scripts": ["background.js"] }, "content_scripts": [{ "matches": ["*://*.google.com/*"], "js": ["content.js"] }], "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "activetab" ] } here popup.js ...

file - How to search phrases in a string in python -

i change text file string. string has been formatted like {'au': 'smith, s’}, {'au': 'james, a’}, {'au': 'stevens, p’} i used code try , find number of times name appears in data. however, returned actual original string. there anyway fix this? searchfile = open('file.txt', 'r') line in searchfile: if 'author name' in line: print (line) searchfile.close() what print 'author name' searchfile = open('test', 'r') word = "test" lst = [] line in searchfile: = line.split() x in a: if x == word: lst.append(x) print(lst) searchfile.close() this took little bit of research , testing, should wanted :). line.split() put words separated space in text file list. there, cycle through list checking if matches world. if does, push our list , later on print can see. if searching smith example "'smith," because there's no space separa...

algorithm - Sum of elements in the power of a matrix -

given matrix a , effective method 1 can obtain sum of elements of a^n ? thinking of property related matrices solve problem without carrying out n multiplications find a^n . to n-th power of matrix, need log(n) matrix multiplications using exponentiation squaring approach . p.s. doubt formula or property sum of elements in power of matrix exist - mathematicians discuss estimation specific kinds of matrices

javascript - Redux reducer not updating state object -

i have following code, , trying update state not working. import immutable 'immutable'; import _un 'underscore'; import { list, map } 'immutable'; const defaultstate = map({ isfetching:true, deparments: list(), products:list(), breadcrumb:list() }) i using set when console before return prints original object. doing wrong? switch(action.type) { case 'get_gallery_data': //console.log("-- api success handler--"); //console.log(action); var depts = getgalleryparseddata(action.res.data); var products = getproducts(action.res.data); var breadcrumb = getbreadcrumbs(action.res.data); state.set('isfetching', true); state.set('deparments', list(depts)) state.set('products', list(products)) //state.set('breadcrumb', list(breadcrumb)) console.log("---state----"); console.log(state); return state; immutab...

Excel error linking C++: "A value used in the formula is of the wrong data type" -

i wrote simple c++ program source.cpp: double __stdcall square(double& x) { return x*x; } define.def: library "square" exports square then in .xlsm file modules, added module1 imporing: declare ptrsafe function square _ lib "c:\users\user\documents\athoscode\marek kolman square\square\debug\square.dll" _ (byref x double) double and in sheet1, put 10 in a1, , =square(a1) in b1. the error says: "a value used in formula of wrong data type". what's problem , how fix it? my environment - windows 7 64-bits - visual studio 2016 community (so it's 32-bits) - excel 2016 64-bits replying comment, if change passing reference passing value, error same. i changed source.cpp to double __stdcall square(double x) { return x*x; } and changed module1 as declare ptrsafe function square _ lib "c:\users\user\documents\athoscode\marek kolman square\square\debug\square.dll" _ (byval x double) double same erro...

Apache James not receiving email from external senders after SSL enabled -

very new james, please bear question. james 2.3.2.1, ubuntu 14.04. configured both pop3 , smtp. ssl enabled , certificate store connected. the problem this: once ssl enabled, smtps listen port 465, , there no longer listener on standard port 25 receive email external senders (e.g., gmail). mail delivery sent local accounts works when sent other local accounts, fails when sent external servers. is possible configure james listen both on standard port 25 external senders , on secured port 465 authenticated senders? if so, how done, , how make sure doesn't become open relay (i.e., receives mail sent local user accounts)? ssl configuration, set both authrequired , verifyidentity true, ensures authenticated users can send mail. standard smtp, i'm not sure: a) how configure while having secured connection; and b) how avoid becoming open relay. thanks in advance help. so didn't find way in james, goals were: a) secured smtp authenticated (domain) user acco...

android - Open Virtual Machine Genymotion Network error -

Image
error when open virtual device nexus 7 android 5.0 api 21 if have tried above solution , still in trouble enable virtuaization in bios. error occurs if have not enabled virtualization in bios.please check on once :) :)

Query data in SQL Server - C# -

how perform search having data in sql server ?db203143#f####** 1a4f4n8bx600##### 123h9e3w#9y1##### when there special characters ?#** in field equivalent characters(a-z) , numbers(0-9). ? = letters(a-z) or numbers(0-9) # = letters(a-z) or numbers(0-9) * = letters(a-z) or numbers(0-9) having data in database: id: ?db203143#f####** model: testdata and when search for: id: adb20314431f123456 or 1db2031431fffffff or 0db2031435f1f05hj this data must returned , can model testdata thank in advance help. to build on greg's answer, if trying search columns , tables string, dynamically list of columns. give list of columns in corresponding table , schema. select s.name schemaname, t.name tablename, c.name columnname sys.tables t join sys.schemas s on t.schema_id = s.schema_id join sys.columns c on t.object_id = c.object_id

php - WordPress site isn't working after I migrated site - changed site address (URL) -

Image
i migrated local computer live server using duplicator. when switched over, wordpress address (url) http://107.343.442.344 - ip address - , site address (url) http://nameofwebsite.com . appears working fine. however, when add item cart , try delete it, doesn't remove item. check console , there's failed ajax request. it's requesting information http://107.343.442.344 . so, change site url http://107.343.442.344 , works fine. however, can't go front page. i tried making these changes database (wp-options), nothing works. does know can correct problem. i've contacted woocommerce, they're taking forever. my site not up, can't go it. easiest way how migrate site localhost server: copy local site files web server install , activate "wp migrate db" plugin local site, it's free , got functionality need. after "wp migrate db" activation find under "tools" > "migrate db". open "migra...

bash - extract value by position and maximum length -

i have extract pattern @ ( position 13 , maxlength= 10 ) files : file 1 : fjlksflsf content1 blabla kjodeddek content1 blabla fdfkjlsdd content1 blabla fsdffsdfs content1 blabla . . . dzedojioj content1 blabla i use script extract value "content1" file 2 fjlsdfsf content22 blabla gfgttsdd content22 blabla gzdfldfd content22 blabla azefsgtg content22 blabla . . . fsffsdfj content22 blabla same thing here script should loop files , extract right value @ position 13 till position 23 print on screen, exemple extracted value second file "content22" in awk. if want position 13, length 10: $ awk '{print substr($0,13,10)}' file1 content1 content1 ... you print second field: $ awk '{print $2}' file1 content1 content1 ...

javascript - Correct way to reference up to date Vue delimiters in a component -

i'm authoring component vue.js applications , have run problem if delimiters changed in application code, plugin template not work correctly (this picked because alter vue delimiters not conflict twig template tokens). my component sake of example looks like: vue.component('example', { template: 'something {{ normal_delimiters }}' }); assuming standard <script> includes in application: <script src="path/to/vue.js"></script> <script src="path/to/my-component.js"></script> <script src="path/to/application.js"></script> referencing vue.config.delimiters option in component code yield default ( {{ }} ) aren't changed until application code farther down page. there few roads invest in looking @ using ready handler on component , somehow updating template string, forcing delimiters changed first piece of javascript in page (very bad experience) etc, thought i'd ask if th...

ruby - Rails 4 - flash-alert with plain text and ERB -

i'm unsure if way i'm treating issue, or erb. right when user registers, sent activation email. if haven't activated, , try log in, they're prompted "sorry, you're not authorized." want modify offers them resent email, well. sessionscontroller class sessionscontroller < applicationcontroller def new end def create user = user.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) if user.activated? log_in user params[:session][:remember_me] == '1' ? remember(user) : forget(user) redirect_back_or user else message = "account not activated. " message += "check email activation link, or click" + <%= link_to "here", :controller => :user, :action => :resend_email %>+ "to have resent!" flash[:warning] = message redirect_to root_url end e...

python - add ambient light to vispy scene -

i trying add ambient light vispy mesh. here code using render triangulated mesh. meshdata = vispy.geometry.meshdata(vertices=r.vertices, faces=r.faces, vertex_colors=r.vcolor) canvas = scene.scenecanvas(keys='interactive', size=(800, 600), show=true) mesh = scene.visuals.mesh(meshdata=meshdata, shading='smooth') view = canvas.central_widget.add_view() view.add(mesh) view.bgcolor = '#efefef' view.camera = turntablecamera(azimuth=azimuth, elevation=elevation) color = color("#3f51b5") axis = scene.visuals.xyzaxis(parent=view.scene) if __name__ == '__main__' , sys.flags.interactive == 0: canvas.app.run() somehow mesh appears dark , want add ambient lights this. how can this? searched online , seems not easy. want start using python 3 , trying use vispy instead of mayavi. appreciated.

jquery - Dynamic forms - Auto fill fields based on previous auto complete -

i have form 2 fields phone , name want when user selects phone number using ajax autocomplete name field auto filled name correspond phone number. watching railscasts episode able make ajax autocomplete works, clean way of doing auto filling? patients_controller class patientscontroller < applicationcontroller def index @patients = patient.order(:phone).where('phone ?', "%#{params[:term]}%") json_data = @patients.map(&:phone) render json: json_data end end reservations.coffee $(document).ready -> $('#patient_phone').autocomplete source: "/patients/index" _form.erb <%= f.fields_for :patient, appointment.patient |patient| %> <%= patient.text_field :phone, id: 'patient_phone' %> <%= patient.text_field :name %> <%= f.submit %> <% end %> not sure how build relationship between name , phone number can auto fill name inside autocomplete select event this ...

cytoscape.js - Cytoscape: finding the leaves of a specific node -

i suppose possible find leaves of particular node. first line of code works, second returns empty object {} what doing wrong? thanks! console.log( cy.nodes().leaves().jsons() ); console.log( cy.nodes("[id='1.1']").leaves().jsons() ); selectors can't have metacharacters, . . need escape them. refer http://js.cytoscape.org/#selectors/notes-amp-caveats

java - how i get the 2nd object of a Hashmap -

i have code: public class game { string no_movements = chatcolor.red+"you don't have sufficient movements that"; public static hashmap<player,integer> movements = new hashmap<>(); public void setupmovements(player player){ movements.put(player,15); } public void movementsmanager(player player){ } public static hashmap arrowshoow(player player){ } } and need know "movements"(int) of hashmap, how it?? thank much! if want know integer value specified player : integer value = movements.get(player); if want know player specified integer : integer value = 15; /* put int value looking here */ player player = movements.entryset().stream() .filter(entry -> entry.getvalue().equals(value)); keep in mind if there no player specific integer , null. if want second object inserted map, need use linkedhashmap , retains order in keys inserted map. retrieve second item inserted map: ...

javascript - Follow hyperlink and re-load page if hyperlink points to current page -

i have tried google way through this, , haven't found answer looking for. have found how reference own location: here , how reload current page: here . looking bit more in depth. i have small website indexed json. on homepage have textbox , button. when user presses button java script registers event , sends contents of textbox php file on server. php cross-references json index search contents. if contains search contents, php throws html element preview of indexed element along link content , returns html js. js appends html element webpage , user sees results (with of css rules). when search results contains element on current page run issue: clicking link focus page on content, won't remove results element. happen page re-load when click link. way html element search results no longer appear/exist. there html attribute sets link re-load webpage on click? i know come js/jquery solution this. i'd use simple approach if exists. thanks! i want tha...

python - How to load a Spark model for efficient predictions -

when build spark model , call it, predictions take tens of ms return. however, when save same model, load it, predictions take longer. there sort of cache should using? model.cache() after loading not work, model not rdd. this works great: from pyspark.mllib.recommendation import als pyspark import sparkcontext import time sc = sparkcontext() # example data r = [(1, 1, 1.0), (1, 2, 2.0), (2, 1, 2.0)] ratings = sc.parallelize(r) model = als.trainimplicit(ratings, 1, seed=10) # call model , time = time.time() t in range(10): model.predict(2, 2) elapsed = (time.time() - now)*1000/(t+1) print "average time model call: {:.2f}ms".format(elapsed) model.save(sc, 'my_spark_model') output: average time model call: 71.18ms if run following, predictions take more time: from pyspark.mllib.recommendation import matrixfactorizationmodel pyspark import sparkcontext import time sc = sparkcontext() model_path = "my_spark_model" model = mat...

How to autowire beans inside a Spring Integration custom message handler? -

i wish create custom message handler use checkpoints in flows. besides, checkpoints stored in elasticsearch . i created class checkpoint : @component public class checkpoint { public static final string task_header_key = "task"; public static checkpointmessagehandlerspec warn(string message) { return new checkpointmessagehandlerspec(new checkpointhandler("warn", message)); } } // ... methods omitted: error, info etc next created checkpointmessagehandlerspec : public class checkpointmessagehandlerspec extends messagehandlerspec<checkpointmessagehandlerspec, checkpointhandler> { public checkpointmessagehandlerspec(checkpointhandler checkpointhandler) { this.target = checkpointhandler; } public checkpointmessagehandlerspec apply(message<?> message) { this.target.handlemessage(message); return _this(); } @override protected checkpointhandler doget() { throw new unsup...

python - Error: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed -

Image
i'm trying set key combination gtkmenubutton . made through glade. when loading application error: gtk-critical **: gtk_window_add_accel_group: assertion 'gtk_is_window (window)' failed glade file python code

Send sessions to subdomain with ajax? -

i want create mobile version of website , process sending request main website , result design mobile.but need each user differently thats why need user id access on sub domain or domains releted ex.com searched , found header('access-control-allow-origin: '.$_server['http_origin']); $some_name = session_name("some_name"); session_set_cookie_params(0, '/', '.example.com'); session_start(); echo('id=',$_session['user']['id']); it works different opened tabs.for example 1 tab show www.ex.com show m.ex.com sessions same(if session id 12 on www.ex.com means on m.ex.com session id 12) when send request ajax(jquery) doesnt work echo this: 'id='

java - wro4j sass preprocessor throwing exception in spring integration -

i working on adding sass support css, , added sasscss preprocessor configuration, not working expected rather throwing exception ro.isdc.wro.extensions.processor.css.sasscssprocessor@18f6b97. reason: bad language version: 180 here exception: severe: exception occured ro.isdc.wro.wroruntimeexception: processor: ro.isdc.wro.extensions.processor.css.sasscssprocessor@18f6b97 faile while processing uri: /css/framework/reset.2.css @ ro.isdc.wro.wroruntimeexception.wrap(wroruntimeexception.java:69) @ ro.isdc.wro.model.resource.processor.decorator.exceptionhandlingprocessordecorator.process(exceptionhandlingprocessordecorator.java:67) @ ro.isdc.wro.model.resource.processor.decorator.processordecorator.process(processordecorator.java:86) @ ro.isdc.wro.model.resource.processor.decorator.benchmarkprocessordecorator.process(benchmarkprocessordecorator.java:44) @ ro.isdc.wro.model.resource.processor.decorator.processordecorator.process(processordecorator.java:8...

nginx - How to configure /etc/hosts to test local Docker setup -

i'm trying develop web app locally using native docker os x (beta) handle entire environment. in order fake production dns configuration (to test nginx setup) have edited host file (at /private/etc/hosts): ## # host database # # localhost used configure loopback interface # when system booting. not change entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost # added me 0.0.0.0 www.mydomain.com the nginx config file tested , working on production server. expected behaviour: when point browser www.mydomain.com should redirected ip 0.0.0.0 (dockers default ip on osx), , containerized web app should appear. actual behaviour: browser shows "failed open page" error message. what missing here? you docker-for-mac ip ist not 0.0.0.0 - nothing has ip. use 127.0.0.1 if using docker-for-mac. also ensure, when start docker, export ports host, either docker-compose or docker run adding -p 80:80 when starting ...

node.js - Node - Override function in all files except one -

i've been looking around @ somehow disabling console.log in application while running unit tests, , found answers can override console.log this: console.log = function(){}; i tried putting in app.js, , overrides console.log when i'm running app, not when running unit tests, tried adding test file, overrides mocha / chai's console.log, , blank screen. is there way override console.log in files except 1 running? what want instead use logging library loggly or bunyan. these pass message want log client , can output logs based on environment in. in case want log during production not during testing (kindof odd, whatever). set process.node_env dev or prod accordingly , logger take care of logging you. here's overview of loggers .

javascript - Calling array names dynamically inside jQuery -

i'm pretty sure question going negative response many people have asked in so. trust me have read every single answer of every single question none helped. i know in jquery can put array key name dynamically this: somearray1["abc" + variable] i'm not looking that. want call array name dynamically like: var i=1; console.log( "somearray" + i["abc" + variable] ) can tell me how possible? cannot put in array , call i'm building dynamic script, must need call array name dynamically. any highly appreciated. normaly, array depend this. this["somearray" + i]["abc" + variable] var bob1 = [1,2,3]; var name = "bob"; console.log(this[name+"1"][0])

Getting MEP error while deploying .aar file on Axis2 Server -

i tying deploy .aar file everytime encountered error. logs below: org.apache.axis2.deployment.deploymentexception: unsupported message exchange pattern (mep) exists in id http://www.w3.org/2006/01/wsdl/in-out . i got error when using axis2-1.7.3-bin distribution replacing latest distribution older axis distribution helped me rid of error.

machine learning - The output of a softmax isn't supposed to have zeros, right? -

i working on net in tensorflow produces vector passed through softmax output. now have been testing , weirdly enough vector (the 1 passed through softmax) has zeros in coordinate one. based on softmax's definition exponential, assumed wasn't supposed happen. error? edit: vector 120x160 =192000. values float32 it may not error. need @ input softmax well. quite possible vector has negative values , single positive value. result in softmax output vector containing zeros , single 1 value. you correctly pointed out softmax numerator should never have zero-values due exponential. however, due floating point precision, numerator small value, say, exp(-50000), evaluates zero.

android - Why is my download button in phonegap app not working? -

i have made working download button html referring sound in de websites folder. when convert phonegap not working annymore. html code: <a href="path local sound" target="_blank" download>download sound</a> the sounds can played withing app generated phonegap, means path , sound matched correctly.

java - OkHttp Request in Separate Class -

so have okhttp requests in mainactivity in order test worked. however, need move them separate class can use requests populate navagation drawer menu items. furthermore, in mainactivity, oauth of invalidating token , requesting , token needs used in requests. bit lost calling new class in mainactivity apirequest.run(); in run console. i/system.out: ya29.cjbiax67rm70-cku9wc5fuslzt9riqt4brubpl4hb9ujwqeratozppbmmndl_spcfwa e/authapp: ya29.cjbiax67rm70-cku9wc5fuslzt9riqt4brubpl4hb9ujwqeratozppbmmndl_spcfwa w/system.err: java.lang.nullpointerexception: attempt invoke interface method 'java.lang.string android.content.sharedpreferences.getstring(java.lang.string, java.lang.string)' on null object reference w/system.err: @ com.example.jamessingleton.chffrapi.authpreferences.gettoken(authpreferences.java:43) w/system.err: @ com.example.jamessingleton.chffrapi.apirequests.run(apirequests.java:34) w/system.err: @ com.example.jamessingleton.chffrapi.mainactivity$1.oncli...

ruby on rails - Carrierwave not uploading image for model through different controller -

i'm trying upload file carrierwave form , controller that's separate model carrierwave mounted on. my uploader logouploader mounted on :logo attribute of setting model. class setting < activerecord::base validates :name, presence: true, uniqueness: true mount_uploader :logo, logouploader end migration: class addlogotosettings < activerecord::migration def change add_column :settings, :logo, :string end end i have form @ views/feedback/configure.html.erb handling image upload through feedbackcontroller : <%= form_tag({:action => 'save_configuration'}, id: 'form-save') %> <div class="form-group"> <%= file_field_tag "settings[cac_hlogo]" %> <%= image_tag(@cac_hlogo.logo.url) if @cac_hlogo.logo? %> </div> <div class="form-actions"> <%= submit_tag t('save').titlecase, class: 'btn btn-primary' %> </div> ...

angularjs - Must give users a success or error message -

when eg. sends right out , text json must provide true. if gives true must make success message. if not fit, must go , give error. the problem right should return if successful or error. it's send whether have solved problem right or wrong in relation time , text have written. this how have built website in mvc. asp.net <input type="hidden" ng-init="getid='@model.id'" ng-model="getid" /> <div ng-repeat="module in newslist" style="clear:both; margin:7px 0; min-height:110px; margin:5px 0;"> <div class="col-md-8"> <div ng-show="succes"> succes </div> <div ng-show="error"> error </div> <div style="clear:both; margin-bottom:10px;" class="col-md-10"> <input type="text" ng-model="modul...

javascript - Fetch POST with some headers -

i want post data using fetch function. i've been testing curl command aim of find correct response. found command works want looks this: curl -0 -a '' -x post -h 'accept: ' -h 'content-type: text/xml; charset="utf-8"' -h "soapaction: \"urn:belkin:service:basicevent:1#setbinarystate\"" --data '<?xml version="1.0" encoding="utf-8"?><s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"><s:body><u:setbinarystate xmlns:u="urn:belkin:service:basicevent:1"><binarystate>0</binarystate></u:setbinarystate></s:body></s:envelope>' -s http://192.168.1.48:49153/upnp/control/basicevent1 the parameters of fetch that i've setted: fetch('http://192.168.1.48:49153/upnp/control/basicevent1', { method: 'post', headers: { 'acce...