Posts

Showing posts from January, 2015

java - Invalid:error connecting to backend after clicking on API publisher test button -

i configured wso2 api manager product on unix environment.i able login carbon,publisher , store url using dns name of server.by using below url able access carbon, publisher page:: https://abc.xx:9445/carbon for testing purpose deployed sample application in publisher. url try hit publisher api:: https://abc.xx:9445/am/sample/pizzashack/v1/api but after clicking on test button(i.e. production endpoint) using dns name of server gives me invalid:error connecting backend .checked log shows connection timeout ** https://abc.xx:9445/am/sample/pizzashack/v1/api **url. if use ip instead of dns name gives me bad certificate error in log. any appreciated!!

sql - Minimum of dates selection in Access -

i have date clause selection of data. there 2 date fields on form 'oberflache' start , end . want choose minimum of 2 fields. i.e should choose record based on date comes first.here code trying with. parameters [forms]![oberflache]![start] datetime, [forms]![oberflache]![end] datetime; select lau.an, lau.ve, lau.du, lau.sta, lau.a, lau.b, lau.sw, lau.po laufzettel min(fix(lau.a)) between forms![oberflache]!start , forms![oberflache]!end)) or min(fix(lau.b)) between forms![oberflache]!start , forms![oberflache]!end; where an,ve,du,sta,a,b,sw,po fields table lau. cases lau.a lau.b 1.11.2016 5.11.2016 2.11.2016 3.11.2016 20.10.2016 4.11.2016 4.11.2016 28.10.2016 here when give start , end dates 1.11.2016 , 4.11.2016 . want records selected in such way if date of lau.a or lau.b before 1.11.2016 in 3rd record or 4th record must left out , first 2 selected. with code tried it give

tortoisesvn - How to handle redundant files in SVN? -

i using svn project track changes. using tortoisesvn client. removed files project no longer need, these files still inside svn repository. want check in latest changes don't want unwanted files appear whenever svn update. how handle situation? best practices here? use svn delete (right-click, tortoisesvn-> delete in default configuration) remove files properly. commit changes. deleted files should appear missing in commit dialog if don't this, , @ point can select files , delete them well. https://tortoisesvn.net/docs/release/tortoisesvn_en/tsvn-dug-rename.html

AngularJS. Compiling is not enough transformation in a template if using SVG elements -

i can use user elements. <div ng-controller="notescretchctrl"><my-element></my-element></div> angularjs 1.5.8 code there: angular.module('myapp') .controller('notescretchctrl', function($scope) { $scope.linearray = [10,30,40]; }) .directive('myelement', function ($compile) { return { restrict: 'ea', replace: true, transclude: true, template: '<div class="boxactive"><img width="300"><div class="boxabsolutesvg">'+ '<svg width="600" height="100" class="svg" >'+ '<line ng-repeat="ngy1 in linearray" x1="0" ng-attr-y1="{{ngy1}}" x2="800" y2="20" style="stroke: black; stroke-width: 3;" />'+ '</svg></div></div>' } }); but in "line svg" elements coming out html-code c

json - ios swift 3 - POST UInt8 array -

i'm trying send image (as uint8 array) in request app crash @ line of code _request.httpbody = try? jsonserialization.data(withjsonobject : self.parameters , options: []) where self.parameters dictionary the crash message "invalid type in json write (_swiftvalue)" does know how solve problem ?

Gitlab CI, ssh runner -

when try create ssh runner in deploy console have error: running gitlab-ci-multi-runner 1.7.1 (f896af7) using ssh executor... error: preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory retried in 3s ... using ssh executor... error: preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory retried in 3s ... using ssh executor... error: preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory retried in 3s ... error: build failed (system failure): open ~/.ssh/id_rsa.pub: no such file or directory on server created ssh key, , key in directory ~/.ssh/id_rsa.pub. .gitlab-ci.yml file: stages: - deploy before_script: - whoami mate-finder: stage: deploy script: - sudo apt-get update -qy - sudo apt-get install -y nodejs - sudo npm install - sudo ng build - sudo ng serve how can deploy application on server? how must configure runner on server, when want deploy angular2 application on it? you need check,

Replication of data between two MySQL databases -

