Posts

Showing posts from February, 2011

angularjs - Angular filter to add " before and after variable content -

i have following html / angular code: <blockquote> {{testimonial.text}} </blockquote> how can create filter, named blockquote, add " before , after {{testimonial.text}}? something like: {{testimonial.text | blockquote}} would render as: "testimonial text content" in opposing current code renders: testimonial text content just create filter adds " on start , end of input: .filter('blockquote', function() { return function(value) { return '"' + value + '"'; } })

css - Why does the Image move with the browser but doesnt stay centered? -

#border-search { position: relative; top: 50% !important; left: 25% !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important; display: none; } #border-search.center img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30%; height: auto; } how stay centered. ive tried many different things, dont work. display none needs stay since need show hide image. else need add thi work? want stay centered horizontally only here js fiddle http://jsfiddle.net/matsuiny2004/zffvcvkk/ you can try center current #border-search inner img element following change in css, relative ly positioning image automatic (and equal) left- , right-margins, , making centered. #border-search { margin: 0 auto; position: relative; } #border-search img { display: block; margin: 0 auto; position: relative; } the display: block; statement need

c# - The name 'AutomationId' does not exist in the current context -

i have assembly ui automation tests (white). i've introduced class autination id's reused in assembly: public static class automationid { public static class toolbar { public const string mycontrol = "mycontrolid"; } } and i'm trying use in test class (the same assembly): var control = mainwindow.get<button>(automationid.toolbar.mycontrol); this code can compiled locally. on teamcity i'm getting such error: the name 'automationid' not exist in current context it's c# 6 feature. similar problem: the name 'nameof' not exist in current context i encountered problem now, lead me here. research indicates need update teamcity: http://dave.ninja/2015/08/06/upgrading-teamcity-to-support-visual-studio-2015/ we still have this, well. post above shows lot of solutions issues encountered while upgrading. didn't seem painful process.

oz - How to use absolute values in Mozart? -

i'm trying absolute value of expression z=:x-y it's not working. here code: declare pso proc {pso w} x y z w in x=5 y=2 z=:y-x w=:abs(z) w=w(w:w) {fd.distribute ff w} end {exploreone pso} i know i'm doing wrong , how fix it. i noticed things: in first line can omit pso , declaring writing body. can't understand code @ all, abs function, have write w = {abs z} obtain absolute value of z in w . compiles, it's not clear me goal is. hope helped.

How to search a document and remove field from it in mongodb using java? -

