Posts

Showing posts from September, 2010

c# - Many nested AggregateExceptions -

working entity framework 7, made simple mistake linq (used skip , forgot include orderby clause). the exception thrown included number of nested aggregate exceptions. the code generates (and catches) exception is: int[] newids; try { newids = await db.products .where(p => p.portalid == portalid) .skip(ids.productids.count) //skip rows read .take(taketotal) //get next block .select(p => p.productid) .toarrayasync(); } catch (aggregateexception ex) { console.writeline(ex.message); newids = new int[] { }; } the code above in repo class called asp.net 5 webapi controller. levels of call using async-await. however aggregate exception got (this dumped immediate window catch block shown above): system.aggregateexception: 1 or more errors occurred. ---> system.aggregateexception: 1 or more errors occurred. ---> system.aggregateexception: 1 or more errors occurred. ---> system.aggregateexception: 1 or mo...

spring data rest - How can you selectively export PATCH, PUT and POST for a @RestRepositoryResource? -

i know possible use annotations prevent export of http methods given repository, e.g: @repositoryrestresource public interface accountrepository extends pagingandsortingrepository<account, long> { @override @restresource(exported = false) account save(account entity); } if understood documentation correctly save mapped post, put , patch. possible selectively prevent export of these individually? instance, in case want allow put prevent post. it workaround makes override automatically generated crud methods (by spring data rest) own controllers: public class crudcontroller { @requestmapping(value = "/save", method = {requestmethod.post, requestmethod.put}) public string save(model uimodel) { // code here } }

javascript - Angular method executes indefinitely when it uses with the ng-style -

html <div class="progress-bar" ng-style="{width: event.methods.getprogress() + '%'}"></div> js getprogress: function () { var total = number($scope.event.item.total); var goal = number($scope.event.item.goal); if (total > goal) { total = goal; } return math.round((total / goal) * 100); }, i have used above code show progress bar on page.progress bar working fine.but when put debug point on getprogress() method executes indefinitely.when remove ng-style there no problem (but know progress bar not working).so tell me how avoid above kind of behaviour ? in advance. html <div class="progress-bar" ng-style="{width: progressvalue + '%'}"></div> js //initially setup value $scope.progressvalue = 0; //then on every call of getprogress updated ...

include video on website (non branded) -

i wanting include video on website, however, client player not have branding , interested know best way include video in site, cross browser ready? i aware of html 5, backwards compatible ie9 , vimeo has pro account has yearly charges. guidance appreciated. i've had same case previous development. the solution found : i've used videojs player . if current browser not compatible html5 (specially play videos), so, link videojs.swf (flash player instead). read documentation on github, works me.

javascript - How to test a service that is called on .success of http.post -

i have controller calls service performs http.post username , password. on .success of post, call service create cookie. i 'believe' have created successful jasmine test test post, unsure of how test cookie service. logincontroller.js: app.controller('logincontroller', function($scope, $http, signinservice, cookiesrv) { $scope.login = function(usrnm, pwd) { signinservice.authuser(usrnm, pwd) .success(function (data, status, headers, config) { var cookieid = 'mycookie'; cookiesrv.createcookie(cookieid, data.token, 3, data.redirecturl); }) .error(function (data, status, headers, config) { // display error message } } }); cookiesrv.js app.service('cookiesrv', function() { return { createcookie : function(cookieid, token, days, redirecturl) { if (days) { var date = new date(); d...

php - How to insert data from a json-object to a database -

i'm pretty new json, i'm trying insert data json database table. keep getting errors: notice: undefined index: subject notice: undefined index: message <?php $jsondata = '{ "p1" : [ { "subject": "something", "message": "something" }, { "subject": "something111", "message": "something11" } ] }'; $data = json_decode($jsondata, true); $p1 = $data['p1']; $sql = "insert table(subject, message) values('".$p1['subject]."', '".$p1['message]."'"); $result = $mysqli->query($sql); ?> there many mistakes in code. 1.$p1 multidimensional array treating array 2.you have forget comma(') before ] in query 3.you have close " @ wrong place in query should @ last after values bracket. use code $jsondata = '{ "p1" : [ { "subject": "someth...

SQL COUNT And SUM -

i have table having table done_by var_id| var_name| q1_by |q2_by|q3_by|q4_by 1 | abc | me | me |me |you 2 | cba | me | me |you |you 3 | abd | me | |you |me the result want get total of me , value me=7 you=5 have done count, cant count 'me' each column you can conditional aggregation like: select sum(case when q1_by = 'me' 1 else 0 end + case when q2_by = 'me' 1 else 0 end + case when q3_by = 'me' 1 else 0 end + case when q4_by = 'me' 1 else 0 end) me , sum(case when q1_by = 'you' 1 else 0 end + case when q2_by = 'you' 1 else 0 end + case when q3_by = 'you' 1 else 0 end + case when q4_by = 'you' 1 else 0 end) tablename

apple push notifications - iOS - How to check wheather pem file is valid or not? -

i have created development , production pem files. have followed steps: 1) developer.apple.com : appids section check bundle id supports development ssl certificate if no create certificate (which supports apns) 2) open key chain 3) right click on our certificate , export certificate. 4) .p12 file here : : hope_apns.p12 5) open console(terminal) , run following command (use created .p12 file here input) openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts 6) .pem file same. (like hope_apns.pem) developement pem file working fine. there in production pem file. when set production pem file , send push notification console. won't push on device. that's old thread looking same answer , hope solution someone... worked me. you can test pem key using following command, should hang if successful until press enter: openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert pnpush.pem -key pnpush.pem the above tests pem...

android - cannot change text size of tabs in a tab group in Titanium -

i have 3 tabs in application. want adjust size of text because if text size more automatically scroll comes in picture. `var tabgroup = ti.ui.createtabgroup(); var win1 = ti.ui.createwindow({ title : "home page" }); var tab1 = ti.ui.createtab({ icon : "/images/default.png", title : "text size 1", font : { fontfamily : 'helvetica neue', fontsize : 8 }, window : win1 }); tabgroup.addtab(tab1); var win2 = ti.ui.createwindow({ title : "bookmarks page" }); var tab2 = ti.ui.createtab({ title : "text size 2", icon : "/images/default.png", font : { fontfamily : 'helvetica neue', fontsize : 8 }, window : win2 }); tabgroup.addtab(tab2); var win3 = ti.ui.createwindow({ title : "bookmarks page" }); var tab3 = ti.ui.createtab({ title : "text size 3", icon : "/images/default.png", font : { fontfamily : 'helvetica neue', fontsize : 8 }, window : win3 }); tabgroup.addtab(tab3); ta...

wordpress - How to order by custom post type by two custom field -

here meta query filter properties property_type , bedrooms order price in desc order. $properties = array( 'post_type' => 'soto_property', 'paged'=>$paged, 'posts_per_page' => 6, 'orderby' => 'meta_value_num', 'meta_key' => 'price', ); /*check price range */ if (!empty($_get['price_range'])) { $lowestprice=get_post_meta($_get['price_range'],"lowest_price",true); $maximumprice=get_post_meta($_get['price_range'],"maximum_price",true); $properties['meta_query'][] = array( 'key' => 'price', 'value' => array($lowestprice, $maximumprice), 'type' => 'numeric', 'compare' => 'between', ); } else { $properties['meta_query'][] = ar...

WCF Service Host using Console App -

is there way automatically add entries app.config of console application used host wcf service or need make entries manually? i referring <system.servicemodel> section in app.config file configure wcf service. additional issues service library project's app.config i understand concept of .svc files , needed in case want host service using iis. start with, plan self-host service using cosole app. issue facing web.config of service library project. when created service library project, app.config automatically created , service configuration automatically generated. however, had changed class names , see error in app.config <service name="myservicename"> parameter , error on service contract attribute. what's wrong in following configuration? error service name="contactmgrservice.contactmanager" , contract="contactmgrservice.icontactmgrservice" <?xml version="1.0" encoding="utf-8" ?> <configur...

html - Expanding a parent div "row-fluid" horizontally to fit its floated children using Bootstrap -

Image
many issues have been raised in same context. , ticket bootstrap framework. indeed, want make panels in same line . thus, container div (row-fluid style class) should . fiddle i make attempt . but, note , panels not in same line basing on this ticket , add this css : .ui-level{ white-space: nowrap!important; overflow: hidden!important; } .myitem{ display: inline-block!important; } however , no news. :( try following, .ui-level{ display:inline-block; } https://jsfiddle.net/isqware/wb5es0zc/2/

python - How to avoid duplicate values while retrieving from database in django -

i need avoid duplicate values while retrieving database in django. having result dictionary list. queryset = [{'name':'shankar','age':'24'},{'name':'manoj','age':'26'}, {'name':'shankar','age':'25'}] i need display value in dropdown list value shankar , manoj . retrieving value query below queryset = books.objects.all() now want avoid duplicate value while displaying dropdown list in template page. thanks in advance. use queryset = books.objects.all().distinct('name') see docs here : "..on postgresql only, can pass positional arguments (*fields) in order specify names of fields distinct should apply. translates select distinct on sql query. here’s difference. normal distinct() call, database compares each field in each row when determining rows distinct. distinct() call specified field names, database compare specified field names....

php - Count number of users for the comma separated values -

i have comma-separated field base_users in database. how query count totaluser of group? have no problem calculate totaluser if data not in comma-separated field. select count(base_u_id) totaluser base_users base_u_group =".$row['base_gp_id']." 1)base_users |base_u_id | base_u_name | base_u_group | ------------------------------------------ | 1 | username1 | 1, 2, 4 | | 2 | username2 | 3 | | 3 | username3 | 3, 4 | | 4 | username4 | 1, 4 | 2)base_groups | base_gp_id | base_gp_name | ------------------------------ | 1 | group1 | | 2 | group2 | | 3 | group3 | | 4 | group4 | | 5 | group5 | from sample database above, expected result be: total user of group1 = 2 total user of group2 = 1 total user of group3 = 2 total user of group4 = 3 total user of group5 = 0 this...

objective c - How to remove 100s of warnings "implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'" I got after updating to arm64? -

problem: yesterday converted large project of mine support arm64 , after got 500+ warnings @ once. 70% of them nsinteger being assigned int or vice versa, , remaining nsuinteger formatted in nsstring this: nsinteger = 123; nsstring *str = [nsstring stringwithformat:@"int:%d", a]; //warning: value of 'nsinteger' should not used formate argument; add explicit cast 'unsigned long' instead. now know how adress them manually, that's huge task , laborious. i'm aware can silence type mismatch warnings together, don't want that. of course, they're helpful. what i've tried: i've converted [nsnumber numberwithint:abc]; [nsnumber numberwithint:(int)abc]; using find-n-replace. fixed some. i've tried change int properties nsinteger properties doubled number of warnings (reached 900+ count). reverted. i've tried find regular expression couldn't find suitable needs. question: i'm looking regular expression or...

How can I use Linux command 'cd' when I have Greek language pack? -

sometimes encounter problem. in greek, desktop called 'Επιφάνεια εργασίας'. can switch greek on terminal, can't use intonation, or mark above α called. there way use ά instead of α? thank in advance. tip: problem that, put intonation, press first ' key , letter. when this, get: "Επιφ'ανεια εργασ'ιας".

docker - Consul and registrator to single host, it's possible? -

i need use consul , registrator manage multiple docker container single host, use 'links" docker-compose.yml, remove links , use consul. have tested consul , registrator single host, ip assigned same of node. it's possible registrator assign ip of docker container instead of node ip? it's possible using argument -internal . from docs: if argument -internal passed, registrator register docker0 internal ip , port instead of host mapped ones. (etcd, consul, , skydns2 now). -internal argument must passed before <registry-uri> argument.

imageview - Label text is not updating in tableview children in titanium android.but work's in IOS -

i have tried update/change lebel in android using titanium.but value not showing on text .but getting updated value in alert.but ios working perfectly. var itemcounttext = ti.ui.createlabel({ top: 5, color: "#000000", left:10, text:data[i].itemcount, width: ti.ui.size, height: ti.ui.size, }); var additem = ti.ui.createimageview({ image: "/images/plus.jpg", top: 5, width: ti.ui.size, left:10, height: ti.ui.size, }); adddeleteitemview.add(additem); additem.addeventlistener('click', function(e) { var item=e.source.getparent(); squantity = e.source.squantity; squantity = number(squantity) + 1; item.children[1].text = squantity; alert(item.children[1].gettext()); here getting alert correct updated value.but it's not showing in label. can give me idea resolve problem in android. edit: from vrk comment have tried also.but it's not working.but getting alert correctly. item.children...

ios - xCode 6.3.1 Missing references while running on simulator -

Image
i working on xcode 6.3.1, working fine while debugging on device iphone 5s ios 8.3 when disconnect device , try test application simulator there hundreds of errors "missing references" many framworks (with simulators ios8+) i tried remove missing references , add again in "build phase" no use. furthermore, having pods setup missing references project of course. working fine before update xcode 6.3.1, here 1 example error: undefined symbols architecture x86_64: "_abaddressbookcopyarrayofallgroups". addressbook not framwork should supported device , not simulator. it working fine device, uploaded archive app store, there no issue either. simulator. i found solution, may else, me iphone sdk location path follows: build settings>framework search paths>iphoneos.platforms i did not correct path, delete path , working on simulator now. furthermore, archive , debugging on device work perfect well.

python - debian wheezy console application set font size -

how set font size python console application? i'm running debian wheezy on raspberry pi. when program exited return default size. you can not this. font size determined terminal emulator not program output.

angularjs - ionic framework with SQL lite -

i using ionic framework . i implementing following steps 1) app runs . create db , table 2) use login, saving data mysql , go dashboard page dbquery.insertcategory(); $state.go('app.dashboard'); dbquery factory . .factory('dbquery', function ($http, $q, $cordovasqlite, localstorage) { return { insertcategory: function () { $http({ url: "http://mydoman.comcategory", method: 'get', withcredentials: true, }).success((function (result) { var user_id = localstorage.get('user_id'); var query = "insert or ignore categories (category_id, user_id, category_name,category_type) values (?,?,?,?)"; var data = ''; result.foreach(function (category) { $cordovasqlite.execute(db, query, [category.id,user_id, category.category_name, category.category_ty...

optimization - Mysql retrieve results of update query -

i developing high load web-application , trying reduce quantity of sql queries. quite need update 1 row , results. think nice have possibility run query , @ same time receive values of updated fields without making 2 calls of mysql server. example, execute following query: update table set val=val+1 id=1; and function returns: array("val"=>10) sure, understand, can write own function, first makes update, select , returns result. problem in such case mysql server have seek data, update during first query, comes second query, again requires seek data , return it. , thinking way, mysql seeks data, updates , returns updated data.

javascript - jQuery puzzler - can't make slideUp/slideDown work -

with jquery , css want show first of 4 paragraphs, , add link/button @ end of first paragraph. when link/button clicked on want show other 3 paragraphs in slidedown manner , make link/button go away, , put link/button @ end can use slideup last 3 paragraphs (and have link/button disappear). sounds easy, can't figure out. here's html code have work with: <div class="wrapper"> <p>here first p</p> <p>here second p</p> <p>here third p</p> <p>here forth p</p> </div> so how can this? i've been trying hours. try .slidetoggle() . if need more information please set jsfiddle in order find not working.

Implementing Domain Driven Design Cost -

i using ddd in project , liked powerful idea has , being independent of end db design. , making use of mvp model in front end. yet lately, having performance issue of translating models models (>>1000 objects @ time) like: from ef repository model domain model from domain model viewmodel and same trip should go persist single object on db. cons of implementing model or there way of reducing cost should follow. probably case use cqrs . when separate read model, can ommit current mapping layers , hydrate directly data source.

apache - PHP: /public_html/index.php NOT working, and Bluehost support has no idea why -

my problem this: website cannot access index.php script file. not access default. not access if type explicitly. can, however, access login.php script file contained in different directory. here contents of .htaccess file # use php5.4 default addhandler application/x-httpd-php54 .php here first 11 lines of /public_html/index.php script file: <? session_start(); echo 'index start'; exit; include $_server['document_root'] . 'library/library.php'; if($_session['logged_in'] === 'true'){ //nothing.... }else{ $_session['logged_in'] = 'false' } the support personnel @ bluehost said there error on line 11 } . (forgive me, forgot copy error exactly.) i'm not complete novice @ php. understand exit; on line 4 should prevent error happening. @ complete loss. <? session_start(); echo 'index start'; exit; include $_server['document_root'] . 'library/library.php'; if($_session['logged...

php - MYSQL: SELECT * FROM `user_log` WHERE `id` is sequential and `username` == EQUAL in multiple rows -

i've searched high , long answer this. have database collects data whenever user logs onto our network. users complaining of disconnections, crawl database, , find sections user appearing in database on 3 sequential rows. database structure is: id user 1 mike 2 john 3 mike 4 mike 5 mike 6 john 7 john 8 mike i query return below (mike user logged on 3 sequential id's) id user 3 mike 4 mike 5 mike i'm stumped how attack this. i'm thinking like: select * `user_log` `id` sequential??? , `username` == ??? possibly sub-select ? what need establish grouping identifier each consecutive sequence of users, , use temporary table perform query groups on new grouping identifier. that, grab group has 3 or more rows, , can use min/max values of id show range. need use variables accomplish this. select min(id), max(id), use...

progress 4gl:how to retrive database record that satisfies all the keywords entered by user in fill-in-field -

the keywords entered user i.e number of keywords,it may 1 or more. take fill-in-field taking input , search pairs of keywords match database record means ,i display on browse...but record must satisfy keywords entered user,if not satisfied means,it display individual keyword result. thankyou sir-------the code write ::::assign entrycount = (num-entries(hi:screen-value)). repeat pos = 1 entrycount : assign keywordi = entry(pos,trim(hi:screen-value)). each db1.vehicles vehicles.ad-num matches keywordi or string(vehicles.sl-num) matches keywordi or vehicles.product-id matches keywordi or vehicles.product-name matches keywordi or string(vehicles.amount) matches keywordi no-lock: each db2.service db2.service.ad-num = db1.vehicles.ad-num no-lock: /* if vcount eq 0 , scount lt 1 */ /* do: */ find ttservice ttservice.service-num = ser...

javascript - Menu only "clickable" once -

i have menu div opacity 0, visibility hidden initially. essentaially want div made available on click of div ( menu sticks top of page, discoverable/hide-able via click). this works great.... one time ... i can click "#menuicon" , menu availble. can click , hidden. menu forever hidden , not become available again. me fix this?? jquery code /* discovers menu on clicks */ $('#menuicon').click(function () { if ($('#menu ul').css('visibility') == 'hidden') { $('#menu ul').css('visibility', 'visible'); $('#menu ul').animate({ opacity: 1 }, 500); } else { $('#menu ul').animate({ opacity: 0 }, 500, function () { $('#menu ul').css('visibility', 'hidden'); }); } }); in animate script, forget close parentheses in proper location should fix it: $('#menuicon').c...

javascript - Google OAuth2 fails for Internet Explorer 11 -

i did google manual oauth2. html: <div id="my-signin2"></div> js: <script src="https://apis.google.com/js/platform.js?onload=renderbutton" async defer></script> <script type="text/javascript"> function onsuccess(googleuser) { alert("uraaa"); console.log('logged in as: ' + googleuser.getbasicprofile().getname()); } function onfailure(error) { alert("uff"); console.log(error); } function renderbutton() { gapi.signin2.render('my-signin2', { 'scope': 'https://www.googleapis.com/auth/plus.login', 'width': 100, 'height': 50, 'longtitle': false, 'theme': 'light', 'onsuccess': onsuccess, 'onfailure': onfailure }); } </script> it works chrome , firefox. ...

ios - Depending on legacy on-demand authorization, which is not supported for new apps -

i using appium version 1.3.7 inspecting ios app. have given app path , device name , platform version. when launch appium server, doesn't recognize physical device have connected via usb. the appium log shows simulators available in system. i have tried inspect ios app in ios simulator itself, app doesn't installed in ios simulator. splash advertisement in app alone displayed in simulator. when checked in ios simulator, don't find app installed in ios simulator.i totally in chaos state, how can able splash add without app installed in ios simulator. i don't know missing while setting parameters ios. there must set bundled id, while connecting physical device. i want know whether device version such iphone 5s , platform version such 7.1.1 mandatory , should given accurate while setting parameters ios. appium log: info: [debug] responding client success: {"status":0,"value":{"build":{"version":"1.3.7...

javascript - Google Maps Marker Clusterer: Nested Click Handling -

after hacking away dom , event propagation issues day i've come last of issues i've been trying deal using marker clusterer. currently i'm attaching click handler dom element change state single infobox using code. //google infobox plug in var boxtext = document.createelement("div"); boxtext.style.csstext = "border: 1px solid #e0e0e0; margin-top: 8px; background: white; padding: 5px; border-radius: 7px;"; boxtext.innerhtml = contentstring; //when infowindow clicked, open view... google.maps.event.adddomlistener(boxtext, 'click', (function (marker) { return function () { $state.go("comments", { "shoutid": activeid }); } })(marker)); this works fine expected single info box window. when call getmarkers on cluster , same thing results not same. in getmarker function i'm using loop iterate through cluster , append infobox looped content inside of it. apply boxtext event handler whole window w...

Actual and formal arguments Differ in length- Java Constructor error -

i starting learn java , ran problem can't solve. have class called myclass constructor. want set constructor access private field: public class myclass{ private long variable1; public myclass(long variable1){ this.variable1=variable1; } public long somethingelse(argument argument){ return somevalue; } } i can call somethingelse class when remove constructor. however, when try along lines data = new myclass(); return data.somethingelse(argument); i error @ data = new myclass() actual , formal arguments differ in length , "requires long, found no arguments". how fix this? from here : the compiler automatically provides no-argument, default constructor class without constructors when explicitly add constructor, override default no-arg one. so, back, add manually: public class myclass{ private long variable1; // need add. public myclass() { } public myclass(long variable1){ t...

httprequest - HTTP Requests in C++ without external libraries? -

so question has been asked before, general answer pointed using external library such curlpp. curious if http requests done using standard libraries of c++14. how difficult be? say example, wanted xml document , store in string parsed. steps have taken achieve this? if curious, i'm doing learning experience better understand how http requests work. it sounds me want implement http protocol scratch on top of posix sockets api. have done myself, quite fun. read sockets api here: http://en.wikipedia.org/wiki/berkeley_sockets if want work on windows, see here . this link , posted in comments, provides pretty starting-point example using api, although weirdly includes both client , server serial logic within same program -- may allow bypass of calls (such waiting incoming connections) required implement client or server standalone program. assuming implementing http server in c++, might choose implement client web page (running on favorite browser), following h...

javascript - Whitelist nested properties using this particular object format -

need "whitelist" object this: { a: { b: { c: '' } } } apply to: { a: { b: { c: 1 } d: 2 e: 3 } } result: { a: { b: { c: 1 } } } any suggestions? not sure how implement using underscore. looking @ _.pick ran trouble nesting. recursion array.prototype.reduce() : function getpaths(obj, whitelist) { return object.keys(whitelist) .reduce(function(whiteobj, key) { if (!obj.hasownproperty(key)) { } else if(typeof obj[key] === 'object') { whiteobj[key] = getpaths(obj[key], whitelist[key]); } else { whiteobj[key] = obj[key]; } return whiteobj; }, {}) } var whitelist = { a: { b: { c: '' } }, g: '' }; var obj = { a: { b: { c: 1 }, d: 2, e: 3 } }; var result = g...

ios - What would cause my segue to infinitely loop? -

Image
i've implemented count-down timer automatically start application if user doesn't select options. when timer hits zero, invalidate , fire performseguewithidentifier , segues me desired view. at point fine... well, sort of. notice view fires twice, fine after that. @ point, if navigate away view, again, segue fires , view loads on , on until stop app. my output window shows: 2015-05-13 21:20:26.880 web app browser[43407:7957566] unbalanced calls begin/end appearance transitions . 2015-05-13 21:20:28.825 web app browser[43407:7957566] unbalanced calls begin/end appearance transitions . here's view controller: class startviewcontroller: uiviewcontroller { var countdown = bool() var timer = nstimer() var count = 5 @iboutlet weak var countdownlabel: uilabel! override func viewdidload() { super.viewdidload() countdown = appdelegate().userdefaults.valueforkey("auto start") as! bool if countdown == ...

java - How to intersect two objects drawn by two different graphics objects? -

i trying create game. in game, ui shows multiple paths(jpanels) obstacles (some sort of jcomponent) moving down paths. user (player) must move left , right or switch paths avoid obstacles. game similar google pony express. https://www.google.com/doodles/155th-anniversary-of-the-pony-express for now, because in developing stages, have 1 path. have player class extends jcomponent , overrides paint component method , draws blue square. have obstacle component class extends jcomponent , overrides paint component method , draws black circle. in board class, create jpanel called thegame , put 1 path , inside of path, 1 obstacle component , 1 player. jpanel put jframe. the player free move using key listener. keep obstacle component in 1 place make debugging easier. not main problem. problem want end game when player intersects obstacle. create skeleton rectangles resembles body of component. example rectangle blue square square , circle, rectangle covers area inside of it. call i...

r - Frequency table including zeros for unused values, on a data.table -

i have data set follows: library(data.table) test <- data.table(structure(list(issue.date = structure(c(16041, 16056, 16042,15990, 15996, 16001, 15995, 15981, 15986, 15996, 15996, 16002,16015, 16020, 16025, 16032, 16023, 16084, 16077, 16102, 16104,16107, 16112, 16113, 16115, 16121, 16125, 16128, 16104, 16132,16133, 16135, 16139, 16146, 16151), class = "date"), complaint = structure(c(1l,4l, 4l, 4l, 4l, 4l, 4l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 1l,5l, 3l, 1l, 3l, 1l, 4l, 4l, 3l, 3l, 3l, 3l, 3l, 2l, 2l, 1l, 3l,3l, 3l), .label = c("a", "b", "c", "d", "e"), class = "factor"), yr = c("2013", "2013", "2013", "2013", "2013", "2013", "2013","2013", "2013", "2013", "2013", "2013", "2013", "2013", "2013","2013", "2013", "2014", ...

Android unable to change background color of ActionBar -

Image
i'm trying change background color of actionbar, after referencing several other questions on site still can't solutions work. styles.xml <resources> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="actionbarstyle">@style/actionbar</item> <item name="android:windowactionbar">true</item> </style> <style name="actionbar" parent="widget.appcompat.actionbar.solid"> <item name="background">@color/light_blue_menu_bar</item> </style> </resources> colors.xml <resources> ... <color name="blue_semi_transparent_pressed">#80738ffe</color> <color name="light_blue_menu_bar">#87cefa</color> </resources> manifest.xml <application android:allowbackup="true" android:ic...

ios - MKTileOverlay not defined -

Image
i have simple map application using openstreetmap works on iphone simulators ( xcode 6.1, ios 7.1 & 8.1 ). however, when compile on real device (iphone 4 ios 7.1), encounter issues (see screenshot), application doesn't recognize classes, such mktileoverlay, mkoverlayrender, etc. the weirdest thing worked few weeks ago, then, after worked on project, when come one, problem appeared. maybe problem coming xcode or device's configuration? searched several days, without success, tell me went wrong? sorry couldn't post screenshot, hadn't enought point guys ^^! did delete framework lot of times, don't seem work, try unistall xcode & re-install it, & bug fix. i hope won't happend horrible. thanks answer guys !

angularjs - How to inject service which depends on script running before it? -

in index.html have following code: <script> $(document).ready(function () { var sessionid = document.url.substr(document.url.lastindexof('/') + 1); $.ajax({ url: 'login/' + sessionid + '?format=json', success: function (response) { // if not logged in, variable not defined. console.log(json.stringify(response)); window.bootstrappeduserobject = response; } }); }); </script> as services loaded have service follows: (function() { "use strict"; var app = angular.module('helloapp.controllers'); app.factory('identity', function($window) { var currentuser; if (!!$window.bootstrappeduserobject) { currentuser = $window.bootstrappeduserobject; } return { currentuser: currentuser, ...

mysql - Pass a value to my function in php -

i have list of products in table extracted db. each product have field aliquota (= vat, tax). want have possibility modify aliquote value assigned single products. i did drop menu next actual aliquote contains allowed value aliquote table of database. (that values 0.00, 4.00, 10.00, 20.00). once selected, value inserted in readonly input text field id "aliquota_xxx" (where xxx id correspond product). want save value pressing button confirm vat activate function save_modify (this function exists in project). code: <select class="piccolo elemento_modulo_obbligatorio" id="aliquota_dropdown_<?php echo $row['rid']; ?>" name="aliquota_dropdown"> <?php $aliquote = "select aliquota,id aid aliquote order aliquota asc"; $result_aliquote = mysql_query($aliquote) or die("invalid query: " . mysql_error()); while ($row_aliquote = mysql_fetch_array($result_aliquote)) { echo '<option onclick=\'...

html5 - Error - input text mangled -

i have website works correctly in notebook image 02. in notebook , text entered in input mangled image01. the image link follows because i'm newbie , still not have enough points post image . http://oi61.tinypic.com/2uppo9c.jpg is there can fix problem ? i'm using visual studio 2013 ultimate asp.net 4.5. this side effect of screen resolution. maybe resolution causing text appear mangled.... try viewing same page on friends pc/laptop.

less-plugin-autoprefix plugin with Gulp showing error -

the less-plugin-autoprefixer plugin readme says that, use plugin, include in gulpfile.js: var lesspluginautoprefix = require('less-plugin-autoprefix'), autoprefixplugin = new lesspluginautoprefix({browsers: ["last 2 versions"]}); less.render(lessstring, { plugins: [autoprefixplugin] }) .then( do want me put open ended callback function here? i'm confused. tried including first part: var lesspluginautoprefix = require('less-plugin-autoprefix'), autoprefixplugin = new lesspluginautoprefix({browsers: ["last 2 versions"]}); and called plugin this: gulp.task('less', ['clean'], function() { return gulp.src('app.less') .pipe(less({ includepaths: ['less'], plugins: [autoprefixplugin] //***// })) .pipe(cssmin({keepspecialcomments: 0})) .pipe(rename('app.full.min.css')) .pipe(gulp.dest('../server/dist/')) ...

java - Check Camel config at load-time? -

we're using spring boot application, camel routing. split routes endpoint "uri" string, testability's sake: rest("/foo").post().to("direct:foo"); from("direct:foo").process(exchange -> { exchange.getin().setbody(service.dostuff()); exchange.getin().setheader(exchange.content_type, content_type_json); }); however if mis-type 1 of "direct:foo" strings, don't error until route invoked. i'd able error earlier, part of application's startup process. obviously using static finals instead of string literals keep mis-typing individual endpoint value, won't situation 1 endpoint doesn't go anywhere, or we're using 1 from without sending it. is there way can ask camel verify routes have working to/from endpoints, once spring has finished scanning classpath , building beans?

regex - How to split string in MongoDB? -

the example data following: {"brandid":"a","method":"put","url":"/random/widgets/random/state"} {"brandid":"a","method":"post","url":"/random/collection/random/state"} {"brandid":"b","method":"put","url":"/random/widgets/random/state"} {"brandid":"b","method":"put","url":"/random/widgets/random/state"} i need find rows method=put , url in pattern /random/widgets/random/state. "random" random string fixed length. expected result : {"brandid":"a","total":1} {"brandid":"b","total":2} i tried write code : db.accesslog.aggregate([ {$group: { _id: '$brandid', total: { $sum:{ $cond:[{$and: [ {$eq: ['$method...

ios - Gradually increasing speed of scrolling background in SpriteKit -

i making simple game in spritekit, , have scrolling background. happens few background images placed adjacent each other when game scene loaded, , image moved horizontally when scrolls out of screen. here code that, game scene's didmovetoview method. // self.gamespeed 1.0 , gradually increases during game let backgroundtexture = sktexture(imagenamed: "background") var movebackground = skaction.movebyx(-self.frame.size.width, y: 0, duration: (20 / self.gamespeed)) var replacebackground = skaction.movebyx(self.frame.size.width, y: 0, duration: 0) var movebackgroundforever = skaction.repeatactionforever(skaction.sequence([movebackground, replacebackground])) var i:cgfloat = 0; < 2; i++ { var background = skspritenode(texture: backgroundtexture) background.position = cgpoint(x: self.frame.size.width / 2 + self.frame.size.width * i, y: cgrectgetmidy(self.frame)) background.size = self.frame.size background.zposition = -100 background.runaction(m...