Posts

Showing posts from February, 2012

html - Modal Option on a TD is increasing the line height of the TD in table -

i have table has line height of 1.4 th , 1.0 td but when add modal option 1 of td's, height of td automatically getting increased around 2.5, , not able decrease original size of 1.0. any kind of appreciated. changing size of modal button btn-xs helped. thanks anyways.

Rotate labels using Plotly in R -

im trying put vertically xlab in plot using plotly package. want same "las= 2" on standard r. i found 'tickangle = 45' ticks, not labels. any 1 can me? ` plot_ly(x = account$country, opacity = 0.6, type = "histogram", histnorm = "probability", color = c('more 1 account'), colors = 'red') %>% add_trace(x = account2$country, opacity = 0.6, type = "histogram", histnorm = "probability", color = c('account'), colors='blue') %>% layout(barmode="overlay", title = "clients test", xaxis = list(title = "country", color ="red"), yaxis = list(title = "clients")) ` thank you. ...

android - FCM Notification icon is not being used -

Image
i using fcm , send push notification app. want use custom notification icon show white icon. running lollipop . from documentation says icon optional, string indicates notification icon. sets value myicon drawable resource myicon. ( i'm not sure means ). here did. i generated icons here . have icons white text , transparent background. sample screenshot pic of icon i added res folder i edited androidmanifest , added android:icon="@drawable/ic_stat_set" in <application i tried running project on device, new app icon ic_stat_set being used app launcher. from console send notification , did receive not icon set. i tried sending through api. did received notification not icon set. curl -x post --header "authorization: key=serverkey" --header "content-type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"to\":\"registeration-token-id\",\"notification\":{\"body\":...

php - Laravel 5 - How to count total records with joins and group by -

i need count total no. of records coming database group by. don't need count of each set or group by default. one way know use ->get() on query, crashes when have lots of record in database. $orders = order::where('orders.store_id', $store->id); $orders->join('order_product', 'orders.id', '=', 'order_product.order_id'); $orders->join('products', 'products.id', '=', 'order_product.product_id'); $orders->join('customers', 'order_product.order_id', '=', 'customers.order_id'); $orders->join('addresses', 'customers.id', '=', 'addresses.customer_id'); $orders->where('products.status', 1); $orders->where('orders.is_deleted', '0'); if ($keyword) { $orders->where(function ($query) use ($keyword, $searchkeyword){ ...

php - oauth2 get access token via db by supplied client id/secret for trusted 3rd party client -

i'm using "lucadegasperi/oauth2-server-laravel". i'm making api endpoint 3rd party trusted client , using client_credentials grant. now thing access tokens tend expire, instead of giving 3rd party user access token, supply them client id/secret. on side following when curl request... select a.id, expire_time oauth_clients c left join oauth_sessions s on s.client_id = c.id left join oauth_access_tokens on a.session_id = s.id c.id = 'asfasasf' , c.secret = 'asfasfasfasf' order s.id desc limit 1; ... above pretty checks if there access token , expire time relating client id/secret. i'd pretty generate new 1 if 1 didn't exist or if expired. couple lines down, curl on side endpoint after given access_token on side without them worrying doing it. i've tested , works, kind of dodgy/bad do? tldr; 3rd party client - goes /api/endpoint client id/secret my server sid...

how to add opencv to a gui QT application? -

Image
i created new widget gui application in qt . , in order using opencv , added includepath , libs projects following : qt += core gui greaterthan(qt_major_version, 4): qt += widgets target = testqt4 template = app sources += main.cpp\ widget.cpp includepath += c:/opencv/build/include libs += -lc:\opencv\build\x64\vc12\lib -lopencv_world310d headers += widget.h forms += widget.ui and included desired opencv headers following : #ifndef widget_h #define widget_h #include <qwidget> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> .... but when builded project encountered error : can me fix error ? thank . are using qt creator? it not update makefile once changed .pro file. right click on project folder in projects view , click "run qmake" should fix it.

html - jQuery - Change input type based on selection value -

i need change input type inside div based on select value. here html- <div id="query_template" class="hide"> <div class="col-md-12 query_row"> <div class="row"> <div class="col-md-3"> <select name="t_col" class="form-control"> <option value="1">col 1</option> <option value="1">col 2</option> <option value="1">col 3</option> <option value="1">col 4</option> <option value="1">col 5</option> <option value="1">col 6</option> </select> </div> <div class="col-md-3"> <select name="t_rel" class="form-...

image - Extraction of the least significant bit of a pixel -

i want extract least significant bit (lsb) of each pixel in image. want know value of lsb in each pixel, whether 1 or 0. how do in matlab? you can use bitget function , specify bit position of 1, denoting lsb of each pixel. assuming image stored in a , do: b = bitget(a, 1); b same size a tells lsb of each pixel in image.

angularjs - Calling MS Dynamics CRM SOAP Service using Angular JS -

i developing ionic application interact ms dynamics crm. have looked online solutions, solutions either restful implementations or non ms dynamics implementations. has implemented soap services of ms dynamics using angular js? if possible please share example. several questions lead solution: do have special requirements use soap ? of crm functionality exposed via rest / odata endpoints. none-trivial cases need use soap syntax. can check list of current limitations here . consider using rest instead. another question be, application deployed? within crm itself? or not? if angular application started within crm (as webresource) lot simpler! since authorized service , don't need bother that. in case maybe this library provide help... there several approaches create great middleware soap requests crm, seems modern one. but if you're not authorized... whole new level of problem... environment you're targeting? online? onprem? in case, first need author...

python - roboframework script issue -

in robotframework, trying execute command on server, taking output in variable , comparing output empty or not empty getting error. robot script: ${redrelease} execute command root , return result ${server} cat /etc/redhat-release | grep '6.7' run keyword if '${redrelease}'=='${empty}' should contain xxx yyyy but getting error: evaluating expression '' red hat enterprise linux server release 6.7 (santiago)'==''' failed: syntaxerror: no viable alternative @ character ''' (<string>, line 1) how can compare output of grep command empty or non empty? roboframework provides in-built library "sshlibrary" helps in dealing same. for example : *** settings *** library sshlibrary *** variables *** ${host} 127.0.0.1 ${username} labadmin ${password} root123 ${command} cat /etc/*release *** test cases *** login_to_server open connection ...

wordpress - How to replace "$" sign from any string with something else in PHP? -

i working wordpress project. using money related work. amount in database.the amount shows $ sign. want replace $ sign euro sign. when using str_replace function took $amount variable, not string. way replace $ ? here echo product_list_price($project->id); function returning price containing $ sign. have replace sign euro sign , echo. how can convert single quoted string? thanks in advance $europrice = str_replace('$', '€', $dollarprice); as mentioned here, php tries interpret words starting $ inside double-quoted strings variables.

principalpermission - IIS WebService Request for principal permission failed -

Image
i have created simple web service , in web service have written simple method illustrated in code below. [principalpermission(securityaction.demand, role = @"kiancoorp\somethingelse users u")] public string helloworld() { var msg = "hello {0} internal.".formatwith(identityname); _log.info(msg); return msg; } i have hosted web service in app pool set domain user kiancoorp\webapppooluser, , have added user group of "kiancoorp\somethingelse users u" (via active directory). now when use internet browser browse web service following prompt, try log in same user have used set app pool user helloworld web service of mine. now if try log in correct credentials, prompt comes again its have enter credentials 3 times, have tested , everytime have been prompted login dialog box have try 3 times , gets following browser screen. system.servicemodel warning: 131076 : <tracerecord xmlns="http://schemas.microsoft.com/2004...

Facebook: Comment to User's post using my facebook app's page -

i'm developing facebook app app post picture user's wall after user grant required permissions. however according facebook's privacy policy don't allow our facebook apps post user's wall haven't explicitly entered user(neither text of post nor comment same post). but need let people see post on user's wall know user got from(a link preferably). so there way post comment generated post in user's wall facebook app's page??(so comment not posted user , not violate facebook's policy) grateful help.

node.js - Packing Node and MongoDB in an App to Install in a Desktop. -

i need install app on windows , mac, main package need that, need firts install node , mongodb in order app can run. i'm not aware of way install mongodb node.js app, use tingodb . it's drop-in replacement mongodb (it uses same api) except don't need run separate database server. if switch it, can use software nexe or enclosejs .

matlab - moving a mxn window inside image -

i have images of sizes mxn .what want want create window mxn step size of 1/4th of image , move inside image left right , top bottom , calculate pixel density pixel density in window= number of white pixels/total number of pixels and fixed pixel density 0.45 set center pixel of window 1 or 0. is there predefined functions make use of in matlab. update i have done following effort function result=imagepixeldensity(image,window,thresh) [widthi,heighti]=size(image); [widthw,heightw]=size(window); totaldensity=widthw*heightw; stepw=widhti/4; r=1:widthi c=1:heighti if(c+stepw<widthi && widhtw+stepw <widthi) temp=image(r:heightw,c+stepw:widthw+stepw); dens=sum(temp(:))/totaldensity; if(dens>=thres) % donot know here setting or clearing %pixel in window end stepw=stepw+width...

android - ContextCompat.checkSelfPermission is undefined -

i have seen question asked multiple time on , went thru answers thoroughly however, still struggling resolve problem. as per multiple answers, have ensured maxsdkversion in android manifest file 23(i kept minsdkversion 15). put targetsdk in project.properties 23. running project on android6 , have android-support-v4.jar included androidsdk/android-sdk-macosx/extras/android/support/v7/appcompat/libs/android-support-v4.jar. in android sdk manager, under extras, have android support repository version 36(which believe latest) , using android-sdk-tools 22.6.2 can please guide why error still persist? how remove it? it issue obsolete jar v7 appcompat. used latest jar android-support-v4.jar , worked charm!!

java - Spring MVC - Bean creation throws ClassNotFound Exception for hibernate.cfg.xml -

i using spring mvc , hibernate 5 integration in app. providing hibernate configuration information through spring bean in spring-dispatcher-servlet.xml file. <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xsi:schemalocation="http://www.springframework.org/schema/beans htt...

xml - Android - Failure getting entry for 0x010802c8 (t=7 e=712) in package 0 (error -75) -

i have android app runs fine in genymotion emulator, has virtual device of api 23, problem when run in device api of 16, realized problem of error logcat throwing because have calendarview in xml layout. how can fix this? need calendarview work fine in api level. error: failure getting entry 0x010802c8 (t=7 e=712) in package 0 (error -75)

scala - Extract substring based on regex to use in RDD.filter -

i trying filter out rows of text file second column value begins words list. i have list such as: val mylist = ["inter", "intra"] if have row like: cricket inter-house inter in list, row should filtered out rdd.filter operation. using following regex: `[a-za-z0-9]+` i tried using """[a-za-z0-9]+""".r extract substring result in non empty iterator. my question how access above result in filter operation? you need construct regular expression ".* inter.*".r since """[a-za-z0-9]+""" matches word. here working example, hope helps: val mylist = list("inter", "intra") val textrdd = sc.parallelize(list("cricket inter-house", "cricket int-house", "aaa bbb", "cricket intra-house")) // map on list dynamically construct regular expressions , check if within // text , use re...

python - Django: "referenced before assignment" but only for some variables -

i'm writing small app in django , i'm keeping state saved in few variables declare out of methods in views.py. here important part of file: from app.playerlist import fulllist auc_unsold = fulllist[:] auc_teams = [] auc_in_progress = [] auc_current_turn = -1 print(auc_in_progress) def auc_action(request): data = json.loads(request.get["data"]) # ... elif data[0] == "start": random.shuffle(auc_teams) print(auc_unsold) print(auc_in_progress) auc_in_progress = [none, 0, none] print(auc_in_progress) the auc_unsold , auc_teams variables work fine; auc_in_progress variable not seen method, though, giving error in title. if take out print statement , let code assign value it, exception thrown somewhere else in code use variable again. i have tried making variable , new 1 seems suffer problem well. what happening? edit: found solution: if write global auc_in_progress before print statements, ...

java - Parse JSON using only org.JSON -

i have been struggling accomplish thought simple org.json. receive json looks this: { "startdate": "2016-08-22t19:07:20.000z", "enddate": "2016-08-23t19:07:20.000z", "products": [{ "name": "&lt;device level product&gt;", "deviceidsensoridarr": [{ "deviceid": 13124, "sensorid": null }], "dataproductid": 1, "dataproductformatid": 2, "searchtypeid": 5, "searchnodeid": 115, "sitedeviceid": null, "resourcetypeid": 1500, "resourceid": 183, "parameter": { "35": "1", "38": "1", "40": ["41", "0"] } }, { "name": "air temperature", ...

python 3.5 - Pyqtgraph string in x tick -

Image
so have been playing pyqtgraph , came problem needed add strings x axis tick label (instead of default float). looked around , found show string values on x-axis in pyqtgraph the solution kind of need (the first solution on page, second 1 cause problems because on python 3.5). tried modified first solution, did not work. from pyqt4 import qtcore import pyqtgraph pg x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, 5, 6] xdict = dict(enumerate(x)) win = pg.graphicswindow() stringaxis = pg.axisitem(orientation='bottom') stringaxis.setticks([xdict.items()]) plot = win.addplot(axisitems={'bottom': stringaxis}) curve = plot.plot(xdict.keys(),y) if __name__ == '__main__': import sys if sys.flags.interactive != 1 or not hasattr(qtcore, 'pyqt_version'): pg.qtgui.qapplication.exec_() the error getting typeerror: 'dict_keys' object not support indexing on line curve = plot.plo...

angularjs - How dynamically get the value of a JSON variable in Angular? -

hi want this: {{item.price.{{comparator}}}} i mean, take value type of price using {{comparator}} variable. this example of code (the data bigger , have more types of prices): var items = [ {"name":"item1",price:{public:10,private:15,other1:16.3,other2:17.5}}, {"name":"item2",price:{public:20,private:45}}, ] var angularapp = angular.module('angularapp', [ 'angularappcontrollers', ]); var angularappcontrollers = angular.module('angularappcontrollers', []); angularappcontrollers.controller('comparationctrl', ['$scope', function ($scope) { $scope.comparator = "private"; $scope.data = items; } ]); <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> ...

google maps - geocomplete - marker not showing -

using http://ubilabs.github.io/geocomplete/examples/draggable.html example. html: <div id="addresses"> <label>address 1</label> <input type="text" class="form-control geocomplete" id="addr_1" data-addrn="1" placeholder="type address here" value="" /> <div class="map_canvas" id="addr_canvas_1"></div> <div id="addr_inf_1"> <input type="hidden" data-geo-1="lat" placeholder="latitude" value="" /> <input type="hidden" data-geo-1="lng" placeholder="longitude" value="" /> </div> <script src="https://maps.googleapis.com/maps/api/js?key=xxxxx&amp;libraries=places"></script> <script src="jquery.geocomplete.min.js"></script> js: $(fun...

curl - Yodlee error for Fastlink (Getting Production Token) -

i trying integrate yodlee our app. have done steps in developer mode, when i'm trying token on production i'm getting error, though using url have use: { "errorcode":"y807", "errormessage":"resource not found", "referencecode":"l1471989041498b11t131n" } i'm using yodlee api rest endpoint, not one? please note- production environment, have different base url. once subscribe service, have provide ips whitelisting , using these ips able consume our services. regards, krithik

Swift nested functions vs Closure Variables -

i want make function fetches record cloudkit, if encounters temporary network error function should retry. func fetchrecord(withrecordid recordid: ckrecordid, returnblock: (opterror: errortype?) -> void){ func internalreturnblock(opterror opterror: errortype?){ if nsthread.ismainthread() { returnblock(opterror: opterror) } else{ dispatch_async(dispatch_get_main_queue(), { returnblock(opterror: opterror) }) } } func internalwork(){ privatedb.fetchrecordwithid(recordid) { (optrecord, opterror) in if let error = opterror{ // if network error retry internalwork() } else{ internalreturnblock(opterror: nil) } } } internalwork() } here define such function (simplified), if fetch encounters error retries calling nested function internalwork() my question difference...

html5 canvas - Extend chart.js horizontal bar graph to include a vertical line -

i'm trying add vertical line @ set point of horizontal bar chart. examples i've found not seem apply charts.js 2. if create new chart type , use horizontalbar draw method no modifications, chart won't draw. chart.controllers.horizontalbarwithline = chart.controllers.horizontalbar.extend({ draw: function () { chart.controllers.horizontalbar.prototype.draw.apply(this, arguments); } }); can explain how extend chart? here's current attemp: https://jsfiddle.net/dwelch/6f1gfog2/ please see answer question. think looking for: how draw vertical line on horizontal bar chart chartjs?

Combining CSS transition and animations together? -

hello having trouble combining both css transition , animations together. animation working reason when add transition, transition works, cancels out animation. know how combine them? here css: .circle-spin { transition: 1s ease; } .circle-spin-reverse { transition: 1s ease; } .success li:hover .circle-spin-reverse { animation:spin-reverse 10s linear infinite; /* above works until add transition below */ transform:scale(1.25); } .success li:hover .circle-spin { animation:spin 10s linear infinite; /* above works until add transition below */ transform:scale(1.25); } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } @keyframes spin-reverse { 100% { -webkit-transform: rotate(360deg); transform:rotate(-360deg); } } sorry know it's alot of code, thats bare minimum code needed question. thanks it’s cause transform /* in :hover */ transform:scale(1.25); overrides transform in animaton ...

powershell - Import-csv Target cell on Csv -

i have csv list of usernames i want import 1 cell of csv file e.g. a2 is possible specific? have tried googling don't see exact solution. tried powershell also. can done ? thanks confuseis the below example select , output 'cell' a2 test.csv in example, column header row 'username' $infile = import-csv c:\temp\test.csv $targetcell = $infile.username[1] write-output $targetcell this snippet doing following: import csv file, yielding powershell object. select column want work with, items column can treated array. select desired item in column referring it's 0 based index value. output results.

ruby - Rails: Save country_select to database -

i’m working on form user can pick country , there choice shown , show.html.erb. i have added country_select in form this <div class="col-md-4"> <div class="form-group"> <%= f.country_select :country %> </div> my model article.rb looks this: class article < activerecord::base belongs_to :author has_many :article_article_categories has_many :categories, through: :article_article_categories validates :title, presence: true, length: { minimum: 3, maximum: 50 } validates :description, presence: true, length: { minimum: 10, maximum: 500 } validates :author_id, presence: true attr_accessor :country end the select works , user can select country.. perfect! but won’t show in view/show.html.erb.. have tried this: <%= @article.country %> so therefor generated migration: class addcountrytoarticles < activerecord::migration[5.0] def change add_column :article, :country, :string...

PHP MYSQL update stament not working -

this code meant check submitted form values , update table, replaces field blank any ideas gone wrong, please? <form action = "update.php" method = "post"> <p> new name: <input type "text" name="name"> <input type= "submit"> </p> </form> <?php require ('/var/www/html/site1/connect_db.php'); if(!empty($_post['name']) && !is_numeric($_post['name'])) { $name=$_post['name']; $name=mysqli_real_escape_string($dbc,$query); $name=strip_tags($name); #$query='update customers set customername = '".$name."' customernumber=114'; $query = "update customers ". "set customername = $name"."where customernumber=114" ; mysqli_query($dbc,$query); } else { echo $name; } $query = 'select * customers customernumber=103'; $result = mysqli_query($dbc,$q...

java - Logical issue in list of numbers in the call log -

my app gives list of numbers in call log. unfortunately, encountered small issue. app lists numbers below separately (even though they're same number). there way group 1 number in app? i'd apply method numbers countries. example: 754-3010 (local) (541) 754-3010 (domestic) +1-541-754-3010 (international) 1-541-754-3010 (dialed in us) 001-541-754-3010 (dialed germany) code app: cursor managedcursor = managedquery( calllog.calls.content_uri,null, null,null, null); int number = managedcursor.getcolumnindex( calllog.calls.number ); list<string> list = new arraylist<>(); while ( managedcursor.movetonext() ) { string phnumber = managedcursor.getstring( number ); list.add(phnumber); } i show list in app. i assuming numbers belong usa you need convert numbers standard format in list while iterating. set<string> numset = new hashset<string>(); while ( managedcursor.movetonext() ) { str...

c# - Reloading the form instead of making a new one / accessing textbox outside of form -

i having problem controlling textbox. need change value outside of form1.cs textbox located have found snippet. public void updatetext(string newvalue) { torrent_name0.text = newvalue; } this allows me in theory control textbox outside of form1.cs, here comes problem, every time want access create new instance of form1 instead of using old 1 , refreshing it. form1 frm = new form1(); frm.updatetext("aaaaaaaaaaaa"); frm.show(); am missing something? there better way this? have tried multiple ways update new form got nowhere. bokker, you have have reference singular form1 things refer. if child form, aybe commented, create public member of mainform , name something. public form myform1; you have event form1 launched... a button click, menu item, toolbar item, etc. in event have check if form exists , create if required. private someevent() { if (myform1 == null) { myform1 = new form1(); myform1.show(this); } myfor...

javascript - Using HTML forms values for AJAX/PHP MySqli query -

i trying use ajax both php , mysqli results database. new ajax , javascript appriciated this form: <form method="get"> <input type="number" min=0 name="gameid" id="gameid" placeholder="game id" required><br> <input type="number" min=0 step=0.01 name="price" id="price" placeholder="price" required><br> <button type="submit" onclick="getgames()">submit</button> </form> this ajax in js: function getgames() { var gameid = document.getelementbyid("gameid").value; var price = document.getelementbyid("price").value; if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp = new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = func...

serialization objects in java -

is there way around during serialization of object full match / repetition of way? example: on client - com.example.myprojectone.model.myclass on server side - com.example.notmyproject.entity.myclass i - java.lang.classnotfoundexception: com.example.myprojectone.model.myclass with full coincidence of names of work packages public class server implements runnable { private settingsconnection settingsconnection; private onreceiveobject onreceiveobject; private serializer serializer; /** * @param remoteserveraddress - address remote server * @param inputport - port on server * @param outputport - port used send * @param password - password should same on client side , server side * @param handler - defines name of method, should called, after received data on server side */ public server(string remoteserveraddress, int inputport, int outputport, string password, onreceiveobject handler) { settingsconnection = new settingsconnection(); sett...

Formatting double to 2 digits after decimal point in J# -

how format double value in j# 2 digits after decimal point (without doing arithmetic operations)? double x = 3.333333; string s = string.format("\rwork done: {0}%", new double(x)); system.out.print(s); i thought j# identical java , following java code gives different result j# : double x = 3.333333; string s = string.format("\rwork done %1$.2f%%", x); system.out.print(s); (since j# dead , unsupported, use visual j# 2005 ) string.format() api introduced in java 1.5 , there's no chance can use in visual j++ or visual j# . there're 2 approaches problem. using java 1.1 api (works java , j++ , j# ): import java.text.messageformat; /* ... */ final double d = 3.333333d; system.out.println(messageformat.format("{0,number,#.##}", new object[] {new double(d)})); system.out.println(messageformat.format("{0,number,0.00}", new object[] {new double(d)})); note despite both formats work given double, there'...

Validating NServiceBus Event Properties (Using Interfaces) -

i not able validate event published using nservicebus.testing ( nservicebus, v6 beta) in api controller publish event await _messagesession.publish<istrategycreated>(stgy => { stgy.strategyid = strategytoadd.id; stgy.investmentobjective = strategytoadd.investmentobjective; stgy.principalinvestmentstrategy = strategytoadd.principalinvestmentstrategy; stgy.portfolioconsultant = strategytoadd.portfolioconsultant; stgy.strategyname = strategytoadd.name; stgy.strategycode = strategytoadd.code; }); in test have: assert.that(messagesession.publishedmessages.length, is.equalto(1), "messages published"); assert.isinstanceof<istrategycreated>(messagesession.publishedmessages[0],"message published of type istrategycreated"); the second line fails, because message type istrategycreated_impl error: message published of type istrategycreated expected: instance of <strategy.contracts.events.istrategycreated> ...

haskell - GHCi Debugger not hitting breakpoints recursively: Why, and what's the solution? -

i have simple recursive program doesn't quite work. i'm trying use ghci debugger figure out what's going on. set breakpoints on lines of functions recurse , progress , shaded , , catches first few. when second line of progress , every invocation of :continue drops me on same line of code, though i'm calling recurse , shaded there , expecting breakpoints work. here's code: import system.environment type pos = (int,int) type acc = ([[pos]], [pos]) main = getargs >>= putstrln . show . length . combos . read . head combos n = recurse n [] (allpos n) [] recurse :: int -> [[pos]] -> [pos] -> [pos] -> [[pos]] recurse n done avail inprog | length inprog == n = inprog:done | null avail = done | otherwise = fst $ foldr (progress n inprog) (done,avail) avail progress :: int -> [pos] -> pos -> acc -> acc progress n inprog pos (done, avail) = (recurse n done (filter (not . shaded pos) remain) (pos:inprog), remain) rema...

amazon web services - AWS Code Deploy Fails When Calling Msdeploy -

i'm working on setting our build process utilize aws code deploy autoscaling group. i've managed code built , zipped appspec.yml , beforeinstall.bat file moved s3 correctly. code deploy pulls down zip file, unzips , calls beforeinstall.bat. batch file has 3 steps stop app pool stop website call website.deploy.cmd it gets through steps 1 , 2, when gets step 3 calls msdeploy , returns error: error: there error reading iis configuration schema 'c:\windows\system32\inetsrv\config\schema\' thinking it's permission issue, logged onto 1 of servers , ran cmd script manually. deploys fine, isn't surprising given logged on admin. opened powershell script localsystem user (which codedeploy host agent service runs as) , ran cmd script. completed successfully. ran whole batch file localsystem user. ran successfully. i went , added echo %username% batch script, committed, built, , ran new deployment. see user in code deploy logs win-49gnl2frhj4$ . deploy...

How can we ignore some SonarQube rules in Java? -

we started using sonarqube . have found rules suggested sonarqube want ignore them or give them low priority , configure time suggested sonarqube. e.g we want avoid rule (and/or configure priority , time suggested sonarqube) for document public class. and complete task associated todo comment. i couldn’t find way configure rules ignored. want kind of rules ignored whole project not specific classes. configuring values have better time estimation fix major issues , give low priority rules above two. using sonarqube 6 i appericiate advice. as noted in comments, have remove rules profile or edit them lower priority. need global administer quality profiles permission that. once you're logged in permission, go rules interface, search rule want deactivate, select rule, click on it, , deactivate relevant profile.

Matlab function in Simulink - retain previous non-zero input value -

i have matlab function block in simulink receives 2 inputs , processes generate output. during course of simulation, @ time points, 1 of inputs zero. i'd use recent non-zero input function whenever particular input value zero. how can achieve this? tried creating persisent variable updates recent non-zero input value doesn't seem work. edit 1 (to include code): function y = fcn(u) persistent ref_val if isempty(ref_val) ref_val=10.0 end if(u(1)<=25) y=20.0 else if(u(2)>0) y=u(2) ref_val=u(2) else y=ref_val end end edit 2: now, fixed issue writing c code uses static variable retain recent non-zero input value. still welcome suggestions/solutions realize directly in matlab function. can't use in simulation? //find index of last non-zero value in input [~,last_non_zero] = max(find(input(1:i) > 0)) //call function using input output = fnc(input(last_non_zero))

c# - Getting properties from forms in IlSpy -

is possible properties (width, height, location, ...) of e.g. labels, buttons, textboxes, ... in ilspy .net? problem is, have done project lost project file, there .exe-file available. , don't wanna redesign whole gui again. if using winforms, generated code designer (width, height, location, text, ...) placed initializecomponent function in respective form class. can decompile method , find information need recreate form.

java - Native insert JPA Spring -

i have many-to-many relationship between 2 entities: entity a id name entity b id name join table a_b a_id b_id i'm trying insert based off of secondary unique attributes (names). want avoid fetching each entity name , saving (2 queries & 1 insert vs 1 insert). effectively, i'm looking this: @query(nativequery = true, value = "insert a_b(a_id, b_id) values ((select id name = ?), (select id b name = ?))") void addtojointable(string namea, string nameb); i saw this post , i'm getting exceptions because insert doesn't return result set. post mentions setting nativequery true resolve issue, i've had no such luck... there & better way this? disclaimer: new jpa, might stupid question...

Azure search: flat data from Collection(Edm.String) -

i have following json structure after request azure search service (using search=*): "value": [ { "@search.score": 1, "id": "160", "title": "title1", "description": "description", "address": "ranelagh gardens, london, sw6 3pr, uk", "categories": [ "{\r\n \"description\": \"c1\",\r\n \"id\": \"3\"\r\n}", "{\r\n \"description\": \"c2\",\r\n \"id\": \"4\"\r\n}" ] } i want search inside categories such description=c1 can't. tried use $filter/categories.any(t:t eq 'c1') isn't working. unfortunately azure search not yet support complex data types such this. top requested feature , high on our list support, take time i...

angularjs - How to use ivhtree bread first search api -

i trying use ivhtreeviewbfs ( https://github.com/ivantage/angular-ivh-treeview#ivhtreeviewbfstree-opts-cb ) ivhtreeviewbfs(mytree, function(node) { console.log(node) }) however prints first level of nodes. how can traverse through entire list? i facing same issue. after research , testing seems behavior occurs when override default attribute children via ivh-treeview-children-attribute . the service doesn't detect children anymore ( undefined ), hence process first level. this demo (forked @ua_boaz's link) illustrates issue. i still trying figure out how fix it. update: this issue reports similar problem. workaround set childrenattribute globally using ivhtreeviewoptionsprovider , demo here .

python - unicodecsv doesn't read unicode csv file -

this line i'm trying read: with open('u.item', 'w') demofile: demofile.write( "543|mis\xe9rables, les (1995)|01-jan-1995||" "http://us.imdb.com/m/title-exact?mis%e9rables%2c%20les%20%281995%29| "0|0|0|0|0|0|0|0|1|0|0|0|1|0|0|0|0|0|0\n" ) this way reading it import unicodecsv csv def moviestordf(csvfilepath): open(csvfilepath, 'ru') csvfile: reader = csv.reader(csvfile, encoding='utf-8', delimiter= '|') row in reader: print row moviestordf("u.item") this error getting: unicodedecodeerror: 'utf8' codec can't decode byte 0xe9 in position 3: invalid continuation byte the value throws error is: misérables, les what wrong did please? (i using 2.7 python) i found problem the file encoded latin-1 not utf 8 this solves problem reader = csv.reader(csvfile, encoding='latin-1', delimiter= '|...

HTML object tag over Bootstrap 3 modal -

Image
i'm using scriptcam.js embed webcam capture in webpage. when open bootstrap modal modal appear under webcam object. this code generated scriptcam.js load webcam capture flash object. i'm trying play z-index it's not working. can have idea on how fix this. you can set z-index of modal , video follows: for video --> z-index: 3040; modal --> z-index: 3050; if doesn't work, try increasing z-index modal.