i have device collection. { "_id" : "10-100-5675234", "_type" : "device", "alias" : "new alias name", "claimcode" : "fg755df8n", "hardwareid" : "serail02", "isclaimed" : "true", "model" : "vmb3010", "userid" : "5514f428c7b93d48007ac6fd" } i want search document _id , update after removing field userid result document. trying different ways none of them working. please me. you can remove field using $unset mongo-java driver in way: mongoclient mongo = new mongoclient("localhost", 27017); db db = (db) mongo.getdb("testdb"); dbcollection collection = db.getcollection("collection"); dbobject query = new basicdbobject("_id", "10-100-5675234"); dbobject update = new basicdbobject(); update.put("$unset&quo

ruby / rails: TypeError: can't convert Symbol into Integer -

i'm trying update representation attributes ivpn & idirect (from csv file via rake task print here meat of program) , getting typeerror: # in rails console: representation = representation.where(id: 977) # => representation_id: 977, ivnp: false, idirect: false rows = hash.[:ivpn => "", :idirect => "x"] # rows coming csv-file representation.update_attributes! ivpn: rows.any?{|r| r[:ivpn].present?}, idirect: rows.any? {|r| r[:idirect].present?} typeerror: can't convert symbol integer (irb):42:in `[]' (irb):42:in `block in irb_binding' (irb):42:in `each' (irb):42:in `any?' what i'm missing here? try this: representation.update_attributes! ivpn: rows.any?[{|r| r[:ivpn].present?}], idirect: rows.any? [{|r| r[:idirect].present?}]

php - Sorting query result to associative array with optional keys -

using php running query on database , result data-set optional values. example: result: array ( [0] => array ( [attribute_1] => red, [attribute_2] => car, [name] => sportscar ) [1] => array ( [attribute_1] => red, [attribute_2] => , [name] => rose ) ) i want format resulting data such: array ( [red] => array ( [car] => array ( [0] => sportscar ) ) [0] => rose ) so access sportscar by $array['red']['car'][0]; and rose by $array['red'][0] this make easier output data nice little foreach loop. of course actual case bit more complex lot more values etc example demonstrates principle. the problem can't think of proper way format data efficiently. not recursive @ least not 1 million if , elses nice. any

c# - Retrieve call forwarding (routing) rules of a Lync client -

how can retrieve call forwarding (routing) rules of lyn client using ucma or mspl? have tried retrieve using userendpoint , subscribing presencenotificationreceived event of remotepresenceview . unfortunately seems not work. according msdn documentation possible query route category local-access ( localownerpresence ). another options use applicationendpoint of impersonate every user want retrieve call forwarding rules. in eyes seems dirty solution. could done mspl? in tests this: another options use applicationendpoint of impersonate every user want retrieve call forwarding rules. in eyes seems dirty solution. has been working solution (outside of querying database directly). if want done in mspl, @ querycategory . problem there need correct containernumber , instance ids. however, if them (see msdn presence data source , category instance id ) find there no instance numbers listed routing. container number info can found here: routing category instan

javascript - Set focus to end of string in div -

i have div attribute contenteditable , want cut content that's input , longer e.g. 5 chars. focus set start of input time... var maxlength = 5; $(".test").attr("contenteditable", function(){ $(this).on('keyup', function( e ){ if( $(this).html().length > (maxlength)){ var content = $(this).html(); content = content.substring(0,(maxlength)); $(this).html(content).focus(); } }); return true; }); div{ width: 100px; height: 20px; background: red; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="test"></div> how can set cursor end of div content? i found samples here in did not work construct. i have tried .focus() , .blur() before , cleared content... no results... of course don't want install plugin... my solution: $

javascript - Neither model or setupController called on page refresh, but the correct route amd template chosen -

i have ember route this; this.resource('searchauctions', { path: 'section/search/:date_one/:date_two/:some_id}); when using link-to can move route no problems. when refresh page , check ember inspector in correct route, correct controller , model has object values expect, model or setupcontroller hooks not called can't capture values re run search in order populate template. my controller has action on updates array on model, gets search values , uses: var urlstring = '/section/search/' + model.date_one + '/' + model.date_two + '/' + model.some_id; window.history.pushstate({}, null, urlstring.trim()); to update url. causing problem? basically refreshing page not calling hooks expect, choosing correct template use.

javascript - Running multiple selenium tests simultaneously in node js -

how can locally run multiple selenium tests @ same time using node js? have tried combining selenium-webdriver , async tests run series. am missing something? can provide actual example? (dont reference me selenium grid or framework)

mysqldump - mysql get the columns sum and also get the distinct values at a time -

i have data base this id project_id client_id price 1 1 1 200 2 2 1 123 3 2 1 100 4 1 1 87 5 1 1 143 6 1 1 100 7 3 3 123 8 3 3 99 9 4 3 86 10 4 3 43 11 4 3 145 12 4 3 155 now here want sum price columns same client_id. made query this select `project_id`, sum(`price`) `table-name` group `client_id` this 1 doing sum price getting 2 project_id in result. want result should distinct project client id , price summed group clients. can tell me how this? , suggestions appreciable. thanks you should not have "bare" column in group by query not in group by statement. if want list of projects, can

c# - Is there a more efficient way to define similar public properties -

i've got class 20 public properties. these properties have in common strings , filled data different tables of database. additionally set pretty normal while special need call specific method. done each property @ moment (see below). my question here is: there more efficient way of doing this, way don't have define each public property hand in way? class myclass { private string _firstname; private string _lastname; ..... public string firstname { { return modifystringmethod(this._firstname); } set { this._firstname = value; } } } like mentioned above every public property looks same. calls modifystringmethod private member given parameter while set sets private member. you try automatic code generation using t4 template . perfect when have simple, repeating pattern of code , not expecting cases different others. simply define xml list of property names , have t4

asp.net - How to dynamically set text on a label inside an EditForm template? -

i've got devexpress 11 aspxgridview in .net 3.5 asp.net web forms application. i'm trying header in edit form, , doing currently: <templates> <editform> <h3>edit item details</h3> <dx:aspxgridviewtemplatereplacement runat="server" id="tr" replacementtype="editformcontent"/> </editform> </templates> this working fine. however, want localize text in <h3>edit item details</hr> , can't seem figure out way so. i've googled around bit haven't found solution. i've tried changing asp:label specific id, , inside htmleditformcreated event called: gridvieweditformeventargs.editform.findcontrol("myheaderid") however, returns null . i should note i've got custom localization going on, i'm looking way dynamically set text inside editform using code behind. there way this? try use label lbl = gridview.findeditformtemplatecontrol("

php - Automatically update SQL database when checkbox clicked -

i'm using php list out table sql database, , each of rows have checkboxes in them user keep track of whether or not part of row complete or not. i'd when checkbox checked or unchecked, sql database automatically update. possible, or need "save data" button @ end of each row? edit: clarify, i'm using php . if set onclick action of checkbox php/updatecheckbox.php?id=... , how know value of checkbox? also, wouldn't force page refresh? try this $fet['id'] id fetched db intimate modify. <a href=#><input type="checkbox" onclick="myfunction('.$fet['id'].');"> </a> <script> function myfunction(del) { var rmvfile=del; if (confirm("are sure want delete file?") == true) { if(del!='') { $.ajax({ type:'post', url:'query4.php', data:{rmvfile: rmvfile}, success:function(msg){ } }); } } } <

java - Android Studio didn't start. Shows issue like "tools, extra-android-m2repository and 6 more SDK components were not installed" -

Image
i tried start android studio cmd line, show issue "tools, extra-android-m2repository , 6 more sdk components not installed". think there problem jdk. tried change proxy settings in other.xml, opened android studio window , cannot able create or import new projects. people guide me. go , check update automatically update required packages , problem solved.

javascript - Regex - match from N-th occurence of a character till end of string -

going mad here :) because must simple , can't crack it. example: htz_2015_cs_ss5_cncenter_1020x200_as2_10k.html htz_2015_cs_ss5_cncenter_1020x200_as2_10k.swf htz_2015_cs_ss5_cncenter_1500x1000_160k_w1020.jpg match 6th "_" (underscore character), select , follows, till end of string replace nothing (basically delete 6th underscore end of string) i using sublime text text editing, find/replace function if necessary use online tool (any suggestions?). these might have guessed banner file names regularly need modify, hundreds of them @ time. many thanks! p.s. can write simple js maybe option if must be. if sure there @ least 6 _ in string : src.match (/^((?:[^_]*_){5}[^_]*)(_[^]*)$/)[1] 'htz_2015_cs_ss5_cncenter_1020x200_as2_10k.html'.match (/^((?:[^ ]* ){5}[^ ]*)( [^]*)$/)[1] == 'htz_2015_cs_ss5_cncenter_1020x200' otherwise use : (src.match (/^((?:[^_]*_){5}[^_]*)(_[^]*)$/) || [,src])[1]

How could I initialize a two dimensional char pointer in C++ class -

class tool { public: tool(); ~tool(); private: char **s; }; char *s1[]={"hello","world"}; how can initialize s , make same s1 ? s={"hello","world"} doesn't seem work. while use std::vector<std::string> , feel it's more beneficial directly answer question. char** s pointer pointer; possibly pointer first pointer in array of pointers. char* s1[] array of pointers const data (and should have been made const ). if want s work s1 , first need allocate array of pointers, reason std::vector recommended others. new , have release allocated memory @ point. using new directly prone leaks. std::vector release allocated memory when object destructed. call delete[] in destructor if wanted to. when array has been allocated, need std::copy array of pointers in s1 array of pointers in s . it's not single assign operation.

php - Multiple Laravel 5 and AngularJS Apps -

i'm working on project has multiple loosely coupled modules (20+) , have decided go laravel 5 , angularjs. i'm using yeoman angularify generator angularjs. can't decide on application structure, ideally want each sub-module different app easy developers work on separate apps independently. mylab/ app/ http/ controllers/ somecontroller.php # api's used across apps ... public/ bower_components/ angular/ bootstrap/ scripts/ angular.modules.js #custom modules used across apps .. resources/ views/ .. #landing page view sub-app1/ app/ http/ controllers/ subapp1controller #sub-app1 specific api's .. public/ bower_components/ repo1/ #specific sub-app1 ... resources/ angularapp1 #spa sub-ap

ruby on rails - What is the best way to test activeadmin classes? -

i have simple activeadmin class looks this: activeadmin.register post actions :index index index_columns end csv index_columns end def index_columns column "id" |sp| sp.id end end end how best test code? write integrations specs capybara or maybe there other way? general idea behind testing gem's functionality - you don't test it . gems (usually) tested.

php - Reuse instance of class -

i thinking missing out on oop php. i developing plugin wordpress have class declaration book: <?php class wpbook{ private $title; function settitle($_title){ $this->title = $_title; } function gettitle(){ return $this->title; } } ?> add_action( 'hookone', 'function_do_stuff'); add_action( 'hookafter_hookone', 'function_do_more_stuff'); function function_do_stuff(){ //some more stuff $newbook = new wpbook; $title = $newbook->settitle ='titlea'; echo $title; //echos 'titlea'; // function_do_more_stuff($title); not work because // function called on hookafter_hookone } function function_do_more_stuff(){ // here want access $title function_do_stuff(); // not know how. } now want able access title of book do_stuff() function function do_more_stuff() . the problem can't use returns form do_stuff() do_more_stuff() , because do_more_stuff() ca

In Android, why are all org.apache.http.* classes deprecated in API 22 (and what should I use as replacements)? -

i use threadsafeclientconnmanager in app, , bunch of other classes httpstatus, sslsocketfactory, plainsocketfactory, schemeregistry, etc. of api 22 thery're being marked deprecated, , don't see clear indication replaced them. documentation jas says "please use openconnection() instead. please visit this webpage further details", , doesn't make clear do. openconnection() points url class, , webpage link 2011 talks differences between apache classes , httputrlconnection . so, mean we're supposed useign httpurlconnection class on? , if that's case, thought wasn't thread safe (which why using threadsafeclientconnmanager ). could please clarify me? i asked that half month ago. turns out have use openconnection() instead of old ones. i think it's bit change code, lollipop on few amount of smartphones, should change can cut ahead of time. got pretty idea here how connection using java.net.urlconnection fire , handle http requests?

TFS Eclipse Plugin detects wrong files edited -

eclipse tfs plugin says lot of files includes images (.png, vs..) have been edited although have made no change them when open "detect local changes" tab. understand files in bin/ folder supposed have been edited don't understand other files mentioned above seen edited tfs eclipse plugin. there idea of reason or solution it? when you're using server workspace, tfs treats file not have readonly bit set changed. that's how server workspaces work. if want tfs reflect contents of file need "undo unchanged", tfs automatically when check in (tfs never creates 2 revisions when both have exact same contents). or switch local workspace, in case tfs store copy of file in hidden folder, knows workspace version looked when tfs served you. tfs 2010 not support local workspaces. note tfs 2010 general support ends july 2015 , it's recommended upgrade tfs 2013u4 or tfs 2015 releases.

c# - WPF - DependencyProperty ignoring setter with side-effects on change -

this question has answer here: wpf: xaml property declarations not being set via setters? 1 answer i have wpf user control wrapper 2 other controls, showing 1 of them depending on situation. possesses itemssource property sets itemssource 2 underlying controls. want make property can bound on .xaml file. i created dependencyproperty , , i've changed getter , setter use it. however, when debug code, can see setter never getting called. can see dependency property changing value, it's not setting underlying controls' properties. how can make underlying controls have properties set when dependency property changes? public partial class accountselector : usercontrol { public static readonly dependencyproperty itemssourceproperty = dependencyproperty.register( "itemssource", typeof(ienumerable), typeof(accountselector)); publi

python - Plot duplication in Pandas Plot() -

there issue plot() function in pandas import numpy np import pandas pd import matplotlib.pyplot plt df = pd.dataframe(np.random.randn(8, 4), columns=['a', 'b', 'a', 'b']) ax = df.plot() ax.legend(ncol=1, bbox_to_anchor=(1., 1, 0., 0), loc=2 , prop={'size':6}) this make plot many lines. note half on top of each other. seems have axis because when not use them issue goes away. import numpy np import pandas pd import matplotlib.pyplot plt df = pd.dataframe(np.random.randn(8, 4), columns=['a', 'b', 'a', 'b']) df.plot() update while not idea use case issue can fixed using multiindex columns = pd.multiindex.from_arrays([np.hstack([ ['left']*2, ['right']*2]), ['a', 'b']*2], names=['high', 'low']) df = pd.dataframe(np.random.randn(8, 4), columns=columns) ax = df.plot() ax.legend(ncol=1, bbox_to_anchor=(1., 1, 0., 0), loc=2 , prop={'size':16})

windows phone 8 - Visual Studio - deploys without building -

today vs pro 2013 started acting up. stopped building wp8 project before deploying on device, have start build manually , start debugging. until had tap f5 run everything... there option connected such behavior might've gotten turned on/off or kind of bug in ide? i had same situation , looks me vs bug. restarting vs helps! :)

soap - python response does not match with soapUI -

when access web service using soapui correctly formatted text. when use python code, dictionary rows in single allbustype key. from pysimplesoap.client import soapclient url = 'http://180.92.171.93:8080/upsrtcservices/upsrtcservice?wsdl' namespace = 'http://service.upsrtc.trimax.com/' client = soapclient(wsdl=url, namespace=namespace, trace=true) print client.getbustypes() the above code returns following: {'return': {'allbustype': [{'busname': u'ac sleeper'}, {'bustype': u'acs'}, {'ischildconcession': u'n'}, {'isseatlayout': u'n'}, {'isseatnumber': u'n'}, {'busname': u'ac-janrath'}, {'bustype': u'jnr'}, {'ischildconcession': u'n'}, {'isseatlayout': u'y'}, {'isseatnumber': u'y'},.... as per following screen, soapui returning bus stops separate tag. (and not stops in single tag above)

java - Using Metrics timer with DropWizard AKKA project -

i trying time method in 1 of actors, upon reading various posts on internet looks @timed annotation applicable dropwizard resources. in order time plain java method, need manually time it. there example shows how achieve this? looking complete example give idea of different classes , be.

c# - Convert HTML with SWF to Pdf or JPG -

my aim clear. convert(capture) websites given url html page swf included pdf or jpg file. i need batch operation lib or saas ok me. could recommend third party solution? library or example service in cloud. can paid of course. what trying example: evopdf library required flash player work cannot install flash on server cause of security risky. cloudconvert (beta) not work (swf container empty) princexml not support web2pdfconvert.com not work (swf container empty) and many others no results.. if cannot install flash player how expect capture swf data? need able draw swf or blank.

ruby - Execute Javascript in Sinatra -

i searched lot can't seem find clear answer how execute javascript code via sinatra, symply renders code html me. here tried far : require 'sinatra' set :public_folder, 'public' class dashboard < sinatra::base '/' send_file file.join(settings.public_folder, 'javascripts/index.js') # renders code html '<script type="text/javascript" src="index.js"></script>' # nothing '<script>alert("hello, world !")</script>' # works correctly end end figured out, path in src must : <script type="text/javascript" src="javascripts/index.js"></script>

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e7AmlG/django-filter -

im trying run pip install on pip_requirements.txt ( readthedocs local install) file in cygwin within virtualenv , running issues. python version:python 2.7.8 pip version: pip 6.0.8 virtualenv: 12.0.7 here console output . whats odd cannot find directory , never creates temp directory. install works fine on linux, running issues on windows box. appreciated!

Configurating Django, Heroku, and a static file server -

we used use following combination: django framework heroku application server , amazon s3 static file server. but need build system handles large amount of video data, data transfer more 10 tb per month. means amazon s3 no longer option because it's expensive. we opt set our own static file server, it's gonna django, heroku, , on-premiss file server. need suggestions: is our decision enough? other options? is nginx choice file server in application? are there documentations uploading large files django+heroku application nginx server? thanks. 1) yes, decision best possible 1 2) nginx best solution. cloudflare serves traffic nginx more major web apps altogether. netflix serves 33% media traffic nginx 3) s3 origin not expensive traffic costs lot. should https://coderwall.com/p/rlguog/nginx-as-proxy-for-amazon-s3-public-private-files large files upload should bypass kind of backend saved on disk asynchronous followed upload destination s separate pro

javascript - Backbone click event being fired multiple times -

i have seen many questions this, no 1 solving problem. i have page main div has 1 div one-image default. there button can add other div s. have event click appends other div template "remove" button. this: image stack <div class="image-stack"> <div class="one-image"> ... <a id="addimage">add image</a> ... </div> </div> image template <script type="text/template" id="another-image-template"> <div class="one-image"> ... <a id="addimage">add image</a> <a id="removeimage">remove image</a> ... </div> </script> view events: { 'click #addimage' : 'addanotherimage', 'click #removeimage' : 'removethisimage' }, addanotherimage: function(e) { var = $('#another-image-template').html(); $('.ima

git push - Confused as to why Git believes my branch tip is behind the origin -

i have branch created develop (created atlassian stash) has handful of commits. when try , push commits error updates being rejected because pushed branch tip behind remote counterpart. based on understanding, means else committed, should pull changes. however, there nothing pull. funny thing looking @ atlassian stash i'm able see push has in fact gone through. $ git push repo_url ! [rejected] develop -> develop (non-fast-forward) ! [rejected] feature/135-add-button-to-ticket-indicating -> feature/ 135-add-button-to-ticket-indicating (non-fast-forward) error: failed push refs 'repo_url' hint: updates rejected because pushed branch tip behind remote hint: counterpart. check out branch , integrate remote changes hint: (e.g. 'git pull ...') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details. i'm not sure i'm doing wrong, love know why particular issue rears ugly head every few days. i

.net - Azure websites (Standard) SSL certificate -

i've scaled azure website standard instance. azure's pricing tier standard says comes "5 sni ssl , 1 ip ssl included @ no cost". i'd set ssl binding custom domain using 1 of these supposed "certificates". however, cannot find on azure portal pointing me 1 of these certificates. option upload certificate. wrong in thinking azure includes or provides these certificates in standard mode? or "5 sni ssl , 1 ip ssl included @ no cost" mean "ssl slots", still have purchase certficates? for custom domain still have purchase own ssl certificate, https supported on non custom domains no cost ("websites provides ssl connections urls under 'azurewebsites.net' domain @ no additional charge. securely access website @ https://.azurewebsites.net.") this link show how add custom ssl once you've bought domain.

c++ - no graphics visible on LCD on running qt application -

i trying cross compile , run qt application on arm board has lcd connected it. used below code , cross compiled arm. when run application executes no graphics visible on lcd. can me. need export something. #include <qapplication> #include <qpushbutton> int main(int argc, char *argv[]) { qapplication app(argc, argv); qpushbutton hello("hello world!"); hello.show(); return app.exec(); } i have done project "rfid based authorization system" had run qt application on lcd interfaced raspberry pi (arm board). please provide more information can of more you. make sure had done: correct qt package (qt on arm embedded system) every time port program intel (your computer) arm based, need configure project on qt creator. make sure graphics environment enabled on arm board working. default, command line interface enabled on arm board , need enable gui separately.

proxy - How to secure android app from network traffic capturing -

my app making http requests , don't want others see content of requests. @ moment can check app doing using fiddler. in order track network traffic on phone had change wi-fi settings , connect internet using proxy server. i.e. computer. possible programatically check whether phone using proxy? if knew phone using proxy forbid user using app showing error dialog. there ways of solving problem? i've seen apps work on normal wi-fi settings not when using proxy therefore assume there solution. way i'm using retrofit library making requests. moving traffic use https help protect against network snoops fiddler. however, fiddler can decrypt https traffic user's help, means can't use https, need implement certificate pinning, whereby client code verifies server presented 1 specific certificate (not interception certificate fiddler generates). however, doesn't solve problem, user can jailbreak device , disable certificate pinning code. you should step

localhost - No route found using Aura Router for PHP -

the app uses aura router routing. accesing index.php of web app returns "route not found" error message. here's (seemingly) relevant code: $path = parse_url($_server['request_uri'], php_url_path); $route = $router->match($path, $_server); if (empty($route)) { header("http/1.0 404 not found"); echo 'route not found'; exit; } i'm running locally, using wampserver. path have app localhost/websites what missing? the manual may out here: https://github.com/auraphp/aura.router#handling-failure-to-match (i'm lead on aura.)

c# - how customize filtering Client Template kendo grid column asp.net mvc 5 -

i have kendo grid contain column client template containing 3 type of icone, able filter column 3 icon didn't find solution question ? please me code: columns.bound(p => p.x).clienttemplate( " # if (x == -1) { # <img src='***** /> # } #" + " # if (x == 0) { # <img src='***# } #" + " # if (x == 1) { # <img src='**** /> # } #" ).filterable("???????").title("").width(20); columns.bound(c => c.code) .groupable(false); any please

java - MapReduce - reducer does not combine keys -

i have simple map reduce job building reverse index. my mapper works correctly (i checked that) , outputs key pair of word , docid:tfidf value: mapper (only output shown): context.write(new intwritable(wordindex), new text(index + ":" + tfidf)); the job of reducer combine these values. implementation: public static class indexerreducer extends reducer<text, intwritable, intwritable, text> { public void reduce(intwritable key, iterable<text> values, context context) throws ioexception, interruptedexception { stringbuilder sb = new stringbuilder(); (text value : values) { sb.append(value.tostring() + " "); } context.write(key, new text(sb.tostring())); } } however, not combine , output looks same form mapper. there lines in output same key although reducer supposed combine them - keys in output file supposed unique when using reduc

sql server 2012 - How to pivot data -

i use pivot function in following query display dateadded, accountname, campaign, campaigngroup on left side , summation of values across top summed across top select convert(varchar(10) , ct.dtadded , 120)dateadded , upper(szaccountname)dealer , upper(c.szcampaign)campaign , upper(cg.szcampaigngroup)campaigngroup , case when d.dialid not null 1 else 0 end namesreceived , attempts callattempts , case when callflag = 1 , attempts < c.nmaxattempts , d.agentid != -1 1 else 0 end eligibleremaining , case when szfaxtype '%appointment%' 1 else 0 end apptfaxes , case when szfaxtype '%hot%' 1 else 0 end hotfaxes , case when szfaxtype '%service opportunity%' 1 else 0 end serviceopfaxes , case when szfaxtype '%basic%' 1 else 0 end basicfaxes , case when szq25 in('now' , '30 days' , '90 days')

javascript - Unable to access AngularJS attribute in directive -

i'm trying implement simple directive in angularjs. in end, want able use directive this: <share-buttons url="google.com"></share-buttons> my directive looks (coffee script): module.directive 'sharebuttons', () -> controller = ['$scope', ($scope) -> $scope.share = () -> console.log $scope.url ] return { restrict: 'ea' scope: { url: '=url' } templateurl: viewpath_common('/directives/share-buttons') controller: controller } and here's template (jade): .social-icons button.btn.btn-li(ng-click="share()") i.fa.fa-linkedin.fa-fw when click button, correct function called ($scope.share), thing logged undefined . can me? its because url attribute 2 way data bound "=" so it's looking scope variable this: $scope.google.com = // should value. to passed contr

c# - null issue during usage of count and sum LINQ -

i have 3 tables , linked grandparent -> parent -> child categorytype - > categories - > menus when try run following return categorytypes.select(x => new categorytypeindexmodel { id = x.id, name = x.name, categories = x.categories.count, items = x.categories.sum(m => m.menus.count()) }); i the cast value type 'system.int32' failed because materialized value null. either result type's generic parameter or query must use nullable type. you trying count isn't there when categories null. believe habib recommend technically work still have account null value after fact. think better solution account in linq directly looking null , providing default return categorytypes.select(x => new categorytypeindexmodel { id = x.id, name = x.name,

objective c - iOS, Sort allKeys of NSDictionary -

<-- why have been down voted? @ least comment reasoning i have incoming json array details consecutive & non-consecutive date periods. an example: (please note, root index values example clarity. real data associative key-value) [0] => '01/01/2015 - 05/01/2015' : ['01/01/2015', '02/01/2015', '03/01/2015', '04/01/2015', '05/01/2015'], [1] => '01/02/2015 - 05/02/2015' : ['01/02/2015', '02/02/2015', '03/02/2015', '04/02/2015', '05/02/2015'], [2] => '25/03/2015': '25/03/2015', [3] => '01/04/2015': '01/04/2015' my final intention display each asso

amazon rds - Create a rds instance using python: having status always = creating -

im trying create rds instance using python. i have code below create instance , want show print "instance running" when instance have status available. the problem that, when appears available status in aws managment console, in console application still appears status = creating , code dont out of while loop: the result im having: .... creating 233 creating 234 ... the code: instance = conn.create_dbinstance(...) print "waiting instance , running" status = instance.status inc = 0 while status != 'available': sleep(5) status = instance.status print status inc=inc +1 print inc if status == 'available': print "instance running" do see why can happening? the boto docs aren't clear when results such dbinstance.status fetched on-demand via api vs. being returned earlier, cached lookup. i'm betting here, instance.status call using returning same (cached) resu

forms - Could not load type "sonata_user_registration" -

when try override registration form in sonatauserbundle got error : "could not load type "sonata_user_registration"".i searched solution of problem of them doesn't me. override template now, need override registration form(add age field), added few code in //app/application/sonata/userbundle/entity/user.php /** * @orm\column(type="string", length=255) * * @assert\notblank(message="please enter name.", groups={"registration", "profile"}) */ protected $age; public function getage() { return $this->age; } public function setage($age) { $this->a=$age; } but if run php app/console doctrine:schema:update --force told nothing update registrationformtype: //app/application/sonata/userbundle/form/type/registrationformtype.php namespace application\sonata\userbundle\form\type; use symfony\component\form\formbuilderinterface; use fos\us

python 3.x - How do I get the Entry Widget to pass into a function? -

i'm sure simple mistake , i've localized specific spot in code: class newproduct(tk.frame): def __init__(self, parent, controller): tk.frame.__init__(self, parent) tlabel = ttk.label(self, text="title: ", font=norm_font).grid(row=0, padx=5, pady=5) qlabel = ttk.label(self, text="quantity: ", font=norm_font).grid(row=1, padx=5, pady=5) plabel = ttk.label(self, text="price: $", font=norm_font).grid(row=2, padx=5, pady=5) te = ttk.entry(self).grid(row=0, column=1, padx=5, pady=5) # add validation in future qe = ttk.entry(self).grid(row=1, column=1, padx=5, pady=5) pe = ttk.entry(self).grid(row=2, column=1, padx=5, pady=5) savebutton = ttk.button(self, text="save", command=lambda: self.save(self.te.get(), self.qe.get(), self.pe.get())) #why wrong!!!!!???!?!?!?!?!? savebutton.grid(row=4, padx=5) cancelbutton = ttk.button(self, t

html - Change the style of an input only when it is followed by a span -

Image
this question has answer here: is there “previous sibling” css selector? 12 answers how can target <input> when there <span> after it? <fieldset> <p>normal input</p> <div> <input name=""> <span><i class="icon-cart"></i></span> </div> </fieldset> input + span {} work if <span> before <input> in case after <input> - there way target without using javascript or adding classes parent container? as can see in image below, want change input border-radius merge span icon on other scenarios. if want add class say, use jquery this: $('span').prev('input').addclass('test'); or add border-radius: $('span').prev('input').css('border-radius','3px');

javascript - Chart.js in AngularJS tabset does not render -

i using angularjs module based on chart.js display graph. works charm, when display chart in angularjs tabset, graph not render if not first tab. <tabset> <tab heading="tab 1"> <!-- ok --> <canvas class="chart chart-pie" data="[140, 160]" labels="['d1', 'd2']" legend="true"></canvas> </tab> <tab heading="tab 2"> <!-- not render --> <canvas class="chart chart-pie" data="[140, 160]" labels="['d1', 'd2']" legend="true"></canvas> </tab> </tabset> this jsfiddle . manage fix ? thanks as @martin pointed out, issue of chart.js not showing chart when initiliazed in hidden dom element (its height , width remain @ 0px after showing hidden element). this issue tracked here . i share home made solution if blocked components t

c# - Draw 2 pictureboxes in one bitmap -

i'm c# beginner , i'm wondering if there way draw 2 images 2 different pictureboxes , save 1 image using method drawtobitmap. i can preview nice in program (it looks good), main problem when save picture, it's showing picturebox1 blank-alike icon of picturebox2 in middle :/ here's part of code , it's not working should picturebox2.imagelocation = potdoslike; bitmap bmp = new bitmap(picturebox1.width, picturebox1.height); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\asd.jpg"); i figured out! problem didn't save picturebox.image , couldn't draw nothing out... here's code! picturebox2.parent = picturebox1; picturebox2.imagelocation = potdoslike; picturebox2.image = image.fromfile(potdoslike); bitmap bmp = new bitmap(picturebox1.image); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\as

multithreading - UI Thread block when starting zxing-android-embedded -

so used https://github.com/journeyapps/zxing-android-embedded embedd barcode scanner app. problem takes while start, 2 4 seconds. in time ui hangs, added , asynctask , ui doesn't hang anymore, progressdialog added asychtask not show. when add thread.sleep doinbackground dialog show hangs again when thread.sleep over. have idea how let user know scanner loading? class loadscanner extends asynctask<void, void, void> { @override protected void onpreexecute(){ progress = new progressdialog(mainactivity.this); progress.settitle("loading"); progress.setmessage("wait while loading scanner..."); progress.setcancelable(false); progress.setindeterminate(true); progress.show(); } @override protected void doinbackground(void... params) { integrator = new intentintegrator(mainactivity.this); integrator.setdesiredbarcodeformats(intentintegrator.one_d_code_types); integra

Does spring integration support AMQP with ActiveMq -

i new mom. i want connect activemq using amqp application. want use spring integration connecting activemq. i see example of amqp rabbitmq not able find example activemq. is not possible spring integration ? no, isn't possible. activemq supports amqp 1.0 protocol oasis standard. where rabbitmq , hence spring integration amqp adapters support 0.9.1. those spec versions different. you should try tu use activemq jms api on amqp. , spring integration jms adapters.

javascript - PHP / JQUERY - display each sub array of json -

i have post script below, current script output this. ["error1","error2","error3"] ["good1","good2","good3"] i want output each error in separate paragraph , each in paragraph php script $error[] = "error1"; $error[] = "error2"; $error[] = "error3"; $good[] = "good1"; $good[] = "good2"; $good[] = "good3"; $data["error"] = json_encode($error); $data["good"] = json_encode($good); die(json_encode($data)); jquery script function _request() { $("form").submit(function(e) { e.preventdefault(); $.ajax( { url: $(this).attr("action"), type: "post", data: $(this).serializearray(), datatype: 'json',

java - BeanNameAutoProxyCreator setBeanNames regular expression not working? -

this beannameautoproxycreator : @bean public beannameautoproxycreator beannameautoproxycreator() { beannameautoproxycreator beannameautoproxycreator = new beannameautoproxycreator(); beannameautoproxycreator.setbeannames("*service"); // if put "*service" instead, exception. beannameautoproxycreator.setinterceptornames("loggingadvice", "debuginterceptor"); return beannameautoproxycreator; } @bean public loggingadvice loggingadvice() { return new loggingadvice(); } @bean public debuginterceptor debuginterceptor() { return new debuginterceptor(); } and clientservice bean: @bean @scope(beandefinition.scope_prototype) public clientservice clientservice() { return new clientserviceimpl(this.clientdao); } so, don't know why, when call setbeannames("*service") not setting interceptors. if put "*service" exception: org.springframework.beans.factory.beancreationexception: error creating

Reverse CSS changes done my jQuery -

so i'm doing. have default set of css each element, need modify on click. is there easy way reverse change done jquery action? rolling default set styles? manually, automatically, somehow without hard coding anything. jquery main.find('li').each(function() { var sub1 = $(this); if(sub1.has('ul').length > 0) { var bg = sub1.css('background-image'); sub1.click(function() { event.preventdefault(); event.stoppropagation(); if(!sub1.find('> ul').is(':visible')) { sub1.css('border-bottom', '2px solid #e1e000'); sub1.css('background-image', 'url(img/square0.png)'); sub1.find('> a').css('color', '#d8a2dd'); }

wpf 4.0 - In WPF, how to check/uncheck a checkbox on 1/0 or y/n entered by user -

i have checkbox in user control. want user able check checkbox when enters y or 1, , uncheck when n or 0 entered. better have in xaml if possible. thank in advance, appreciated. you can add keybinding usercontrol respond key presses in xaml, still need write command changes binding property. <usercontrol.inputbindings> <keybinding key="y" command="{binding mycommand}" /> <keybinding key="n" command="{binding mycommand}" /> <keybinding key="d0" command="{binding mycommand}" /> <keybinding key="d1" command="{binding mycommand}" /> </usercontrol.inputbindings>

javascript - SVG Clear group<g> -

suppose have svg element so <svg id="svgcanvas" class="pan" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveaspectratio="none"> <g id="viewport"> //filled arbitrary amount of lines , cirles - examples below. <line x1="632" y1="357.5" x2="682" y2="270.89745962155615" class="line" style="stroke: rgb(128, 128, 128); stroke-width: 1.3px;"></line> <circle cx="82.08376766398476" cy="367.0988235405059" r="16.5" stroke="blue" fill="white" class="circle"></circle> </g> </svg> how go clearing group, whilst keeping group element itself? just using dom methods without need framework go for: var el = document.getelementbyid("viewport"); while (el.firstchild) { el.removechild(el

android - Why doesn't XCode accept I have Java? -

i have installed spritebuilder (latest version) , have latest version of xcode installed. from spritebuilder store, have installed android 'pack' has resulted in being able deploy android tablet within xcode. problem is, build fails , popup tells me need java, takes me website download , install do. i restart no further forward. same error. have installed java 3 times , no change. anyone experienced , got ideas? :/ thanks in advance.

php - can't pass value in select option -

this code in test1.php <?php if ($_post['check']!= ""){ $a = $_post['translation']; } ?> <html> <form action="test2.php" method="post"> <select name="translation"> <option selected="selected" value="1">vietnamese-english</option> <option value="2">english-vietnamese</option> </select> <input type="submit" value="check" name="check"> </form> </html> and in test2.php echo value $a nothing. value null when use var_dump($a) this part of code in form, doesn't belong there: <?php if ($_post['check']!= ""){ $a = $_post['translation']; // echo $a; // added } ?> it belongs in test2.php file, why not getting results.

java - Getting all objects with same key from a MultiValueMap -

i have multivaluemap<integer, path> trying [ print purpose of question ] out paths put in map using same key. this current solution: multivaluemap<integer, path> duplicates = duplicatefinder.getduplicates(); (map.entry<integer, object> entry: duplicates.entryset()) { final integer key = entry.getkey(); final object obj = entry.getvalue(); (object o: (linkedlist)((arraylist)entry.getvalue()).get(0)) system.out.println(o); system.out.println(); } i feel solution dangerous (casting , magic number 0) , avoid it. how can achieve desired result in more readable/safe manner? the entry set seems declared unfortunate signature. iterate on keys instead, , call getcollection each: for (integer key : duplicates.keyset()) { collection<path> paths = duplicates.getcollection(key); system.out.println("paths " + key); (path path : paths) { system.out.println(" " + path); } system.out.println();

html - Whats the best alternative for display:flex for the Inernet explorer? -

with display:flex , can make divs float next each other. display:flex not work in ie. how create similar effect in ie in simplest possible way? this question may have been answered in following post: https://stackoverflow.com/a/28709421/3943441 if doesn't out, please clarify different in problem , glad continue helping in search solution.

how to format one element of multi array (of php) in jquery part code -

when login part of code executed: $_session['user'] = array('user_id' => $user[0]['user_id'], 'ip' => $_server['remote_addr']); now on upfollowing php page code has read user_id $.tablesorter.setfilters( table, ['', '<?=$_session["favcolor"];?>' ], true); where 'favcolor' is, needs 'user_id' be... but how format that? i thought so: (i got idea site, thougth multi array http://www.w3schools.com/php/php_arrays_multi.asp ) '<?=$_session[0][1];?>' but not work.. so how should formated then? pls help almost there, word 'array' in column $.tablesorter.setfilters( table, ['', '<?=$_session["user"];?>' ], true); you can use $_session['user']['user_id'] access user_id $_session array. in : $.tablesorter.setfilters( table, ['', '<?=$_session["user"];?>'