we going use 2 mysql databases same application. 1 of database going main database , other going fail on database. database not going locate @ same location. main database going active 1 handles traffic, second database going used if happens main server, getting damage or nonfunctional, used if main database getting hammered traffic should workload (yes have load balancer in place). now real question, how best create data replication between 2 database? 2 method have thought is: • using shared disks • replication cluster have hard time decide solution best use. please give me cons , pros. if know , smart method i’m not aware off, please tell me. if project success, going more mysql databases, of them use nfs mounts, information chance decision? if yes, why?

knockout.js - Update observed model in custom knockoutjs binding -

i'm trying integrate jquery autocomplete extension in foreach knockout loop. i've created custom binding , autocomplete works. after autocomplete need update observable item model , cannot figure out how it. here code: <!-- ko foreach: items --> <input data-bind="autocomplete: { source: '/products/item-search-ajax', options: { delay: 100, max: 20, minchars: 2, extraparams: { itcode: 1 }}, findcallback: $parent.findvaluecallback }, value: partnumber" type="text"> <!-- /ko --> <script type="text/javascript"> ko.bindinghandlers.autocomplete = { init: function (element, valueaccessor, allbindings, viewmodel, bindingcontext) { var settings = valueaccessor(); var source = settings.source; var options = settings.options; var findcallback = settings.findcallback; $(element).autocomplete(source, options);

c# - StructureMap - different concrete instance based on inheritance of generic type in parent -

i'm not sure if possible. might have make changes want work. maybe need 2 repository classes. i'm open suggestions make work can connect 2 different entity framework data contexts. i have setup user profiles stored in shared database sub-sites, , other models in site database specific site. there going 2+ sites , use shared entity context shared models. first have profile model in shared models library public class profile : coreobject, ishared { //...properties } for comparison, here object in subsite models library public class game : coreobject { //...properties } then have repository interface public interface irepository<t> : idisposable t : coreobject and concrete public class repository<t> : irepository<t> t : coreobject { //system.data.entity.dbcontext private dbcontext context { get; set; } public repository(idbcontextfactory dbcontextfactory) { context = dbcontextfactory.getdbcontext(); }

python - Adding attributes from another dictionary for same key without overwriting -

let's have 2 dictionaries: d1 = {'a': 2, 'b': 4, 'c': 5, 'd': 6} d2 = {'a': 5, 'c': 4, 'e': 8} iterating on second: for k, v in d2.items(): i check key presence in d1, , if it's there add value attribute key , if not, add dictionary want: d1 = {'a': [2, 5], 'b': 4, 'c': [4, 5], 'd': 6, 'e': 8} i know how check presence in operator can't work out how update dict new attributes. bear in mind, have presented simple case of problem , within loop means key have multiple attributes rather 1 or 2. thank you. you can't have 2 values 1 key in dictionary. that, need value list append "real" values key. for k,v in d2.items(): if k in d1: if isinstance(d1[k], list): d1[k].append(v) else: d1[k] = [d1[k], v] else: d1[k] = v however, seems more straightforward: for k,v in d2.items(): if

python - Pandas: iteratively concatenate columns stored in a dictionary of dataframes -

Image
suppose have dictionary of pandas dataframes keys 0, 1, 2, ..., 999 , , values dataframes ( test_df ): b c 0 1.438161 -0.210454 -1.983704 1 -0.283780 -0.371773 0.017580 2 0.552564 -0.610548 0.257276 3 1.931332 0.649179 -1.349062 4 1.656010 -1.373263 1.333079 5 0.944862 -0.657849 1.526811 say index means nothing you, , want create new dataframe columns a , b concatenated: mydf=pd.concat([test_df[0]['a'],test_df[0]['b']], axis=1, keys=['a','b']) now, can use line inside loop iterates on keys in dictionary of dataframes? if not, way of doing this? result dataframe 2 columns, a , b , , 6x1000 rows. index column therefore go 0 5999 . if df_dic dictionary, can do: pd.concat([df[['a', 'b']] df in df_dic.values()]).reset_index(drop=true) here result looks if df_dic contains 2 key-value pairs:

Paypal credit card payment with Paypal checkout HTML button -

i met issue w/ paypal checkout html button when want "check out guest". on paypal checkout page: - click on "check out guest" - fill required fields - deny paypal account creation , when click "pay now" button, nothing happens (no error, no form submit) anybody ever encountered kind of problem ? ideas ? thanks in advance paypal checkout html button code sample <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="xxxxx"> <input type="hidden" name="lc" value="fr"> <input type="hidden" name="item_name" value="buynow"> <input type="hidden" name="amount" value="1.50"> <input type="hidden" name="

javascript - Nativescript - cocoapod / Google Conversion Tracking -

my question how implement , use cocoapod modules in ios, want use google conversion tracking pod in nativescript application cant work. can install pod, when try use it, not possible to. is there guides how implement cocoapod modules nativescript ? this code try run in app.module.ts class mydelegate extends uiresponder implements uiapplicationdelegate { public static objcprotocols = [uiapplicationdelegate]; applicationdidfinishlaunchingwithoptions(application: uiapplication, launchoptions: nsdictionary): boolean { console.log("applicationwillfinishlaunchingwithoptions"); // google ios in-app conversion tracking snippet // add code event you'd track in [actautomatedusagetracker enableautomatedusagereportingwithconversionid:@"12345678"]; //actconversionreporter.reportwithconversionidlabelvalueisrepeatable("12345678", "aassoighsingaxx", "0.00", true); [actconversionreporter reportwithconversionid:@"12345678"

.net - How can I get WCF MSMQ to get more then 10 messages at a time? -

i've programmatically set msmq binding , throttling, though specify maxconcurrentcalls, maxconcurrentsessions , maxconcurrentinstances higher 10 don't manage process more 10 messages @ time. here code create host: var host = new servicehost(typeof(mqprocessrequestserver)); var binding = new netmsmqbinding(netmsmqsecuritymode.none) { usesourcejournal = true, receiveerrorhandling = receiveerrorhandling.drop, receiveretrycount = 0, maxretrycycles = 0, retrycycledelay = timespan.fromminutes(1), exactlyonce = true, durable = true, maxreceivedmessagesize = 4000000000, receivetimeout = timespan.fromseconds(30) }; var queueuri = string.format("net.msmq://localhost/private/{0}", scriptengineversion); host.addserviceendpoint(typeof(imqprocessrequest), binding, queueuri); // set throttling scriptengine.capac

asp.net - How to get value of control programmaticaly created, before postback erase them ? -

i'm creating dynamic controls via code ' fields array of string each field string in fields if field.trim <> "" fieldqty += 1 dim mylab new label mylab.text = field mylab.id = "lblinfo" & fieldqty dim mytxt new textbox mytxt.id = "txtinfo" & fieldqty paninfo.controls.add(mylab) paninfo.controls.add(mytxt) end if next session("fieldsqty") = fieldqty then, i've button want save or send via email content of fields. protected sub btnsave_click(sender object, e eventargs) handles btnsave.click k integer = 1 cint(session("fieldsqty")) dim mytxt textbox dim mylbl label lblmsg.text = paninfo.controls.count 'here got 0 mylbl = ctype(paninfo.findcon

awk - How to replace other column-entries when searching for a specific column in a file? -

suppose file looks this: a 1 0 b 1 0 c 1 0 how can search line has b in first column, , if so, switch entries in second , third column? final result like: a 1 0 b 0 1 c 1 0 try - vipin@kali:~$ awk '{if($1 == "b") {print $1,$3,$2} else print $1,$2,$3}' kk 1 0 b 0 1 c 1 0

http - Testing external API's using Angular 2 & Apache -

i trying make http requeset external api using following request: let headers = new headers({ 'x-requested-with': 'xmlhttprequest', 'content-type': 'application/x-www-form-urlencoded', 'access-control-allow-origin': "*" }); let options = new requestoptions({ headers: headers }); let body = json.stringify({ test: test comments: "test" }); this.http.post("external_api_url", body, options) .map(res => res.json()) .subscribe((data) => { console.log(data); }); when making api call chrome postman plugin, api works without problem. when i'm trying make call angular 2 app, call not working , returns following error: xmlhttprequest cannot load my_api_url. response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:4200' therefore not

How to use C# Reflection to set properties and fields with generic code? -

my code wants iterate dictionary contains both fieldinfo , propertyinfo of type, , use map values 1 object another. example: public static void mapfieldsandproperties(object source, object target) { dictionary<string, memberinfo> target_properties = classutils.getpropertiesandfields(target); dictionary<string, memberinfo> source_properties = classutils.getmatchingpropertiesandfields(target_properties.keys, source); foreach (var entry in source_properties) { var sourceproperty = entry.value; var targetproperty = target_properties[entry.key]; // now, match datatypes directly if (datatypesmatch(source, target)) { var sourcevalue = sourceproperty.getvalue(source); try { targetproperty.setvalue(target, sourcevalue); } catch (targetexception e) {

python - Cant save the dataframe to excel, atribute error -

i have 2 dataframes imported quandl , i'm having trouble saving results excel file. keep getting error attributeerror: series object has no attribute to_excel however, before did division of columns excel writing working fine, cant figure out whats wrong if comment out part of code, .to_excel works fine result['snp/gld'] = result['settle1'] / result['settle'] result = result['snp/gld'] ... from pandas import excelwriter import pandas pd import quandl import unicodecsv import datetime dt gld = quandl.get("chris/cme_gc1") snp = quandl.get("chris/cme_es1") snp.rename(columns = {'open' : 'open1', 'high' : 'high1', 'low' : 'low1', 'last' : 'last1', 'change' : 'change1', 'settle' : 'settle1', 'volume' : 'volume1', 'open interest' : 'open interest1'}, inplace = true) result = snp.

javascript - What Ember Add-on do I need for this situation? -

i wondering if there ember add-on can implement following. |-----------------------------------------------v----| green yellow red color gradient bar of green > yellow > red , v represents value lands there. green, yellow, red start based on values, green 0-20 , yellow 21-40 , red 41+ i don't know called, if can let me know , point me in right direction, obliged. here go: var min = 0; var max = 60; function set(x) { var left = (x - min) / (max - min) * 100; document.getelementbyid("v").style.left = left + "%"; } set(50); #gauge { background: linear-gradient(to right, green 0%, yellow 50%, red 100%); height: 2em; position: relative } #v { width: 0; height: 2.4em; border: 1px solid black; position: absolute; top: -0.2em } <div id="gauge"> <div id="v"></div> </div>

maven - Java Classes Structure -

i working project made in maven spring , want start structure fine beginning. i need know if ok did until now. so, in have structure: src/main/java/com/fabbydesign/controller src/main/java/com/fabbydesign/model src/main/java/com/fabbydesign/util and have file in: src/main/webapp/web-inf/appconfigs.xml in file store configurations of project, database login, etc in directory utils, store utils class project. example, make class read appconfigs.xml configurations stored there is ok did until now? in model directory, have store beans database, or can add other types there? like, bean xml configs? thanks!

c# - Console app skeleton with input and output that is reusable -

i have made countless console applications since started coding. need test quickly, other times want make simple helper program. in case need kind of interaction program , every time feels reinventing wheel. so question is: does know of console application skeleton? mean console application takes care of things might expect console application. input command parsing many arguments want map methods in classes example. output depending on input. both when type expected , unexpected. easy way add custom classes , connect them skeleton app. p.s. have found one: link console app skeleton nice, has limitations. nice requires static among other things. may suggest alternative countless console applications test something? i use linqpad ( https://www.linqpad.net/ ) hate these throw away projects try something. can define basic query (template) , clone each time. it supports nuget packages , adding own references.

Executing an external python script from django, leads to segmentation fault -

i wrote script while ago, creates figures , few sql querys psycopg2 on postgresql after processing file "a". script works fine when executed on own. tested multiple times. @ moment working on django project, can upload file "a". idea use script made on file, create output, displayed on webside. had no problem implement file uploading process, copyed file subfolder script using shutil. when try run script process file withhin django script, segmentation fault error. again: python script #runs in django app/views.py from script import function function() #segmentation fault i know, django in debug modus keeps track of sql querys , excessive memory use can lead segmentation fault. source: turn off sql logging while keeping settings.debug? as perfoming sql querys inside script guess reason crashes debug behaviour. wondering if there simple way turn debug sql tracking off function ? or other ideas, why function works outside django environement crash

c# - Not all values in MVC form being posted -

a little or advice if of can? have mvc form (it's umbraco form/surface controller, don't know that has bearing on this), model contains list of objects being used generate check-boxes using html helper methods; see following post how rendering these , receiving them in child action: https://stackoverflow.com/a/20687405/1285676 all appears working well, except although check-boxes being posted on submit, not being picked model received actionresult method in controller. have looked @ posted data using network tools in chrome, , appears ok.. (all check-boxes appear being posted in same format), million dollar question is, preventing values being picked in model? here's snipet of form rendering check-boxes, cut down rest should not relevant (yes there submit button in real thing..): @model memberpreferencesvm @using (html.beginumbracoform<memberaccountsurfacecontroller>("handledealermemberpreferencesaccountupdate", formmethod.post, new { @class = &quo

ios - DateFormatter producing unexpected result on device -

this question has answer here: nsdateformatter show wrong year 1 answer i have following code: var components = datecomponents() components.year = 2017 components.month = 1 var calendar = calendar.current let date = calendar.date(from: components)! let formatter = dateformatter() formatter.setlocalizeddateformatfromtemplate("mmmmyyyy") let string = formatter.string(from: date) when run in simulator on computer works expect , value of string january 2017 . however, when run same code on device value of string january 2016 . can causing difference? the difference a different locale on device , simulator. and / or yyyy year in week of year based calendar. yyyy year in standard calendar. you should use yyyy .

Android ScrollView inside LinearLayout -

Image
i have problem layout (buttons) in andoid. want display buttons inside scrollview scrollview must below relativelayout or other words, first 2 buttons scrollview not displayed on phone.. here picture: here layout: <relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:textappearance="?android:textappearancelarge" android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="58.0dip" android:text="@string/naziv" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" /> </relativelayout> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/scrollview" > <linearlayout android:layout_gravit

jquery - How to include Cytoscape.js Extension Cytoscape-qtip into an Ember App -

i use cytoscape extension cytoscape-qtip in component of ember app uses cytoscape.js dependency draw graph. successful setup of cytoscape.js cytoscape.js hooked ember installing via bower bower install cytoscape , importing via ember-cli-build.js: in my-ember-app/ember-cli-build.js: // in my-ember-app/ember-cli-build.js // .... app.import('bower_components/cytoscape/dist/cytoscape.js'); return app.totree(); in cytoscape-graph component can use cytoscape global variable out of box: in my-ember-app/app/components/cytoscape-graph.js: import ember 'ember'; export default ember.component.extend({ didinsertelement(){ let container = this.$(); // ... var cy = cytoscape({ container: container, // ... styles, layout, element selection }); // cytoscape instance renders fine! accessing global cytoscape works fine approach. analogue setup of cytoscape-qtip doesn't work although, when install cytoscape-qtip via bower, import dependency si

jwt - Spring boot and JWTToken and how to authenticate the User -

i learning how implement jwt token generation spring boot restful controller , following article on https://auth0.com/blog/securing-spring-boot-with-jwts/ by following article able generate jwt token , able access /users. in article author defaulted user name , password below: public class websecurityconfig extends websecurityconfigureradapter { @override protected void configure(httpsecurity http) throws exception { // disable caching http.headers().cachecontrol(); http.csrf().disable() // disable csrf our requests. .authorizerequests() .antmatchers("/").permitall() .antmatchers(httpmethod.post, "/login").permitall() .anyrequest().authenticated() .and() // filter api/login requests .addfilterbefore(new jwtloginfilter("/login", authenticationmanager()), usernamepasswordauthenticationfilter.class) // , filter other requests check presence of jwt in header .addf

java - Array of Button in JavaFX using Scene Builder -

lets have 2 buttons in fxml instance: <button fx:id="button1" onaction="#onclick1" prefheight="134.0" prefwidth="134.0"></button> <button fx:id="button2" onaction="#onclick2" prefheight="134.0" prefwidth="134.0"></button> and want have array of buttons in controller class. how can go , that? have tried: public button button1, button2; public button[] arraybuttons = {button1, button2} and tried making method: public class controller { public button button1, button2; public button[] arraybuttons; public void initializebuttonarray() { arraybuttons = new button[2]; arraybuttons[1] = button1; arraybuttons[2] = button2; } } none of these work gives me runtime exception when try array (ie. arraybutton[1].settext("test")): java.lang.runtimeexception: java.lang.reflect.invocationtargetexception how can go , have array of b

sql - MySQL GROUP BY (if) -

edited: sorry badly asked.. i want group variable if variable equal. i have this: username name forename jpumpkin_01 pumpkin jack jpumpkin_02 pumpkin jack pnice nice paul mpumpkin pumpkin michael i display content with: select * ... ... this lists entries: pumpkin jack pumpkin jack nice paul pumpkin michael "pumpkin jack" listed double. use group 'name' ... group name now, "pumpkin jack" listed 1 time, "pumpkin michael" in group too, , disapeared. how can list michael? thank answers , hints.. rgs r the group not conditional. can this: "select * ... ... group name, forename".

scala - Compile-Time Check on AnyVal for Allocation? -

the scala docs discuss anyval . in when allocation necessary section, mentions: case class p(val i: int) extends anyval val p = new p(3) p match { // new p instantiated here case p(3) => println("matched 3") case p(x) => println("not 3") } is possible, @ compile-time, know whether anyval requires allocation, i.e. put onto heap rather stack? furthermore, i'd write above code, , then, @ compile-time, receive warning p match { results in allocation. as understand, allocation defeats purpose of anyval .

ruby on rails - Prefill nested model fields with simple_form -

is possible prefill simple_fields_for ? i have users , has_one backpack , has_may pockets , each pocket has_many items . i created default backpack, , prefill user form backpack fields datas default backpack. i tried think of: 1 - in controller @default_backpack = backpack.first @backpack = @default_backpack.deep_clone include: [ :pockets, { pockets: :items } ] @backpack.save @user.backpack = @backpack but leads me couldn't find backpack id=597 user id= 2- in view <%= f.simple_fields_for :ibackpack, @default_backpackdo |bkpk| %> <%= render 'backpacks/form', f: bkpk %> <% end %> which leads me weird behaviour: backpack fields pre-filled, child fields ( pockets , items ) empty. start form simple <%= simple_form_for @user |f| %> here's simple_fields_for <%= f.simple_fields_for :invoice_quote_element, @invoice_quote_element |iqe| %> <%= render 'briefs/quote_proposal', f: iqe %> <% end %>

Python: How do I capture "cooked mode" / cbreak output of subprocess? -

what i'm trying do: i'm attempting write wrapper in python modifies output of openbsd command-line program before displayed user. command-line program interactive, , it's execution indefinite, wrapper has able modify output in "realtime" produced program. user running wrapper has able interact command-line program. the problem i'm having: script works far, except when command-line program goes cooked-mode (cbreak). user able interact, program output shown, , string replace works. but, when child/subprocess in cooked mode, no output @ all. type not shown, until end of script execution, on exit, dumps @ once. non-cooked mode output shows after type in cooked-mode, , cooked-mode info still cached until end. what have far: have far wrapper: #!/usr/local/bin/python import subprocess process = subprocess.popen(['./cooked.pl'], stdout=subprocess.pipe) while true: output = process.stdout.readline() if output == '' , proc

Objective C indirect pointer bound to block fails to update direct pointer -

i have function binds indirect pointer block, , returns block later assignment direct pointer, this: @interface someclass : nsobject @property int anint; @end @implementation someclass @end typedef void(^callbacktype)(int a); - (callbacktype)getcallbacktoassignto:(someclass **)indirectpointer { return ^(int a){ nslog(@"indirectpointer is: %p", indirectpointer); nslog(@"*indirectpointer is: %p", *indirectpointer); (*indirectpointer) = [[someclass alloc] init]; (*indirectpointer).anint = a; nslog(@"after: indirectpointer is: %p", indirectpointer); nslog(@"after: *indirectpointer is: %p", *indirectpointer); }; } - (void)iwillnotdowhatimsupposedto { someclass *directpointer = nil; callbacktype cb = [self getcallbacktoassignto:(&directpointer)]; nslog(@"directpointer pointing to: %p", directpointer); nslog(@"&directpointer pointing to: %p", &directpointer); cb(1); nslog(@

intellij idea - Hide Projects in .sbt -

i have following declarations in .sbt file: lazy val root = (project("core", file(".")) aggregate(project1, project2) settings (...)) lazy val project1 = project("project1", file("project1")) lazy val project2 = project("project2", file("project2")) lazy val project3 = project("project3", file("project3")) i want default have project3 hidden sbt (and of course intellij idea project), , have visible after enabling via system property -dproject3.enabled=true . ideas how implement such forking? just assign subproject conditionally: lazy val project3 = if (system.getproperty("project3.enabled") == "true") { project("project3", file("project3")) } else { // cheat type system working. there might // cleaner way this. root }

Azure Virtual Machine Scale Set: Microsoft.Azure.Diagnostics.IaaSDiagnostics has exited with Exit code: -3 -

when deploying arm template create virtual machine scale set, installation of final, azure diagnostics extension fails. handler 'microsoft.azure.diagnostics.iaasdiagnostics' has reported failure vm extension 'vmdiagnostics_name' terminal error code '1009' , error message: 'enable failed plugin (name: microsoft.azure.diagnostics.iaasdiagnostics, version 1.7.4.0) exception command c:\packages\plugins\microsoft.azure.diagnostics.iaasdiagnostics\1.7.4.0\diagnosticspluginlauncher.exe of microsoft.azure.diagnostics.iaasdiagnostics has exited exit code: -3' can't see caused problem when remote desktop connected 1 of servers. from arm template (standard): "extensionprofile": { "extensions": [ (...) { "properties": { "publisher": "microsoft.azure.diagnostics", "type": "iaasdiagnostics", "typehandlerversion": "1.5", &quo

java - Getting Logical Subexpressions Using Stack -

i don't have code right now, i'm trying process how i'm going perform algorithm , need ideas. say have string example: ((a+b)*(c+b)) * (a+c) i don't want use regex @ i'm trying figure out how using strictly stack operations. thinking of maybe counting brackets have account double inner-brackets. i'm lost of other ideas. so string, want derive following: a+b c+b (a+b)*(c+b) a+c ((a+b)*(c+b)) * (a+c) // original string any ideas? this solution based on assumption every subexpression surrounded parenthesis (except, maybe, entire expression). it's simplification of shunting-yard algorithm, can parse arbitrary arithmetic expressions: let's keep stack of tokens (represented strings). stack empty. iterate on string , each character, following: if it's closing parenthesis, keep popping tokens of stack until opening parenthesis found. concatenate popped tokens (including parenthesis), print result , push stack. otherwise p

Is it possible to create container in multiple host using a single docker compose file? -

i have create containers in multiple host. have dockerfile each container. found docker-compose can used run multiple containers single yaml file. have run containera in hosta, containerb in hostb , on.. possible achieve using docker-compose ? or best way create container in different host using dockerfile. no, docker-compose alone won't achieve this. managing containers across multiple hosts job of schedulers. the docker ecosystem: scheduling , orchestration older article, should give introduction. the scheduler provided docker called swarm. use compose swarm place start understand how use them together. this part of answer time limited, during mentor week there few free courses can take learn more swarm. in case operations beginner , intermediate may interesting.

home and zoom widget button in arcgis api js -

Image
how use one? what name of widget? there dedicated home button widget available ( 4.x docs , 3.x docs ) acts separate button , not integrate zoom controls. judging screenshot looks custom made (html element inserted zoom controls), there's thread on geonet similar looking suggestions: https://geonet.esri.com/thread/107259#comment-402029

Delegate method called twice in Xcode 8.1/Swift 3.0 with debugger breakpoint -

i have problem xcode 8.1/swift 3. think might bug in debugger xcode software thought see if sees missing. working on ios application need override backspace method used uitextfield. setup delegate watch backspace key being pressed. program works until set debugger breakpoint in overridden method (see code below). when backspace method gets called twice each time press key instead of 1 time. if delete breakpoint code works. bug or doing wrong? here code help! import uikit class viewcontroller: uiviewcontroller, eqfielddelegate { override func viewdidload() { super.viewdidload() let newfield = eqfield() newfield.mydelegate = self newfield.becomefirstresponder() view.addsubview(newfield) newfield.frame = cgrect(x: 50, y: 50, width: 200, height: 150) } func backspacepressed( ){ print("in backspacepressed") // breakpoint added here } } here subclass of uitextfield: import uikit class eqfield: uitextfield { var mydelegate:

c++ - Accessing and changing member variable within other class -

#include <iostream> #include <string> using namespace std; class person { private: string name; public: person(string _name, int _money) : name(_name), money(_money) {} int money; int get_money() {return money; } }; class company { private: string name; public: company(string _name) : name(_name) {} void pay_salary(person p, int amount); }; void company::pay_salary(person p, int amount) { p.money += amount; } int main() { person bob("bob", 0); company c("c"); cout << bob.get_money() << endl; // prints 0 c.pay_salary(bob,100); cout << bob.get_money() << endl; // prints 0 return 0; } in code (simplified illustrate problem) want access member variable money, inside company increase money of person. however, p.money += amount appears work locally, , not change value of money specific person in main. what methods of making work? possible make money a protected m

swift3 - How can I incorporate both iOS 9.3 & iOS 10 codes into my App? -

Image
scenario: have existing ios 9.3 application 5th-generation itouch can handle. i want add ios 10-savvy code application , able filter existing code can continue working old itouch. however, compiler refuses build if deployment target set @ ios 9.3 or lower: there work-around or must create new application? possible solution: 1. build ios 10.0+ deployment; then 2. filter via in-code @available(ios 10.0, *). itouch can't handle ios 10; i'm hope above solution work. you use #available if #available(ios 10, *) { uiapplication.shared.open(url, options: [:], completionhandler: { (success) in guard success else { //handle error return } }) } else { _ = uiapplication.shared.openurl(url) } }

python - django-supervisor connection refused -

i using supervisor run celery django 1.8.8. setup. using django-supervisor==0.3.4 supervisor==3.2.0 but when restart proecsses, get unix:///tmp/supervisor.sock refused connection not able restart processes, python manage.py supervisor --config-file=setting/staging_supervisor.conf --settings=setting.staging_settings restart supervisor config file [supervisord] logfile_maxbytes=10mb ; maximum size of logfile before rotation logfile_backups=3 ; number of backed logfiles loglevel=warn ; info, debug, warn, trace nodaemon=false ; run supervisord daemon minfds=1024 ; number of startup file descriptors minprocs=200

gpgpu - Parallel Brute Froce Algorithm GPU -

i have implemented parallel bf generator in python in post! parallelize brute force generation . i want implement parallel technique on gpu. should parallel bf generator on gpu. can me out code examples parallel bf generator on gpu? couldn't find examples online made me suspicious... thx look @ implementation - did distribution on gpu code: void incbrutegpu( unsigned char* thebrute, unsigned int charsetlen, unsigned int brutelength, unsigned int incnr){ unsigned int = 0; while(incrementby > 0 && < brutelength){ int add = incrementby + ourbrute[i]; ourbrute[i] = add % charsetlen; incrementby = add / charsetlen; i++; } } call this: // thread index number int idx = get_global_id(0); // length of charset "abcdefghi......" unsigned int charsetlen = 26; // length of word want brute unsigned int brutelength = 6; // thebrute keeps single start numbers of alphabeth unsigned char thebrute[m

readfile - Skipping whitespaces when reading file python -

im working on long project read file saved in campus network system, when reading file, works if delete white spaces @ bottom of list, when leave them in(like prof wants) error, "invalid literal int() base 10: 'date'" ive tried few different options ignore white spaces none have worked- list of ive tried open("c:\\users\\brayd\onedrive\\documents\\2015homicidelog_final.txt") f_in: lines = (line.rstrip() line in f_in) lines = list(line line in lines if line) line in file: if not line.strip(): print("it empty line") open("fname.txt") file: line in file: if not line.strip(): file.close() open file f_in: lines = list(line line in (l.strip() l in f_in) if line) nothing has worked, here use when deleting white spaces in file , works perfectly file = open("c:\\users\\brayd\onedrive\\documents\\2015homicidelog_final.txt" , "r") lines=file.readlines()[1:] file.close() i've bee

java - Does SonarQube 5.6 executes Decorators in plugins developed with sonar-plugin-api version 4.5.2? -

i installed sonarqube 5.6, , download c# plugin. i decide extend c# plugin, proceed download code of plugin installed (version 5.3.2). the c# plugin project has reference sonar-plugin-api version 4.5.2 i add new metrics require calculated project level, therefore, , following documentation, create decorator . public class csharpmydecorator implements decorator{ private static final logger log = loggerfactory.getlogger(csharpmydecorator.class); @override public boolean shouldexecuteonproject(project arg0) { // todo auto-generated method stub return true; } @override public void decorate(resource resource, decoratorcontext context) { log.info(resource.getname() + " project: " + scopes.isproject(resource) +" project not module:" + qualifiers.isproject(resource, false)); if (scopes.isproject(resource) && qualifiers.isproject(resource, false)) { double files = 0d; dou

Java,Swing - cannot draw lines on a JFrame -

Image
i'm trying draw vertical lines separate days in week on jframe. code seems fine no error when run it, output frame picture below. missing anything? public class weektoview extends jframe{ public weektoview(){ settitle("sheffield dental care"); //set title toolkit toolkit = toolkit.getdefaulttoolkit(); dimension screendimensions = toolkit.getscreensize(); setlocation(new point(screendimensions.width*1/4, screendimensions.height*1/4)); //set location based on screen size jpanel container = new jpanel(); jscrollpane scrpane = new jscrollpane(container); getcontentpane().add(scrpane); double size[][] = {{150, 150, 150, 150, 150}, // columns {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}}; // rows container.setlayout(new tablelayout(size)); string daysinweek[] = {"monday", "tuesday", "wednesday", "thursday", "friday&quo