Posts

Showing posts from May, 2012

java - How to make an html-file appear on localhost with Spring Boot? -

i using spring boot , have html-file "index.html", , have class "functions". basically, want happen when functions-class run, , when go localhost:8080, html-template appears @ localhost. how should this? here segment of functions-class: public class functions{ @requestmapping("/") public void gethomepage(){ //return html-template } } the html-file called "index.html" , in src/main/resources/static-folder. thank you! first of all, put index.html template file in src/main/resources/templates instead of in src/main/resources/static . your class functions must spring mvc controller; can make controller adding @controller annotation. return name of template in gethomepage() method: @controller public class functions { @requestmapping("/") public string gethomepage() { return "index"; } } this basic spring web mvc; see tutorial serving web content guide on spring

javascript - How to read Current logged-in user using Angularjs -

could me, how read current logged-in user id, name using angularjs ? well, on callback service, stores users, can put required credentials in i.e. angular-storage , use further in application

How to install manually package for sublime text on osx? -

trying install third-party st3-livereload package sublime text ( https://github.com/grafikart/st3-livereload ) on osx manually (there no package in package manager). when extracting folder zipped archive in macos>packages folder, doesn't work sublime cause needed .sublime-package extension. git instruction macos in repository not worked me too. don't worry .sublime-package files, these installed when using package control. the instructions on link repository use outdated url. here how install package using git : cd ~/library/application\ support/sublime\ text\ 3/packages/ git clone https://github.com/grafikart/st3-livereload livereload

angularjs - prevent user to access if has not logged in (only login/register views) -

i creating app ionic. need when user not logged, , him go state/page not log/register view, app move login or register. but code generates loop. $rootscope.$on('$statechangestart', function(event, tostate, fromstate){ if(!userfactory.isloggedin() && (tostate.name !== 'login' || tostate.name !== 'register') ){ event.preventdefault(); $state.go('login'); }else if(tostate.name == 'login' || tostate.name == 'register'){ $state.go(tostate.name); } }); ** update ** i removed else if statement, problem same. $rootscope.$on('$statechangestart', function(event, tostate, fromstate){ if(!userfactory.isloggedin() && tostate.name !== 'login' ){ event.preventdefault(); $state.go('login'); } }); any solution? thanks! pd: sorry poor english.

hql - Hibernate select elements of collection with a given property -

entity project has collection property contributors mapped @onetomany relationship entity user @entity @table( name = "projects" ) public class project { ... @onetomany @jointable(name = "project_contributors") private list<user> contributors = new arraylist<user>(); ... } i need check if contributors has user id contributorid before adding it. trying hql query, quite innept. what trying: query query = session.createquery( "select p.contributors project p p.id = :pid , p.contributors.id = :cid" ); query.setparameter("pid", projectid); query.setparameter("cid", contributorid); @suppresswarnings("unchecked") list<user> res = (list<user>) query.list(); but gives error illegal attempt dereference collection [project0_.id.contributors] element property reference [id] is there samaritan give me little push? another try made is "select p.con

java - How to call a method only when the app has been launched? Please see details -

i have method in i'm fetching user's details , data firebase database. the problem method getting called twice or thrice after launching app , again when i'm navigating other activity. i have put method in oncreate method this: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); checkauthstate(); } i sure haven't called checkauthstate() in onstart() or onresume() methods. this how i'm navigating other activity: @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case android.r.id.home: onbackpressed(); return true; } return super.onoptionsitemselected(item); } please let me know why checkauthstate() getting cal

mapreduce - Aggregate pipes together in Hadoop -

so have giant pipe in cascade looks this: k1 - v1 k1 - v2 k1 -v3 k2 - v4 k2- v5 k2-v6 is there anyway aggregate them using every pipe such output looks along these lines: k1 - {v1, v2, v3} k2 - {v4, v5, v6} thank you! edit: my code far: i calling every pipe outputpipe = new every(outputpipe, fields.all, somebuffer()); and overriding operate method in buffer: @override public void operate( flowprocess flowprocess, buffercall buffercall ) { tupleentry group = buffercall.getgroup(); // current argument values grouping iterator<tupleentry> arguments = buffercall.getargumentsiterator(); // create tuple hold our result values string result = ""; string key = ""; if (arguments.hasnext()) { tupleentry argument = arguments.next(); key = argument.getstring("key") + "\t"; } while (arguments.hasnext()) {

mysql - SQL query for lots and bids: finding if user has highest bid -

i'm building laravel auction application. have table lots , table bids. lots table: mysql> select id, lot_name, created_at, updated_at lots; +----+----------+---------------------+---------------------+ | id | lot_name | created_at | updated_at | +----+----------+---------------------+---------------------+ | 1 | lot 1 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 2 | lot 2 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 3 | lot 3 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 4 | lot 4 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 5 | lot 5 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 6 | lot 6 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 7 | lot 7 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 8 | lot 8 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 9 | lot 9 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 10 | lot 10 | 2016-06-09 14:23:58 | 2016-06-09 14:23:58 | | 11 | lot 11 | 2016-06-09 14:23:58

java - Finding hidden form elements in selenium webdriver -

can me following, submit form contains several hidden elements. example, <div id="42511f94-8a79-44b0-b875-caee5e4f8472" class="enquiry-modal-wrapper" style="height: 1964px;"> <div class="enquiry-modal-border-top main-contact "> <div class="enquiry-modal-hold"> <div class="enquiry-modal"> <div class="enquiry-modal-header"> <div class="enquiry-modal-body"> <div id="8b492185-17f0-4343-b3b1-98c375943f07"> <form method="post" enctype="multipart/form-data" action=""> <input type="hidden" value="wvz4z5zyy0r1crda84tneiu51y-n3-8fdp9gbthoptzv2syaohiszixy_g0zlkmxmt-e9_tiqostwzuyfafe0fsmtkg1" name="__requestverificationtoken"/> <input id="formid" type="hidden" value="26ce85a6-4634-44f7-80bb-d9a391d9507f" name="formid" data-val-required="the

javascript - Scrapy + phantomjs + selenium raise NotImplementedError -

i'm trying scrape page javascript elements, i've made this, has part pass 302 (that tested , works fine): class bllanguage(scrapy.spider): handle_httpstatus_list = [302] name = "bllanguage" allowed_domains = ["http://explore.com/"] start_urls = [ 'http://explore.com/this-other-url' ] def __init__(self): driver = webdriver.phantomjs(executable_path='/usr/local/bin/phantomjs') def start_requests(self): u in self.start_urls: r = scrapy.request(url = u, dont_filter=true, callback=self.parse) r.meta['dont_redirect'] = true yield r def parse(self, response): driver.get(response.url) print response.url it gives me error: traceback (most recent call last): file "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runcallbacks current.result = call

jsp - Scrollbar to div element in jquery -

i putting scrollbar div element,below code i have function assigns text it $.each(obj, function(index,value) { displaystringappdata = displaystringappdata+'<xmp>'+value+'</xmp>'; $("#configwindow").html('<br>'+displaystringappdata); showrcmodal('configwindow', 400, 700); }); where function showrcmodal(divid, height, width) { var rcmodel = ""; $('#'+divid).modal({ onshow: function() { rcmodel = ; }, onclose : function() { rcmodel.close(); } }); $("#simplemodal-container").css({'height':height,'width':width,'padding':'0','border':'0'}); $(window).trigger('resize.simplemodal'); return rcmodel; } but scroll not coming.what should do.please me use overflow:scroll prope

visual studio - Why waitforexit dont work for all exe with C#? -

why of applications work waitforexit doesn't work notepad works fine bit dcomcnfg.exe doesn't reason has edited app.manifest run application admin right application debuged cpu my code is: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.diagnostics; namespace prchk { public partial class form1 : form { public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { method(); } public void method() { process prcs = new process(); prcs.startinfo.filename = @"c:\windows\system32\dcomcnfg.exe"; //p.startinfo.arguments = argu; prcs.startinfo.useshellexecute = true; prcs.start(); prcs.waitforexit(); mes

How to erase canvas using the cursor -

i'd add responsive canvas web page. black div , should erasable cursor. div 1 (canvas) on top of div 2 (text). cursor should erase div 1 , reveal div 2. update i'm using code it's not working. var canvas = document.getelementbyid("canvastop"); var ctx = canvas.getcontext("2d"); ctx.linewidth = 10; ctx.linecap = "round"; ctx.linejoin = "round"; ctx.fillstyle = "skyblue"; ctx.fillrect(0, 0, canvas.width, canvas.height); var canvasoffset = $("#canvastop").offset(); var offsetx = canvasoffset.left; var offsety = canvasoffset.top; var startx; var starty; var isdown = false; function handlemousedown(e) { e.preventdefault(); startx = parseint(e.clientx - offsetx); starty = parseint(e.clienty - offsety); isdown = true; } function handlemouseup(e) { e.preventdefault(); isdown = false; } function handlemouseout(e) { e.preventdef

php - How to use .tpl files in zend frame work 2? -

i learner in zend framework. tried this link , working fine. want use .tpl files instead of .phtml files. referred this . link , followed steps. when run project null page...! whats wrong , did missed? or other way use .tpl files instead of .phtml files? the error getting : fatal error: uncaught exception 'zend\modulemanager\exception\runtimeexception' message 'module (smartymodule-dev) not initialized. actually added "smartymodule-dev" in vendor folder installation steps via composer library's manual add "murganikolay/smarty-module": "1.0.0" composer.json file , run php composer.phar update. add smartymodule config/application.config.php file under modules key. you forgot add smartymodule config/application.config.php file

socket.io JWT with PHP -

i running php website(www.mywebsite.com). add real-time chat function users can chat others. i decided run node.js , socket.io in server separating web server(chat.mywebsite.com). users wish use chat function have log in through www.mywebsite.com. after login, sent chat page (www.mywebsite.com/chat). on page client must post request web server jwt , use jwt authenticate in socket.io. my question is: if jwt stolen else, , pass jwt socket.io, fake server user authenticated. approach correct or can suggest method situation? thanks! if has access jwt token - hijacked session, https://en.wikipedia.org/wiki/session_hijacking as long don't have xss's or other vulns on website, shouldn't should worry about. just make sure socket.io auth user using jwt token before letting him send/recieve messages.

git - Locally pushing GitHub Repository to master branch:Not pushing folders -

so i've got local copy of github repository , pushed local changed master branch. only individual files added , not new folders containing files any idea why folders weren't uploaded? i used git clone git add . git commit -m "blah" git push origin master to make changes pre-existing repository did not make whole new repository git init , didn't "bare" or whatever command is. as determined in comments question - if have files, or parent folder files matching pattern in project's .gitignore file, without specific exceptions files trying add git add . then git not stage files , therefore not committed or pushed subsequent commands.

c# - Distribute N items over a Set at least once -

given set of n items in dictionary , occurrences associated it. have assign x slots each item based on overall probability, @ least 1 slot per item. here i've come with: using system.collections.generic; using system.diagnostics; using system.linq; public static class program { public static void main( string[] args ) { var dict = new dictionary<char,int>(); dict.add( 'a' , 10 ); dict.add( 'b' , 0 ); dict.add( 'c' , 4 ); dict.add( 'd' , 1 ); dict.add( 'e' , 9 ); dict.add( 'f' , 0 ); var distributionmap = distribute( dict , 40 ); } public static dictionary<t,int> distribute<t>( dictionary<t,int> occurmap , int slots ) { var freeslots = slots - occurmap.count; var total = occurmap.sum( x => x.value ); var distmap = new dictionary<t,int>(); foreach( var pair in occurmap ) {

java - Error/warnings list in IDEA -

Image
does idea have error/problems list in eclipse? mean this: alt+0 bring messages tab or click on view -> tool windows -> messages if click on build -> make project or ctrl+f9 should automatically bring if have errors.

r - Change the spacing of tick marks on the axis of a plot? -

how can change spacing of tick marks on axis of plot? what parameters should use base plot or rgl ? there @ least 2 ways achieving in base graph (my examples x-axis, work same y-axis): use par(xaxp = c(x1, x2, n)) or plot(..., xaxp = c(x1, x2, n)) define position ( x1 & x2 ) of extreme tick marks , number of intervals between tick marks ( n ). accordingly, n+1 number of tick marks drawn. (this works if use no logarithmic scale, behavior logarithmic scales see ?par .) you can suppress drawing of axis altogether , add tick marks later axis() . suppress drawing of axis use plot(... , xaxt = "n") . call axis() side , at , , labels : axis(side = 1, @ = v1, labels = v2) . side referring side of axis (1 = x-axis, 2 = y-axis), v1 being vector containing position of ticks (e.g., c(1, 3, 5) if axis ranges 0 6 , want 3 marks), , v2 vector containing labels specified tick marks (must of same length v1 , e.g., c("group a", "group b"

c++ - explanation of glFrustum() compared to gluLookAt() -

i'm debugging code want @ scan of depth image, camera setup doesn't let me see scan. thus, i'm playing around camera setups. create huge point @ (30,120,800) , can see using glulookat. according setup glfrustum(left, right, bottom, top, near, far)? using setup, point should lay in center, cannot see it. void ondisplay() { glenable(gl_normalize); glenable(gl_depth_test); glmatrixmode(gl_projection); glloadidentity(); glmatrixmode(gl_modelview); glloadidentity(); glclearcolor( 1.0f, 1.0f, 1.0f, 1.0f ); glclear( gl_color_buffer_bit | gl_depth_buffer_bit ); gldisable(gl_cull_face); glpushmatrix(); glpointsize( 1111111116.0 ); glcolor3f( 0.25f, 0.907, 0.731f ); glloadidentity(); // set camera //glulookat( 30.f, 120.0f, 800.f, 30.f, 120.0f, 800.f, 0.0f, 1.f, 0.0f); //works glfrustum( 28, 32, 118, 122, 798, 802); glbegin( gl_points ); glvertex3f( 30, 120, 800 ); //30,120,800 glend(); glpopmatrix(); //glfinish(); //glutswapbuffers(); glutswapbuffers()

Atomikos Transaction management spring boot/spring jams -

i have spring boot application spring jms using defaultmessagelistener container. using atomikos transaction management. on exception message queue roll works fine , messages move out queue, database updates not roll back. have set autoconfigured jtatransactionmanager on defaultmessagecontainerbean. there other configurations required here true global transaction management. using batis database. public class cuslistener implements messagelistener{ public void onmessage(message message) { //database call catch (exception ex) { throw (new runtimeexception()); } } } @configuration public class listenercontainer{ @bean public defaultmessagelistenercontainer defaultmessagelistenercontainer(connectionfactory queueconnectionfactory,mqqueue queue, messagelistener listener, jtatransactionmanager jtatransactionmanager) { defaultmessagelistenercontainer defaultmessagelistenercontainer = new def

excel - Date related query -

i stuck small issue in excel date function. if given date ex. 15-02-2009 if need know equivalent of date of year, how find it? for ex. given date 15-02-2009 ideally answer should 15-02-2016. how calculate huge data? many help! best regards, arun i think easiest way is =date(2016,month(a1),day(a1)) if original date in a1.

php - Laravel Blade - User Allowed to Input Variable -

i'm making admin setting section of laravel 5.2 app using storage package thetispro/laravel5-setting . i'd admin users able update email copy sent out user, of emails include variables such users name. "thanks shopping us, customer name". i can store following in setting, when blade outputs it prints out string instead of variable. i've tried escaped , nonescaped characters {{}} , {{!! !!}. here's have: email message admin user can edit: <h2>hi, {{ $user->name }}</h2> <p>welcome web app</p> in view have: {!! setting::get('emailuserinvite') !!} <br /><br /> <!-- testing both escaped , nonescaped versions --> {{ setting::get('emailuserinvite') }} what blade renders just: echo "<h2>hi, {{ $user->name }}</h2> <p>welcome web app</p>"; i trying make custom blade directive close echo, display variable , open echo up, doesn't seem working correct

facebook - react-native-fbsdk for Windows app -

i using react-native-fbsdk react native project. it working fine android , ios , followed steps mentioned on official site. https://developers.facebook.com/docs/react-native but, there no resources fbsdk windows integration. is possible integrate fbsdk windows react-native app ? depending on features want, ported of react-native-fbsdk features f8 developer conference app here: https://github.com/reactwindows/f8app/tree/master/windows/f8v2/fbsdk and leveraged shared wrapper around fb sdk encapsulated slight differences in api: https://github.com/reactwindows/f8app/blob/master/js/facebooksdk.js

multithreading - Different execution contexts and thread allocation with akka-http -

not sure if that's right stackexchange question i've got akka-http application acts front heavy computation. requests handles vary in time takes process them. finish within 1 second, take more that. computation purely asynchronous, there's no await @ point, complete requests future, i.e.: val spotsjsonf: future[string] = spotsf.map(spots => debugformatter.producejson(text, spots._1, spots._2, env)) complete(spotsjsonf.map { t => httpentity(contenttypes.`application/json`, t) }) my requirements/assumptions: i need maximise parallelism, i.e. connections shouldn't rejected under heavy load i can live (even small) requests taking longer if service busy i can live extremely long requests timeouting under heavy load long don't affect parallelism after http request finished timeout. to that, provided separate execution context (i.e. scala's default executioncontext.global ) heavy computation, i.e. spawns , modifies future s on different thread

refactoring - C++ : Factorize code without passing a million arguments -

i doing c/c++ programming (mostly c++) , find myself in need factorize code twice same, except every occurence of "left" replaced "right". once code finishes, need know if "left" or "right" version being executed, that's all, both return number out of can make sense (once combined left or right information). in setup, every change needs done twice, , that's annoying. so factorize replacing left/right "other" , call factorized function twice, knowing each time if calling "left" or "right". now reach part of code, there million variables (cursors, ids, arrays being filled, etc ...). if wanted factorize left/right code, i'd need function have gazillion arguments, , that'd quite ugly. i don't want overload c++ class attributes used in case. any suggestions factorize smoothly here ? int arrayright[many], arrayleft[many], cursor; while(1) { rightthing = arrayright[c

How to make a parallelogram on one side in CSS? -

i trying make parallelogram in css, 1 side not straight, can both sides @ moment, like: #parallelogram { width: 150px; height: 100px; -webkit-transform: skew(20deg); -moz-transform: skew(20deg); -o-transform: skew(20deg); background: red; } which displays bent side on left , right. need on right. how 1 this? try using wrapper overflow: hidden; , negative margin, hide left skewed side #parallelogram { width: 150px; height: 100px; -webkit-transform: skew(20deg); -moz-transform: skew(20deg); -o-transform: skew(20deg); background: red; margin-left: -19px; /* (tangens(20deg)*100px)/2 */ } #wrapper{ overflow: hidden; } <div id="wrapper"> <div id="parallelogram"></div> </div>

java - ConcurrentModificationException and a HashMap -

i using persisting objects using jpa. main object has owning one-many relationship object. other object stored in hashmap. sort of synchronisation fix problem? seems happen @ random times , unpredictable. here exception get: exception in thread "pool-1-thread-1" java.util.concurrentmodificationexception @ java.util.hashmap$hashiterator.nextentry(unknown source) @ java.util.hashmap$valueiterator.next(unknown source) @ org.hibernate.collection.abstractpersistentcollection$iteratorproxy.next(abstractpersistentcollection.java:555) @ org.hibernate.engine.cascade.cascadecollectionelements(cascade.java:296) @ org.hibernate.engine.cascade.cascadecollection(cascade.java:242) @ org.hibernate.engine.cascade.cascadeassociation(cascade.java:219) @ org.hibernate.engine.cascade.cascadeproperty(cascade.java:169) @ org.hibernate.engine.cascade.cascade(cascade.java:130) this not synchronization problem. occur if

application settings - Smooch change language of output of bot -

i working smooth , know how change text of app. in english have text in dutch. how go that? cheers wouter you can override strings in smooch web ui specifying them in customtext option of smooch.init call: http://docs.smooch.io/javascript/#strings-customization the whole list of overridable strings here . note overrides strings of users, unfortunately can dutch or english. we're still working on building proper localization in widget, e.g. letting specify locale init, , detecting preferred language via user agent.

typescript - Directive selector doesn't find element -

when change selector 'input' works on every input can find. if change 'input[numeric]' nothing happens (yes input[numeric] there). doing wrong? isn't supposed work this? says css selector in documentation... import {directive, elementref} '@angular/core'; import {ngmodel} '@angular/common'; @directive({ selector: 'input[numeric]', host: { '(input)' : 'oninputchange()' } }) export class numberformatdirective { constructor(public model: ngmodel, public element: elementref) { console.log(1); } oninputchange(): { console.log(2); } } the template looks this: <input *ngif='!ismultiline()' [attr.readonly]='readonly' [attr.disabled]='isinputdisabled()' [attr.minlength]='minlength' [attr.maxlength]='maxlength' [attr.numeric]='isnumeric()' [(ngmodel)]='value' (ngmodelcha

angularjs - angular directive doesnt render the template, after adding html dynamically in controller -

my problem directive doesnt show template. added html tag specific name in controller dom via "$sce.trustashtml(taskdirective)" , "$compile(taskdirective)($scope)" . controller-function inside directive called. template not showing up. im using $stateprovider , calls "taskdetailctrl" html. anybody can help? thank you!+ controller: app.controller("taskdetailctrl", function ($scope, $state, $stateparams, $sce, $compile) { cur_task = $stateparams.newtask; $scope.title = cur_task.title; var taskdirective = "<" + cur_task.type + "taskdirective" + "></" + cur_task.type + "taskdirective" + ">"; $scope.showtask = $sce.trustashtml(taskdirective); $compile(taskdirective)($scope); }); directive: app.directive('clicktaskdirective', function () { return { restrict: 'e', template: '<ion-content style="padding:

m - How can i support different measurements for screens in android -

i want accomplish adequate size of layouts depending on screen size of device. using dp unit, doesn't seem work. how can that? for sure dp adequat unit accomplish goal. there in addition that, have define several values folders define dimensions scaling tablets or phones. e.g. define 2 values folders like: values-large values-xlarge now define dimen.xml file inside folders, can put measurements in (unit dp) corresponding screensize. define measurement this: 17dp then embedd sizes in layout xml, like: android:layout_height="@dimen/value1" depending on screensize, system load correct measurements folders, e.g. if have screen size large defined values in folder values-large loaded. more information, have @ https://developer.android.com/distribute/essentials/quality/tablets.html

java - no suitable method found for getAnnotation(Class<CAP#1>) -

i'm coding few simple methods annotations class, field, or method. first method, gets class-level annotation, works fine. copy , paste create new method field-level annotation results in compile error saying: error: no suitable method found getannotation(class<cap#1>) not sure how getannotation method call on class object works ok same method call on field object results in compilation error. thoughts? public class annotationtool { public static <t> t getannotation(class c, class<? extends t> annotation) { return (t)c.getannotation(annotation); } public static <t> t getannotation(class c, string fieldname, class<? extends t> annotation) { try { field f = c.getdeclaredfield(fieldname); return (t)f.getannotation(annotation); // compile error here?? } catch (nosuchfieldexception nsfe) { throw new runtimeexception(nsfe); } } } field.getannotation

How to handle non transient exception in Azure Worker role -

we have 2 azure worker roles - , b. a quartz scheduler runs jobs every minute. it reads ids 'redis cache' every minutes , execute jobs ids. 'a' publish output service bus queue subscribed worker role 'b'. 'b' worker role reads values queue , execute more operation on them. both worker roles has build cache on startup. now here few issues regarding azure component failure: if redis cache goes down, how can handle that. need stop our execution till time again , need build our cache again. 'b' worker role should stop pulling message service bus till time redis comes again. how handle service bus failure in worker role 'b'? you don't need stop of worker roles. worker role should resilient issues in redis cache , meaning code should handle exception thrown redis (or network exceptions), either retry or swallow exception. worker role b should pull messages service bus . if worker role doesn't publish d

ios - Quickblox ipv6 support -

we have live app on app store using quickblox ios sdk v2.1.1. we trying upload new version of app. (apple has rejected latest build quickblox login fails in ipv6 network) but per apple's announcement of transitioning ipv6-only network services in ios 9. starting june 1, 2016 apps submitted app store must support ipv6-only networking. and, quickblox added support of ipv6 in 2.7.2.1. is there way of fixing ipv6 support without migrating updated sdk? please check - ios-quickblox-sdk-2.1.1-ipv6 change log: qbchat ipv6 support

(VBA) Importing Data from Unique HTML File into Excel -

i want create vba code pulls relevant data want work out of webpage , posts html. did lot of searching, , couldn't find thread similar situation (i don't know html). here basic structure of html file: <html><head> <meta http-equiv="content-type" content="text/html; charset=windows-1252"> <meta name="robots" content="index,follow"> <title>"title: abcdefg"</title> </head> <h1>"heading: 2345"</h1> <p> last updated: "last date" </p><p> </p><p> <next></next><table border="3" cellpadding="6" cellspacing="3"> <tbody><tr> <td> <pre> *want data* </pre> </td> </tr> <tr> <td> <pre> *want data* </pre> </td> </tr> <tr> <td> <pre> *want data* n

javascript - MongoDB/Mongoose: Updating entire document with findOneAndUpdate() -

i want use findoneandupdate() method either create document if doesn't exist, or update if exist. consider following code: samplecomment = new comment({ id: '00000001', name: 'my sample comment', ... }) this attempt find out if samplecomment aldready exists, , if so, update it, otherwise creating it: comment.findoneandupdate( { id: samplecomment.id }, { samplecomment }, // <- not passing object { upsert: true, setdefaultsoninsert: true }, function(error, result) { ... }); i'm trying pass model-instance object in second argument, result returning default values of model. same goes document itself. how pass entire object samplecomment correctly in second argument? by default returned result going unaltered document. if want new, updated document returned have pass additional argument named new value true

c++ - pthread_create - invalid use of non-static member function -

this question has answer here: pthread function class 7 answers i've been trying learn how use threads, , i'm getting stuck on creating one. i'm having thread created in class constructor this... beacon::beacon() { pthread_create(&send_thread,null, send, null); } the send function isn't doing yet, here's looks like. void beacon::send(void *arg){ //do stuff } everytime run code invalid use of non-static member funciton error. i've tried using &send, , didn't work. had last null parameter set this, didn't work. i've been looking @ other example code try , mimmick it, nothing seems work. doing wrong? if can't use std::thread recommend create static member function wrap actual function, , pass this argument function. something like class beacon { ... static void* send_wrapper(void* o

reactjs - How to dynamically show the component based on the state -

i want create dashboard has sidebar, , sidebar change state. here how it my showpage: showpage(page) { switch (page) { case 'feeds': return <helppage />; case 'messages': return <messagespage />; case 'projects': return <projectspage />; case 'support': return <supportpage />; case 'about': return <aboutpage />; default: return <dialogpage />; } } my render method: how switch page: handleclick(page) { this.props.pageswitcher(page); } ... <listitem primarytext="feeds" onclick={() => this.handleclick("feeds")} /> how call element: <col xs={6} sm={6} md={6} lg={8}> { this.showpage(page) } </col> my action: export function pageswitcher(page = '') { let payload = {}; switch (page) { case 'feeds': payload = { t

c# - Fetch first element from a collection -

i'm trying first element collection , i'm getting error : a fetch request must simple member access expression; '[100002]' subqueryexpression instead. parameter name: relatedobjectselector. my query : var allconferences = session.query<conferencedao>() .fetch(i => i.incident) .thenfetch(s => s.sheets.firstordefault()) //here need first sheet .thenfetch(v => v.victims) .projectto<telephonyconference>(); i've tried : var subq = queryover.of<incidentdao>().selectlist(x => x.selectmin(y => y.sheets)); var allconferences = session.queryover<conferencedao>() .fetch(i => i.incident).eager .withsubquery.whereproperty(x => x.incidentid).in(subq) .list() .asqueryable() .fetch(b=>b.victims) .fetch(a => a.agency) .projectto<telephonyconference>();

php - HTML form POST not sending values -

i know there has been couple of threads that, have looked through them , can't seem able find answer. have html form php file action , method post. here form: <div class="col-md-4 col-sm-12"> <div class="contact-form bottom"> <h2>send message</h2> <form id="main-contact-form" name="contact-form" method="post" action='http://creobox.ie/site/sendemail.php'> <div class="form-group"> <input type="text" name="name" class="form-control" required="required" placeholder="name"> </div> <div class="form-group"> <input type="email" name="email" class="form-control" required="required" placeholder="email id"> </div> <div class="f

Split directories in git to new repository -

i dont know if approach correct result want. me figure out? i have repository abbr repo 3 solutions split up. before: root |_project1 |_project2 |_project3 after: root |_project1 etc etc. my approach: git clone <url-to-old-repo> <new-repo-folder> cd <new-repo-folder> git checkout <branch> git remote rm origin git filter-branch \ --prune-empty \ --index-filter ' git rm --cached -qr --ignore-unmatch -- . && git reset -q $git_commit -- \ <project-folder> ' \ -- \ --all git remote add origin <url-to-new-repo> git push -u origin <branch> after these commands, end new repo folder want , history preserved. , done 3 projects. remaining repo contains project unused in future, maybe kept backup.

jquery - Javascript code works in fiddle but not in Wordpress (woocommerce) -

i added total price of after calculating regular price - sale price , added javascript code there, should hide price of total 0. works in fiddle doesnt work in wordpress. maybe put in wrong place (content-product.php) my fiddle here: https://jsfiddle.net/foduxc0y/ and code in wordpress: <html> <head> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> jquery( document ).ready(function($) { "use strict"; if (parseint($(".win").text(), 10) === 0) { $(".hinnavoit").hide(); $(".jah").hide(); } }); </script> </head> </html> <?php /** * template displaying product content within loops. * * override template copying yourtheme/woocommerce/content-product.php * * @author woothemes * @package woocommerce/templates * @version 2

Firebase How to get value from reference -

so happens user creates account key/value stored on realtime database logs in need retrieve value value not change after being created. there direct way me value key or not possible? found answer can achieve if use addlistenerforsinglevalueevent on reference key hope helps asking same question

winforms - Adding custom objects to checked list boxes in C# -

i have object stores 2 strings , overrides tostring() method return 1 of strings foobar temp; foreach (string foo in bar) { temp = new foobar(); <--- why line needed when overwriting code , path on each cycle before adding? temp.code += "."; temp.path += "."; console.writeline(temp); clbfoobar.items.add(temp); } the prints console obey overwritten code , path string values, checked list box items same thing (the last item's tostring()), underlying process going on isn't obvious? if change clbfoobar.items.add(temp.tostring()); works absolutely fine, wouldn't same temp.tostring.tostring() because .add calls .tostring() in first place? figured both console print , .add act same seeing both call tostring() edit: temp = new foobar(); fix problem, want know why fix when intuition leads me think

step by step instructions for eliminating scrollwheel zoom in google maps -

i found thread shows scrollwheel code line needs set false stopping annoying scrollwheel zoom. can't post on page because don't have 10 reputation , apparently drew kind of spam . . . sorry redundancy. my problem don't know find code or how open , change it. seems might browser dependent i'm unclear on that. i'm running firefox 47 on mac air system 10.10.5 it drives me absolutely crazy google wouldn't provide toogle feature takes on standard function of operating system, esp. since 99% of time can's scroll using arrow keys without standing on head , whistling star spangled banner backwards not instinctive speed of sound zooming absurd have no way scroll display without carpel tunnel inducing click-hold-move cursor i have no clue made them think zooming more important scrolling. suppose advantage might learn low level coding these interfaces. thanks if can walk me through step step. if you're trying make above mentioned "no-scro

Read textfile in VHDL testbench -

i have file source.txt , looks this: 00660066006700670067006800680069006b006d006e 00660066006700670067006800680069006b006d006e 00660066006700670067006800680069006b006d006e 00660066006700670067006800680069006b006d006e 00660066006700670067006800680069006b006d006e 0065006500660067006700690069006a006b006c006e 00650065006600670067006700680069006a006c006d 00650065006600670067006600660068006a006b006d 006500650066006700670065006600670069006b006d 00650065006600670067006600670068006a006c006d 0065006500660067006700690069006a006b006c006e * after each line there hidden newline character '\n'. asterix '*' visible end-of-file character. how write testbench in vhdl following: read file store 1 line in vector write vector in new target.txt using vhdl-2008, , showing std_logic_vector underway, code can be: library ieee; use ieee.std_logic_1164.all; use std.textio.all; entity tb end entity; architecture syn of tb begin process variable line_v : line;

javascript - Transforming js array such that a numeric value is added -

my base data.. [{ month: 'jan', cat: 'a', val: 20 },{ month: 'jan', cat: 'b',' val: 5 },{ month: 'jan', cat: 'c', val: 10 },{ month: 'feb', cat: 'a', val: 30 },{ month: 'feb', cat: 'b', val: 10 },{ month: 'feb', cat: 'c', val: 20 }]; i transform following format.. [{ dim:'val' x: 'jan', nval: 20 //same base object val },{ dim:'val' x: 'jan', nval: 25// 20+5 -> above nval value + base object val },{ dim:'val' x: 'jan', nval: 35//25+10 },{ dim:'val' x: 'feb', val: 65//35+30 },{

javascript - Setting headers from main page to an iframe -

is possible somehow, using javascript or other methods, set http request headers in iframe? basically, need embed external website existing webpage using iframe. both pages authenticated using same domain, , trying avoid forcing user login twice. both parent webpage , external website running https, , both accept basic authentication header login methods. so, thinking if there way take header main page, , pass on iframe? the main webpage allows me basic authentication header using javascript, don't need header parent request, need able inject header iframe before loading it. you not allowed modify content of other sites through iframe because of same-origin policy . better option use ajax load pages , display them user without using iframe. more resources: https://en.wikipedia.org/wiki/same-origin_policy https://www.w3.org/security/wiki/same_origin_policy

javascript - Integrating Crashlytics into React Native - Android -

i've set crashlytics integration ios our react native project, , have managed android version registered well. problem reports java/system related crashes - if there javascript exception thrown doesn't register reporting. working, ios version has functionality already. i've set reporting outlined in fabric docs , this question - see second answer down, i've added oncreate in mainactivity. following have attempted create own nativemodulecallexceptionhandler per this issue comment . code below: package com.mypackage; import com.facebook.react.bridge.nativemodule; import com.facebook.react.bridge.reactapplicationcontext; import com.facebook.react.bridge.reactcontext; import com.facebook.react.bridge.reactcontextbasejavamodule; import com.facebook.react.bridge.reactmethod; import com.facebook.react.modules.core.javascriptexception; import com.facebook.react.bridge.nativemodulecallexceptionhandler; import java.util.map; import com.crashlytics.android.crashlyt