Posts

Showing posts from July, 2010

visual c++ - OPOS_E_NOSERVICE after return from DllGetClassObject() in simple ATL COM OPOS Service Object -

an example msr opos service object writing not initializing properly. adding question others run same problem since various searches resulted in no whatsoever. my question is: how can determine method in opos service object missing? there utility of kind can exercise opos service object , tell me missing? there way determine methods interface expected provide , missing? i following procedure in writing opos service object using atl in order learn how opos service object created. using visual studio 2005 under windows xp. test basic functionality using ncr retail services manager (rsm) utility create profile msr in order test basic functionality of mag stripe reader simulator service object. the visual studio project creates com object , registers properly. when attempt use diagnostics function of rsm on service object profile receive error of opos_e_noservice . have created log file logging function in com object shows service object loaded, dllmain() function of com obje...

linux - How can i execute commands inside containers during host provision -

i using vagrant build docker host , have shell script install required packages host , script build , run containers vagrant file config.vm.provision :shell, :inline => "sudo /vagrant/bootstrap.sh" inside run containers like docker run -d . .bla bla .. . this works fine have ssh container , run make deploy install stuff. is there way can run make deploy within bootsrap.sh . the 1 way make entry point every run, i want when provision host command should run inside container , show me output vagarnt shows host use docker exec see doc http://docs.docker.com/reference/commandline/exec/ for example docker exec -it container_id make deploy or docker exec -it container_id bash and make deploy inside container

android - Different font for Some activities using Calligraphy Library -

i using calligraphy library using custom font in application. set custom font whole application default font using calligraphyconfig , in application class in #oncreate() method , working fine. problem comes when need change font of 1 activity (settingsactivity). i tried using custom font in style didn't change font of activity. following code of style <style name="englishactivitiestheme" parent="apptheme"> <item name="android:textviewstyle">@style/apptheme.widget.textview</item> </style> <style name="apptheme.widget.textview" parent="android:widget.holo.light.textview"> <item name="fontpath">fonts/roboto-regular.ttf</item> </style> in manifest <activity android:name=".settingsactivity" android:theme="@style/englishactivitiestheme" android:parentactivityname=".mainactivi...

java - Play Framework Ebean query retreival -

