Posts

xcode - Parse stack to second view -

im creating rpn calculator in swift. need code view calculations when tape button pressed segue secondvc. when tape button pressed display calculations entered.the functionality in second view controller. im knew programming. have implemented prepareforsegue in first vc. not know how pass stack numberofrowsinsection calculator engine class calculatorengine :nsobject { var operandstack = array<double>() func updatestackwithvalue(value: double) { self.operandstack.append(value) } func operate(operation: string) ->double { switch operation { case "×": if operandstack.count >= 2 { return self.operandstack.removelast() * self.operandstack.removelast() second view class secondvcviewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { var array = [""] func tableview(tableview: uitableview, numberofrowsinsection section: int) -> in...

c# - Libgit2sharp can't find git2-*.dll when built in Xamarin studio on Windows -

i'm attempting build c# desktop application on windows xamarin studio. after importing libgit2sharp package (and consequently libgit2sharp.nativebinaries package), attempt use library results in 1 of these: exception in gtk# callback delegate note: applications can use glib.exceptionmanager.unhandledexception handle exception. system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.dllnotfoundexception: git2-785d8c4 @ (wrapper managed-to-native) libgit2sharp.core.nativemethods:git_config_find_xdg (libgit2sharp.core.handles.gitbuf) @ libgit2sharp.core.proxy.convertpath (system.func`2 pathretriever) [0x00006] in <filename unknown>:0 @ libgit2sharp.core.proxy.git_config_find_xdg () [0x00000] in <filename unknown>:0 @ libgit2sharp.configuration..ctor (libgit2sharp.repository repository, system.string repositoryconfigurationfilelocation, system.string globalconfigurationfilelocation, system.string xdgconfi...

c# - Choose my method name for delegate without reflection -

my delegate... private delegate double calculatedelegate(double x, double y); code declareing delegate... private calculatedelegate calculate; my methods use in delegates... private double add(double x, double y) { return x + y; } private double subtract(double x, double y) { return x - y; } how execute desired method... calculate = new calculatedelegate(add); or... calculate = new calculatedelegate(subtract); this works actual code contains many more 'functions' avoid using switch/if statement. need write new method send in. the calc method (i usied action here thinking might work, not) public double calc(action methodname, double x, double y) { calculate = new calculatedelegate(methodname); return calculate(x,y); } how execute desired method. public void go() { calc(add, 5,4); } is possible without reflection? what solution , use dictionary of delegates keys equal names of delegates, @ example.: public del...

c# - Step in through referenced assemblies code in Visual Studio -

Image
i've several visual studio solutions. each solution has several projects generating assembly. all of these assemblies generated these projects. so, these assemblies loaded dinamically using 2 ways: referenced browsing assembly location (for example debug folder of each project). ninject (loading classes of whichever assembly containing classes implements interface). currently, when need debug code of these referenced or loaded assemblies, need generate exception of whichever assembly i'd step in, , visual studio, automatically shows me code. i figure out there way able navigate through code assemblies, i've absolutly no idea how that. you may open solutions @ once in several visual studio instances. then may start main process. in other vs instances select "attach process ... ctrl+alt+p" find process , attach then may set breakpoint in instance of vs.

javascript - NodeJS + mysql: Select query returning individual objects -

i have been using mysql npm package many months , have not faced issues. code acting strange. using(connectionpool.getsqlconnection(), function(connection) { return connection.queryasync('select * table_name'); }).spread(function(rows, fields) { console.log('rows: %j', rows); console.log('fields: %j', fields); res.json(rows); }).error(function(err) { console.log(err); }); i know there 50 rows in table. getting 1 in rows . also, strangely fields has 2nd row. idea why happening? have used same query elsewhere no problems. edit i fiddled around little bit , found each row coming separate object. if change code following: using(connectionpool.getsqlconnection(), function(connection) { return connection.queryasync('select * table_name'); }).spread(function(r1, r2, r3, r4) { console.log('rows: %j', r1); console.log('rows: %j', r2); console....

python - Read text from TextBuffer in pyGtk using TextMarks -

i using multiline text view , text buffer manipulate text in pygtk. want read input position insert pressed last time, , current position insert pressed again. def markit(self, pos): mark = self.create_mark(mark_name = 'startinsert', = pos, left_gravity = true) mark.set_visible = true return mark def keypress(widget, event): if event.keyval == 65293: buff = termwindow.get_buffer() # read command. ### how this????? print command # delete previous created mark. buff.delete_mark_by_name('startinsert') buff.markit(current_pos) return true return false this mark create every time in enter key callback function. initially, position can zero. also, though did set visibility true, not visible.

angularjs - How to access Angular attribute via Javascript injection -

for instance, let's have <div class="row costbreakdown__shipping"> <div class="small-8 medium-7 large-7 columns">shipping:</div> <div class="small-4 medium-5 large-5 columns text-right" ng-switch="cart.israted"> <!-- ngswitchwhen: true --><div ng-switch-when="true" class="ng-binding ng-scope">$8.48</div><!-- end ngswitchwhen: --> <!-- ngswitchwhen: false --> </div> </div> how 1 access value $8.48 in class costbreakdown__shipping? i've have var x = $(".costbreakdown__shipping").eq(2).children().eq(1).children().eq(1) which gives me <!-- ngswitchwhen: true --><div ng-switch-when="true" class="ng-binding ng-scope">$8.48</div> but how go accessing value inside? have tried using .innerhtml @ end of assignment va...