i want show previous 5 transactions of signed in user in banking app. public static model.finder<string,transaction> find = new model.finder<string,transaction>(string.class,transaction.class); public static list<transaction> fetchtransactions (string currentuser) { return find.where().eq("user.username",currentuser).setmaxrows(5).findlist(); } i tried ebean.find function: @inject list<transaction> list = ebean.find(transaction.class).fetch("transnature").fetch("amount").where().eq("user.username",user.findbyemail(request().username()).username).findlist(); what doing wrong? if want last 5 transactions, have include order respective column, transactiondate descending order. otherwise ebean default, fetch rows order id in ascending order. first 5 rows transaction table. try this, public static list<transaction> fetchtransactions(string currentuser) { return find.where().eq("user.u...

Run Cucumber scenario outline by range on line numbers -

i know it's possible run specific examples in cucumber cucumber tests/features/my.feature:141 #just example 141 cucumber tests/features/my.feature:141:151 #just examples 141 & 151 what syntax run range of examples 141 151? cucumber tests/features/my.feature:141-151 #this not work if helps, here scenario outline snippet... assuming 'tc-44' on line 141 in file scenario outline: running scenario subset of examples given testing subset , scenario outline many examples can run subset providing range examples: | test-case | | tc-44 | | tc-45 | | tc-46 | | tc-47 | | tc-48 | | tc-49 | ... | tc-100 | from command line can run specific scenarios same feature file using colon between line numbers, this: cucumber tests/features/my.feature:37:52 if scenarios defined @ lines 37 , 52, both executed cucumber. you can likewise run specific examples referencing line number. in case, work: cucumber tests/features/my.feature:141:142:143:144:145:146:147:148:...

javascript - How to use JQuery UI components in Aurelia getting started app (navigation app) -

i able run aurelia app following steps provided in getting started tutorial. have used bootstrap nav-bar in skeleton application. possible use jquery ui components in aurelia app. if yes, please explain me how achieve this. thanks in advance. yes, it's possible! i've made jqueryui tabs example you: tabs.html <template> <ul> <li repeat.for="tab of tabs"> <a href="${'#' + $parent.id + '-' + $index}">${tab.title}</a> </li> </ul> <div repeat.for="tab of tabs" id="${$parent.id + '-' + $index}"> <p>${tab.text}</p> </div> </template> as can see, i've copied boilerplate html of jqueryui tabs component, , created bindable property tabs which array of objects that: [{title: "", text: ""}] . tabs.js import {bindable, inject} 'aurelia-framework'; import $ ...

objective c - Application is not showing in full screen in xcode 6 simulator using SHViewPager? -

Image
i using shviewpager library swipe between viewcontroller? application not showing in full screen? right side blank? can regarding? using same code provided in example test still appear blank on right side.

opencv - Background subtraction + MOOSE filter -

i'm trying create camera raspberry pi detect people moving in corridor(here i'm assuming things moving people) , , identify ones spending time in area (with use of timer) , use background subtraction detect movement , trying use correlation based tracker such mosse filter track them. my question how create bounding box around moving person after performing background subtraction , pass tracking algorithm tracked? background subtraction return binary image contains black , white pixels. detecting center of white contour can draw rectangle around center. width , height depend on contour size. there lot of algorithms, this youtube video can provide function center of contour , draw whatever around of it.

Error: argument of length 0 returned in R -

background: i working functional diversity index fris who's r script provided @ : http://www.irstea.fr/la-recherche/unites-de-recherche/hyax/ecology-schleuter-2010 i have had number of problems script running errors think have found solutions to, novice in r , cannot fix latest one. it involves use of 3 data.frames number of each species of animal @ each habitat type, , max , min values of trait each species such as: abundance1 location s1 s2 s3 s4 s5 s6 s7 s8 s9 palm 6 3 0 1 0 16 0 2 3 forest 2 0 2 1 2 1 3 0 2 max1 species max s1 44.7344 s2 22.6966 s3 75.1817 s4 17.8176 s5 50.7472 s6 33.3660 s7 14.3341 s8 3.3947 s9 10.2510 min1 species min s1 25.3038 s2 19.5750 s3 60.5880 s4 16.2864 s5 46.1040 s6 10.9056 s7 8.7570 s8 2.1289 s9 4.1730 what i...

mysql - Get result with matching all search queries -

i have 3 tables: comics , tags , comictags . comics table id connected through foreign key comictags table while tags table id connected comictags table through tagid . comics table +----+ | id | +----+ | 1 | | 2 | +----+ comictags table +---------+-------+ | comicid | tagid | +---------+-------+ | 1 | 1 | | 2 | 1 | | 2 | 2 | +---------+-------+ tags table +----+-------+ | id | tag | +----+-------+ | 1 | tag1 | | 2 | tag2 | +----+-------+ what i'd achieve is, if i'm searching tag1 , tag2 i'd comic id 2 result. given string 2 tag names. select c.id `tags` `t` left join comictags ct on ct.tagid=t.id left join comics c on c.id=ct.comicid ((t.tag 'tag1') or (t.tag 'tag2')) group c.id with statement i'm getting comic id 1 not want. changing or , doesn't work in statement i've created. could point me in right direction on how comic ids match tag ids? ...

java - Void methods can't return the value of a void method? -

i don't mind if don't understand, want know why happens: void something(string a) { return hi(); } void hi() { return; } the odd thing here, hi() has return type of void . syntax error in ide: void methods cannot return value furthermore, code doesn't compile: exception in thread "main" java.lang.error: unresolved compilation problem: void methods cannot return value @ resources.setsystemproperties(resources.java:33) @ resources.main(resources.java:49) i expect happening: hi() -> return nothing return [nothing] -> hi() nothing so in end, returns nothing, void method should. why behaviour happen? , why doesn't code compile, when return result of void method? this defined in jls 14.17 : a return statement expression must contained in 1 of following, or compile-time error occurs: a method declared return value a lambda expression a void method not declared return value, return s...

javascript - Do preventDefault and then do default behavior -

i have requirement in single page application project, need change page's section when click on anchor tag based on provided href attribute. this: <a class="page-click" href="#showpeople/1">open</a> this anchor in popup on page. so, whenever click on anchor tag, anchor should close popup , change window location http://www.example.com/#showpeople/1 now, anchor changing url ( which default ) not closing popup. when researched found anchors, should use e.preventdefault() remove default behavior. in case, need both default behavior custom behavior ( closing popup ). i found link has similar requirement thing attaching event dynamically. $(document).on('click', '.page-click', function (e) { // e.preventdefault(); // code here }); and if somehow succeeded unbind event specific clicked anchor, anchor not close popup, when user opens popup again ( since registered event has been removed ). try $(...

jquery - Show link only in JSON -

i have following json string - { "fruits":[ { "name":"apples", "id":"1" }, { "name":"bananas", "id":"2" }, { "name":"oranges", "id":"3" }, { "name":"pears", "id":"4" }, { "name":"grapes", "id":"5" }, { "name":"strawberries", "id":"6" } ], "links":[ { "source":"1", "target":"2" }, { "source":"1", "target":"3" }, { "source":"1", "ta...

asp.net mvc 4 - MVC - Store secure information -

i come cross question during mvc studies. possible b correct answer? you designing distributed application. application must store secure information specific individual user. data must automatically purged when user logs off. need save transient information in secure data store. data store should use? a. session state b. database storage c. profile properties d. application state thanks, if "the data must automatically purged when user logs off", there literally no need b or c. d (application state) single across users, best bet a. from msdn ...application state useful place store small amounts of often-used data not change 1 user another. information on saving data on per-user basis see asp.net session state overview , asp.net profile properties overview . [ref] this indicates , c possibilities, - [profile properties] similar session state, except profile data not lost when user's session expires. [ref] which not satisfy, ...

javascript - Message is not sent to Chrome extension -

i can read messages come extension, not able send message c++ native app chrome extension. using win 8 64bit. chrome log not report error, no info there. here code: void sendmessage(string msg){ _setmode(_fileno(stdout), _o_binary); unsigned int len = msg.length(); cout.write((char*)&len,4); //cout.write(reinterpret_cast<char*>(&len),4); std::cout << msg << flush; } string readmessage(){ string msg = ""; std::cout.setf( std::ios_base::unitbuf ); unsigned int ch;//, len = 0; //another way length _uint32t len = 0; cin.read(reinterpret_cast<char*>(&len) ,4); // read len number of characters message (int i=0; < len; i++) { ch = getchar(); msg += ch; } return msg; } int _tmain(int argc, _tchar* argv[]) { //reading messages extension string msg = readmessage(); //here write msg log , it's there. //sending message sendmessage (...

iphone - IOS Drawing app in Swift - Need to prevent user drawing outside the image lines -

i have uiview have implemented methods allowing me 'paint' upon this. however, want add feature image can selected , user can colour drawing in. it's aimed @ young audience want allow user able draw inside image border. have suggestions on best way approach/implement this? in opinion, should create custom uiimageview, , draw on image implementing touch start/move/end method. doing this, can draw inside image border edited: after selecting image have set flag true / false in uiview (the view contains image) prevent draw in view, , implementation of touch action in custom uiimageview => can draw inside picture or if don't want have step "select image" , fire event custom uiimageview parent view when user start touching on uiimageview -> set flag in parent view true / false prevent drawing when touches go outside uiimageview

JavaScript returning NaN value -

i have 2 ui-slider, , have calculation on slide callback, it's returning nan value $( document ).ready(function() { $("#amount").slider({ range: "min", value: 160000, min: 10000, max: 400000, step: 1, slide: function(event, ui) { var interest = 0.0325; var amount = parseint(ui.value); var temp1 = amount * (interest / 12) / (1 - math.pow(1 + (interest / 12), -(years * 12))); $('#currentamount').val(amount); $('#monthly').text(math.round(temp1)); } }); $("#years").slider({ range: "min", value: 8, min: 1, max: 12, step: 1, slide: function(event, ui) { var interest = 0.0325; var years = parseint(ui.value); var temp1 = amount * (interest / 12) / (1 - math.pow(1 + (interest / 12), -(years * 12))); $('#yearsval').text(years); $('#monthly').text(math.rou...

redirect - PhantomJS Url fail to load for unknown reason -

here url i'm trying load phantomjs : http://shop.karinelecchi.fr/collections/jupes-robes/products/jalousie here code : var fs = require("fs"); var system = require("system"); var page = require('webpage').create(); page.settings.useragent = "mozilla/5.0 (compatible; googlebot/2.1;+http://www,google,com/bot.html)"; page.settings.loadimages = false; var url = "http://shop.karinelecchi.fr/collections/jupes-robes/products/jalousie"; page.onconsolemessage = function(msg) { console.log(msg); }; page.open(url, function (status) { if (status !== 'success') { console.log('unable load address!'); phantom.exit(); } else { console.log('yiha! load address!'); phantom.exit(); } }); my output : "unable load address" any guesses? thx here have website explains how track down url load fails: https://newspaint.wordpress.com/2013/04/25/getting-to-the-bottom-of-why-a-phanto...

canvas - Stop and Restart CreateJs animation -

i wondering how stop entire createjs canvas animation , how restart later. i'd save computing power , memory while canvas not visible user. does know how? thank in advance simply remove listener on ticker. example: createjs.ticker.removeeventlistener("tick", mystageortickfunction); // add later unpause: createjs.ticker.addeventlistener("tick", mystageortickfunction); if want reset entire animation exported flash, have couple of options: you can re-instantiate main timeline. you'll need take @ output code grab name of main timeline symbol, based on fla name (ex. fla named "test.fla" have main timeline symbol named "test"). stage.removechildat(0); stage.addchild(new lib.test()); you can use gotoandplay(0) . requires child movieclips set graphic instances though, because mcs play independently of parent. stage.getchildat(0).gotoandplay(0)

c# - Chrome instead of firefox, element not found -

i'm starting use selenium , have problems. here code (c#): namespace selenium1 { [testclass] public class unittest1 { firefoxdriver firefox; [testmethod] public void testmethod1() { firefox = new firefoxdriver(); firefox.navigate().gotourl("https://www.google.com"); firefox.findelement(by.id("gbqfq")).sendkeys("google"); firefox.findelement(by.id("gbqfq")).sendkeys(keys.enter); } [testcleanup] public void teardown() { firefox.quit(); } } } but instead of opening firefox opening chrome , invoking error: test method selenium1.unittest1.testmethod1 threw exception: openqa.selenium.nosuchelementexception: unable locate element: {"method":"id","selector":"gbqfq"} where mistake? thx. have here: how run selenium tests in multiple browsers cross-browser testing using java? and here http://www.widecodes.com...

Lisp Function fails, although working previously (Draft Sight, SVG to CAD) -

we trying implement draft sight/autocad script transform svg file cad drawing. the principal idea read file line line (performed readsvgdata), split svg definitions spaces (readhtmlitemdata), read individual html attributes list , based on type of svg item draw cad element. in regards principal... the unususal part is, whenever html attributes, "id="box_8_0"" sent findchar function, attrlis function, script fails, although same arrangement went before does have hint mistake hidden? (defun findchar (findchar text) (setq ;current location in string coord 1 ;init return coordinate returncoord 0 ;length of searched item, enable string searching findcharlen (strlen findchar) ;nil count: requires regular expressions (/t) identified 2 times ascii char 9 nilcnt 0 ;storage of last char ascii identify regular expressions lastcharasci -1 ) ;iterate string , break in case ...

R code challenge: retrieving the values in matching columns and sum them up with matching rows -

i have problem solving in r. have data frame called testa (dput included). need match letters in column alt colnames (a,c,g,t,n) , corresponding values in column along value ref letters , result ad.new (my code job). however, need expand code solve issue line type column has flat @ end. row flat , need match start id ( chr10:102053031 ) other ids in start column. if match, need sum corresponding value alt a,c,g,t,n column , replace ad.new column flat line along ref value. if run dput , code able understand it. basically, want match letters in ref , alt columns , corresponding values columns ( a,c,g,t,n ) , separate values comma ref , alt . (in example), flat line want sum value in column a matching start id start id of flat line (the value in case 6 ) , value match (the value in case 7 g column) , sum them give 13 . flat line result should 0,13 . the expected result shown below. my incomplete code: testa[is.na(testa)]<-0 ref.counts<-testa[,te...

Sage One API - authorization -

i'm having trouble making api call. have got token, secret etc, no problem. difficulties occur when trying retrieve contact information. i've tried access sage developers forum taken round in circles sage sight. here own trace. access : 2a075f2f204a380505a4f27378056bfa326b582f refresh : 2de459f637c1c89bc7add9a424b04f4a2c29a6ec post : post&https%3a%2f%2fapi.sageone.com%2faccounts%2fv1%2fcontacts&contact_type=1&1435822573 signing : 4c53564b7b9f1542838e65384b2c506b37bb5c28&2a075f2f204a380505a4f27378056bfa326b582f hash : nzy2ode1zjjmotvlmmy5mwvjodi2mjdhmtaymgmynwm0n2mynja1ng== curl args: url : https://api.sageone.com/test/accounts/v1/contacts?contact_type=1 authorization : bearer 2a075f2f204a380505a4f27378056bfa326b582f x-signature : nzy2ode1zjjmotvlmmy5mwvjodi2mjdhmtaymgmynwm0n2mynja1ng== x-nonce : 1435822573 accept : */* content-type : application/x-www-form-urlencoded user-agent : great water string : authorization=bearer 2a075f2f204a380505a4f27378056b...

java - Lookup with InitialContext lookup() and @Inject of Singleton -

i have @singleton bean use store state shared other beans/threads. state shared maintained in hashmap. other beans require services of singleton @inject , invoke methods. recently, had introduce quartz scheduler since had asynchronous jobs done. in 1 quartz job lookup singleton using intialcontext lookup(), , use methods provided singleton. once job executes, other beans use @inject (for singleton) no longer information maintained in hashmap. @singleton(mappedname = "clientsessionmgr") public class clientsessionmgr { private final map<string, clientsession> clientsessions = new hashmap<string, clientsession>(); /* methods manage clientsessions data */ } one amongst few beans inject above singleton. @stateless(mappedname = "nwdcredprofrepo") public class nwdcredprofrepo { @inject private clientsessionmgr csm; /* bean methods invoke methods of singleton */ } the quartz job lookup of singleton , uses methods provided same. pu...

java - Weblogic ActiveDirectory get full user name instead of id of logged in user -

i have managed configure activedirectory authenticator on weblogic, , our web application authenticates ad users now, issue have not able logged in user's full name. possible? i getting userid both http request's getuserprincipal , getremoteuser methods. thanks.

iOs: Swift Google Analytics -

Image
i new ios development , implement google analytics (swift). it appears there missing information on implementing google analytics in swift on google's instruction page : it seems import statement above incorrect, can assist me missing/correct statement? exta info: i come java background , ides use import you, please excuse stupidity. i have cocopods installed, , use other pods: almofire, fabric, swiftyjson etc i developing ios 8 instructions above this, clear , working. installing pods/config file etc if in pods folder in xcode can see available pods there. of them have file contains import statements files needed. in case analytics.h file in pods/google/analytics/ i'm guessing that, import file in bridging header (which hope have, if not let me know), can use #import "google/analytics.h" . it says little bit lower on page, import <google/analytics.h> header.

excel - Datanitro Charts -

how control position of chart on excel sheet using datanitro? thought setting active cell positioned there comes out top left obscures cells calculated results want remain visible. you can pass x , y image position chart: https://datanitro.com/docs/images.html#x with nitroplot, can pass x , y graph library: nitroplot.graph(x = 123, y = 456)

sql - DBNETLIB errors -

what should very straight forward query giving me trouble. first, here's code: `select accthist.acct, accthist.cpnyid, accthist.fiscyr, accthist.ledgerid, accthist.ptdbal04 curr_month, sum(accthist.ptdbal00+accthist.ptdbal01+accthist.ptdbal02+accthist.ptdbal03+accthist.ptdbal04) ytd_bal ffneapp.dbo.accthist accthist (accthist.acct>='4000000' , accthist.ledgerid in ('actual','stat','budget','budstat') , accthist.fiscyr in ('2014','2015') , accthist.cpnyid not in ('999')) group accthist.acct, accthist.cpnyid, accthist.fiscyr, accthist.ledgerid, accthist.ptdbal04` when refresh query via connection in ms excel, 3 errors. first [microsoft][odbc sql server driver][dbnetlib]connectionwite (send()). next [microsoft][odbc sql server driver][dbnetlib]general network error. check network documentation. last problems obtaining data. oddly, when remove 'budget' clause, works. cause query fail? p...

javascript - Plot dynamic Nvd3 chart without reinitialising? -

i'm creating pie chart: var chart = nv.models.piechart() .x(function(d) { return d.key; }) .y(function(d) { return d.value; }) .valueformat(d3.format(',d')) .labelsoutside(true) .showlabels(true); and i'm retrieving data repeatedly via ajax , updating chart: (function loop() { d3.json(url, function(data) { d3.select('#chart svg').datum(data).call(chart); }); settimeout(loop, 2000); })(); however, if uncheck 1 of values in legend remove entry reappears @ next timer refresh, causing slice reappear. is there way refresh data without causing reinitialise? i've tried using .data instead of .datum no avail.

angular ui router - $urlRouterProvider.otherwise has empty $location.search() -

i've defined states , want use fallback state/url defined otherwise . because states not define root url '/' (i have no view state) app may started url optional query params, tried use function call of otherwise keep possibly given params. when otherwise function called, $location.search() empty, although url looks localhost:9002/?ac=1 . maybe side effect given url rewritten localhost:9002/?ac=1#/search although expect url rewritten localhost:9002/#/search?ac=1 . $urlrouterprovider.otherwise(function($injector, $location) { var state = $injector.get('$state'); console.log('location', $location, 'location.search()', $location.search()); state.go('search', $location.search()); return $location.path(); }); $stateprovider .state('search', { url: '/search', templateurl: 'templates/search.html' }) .state('displays', { url: '/displays', ...

javascript - Meteor.js scope issues -

i doing of coding in [appname].js @ root, , third party libraries in app/client/compatibility i able load these libraries, , declare , instantiate objects them in template.template1.rendered handler, works great. however, when want modify 1 of variables in template.template2.events , event when selector changed. when try change here tells me variable undefined. i have tried declaring variable @ top of file, in isclient , doesn't seem matter. there no scenario defined there. so question how can modify variable in template.template2.events ? var something; if ( meteor.isclient ) { function dosomething(some, value) { some.property = value; } template.template1.rendered = function() { if(!this._rendered) { this._rendered = true; this.something= thirdparty.create(); dosomething(this.something, document.getelementbyid("text").value); } } template.template2.events({ "change select" : function( event ) { ...

javascript - Does Lightbox for jQuery write a div into the DOM or simply show a hidden div? -

i have specific question lightbox plugin jquery. write div dom dynamically, or show hidden div? looks div created when lightbox instantiated (build function), , div shown when start() called. source: https://github.com/lokesh/lightbox2/blob/master/src/js/lightbox.js

grails 3 functional test plugin -

when use grails 2, use functional plugin create function test , use rest-client-builder send post , request. function test can start server. however, when upgrade grails 3. built in geb framework can me create function test. however, don't know how can send post , request. , function test can not start server. have run-app first , run test. know should function post/get test via grails 3? thanks much and function test can not start server. you haven't described details of doing don't know why might not working you, can made work. want create integration tests , mark them @integration . have lot of examples in project @ https://github.com/grails/grails3-functional-tests . in https://github.com/grails/grails3-functional-tests/tree/master/app1/src/integration-test/groovy/functionaltests . simple example should easy read @ https://github.com/grails/grails3-functional-tests/blob/master/app1/src/integration-test/groovy/functionaltests/homespec.groovy ...

android - A blank screen appears when starting another activity from inside onCreate() -

i working on android application. have started coding it. want have initial activity check if user logged in. if yes, redirect user's home page, otherwise it'll redirect user login/signup page. for now, have created simple main activity, should show progress bar. i've added 5sec delay , activity should direct user login page (i've not kept button on page). activity creates intent , start other activity using after 5 sec delay. i'll store user's login state in shared preference later. the problem when run app on device, shows blank screen (not progress bar had put) 5 sec , redirects login page. i'm doing wrong? here's activity_main.xml file <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id/main_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:o...

c++ - How can I create a "proxy" openGL texture in Qt? -

i porting app qt , have troubles integration of syphon framework ( http://syphon.v002.info/ ) used video streams sharing between applications via gpu (mac os x only). two c++ implementations syphon available, 1 cinder (github/astellato/cinder-syphon) , 1 openframeworks (github/astellato/ofxsyphon). started cinder implementation (both quite similar) , tried port qt can't find way create qopengltexture using created texture. here code cinder-syphon i'm trying work (file syphonclient.mm ) : void syphonclient::bind() { nsautoreleasepool* pool = [[nsautoreleasepool alloc] init]; if(bsetup) { [(syphonnameboundclient*)mclient lockclient]; syphonclient *client = [(syphonnameboundclient*)mclient client]; latestimage = [client newframeimageforcontext:cglgetcurrentcontext()]; nssize texsize = [(syphonimage*)latestimage texturesize]; gluint m_id = [(syphonimage*)latestimage texturename]; mtex = ci::gl::texture::creat...

string - Filtering objects from lists in python -

i'm trying program filter vowels out of string of text , i'm not sure why function doesn't work. here's code def anti_vowel(text): letters = text.split() #make list of letters in string index = 0 #for del x in letters: if x == "a" or x == "a" or x == "u" or x == "u" or x == "i" or x == "i" or x == "o" or x == "o" or x == "e" or x == "e": del letters[index] index += 1 #to make if-clause work return "".join(letters) #turn edited list string while iterating on letters if-clause should activated when object in letters vowel right? should delete object. doing wrong? your code isn't iterating through letters, it's iterating through words. because text.split() splits text list of whitespace-separated "word" strings. the next problem you're iterating through list , deleting entries. mutating iterable whi...

asp.net mvc 4 - MVC 4 Updating a partial view from another partial view using Ajax.BeginForm() -

Image
i have comment section set on 1 of pages. parent view has partial view shows comments id , gives option display partial view post comment. when post comment want first partial view within parent refresh displaying new comment. currently when click post comment, addcomment method called , added database. error saying passing wrong type of model view. seems trying pass return value addcomment partial view instead of injecting partent view div. parent view @model qieducationwebapp.models.course @{ viewbag.title = "course details"; } <h1 class="page-header">@viewbag.title</h1> javascript here . . . <table class="table"> details here </table> <ul id="view-options"> <li>@html.actionlink("back courses", "index", "course")</li> </ul> <input type="button" id="view" class="showcomment" value="show comme...

android - Design Support TabLayout Style Not Applied -

i'm working android.support.design.widget.tablayout , i'm having real hardtime trying make applied theme work. here's xml i'm trying use: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.tablayout android:id="@+id/viewpagerlayout_tabview" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/tablayout.theme"/> <framelayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.viewpager android:id="@+id/viewpagerlayout_viewpager" android:layout_width="match_parent...

sql server - BatchUpdateException updateCounts return inconsistent results -

i trying find way recognise item failed in batch insert using sql server (driver: sqljdbc4). i created tiny test case sends varchar out of range got "java.sql.batchupdateexception: string or binary data truncated." i cannot understand value of updatecounts , follows: when first batch insert causes error : => updatecounts -3 when 2nd batch insert causes error : => update counts: -3, 1, 1, 1 when 3rd batch insert causes error : => update counts: 1, -3, 1, 1 when 4rd batch insert causes error : => update counts: 1, 1, -3, 1 when 5th batch insert causes error : => update counts: 1, 1, 1, -3 i sending 5 items time, expecting 5 items in updatecounts . does see pattern here can identify wrong item?

casting - Is the "(int)" in "sizeof (int)" a typecast operator or some special case parameter? [C] -

this question has answer here: why sizeof int wrong, while sizeof(int) right? 3 answers i assumed c expression sizeof (int) worked function, whatever inside parentheses being passed parameter. int (or other type specifier) keyword , not object can passed, assumed sort of special case hard coded compilers. but discovered if use sizeof on variable, can omit parentheses ( sizeof var ) , it'll compile , run fine. since sizeof operator , not function (and operators don't need parentheses), , types specifiers things need parentheses, i'm wondering if they're type specifiers or if they're type cast operators somehow being used sizeof find sizes corresponding types. () used sizeof operator if operand data type . c11: 6.5.3.4 (p2): the sizeof operator yields size (in bytes) of operand, may expression or the parenthesized name of...

Bower issue when deploying to heroku custom git module -

running deployment build failure when using bower on heroku. this post install step: gem install sass && bower install && brunch build --production however, bower fails install package specified git url , not version. the following package specification causes issue. "bootstrap-offcanvas": "git://github.com/yagudaev/bootstrap-offcanvas.git#master" heroku complains not being able retrieve right revision install bower component. (you have first set heroku config:set npm_config_loglevel=verbose see it). try specifying reversion directly avoid revision resolution attempts so: "bootstrap-offcanvas": "git://github.com/yagudaev/bootstrap-offcanvas.git#d7249875c049b6cce3c8fbdbda9d7b8ced296030" also avoid using: git@github.com:yagudaev/bootstrap-offcanvas#master it seems fail on heroku, may work locally.

google glass - How do I get user statistics? -

google play , itunes connect give statistics on has downloaded apps. google tells me still has them installed. glass? don't seem able find information @ on has glassware installed. ok, fine, have installed web bugs in app but, hey, didn't! assumed (ha ha ha) i'd have same tools available me had elsewhere! well... don't see them. glass-support says don't have information. how make sense? if don't, does? anyone? anywhere? thoughts??? thx! you can use google analytics. able demographic info glassware users such language, country , city. also, google analytics gives number of new users , returning users. hope helps.

java - Deprecated methods in JasperReport -

i using jasperreports-6.1.0.jar , , there deprecated methods in class jrprintserviceexporterparameter . how find out method or class supposed use? how find out if it's safe use deprecated methods? edit: this deprecated part of code: exporter = new jrprintserviceexporter(); exporter.setparameter(jrexporterparameter.jasper_print, jasperprint); exporter.setparameter(jrprintserviceexporterparameter.print_service, printservice[selectedservice]); exporter.setparameter(jrprintserviceexporterparameter.print_service_attribute_set, printservice[selectedservice].getattributes()); exporter.setparameter(jrprintserviceexporterparameter.print_request_attribute_set, printrequestattributeset); exporter.setparameter(jrprintserviceexporterparameter.display_page_dialog, boolean.false); exporter.setparameter(jrprintserviceexporterparameter.display_print_dialog, boolean.false); exporter.exportreport(); deprecated methods safe...

javascript - Loop through each new Object from Constructor -

firstly, sorry lack of terminology. if have constructor function myobject(name, value){ this.name = name; this.value = value; } and make few objects it var 1 = new myobject("one", 1); var 2 = new myobject("two", 2); can loop through each new object made myobject class, without putting each new object array? would possible add instantly invoking function constructor adds object array? e.g. function myobject(name, value){ this.name = name; this.value = value; this.addtoarray = function(){ thearray.push(this); // iife }(); } that way new objects created instantly run function , added array. is possible? ( current syntax not work, ) edit coming 1 year later can tell possible. call function inside constructor so: function myobject(name, value){ this.name = name; this.value = value; this.addtoarray = function(){ thearray.push(this); }; this.addtoarray(); } here exam...

html - How can I make my left tab float left but fill the empty area to the other tabs which float right? -

i have bootstrap tabs, align right inside container: https://jsfiddle.net/yc2dxnev/ this code: <div class=container> <ul id="tabs" class="tabs-right tabs"> <li class="banana active"><a>banana</a></li> <li class="monkey"><a>monkey</a></li> <li class="woods"><a>woods</a></li> </ul> </div> <style> ul.tabs { display: block; outline: none; } ul.tabs { list-style: none; padding: 0; margin: 0; display: block; } ul.tabs>li { display: inline-block; position: relative; margin-top: 5px; margin-bottom: -1px; } what want keep tabs right , make left tab stick left, in same time fill area next tab. hard explain posted image: http://s16.postimg.org/bhr4qzt51/002.jpg i not know how achieve it, maybe know trick. your right tabs should right, float them r...

javascript - Conditionals: Replacing a value with a glyphicon -

i trying make if in table status 'r' replace 'r' glyphicon, glyphicon glyphicon-alert . i've thought of different ways of doing such making true or false condition because having 'g' appear not necessary (if assist making if 'g' display ' ' of use too) haven't made headway that. can assist in this? this plnkr of code in question. http://plnkr.co/edit/ctrlmfnw4bxxy8wyhtsp?p=preview <tbody> <tr class="tt" data-toggle="tooltip" title="click more information on {{x.c}}." ng-click="iscollapsed = !iscollapsed" ng-repeat- start="x in projects | filter:query | filter:myfilter | orderby:orderproperty"> <td class="shrink"><b>{{x.a}}</b></td> <td class="shrink">{{x.b}}</td> <td class="shrink"><u>{{x.c}}</u></td> <td class=...

java - Generate Azure SAS Token on Android -

trying generate azure sas token in order able use service bus rest api. found link: http://blog.simontimms.com/2015/01/30/sending-message-to-azure-service-bus-using-rest/ how achieve same on android? my current attempt looks this: private string generatesastoken(string uri, string keyname, string key){ string ret = ""; long tokenexpirationtime = (system.currenttimemillis() / 1000) + (10 * 365 * 24 * 60 * 60); try { string stringtosign = new url(uri).tostring() + "\n" + tokenexpirationtime; secretkey secretkey = null; byte[] keybytes = key.getbytes("utf-8"); mac mac = mac.getinstance("hmacsha256"); secretkey = new secretkeyspec(keybytes, mac.getalgorithm()); mac.init(secretkey); string signature = base64.encodetostring(mac.dofinal(stringtosign.getbytes("utf-8")), base64.default); ret = string.format("sharedaccesssignature sr=%s&sig=%...

sql server - set based approach to remove contained points -

Image
i have data: if object_id('tempdb..#temp') not null drop table #temp create table #temp ( id int identity(1, 1) , x float not null , y float not null ) insert #temp (x, y) values (0, 0) insert #temp (x, y) values (0, 1) insert #temp (x, y) values (0, 2) insert #temp (x, y) values (0.5, 1) insert #temp (x, y) values (1, 1) insert #temp (x, y) values (1, 2) insert #temp (x, y) values (1.5, 0.5) insert #temp (x, y) values (2, 0) insert #temp (x, y) values (2, 1) i remove points contained within other points, such as: (0, 1) (1, 1) (1.5, 0.5) to obtain outer points define outer polygon consisting of vertical , horizontal lines without redundancies (e.g. (0, 1) redundant point). can achieved set based tsql approach in sql server 2014? ps: a scatter plot of data follows: i remove encircled points. ultimately, after outer border (drawn red lines). hope makes clearer. i believe might work. seems deliver on test data. bit rough...