Posts

Showing posts from July, 2013

networking - Optimizing Ansible Transport\SSH for Unconventional Networks -

i'm wondering how optimise ansible work network radically different 1 use cases accelerate , default might not beneficial. in scenario i'm not dealing virtual network, nor dealing servers. i'm dealing hundreds of embedded, rather unique network design, downside of faults in hosts or cabling on network may cause periodic connectivity changes neighbouring hosts. this result in dropped or laggy ssh sessions on individual ssh conneciton, unfortunately cause ansible hang on particular hosts , timeout change alone doesn't seem make difference. could provide information parameters best managing configuration changes , install updates on network drop outs may occur during session on or connected particular hosts, longer lived sessions may not beneficial. in particular advice on these areas in context use scenario ssh vs paramiko control persist, pipelining , timeout params accelerate or no? evaluating suitability number of specified forks run if workin...

ruby - Example of an update-able image in dashing dashboard -

Image
i have taken dashing sample dashboard , added widgets - 2 image , 1 bigimage widgets: <li data-row="1" data-col="1" data-sizex="2" data-sizey="1"> <div data-id="image2" data-view="image" data-image="images/image2.jpg" title="image2" data-link='abc' style="background-color:#ff9618"></div> </li> <li data-row="1" data-col="1" data-sizex="3" data-sizey="2"> <!-- <div data-id="picture" data-view="bigimage" data-image="file:///shared/images/aura0.jpg" --> <div data-id="picture" data-view="bigimage" data-image="https://www.google.com/images/nav_logo195_hr.png" style="background-color:transparent;" data-max="true" ></div> </li> the placeholder widgets show images not: when click f...

sql server - SSMA MySql to MsSql Null Value Error -

Image
the mysql contains tables 0 date time : '0000-00-00 00:00:00'. when using ssma migrate database mssql facing error cannot insert dbnull. understandable since neither mysql or mssql has field nullable. what not understand changed ssma's default projet setting replace constant zero-date not null columns. constant choose : 1900-01-01. is there other settings must set? the way found go inside mysql database, alter every table having default value 0 based datetime allow null. then, update every of these fields update 0 based value null. here, using ssma tool work since no more 0 based date time. far being perfect works.

2d - HaxeFlixel & OGMO Editor - Some tiles are blank -

i using ogmo level editor create 2d levels game, , loading them game using flxogmoloader flixel addon. saving levels in csv format in ogmo. in game, tiles (usually 3-4 per level) appear black. if open level in editor, tiles appear how supposed to. in oel file levels, these blank tiles represented 0. if change number hand appear supposed in game. because ogmo can open levels , display them fine, assuming problem way haxeflixel loading them in, , not way ogmo saving them. also, tileset using 3 tiles wide , 7 tiles tall, , each tile 32x32 pixels. here how loading levels: // class using load levels import flixel.addons.editors.ogmo.flxogmoloader; // in playstate class private var _map:flxogmoloader; private var _mwalls:flxtilemap; // in create method of playstate _map = new flxogmoloader(assetpaths.dungeon_room_1__oel); _mwalls = _map.loadtilemap(assetpaths.simple_dungeon_tiles__png, 32, 32, "walls"); _mwalls.settileproperties(7, flxobject.none); add(_mwalls); ...

python - how to configure eclipse(pydev) to run with external executable -

i have test framework tests have kicked off using particular executable(say m). tests written in python(i have eclipse configured pydev) . run tests run thru cmdline like: $ m -test <test_file_name>.<testcase_name> how configure eclipse run configuration can run /debug eclipse? not able able find documentation tells me if can use "program arguments" in run/debug configuration set up? pydev run python executable configure in interpreter preferences (so, if want run different executable, it'll work if it's program configured in interpreter preferences , can launch python script -- regular interpreter). if that's not case, can configure external tool make run (run > external tools > external tools configurations > program) , use run. now, if executable work python executable (or if you're running python itself) see: getting started on how run program: http://pydev.org/manual_101_run.html how run unittest: http://pyd...

vba - Open an Excel file, run a macro, save it (overwrite) -

i'm trying create .vbs opens excel runs macro saves new information quits this have far: dim xlapp, xlbook set xlapp = createobject("excel.application") xlapp.displayalerts = false set xlbook = xlapp.workbooks.open("c:\test\test.xlsm", 0, true) xlapp.run "test" xlbook.save xlbook.close false set xlbook = nothing xlapp.quit set xlapp = nothing wscript.echo "upload finished" wscript.quit i 'upload finished', macro not saved. doing wrong? the macro putting 1 worksheet another: sub test() ' ' test macro ' sheets("sheet2").select range("a1:a10").select range("a10").activate selection.cut activesheet.previous.select selection.end(xltoleft).select range("a2").select activesheet.paste end sub out of curiosity why macro in excel? if controlling excel via object, why not have macro code in there also? dim xlapp, xlbook set ...

c# - How to change ViewPort3D background color in WPF? -

i have viewport3d , want change background color. i new wpf. didnt understand other posts. ask here. i changed brush property viewport3d nothing <window x:class="w3dtinker.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="800" width="1200"> <grid horizontalalignment="left" height="780" margin="10,10,0,-21" verticalalignment="top" width="1180"> <viewport3d grid.row="0" grid.column="0" x:name="viewport" margin="350,10,10,10" opacitymask="{dynamicresource {x:static systemcolors.appworkspacebrushkey}}" /> </grid> viewport3d control creates 3d scene render things into. not display itself. if want background color behind it, set background color on parent control, i...

ios - cocos2d can't get started with physics -

so apparently cocos2d community thinks i'm spammer because don't understand tutorials, here :d hey i'm trying physics working single object "failed find parent ccphysicsnode ccphysicsbody. ccphysicsbody requies child of ccphysicsnode when onenter called". in init function scene have, override init(){ super.init() let scenephysics = ccphysicsbody() self.physicsbody = scenephysics } i unable find proper tutorial, or answer after lot of googling. seems api docs tells not how it. see examples setting physics world, see cocos2d api not have physics world, or not saying need one. conflicting things, no hard answer or example how this. -already tried reading docs -added ccphysicscontactdelegate class definition -read http://cocos2d.spritebuilder.com/docs/api/classes/ccphysicsnode.html -tried adding physics node scene in spritebuilder i adding ccphysicsbody instead of ccphysicsnode

testing - 'dart pub test' can you pass parameters that can be referenced in tests? -

dart/pub v1.10 can pass parameter 'pub run test -dkey=value' can referenced in test? i'd strategy change test.data.yaml file (say user creds) passing parameter. what idiomatic way accomplish in dart? shell script? ideas? passing parameters not supported , far know not planned. use environment variables pass parameters.

language agnostic - When to use unsigned values over signed ones? -

when appropriate use unsigned variable on signed one? in for loop? i hear lot of opinions , wanted see if there resembling consensus. for (unsigned int = 0; < something.length(); i++) { var = something.at(i); // idea. } i know java doesn't have unsigned values, , must have been concious decision on sun microsystems ' part. i glad find a conversation on subject, hadn't given thought before. in summary, signed general choice - when you're dead sure numbers positive - if you're going arithmetic on variable (like in typical loop case). if you're going bitwise things masks, unsigned starts make more sense. or, if you're desperate positive range taking advantage of sign bit. personally, signed because don't trust myself stay consistent , avoid mixing 2 types (like article warns against).

html - CSS transform-origin + stacked divs -

i attempting rotate/spin-in-place stacked divs, 'transform-origin' property seems ignored when using absolute divs. attached example, divs stacked using stack class. using svg better solution? .circle { height: 250px; width: 250px; border-radius: 50%; border: 50px solid white; margin: auto; } body { background: black; overflow: hidden; } .circle_one { animation: rotatey 3s infinite linear; } .circle_two { animation: rotatex 2s infinite linear; } .spinme { animation: spinme 2s infinite linear; transform-origin: 50% 50%; } .stack { position: absolute; top: 0; left: 0; } @-webkit-keyframes rotatey { { transform: rotatey(360deg); } } @-webkit-keyframes rotatex { { transform: rotatex(360deg); } } @-webkit-keyframes spinme { { transform: rotate(360deg); } } <div class="spinme"> <div class="circle circle_one stack"></div> ...

asp.net web api - Angular $resource WebAPI FromBody Clarification -

i have webapi controller defined this [route("~/api/v1/employees/{id}")] [httpget] public httpresponsemessage getemployee([frombody]int empid) { var emp = db.employees.firstordefault(i => i.empid == empid) employee; return request.createresponse<employee>(httpstatuscode.ok, emp); } here angular controller call method , angular service controller: $scope.employee = empfactory.singleemployee.query({ id: sharedata.value }, { empid: 2 } , function (data) { emp = data; }); service: singleemployee: $resource('/api/v1/employees/:id', { id: '@id'}, { query: { method: 'get' } } ) note: have purposefully changed parameter name empid in webapi controller understand how call such methods angular.. question 1: doesn't work.. fiddler, clear empid not getting passed while request question 2: per doc...

ios - Popup User Agreement Display in Swift -

i'm trying implement code swift user given popup alert upon initial launch of app. , prefer not have popup again each time app re-launched. i'm thinking using uialert in viewdidload() don't know code determine if app has been launched more once. appreciate input , code examples. thank you! you use nsuserdefault storage this let firstlaunchkey = "firstlaunch" if nsuserdefaults.standarduserdefaults().objectforkey(firstlaunchkey) == nil{ // show alert , set firstlauch key nsuserdefaults.standarduserdefaults().setbool(false, forkey: firstlaunchkey) }

javascript - CSS MegaMenu Full Width in IE 10/11 -

i working on superfish menu custom styles make menu full width , responsive. project works on google chrome , firefox, not in ie 11. take in sample * { margin:0; padding:0; } html { height: 100%; width: 100%; } body { font-size:13px; color:#777; text-align:center; min-width:250px; position:relative; } body > .wrapper { position:relative; } .page { margin: 0 auto; padding: 0 0 0; text-align: left; width: 900px; } .sf-menu, .sf-menu * { margin: 0; padding: 0; list-style: none; } .sf-menu { position: relative; float: none; width: 100%; display: table; font-family: tahoma, helvetica, arial, sans-serif; } .sf-menu li { position: relative; -webkit-transition: background .2s; -moz-transition: background .2s; -o-transition: background .2s; transition: background .2s; } .sf-menu ul { position: absolute; padding-top: 15px; padding-bottom: 15px; display: none; top: 100%; left: 0; z-index: 99; min-width: 12em; } .sf-menu li.last > ul { left: inherit; right:0; } .sf-me...

robotframework - Returning multiple PASS/FAIL -

if have list of strings ['pass', 'fail', 'pass'] , how can return multiple pass or fail status, depending on string? right have like: test01 :for ${test} in @{tests} \ log console ${test} \ should match ${test} pass the robot framework return: test01 pass pass fail test01 | fail | 'fail' not match 'pass' essentially want 1 test dynamically generate test_status arbitrary length list, , results like: test01 pass | pass | pass | pass | fail test01 | fail | 'fail' not match 'pass' you have create separate test cases, since test case has 1 status, pass or fail . however, there ways ensure values in list handled. easiest, think, using ...

python - closing a pyqt widget in ipython notebook without using sys.exit() -

i trying run through pyqt5 tutorials in ipython notebook, have issue every second time run code block kernal undergoes forced restart. here smallest code causes problem: import sys pyqt5.qtwidgets import qapplication, qwidget if __name__ == '__main__': app = qapplication(sys.argv) w = qwidget() w.setwindowtitle('simple') w.show() sys.exit(app.exec_()) i running ipython3 notebook , python 3, pyqt5, , using ubuntu 14.04. should noted problem not occur when running same code via script in terminal. some other unrelated questions have suggested problem due sys.exit() messing instance of python(i hope correct term) instead of closing pyqt application. happens first time run code, second time runs kernel forced restart. problem? , if how work around this? if more info required, please ask. i tried out taar's solution still got dead kernel after calling cell main more twice.the problem creating multiple qapplications, crashes no...

Kafka consumer fetching metadata for topics failed -

i attempting write java client third party's kafka , zookeeper servers. able list , describe topics, when attempt read any, closedchannelexception raised. reproduce them here command line client. $ bin/kafka-console-consumer.sh --zookeeper 255.255.255.255:2181 --topic eventbustopic [2015-06-02 16:23:04,375] warn fetching topic metadata correlation id 0 topics [set(eventbustopic)] broker [id:1,host:some_host,port:9092] failed (kafka.client.clientutils$) java.nio.channels.closedchannelexception @ kafka.network.blockingchannel.send(blockingchannel.scala:100) @ kafka.producer.syncproducer.liftedtree1$1(syncproducer.scala:73) @ kafka.producer.syncproducer.kafka$producer$syncproducer$$dosend(syncproducer.scala:72) @ kafka.producer.syncproducer.send(syncproducer.scala:113) @ kafka.client.clientutils$.fetchtopicmetadata(clientutils.scala:58) @ kafka.client.clientutils$.fetchtopi...

java - Overflow occurs with multiplication -

long m = 24 * 60 * 60 * 1000 * 1000; the above code creates overflow , doesn't print correct result. long m2 = 24l * 60 * 60 * 1000 * 1000; long m3 = 24 * 60 * 60 * 1000 * 1000l; the above 2 lines print correct result. my questions are- does matter compiler use, m2 or m3 ? how java starts multiplying? left right or right left? 24*60 gets computed first or 1000*1000? i use m2 line instead of m3 line. java evaluates multiplication operator * left right , 24 * 60 evaluated first. it happens 24 * 60 * 60 * 1000 (one 1000 ) doesn't overflow, time multiply 1000l (the second 1000 ), product promoted long before multiplying, overflow doesn't take place. but mentioned in comments, more factors can cause overflow in int data type before multiplying last long number, yielding incorrect answer. it's better use long literal first (left-most) number in m2 avoid overflow start. alternatively, can cast first literal long , e.g. (long) 24 * ...

ios - Initialising an array of two tuples fails -

i have simple function returns array of tuples func findnodeneighbors(node: node) -> [(node: node, distance: double)] { var neighbors = [(node: node, distance: double)]() var nodelinks = linkswith(node) link in nodelinks { neighbors.append((node: link.othernodelinkedwith(node), distance: link.length)) } return neighbors } but turns out error invalid use of () call clue of non-function type on first line of function body. if instead declare type neighbors explicitly, fine. var neighbors: [(node: node, distance: double)] = [] how come? i've read preferred declare arrays initialising them , allowing implicit type inference. pretty bug in swift's parser, [type] sugar in combination named tuples. var neighbors = array<(node: node, distance: double)>() (which should identical [(node: node, distance: double)]() ) works fine. edit: looks dictionary equivalent has same problem works fine: var d = dictionary<int...

python 2.7 - TypeError: getch() takes exactly 0 arguments (1 given) -

i have piece of code want if entered other 1,2,3,4 take input once again import msvcrt answer = msvcrt.getch() while answer not in ['1','2','3','4']: answer = msvcrt.getch('enter valid option (1,2,3,4): ') entering not in list gives error: typeerror: getch() takes 0 arguments (1 given) but dont know why giving me error tho appreciated the error text self explanatory. in second line called getch correctly: answer = msvcrt.getch() in order code it's expected change to: while answer not in ['1','2','3','4']: print 'enter valid option (1,2,3,4): ' answer = msvcrt.getch()

html - Smart way to make divs the same size with css? -

i have 2 different divs various contents, , them same height , width. seems bad idea set height , width fixed pixel size, because size should vary based on browser/screen size. setting width percentage works, percentage not option height. is there way ensure 2 divs have same dimensions without setting fixed pixel sizes? or fixed pixel sizes bad? having outer div display: table; , these 2 divs inside display: table-cell; should work you.

c# - SharePoint 2013 WebPart not passing Custom Properties -

developing webpart in sharepoint 2013 , having issue custom properties. custom properties input boxes show , appears normal on frontend. however, when put value in either box , hit 'apply' values coming setter null. here ascx.cs file. getevents , getnews calls other classes. use string coming in custom properties , pass them function pull custom lists. (they pull when hard code lists properly) commented out default values because seemed work not change because of aforementioned issue setter. using system; using system.componentmodel; using system.web.ui.webcontrols.webparts; using system.collections.generic; using system.collections; using system.web.ui.webcontrols; using system.web.ui; namespace listget.visualwebpart1 { [toolboxitemattribute(false)] public partial class visualwebpart1 : webpart { //const string _eventdefaultlist = "events"; //const string _newsdefaultlist = ...

docker - Issues getting Ansible to work with Boot2Docker -

i'm using ansible playbook manage installation of docker containers. have following playbook, installs cassandra: i want run playbook locally, , have install boot2docker. able ssh boot2docker using instructions this answer : $ ssh -i $home/.ssh/id_boot2docker -p 2022 docker@localhost ## . ## ## ## == ## ## ## ## === /""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\______/ _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ | '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__| | |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ | |_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| boot2docker version 1.4.1, build master : 86f7ec...

java - image rotation method leaves something in the ram -

i working on game , more diversity of graphics want call rotate(bufferedimage imgold, int deg) method few hundred times rotate graphics (eg. tree stumps). with unrotated graphics never had issues memory. started use rotator error occurred if didn't reduce amount of rotated images drastically (like 95% drastically). the error occurred inside of rotate(bufferedimage imgold, int deg) method , since started rotate massive amounts of images suppose there must leftovers inside memory rotate(bufferedimage imgold, int deg) method don't know how deal with. here see code of class rotator: package movement; import java.awt.graphics2d; import java.awt.geom.affinetransform; import java.awt.image.bufferedimage; public class rotator { public static bufferedimage rotate(bufferedimage imgold, int deg){ //parameters method image rotate , rate of rotation in degrees affinetransform @ = affinetra...

javascript - css3 transition is not smooth in safari -

i'm rebuilding someone's else css3 transition make work across safari, chrome, , firefox. in version (mouse on package images), transition works in safari, not in other two: elements stuck in "up" position. in version , transition runs smoothly in ff , chrome, jerky in safari (plus it's not rotating). ideas? css below. .package-down { display: block; position: relative; height: 100%; float: left; width: 33.333%; margin: 0 0 0 0; transform: rotate(0deg) ; -webkit-transition: margin .1s ease, transform .25s ease; -moz-transition: margin .1s ease, transform .25s ease; -o-transition: margin .1s ease, transform .25s ease; transition: margin .1s ease, transform .25s ease; } .package-up { display: block; position: relative; height: 100%; float: left; width: 33.333%; margin: -50px 0 0 0; transform: rotate(-2deg); -webkit-transition: margin .1s ease, transform .25s ease-out; -moz-transition: margin .1s ease, transform .25s ease-out; -o-transition: margin .1s ease...

ios - Xcode Interface Builder Segue Animation -

Image
i have added few segues between different view controllers through interface builder. transition animation same (view pulled bottom). how can have different segues using different transitions pulled in left or right. far can seem find results relating building custom transitions happily use existing ones left/right transition seen when using navigation controller. you can use predefined animations.. just click segue storyboard, , in right side panel, click show attributes inspector icon, , see dropdown choosing animation shown in image below:

lua - Why set underscores equal to a function? -

i've searched answer here , elsewhere online, topics deal either iterating table, metatables, or times when _,var1 = do_some_stuff() not case here. this non-realistic function, containing examples of mean: function do_some_stuff(data) _ = some_function(data) some_other_code _ = some_other_function(data) end wouldn't considered same entering: function do_some_stuff(data) some_function(data) some_other_code some_other_function(data) end i know if create basic lua program both versions run same: function hello(state) print("world") end function ugh(state) _ = hello(state) -- , w/ hello(state) end ugh(state) i know if there can time _ = some_function() necessary? there no benefit _ = do_some_stuff() , rather using do_some_stuff() fine , more accepted. underscore provides no benefit when used in way. thanks etan reisner , mud , clarification.

qt - How to design a multi-level fluid layout in QML -

Image
i have designed layout in qml learn more features , have questions on "best practices" in designing such layout. here is: it columnlayout consisted of 3 rowlayout s, each 1 rectangle s. size of each row , rectangle should calculate such as: first row: height = 40%, width = 100% red rectangle filling whole area second row: height = 20%, width = 100% dark-green rectangle: height = 100%, width = 20%, light-green rectangle: height = 100%, width = 80% third row: height = 40%, width = 100% dark-blue rectangle: height = 100%, width = 40%, blue rectangle: height = 100%, width = 20% light-blue rectangle: height = 100%, width = 40% the qml have came working , in following. have questions it: i have set width , height percentages using layout.preferredheight: x*parent.height pattern. other options caused issues (e.g. preferredheight caused binding loop warnings). approach correct , efficient? as hack, set layout.fillwidth: true first element of row #2 ...

c# - Signal R - Handling a disconnect outside of a hub -

i trying accomplish sending data client methods controller method returns response when instance client disconnected. controller currently.. public void somemethod(){ ihubcontext hubcontext = globalhost.connectionmanager.gethubcontext<myhub>(); while(true){ hubcontext.clients.all.addnamevalue(name,value); } } what like.. bool someproperty = false public string somemethod(){ ihubcontext hubcontext = globalhost.connectionmanager.gethubcontext<myhub>(); while(true & (someproperty == false)){ hubcontext.clients.all.addnamevalue(name,value); } return "done"; } since know client disconnects hub overrided method.. hub public override task ondisconnected(bool stopcalled = true) { console.writeline("hub disconnected: {0}\n", context.connectionid); return (base.ondisconnected(stopcalled)); } is there way outside hub keep track of controller instance can done? p...

javascript - What technique is used to create a div limited by the page fold? -

skipping discussion importance of fold in web design, i'd know technique used limit specific section (could div, example) on browser fold considering responsive design. websites use both mouse scroll , button slide section below. ex.: next my point not slide itself, how each section renders on fold regardless of monitor resolution. you might try using css unit of measurement vh . have div want take half screen (viewport) this: div{ height: 50vh; } vh stands "viewport height" , used percentage. have div take 100% of view-able area (viewport), regardless of screen size or resolution this: div { height: 100vh; }

PHP MYSQL - Filter and sort function -

i m working on filter , sort option website , seem stuck. whole code can seen here: http://pastebin.com/pyfnlisz it's not 100% complete ... parts this if(array_key_exists('number', $sorts)) { $issue = $sorts['number']; $setissue = "and i.item_number = ?"; } still need edited bit, hope it's understandable. the part can't figure out this(line 126 in pastebin): if( !empty($userids) && $letter ) { $ref = array(); foreach($userids $id) { $ref[] = $id['followed']; } $ref[] = $letter; $params = implode(",", array_fill(0, count($userids), "?"))."?"; $prep = implode("", array_fill(0, count($userids), "i"))."s"; } i'm not sure how make above if dynamic. need if $userids array not empty , either $...

osx - NSTimer Don't Accept ToInt() -

i trying nstimer.scheduledtimerwithtimeinterval . have string , i'm getting int substringtoindex im converting int value toint() nstimer don't accept. var time = cleantext.substringtoindex(advance(cleantext.startindex, 2)) let time2:int = time.toint()! var timer = nstimer.scheduledtimerwithtimeinterval(time2, target: self, selector: selector(""), userinfo: nil, repeats: false) what solution? this prototype of nstimer.schdeuledtimerwithtimeinterval + (nstimer *)scheduledtimerwithtimeinterval:(nstimeinterval)ti invocation:(nsinvocation *)invocation repeats:(bool)yesorno; where ti parameter of type nstimeinterval in turn double ... typedef double nstimeinterval; so instead of integer use double like 2.0 instead of 2

ruby - How to use Sequel with PostGIS -

i using sequel gem access multiple postgres databases. databases partially use postgis extension. there postgis adapter activerecord, haven't found 1 sequel. so current solution use raw sql query postgis based data. there better way? currently using raw sql in ar well, no, think raw sql may plain solution this.

angularjs - IE 10 iframe not rendering -

this in angular app believe error lies solely in ie relates iframe , src attribute. renders fine in chrome. large app it's hard silo error in jsfiddle. here pertinent pieces. the html/angular markdown: <div ng-repeat="form in formstoprint"> <h5>{{ form.formname }} - {{ form.pagestatus }}</h5> <iframe ng-if="form.formid != '9' && form.formid != '10'" ng-src="{{ form.pagesrcurl }}" print-iframe seamless="seamless"></iframe> <div ng-if="form.formid == '9'" ng-repeat="srp in srpstoprint"> <h5>{{ srp.srpcode }} - {{ srp.pagestatus }}</h5> <iframe ng-src="{{ srp.pagesrcurl }}" print-iframe seamless="seamless"></iframe> </div> <div ng-if="form.formid == '10'" ng-repeat="srp in localpackages...

ios8 - Set collection type swift -

i learning swift through apple's documentation , on collection types chapter , in sets section. 1 of examples this var letters = set<character>() but when go enter following error. error: use of unresolved identifier 'set' var letters = set<character>() there revision on sets according documentation, nothing helping me there. native set available since swift 1.2. everthing points you're using lower version. swift 1.2 , xcode 6.3 beta new native set data structure — unordered collection of unique elements bridges nsset , provides value semantics array , dictionary.

properties - How to declare in Swift a function parameter that is a property name -

i want have class can access specified property in class @ runtime. guessing possible if pass closure or function in parameter. example: class x { let pointfunction : (thing) -> (cgpoint) init(pointfunction : (thing) -> (cgpoint)) { self.pointfunction = pointfunction } func action(#thing : thing) { var p = pointfunction(thing) ... } } and class func getposition(thing : thing) -> cgpoint { return thing.whereami } then pass getposition when creating x. but there syntax can pass in whereami function name? then, in action method can do: thing.pointfunction you need thing->cgpoint . function literal function there: let x = x(pointfunction: {$0.whereami}) if promise whereami method rather property, other tricks (see http://oleb.net/blog/2014/07/swift-instance-methods-curried-functions/ ), works methods. inexplicably imo swift properties not methods. if were, pass thing.whereami . that said, you...

knockout.js - How to data-bind "mousedown" instead of "click" on an HTML button? -

i have following button using data-bind="click: ..." , wondering if @ possible use "mousedown" instead of "click". <span style="cursor:pointer" class="button button--sm" data-bind="click: setversion9, css: { 'button--primary': isversion9selected() }">code version 9</span> currently when clicking ui button, if press , release of mouse button happens quickly, causes problems switching between text boxes (ie: copies text 1 box on next one). hoping using "mousedown" resolve issue wouldn't have worry clicking button fast. you can use event binding events don't have first-class-citizen binding as described here . <span style="cursor:pointer" class="button button--sm" data-bind="event: { mousedown: setversion9 }, css: { 'button--primary': isversion9selected() }">code version 9</span>

c# - Syntactic sugar in Web Api - how to omit [FromBody] -

is possible omit writing [frombody] ? [httppost] public string somemethod([frombody]somemodel model) { return "ok"; } should apply global attribute? how achieve this? the model binding attributes in mvc 5 specify " bindingsource " each parameter on action , can specify each property on controller, too. can see code picks frombody attribute in bodymodelbinder let me first should beware of beta6 (and think point in beta5), having multiple parameters/properties bindingsource.body not allowed , , not able use actions if have multiple parameters left default. might desirable if want annotate more; guess not. you can see in defaultapidescriptionprovider default source set; unfortunately, there no hook @ point tie into, , method private , not virtual; you'll need re-implement entire class. once have, though, it's rather easy register in configureservices use instead: services.tryadd(servicedescriptor.transient<iapidescriptionprov...

post's category (forum) in xf_post (xenforo) -

i want display posts threads 1 category (forum) but: xf_post http://screenshu.com/static/uploads/temporary/c8/xy/5d/zia0a4.jpg as can see, there no cell category (forum). want know if can other table? on database: xf_node: nodes (category , forum , page , ect) : node_id , parent_node , ... xf_thread: threads with: thread_id , node_id post_id (xf_post) --> thread_id (xf_post , xf_thread) --> node_id (xf_thread , xf_node). or node_id(xf_thread , xf_node) --> thread_id (xf_post , xf_thread) --> post_id (xf_post)

How to import OpenSSL in python -

i trying run simple code retrieve ssl certificate: import ssl, socket #print ssl.get_server_certificate(('www.google.com', 443)) cert=ssl.get_server_certificate(('www.google.com', 443)) # openssl x509 = openssl.crypto.load_certificate(openssl.crypto.filetype_pem, cert) x509.get_subject().get_components() but error saying: traceback (most recent call last): file "c:\users\e\desktop\python\ssl\test.py", line 6, in <module> x509 = openssl.crypto.load_certificate(openssl.crypto.filetype_pem, cert) nameerror: name 'openssl' not defined i aware have import openssl. not know how? , openssl from? downloaded module called pyopenssl https://pypi.python.org/pypi/pyopenssl contains 2 folders: pyopenssl-0.15.1.dist-info , openssl. when tried add import openssl or import pyopenssl errors. can explain please, how import these libraries or modules? should placed? if not in same directory of code file? how write path in import syntax?? pleas...

java - ServletRequest.getParameterValues returns only first value -

i assigning integer converted string value hidden input through loop s1 loop iterator. <% int k=0; string s1 = null; while(mar.next()){ k++; s1 = integer.tostring(k);%> <table> <tr><td><b>user name </b> </td> <td><%= mar.getstring("username") %></td></tr> <tr><td><b>type </b></td><td> <%= mar.getstring("type") %></td></tr> <tr><td><b>complain </b></td> <td><%= mar.getstring("complaint") %></td></tr> <tr><td><b>status </b> </td> <td><%= mar.getstring("status") %></td></tr> <tr><td><b>date </b> </td> <td><%= mar.getstring("date") %></td></tr> </table> <form action = "demo1.jsp" method = "post"> <% out.println(mar....

url - PHP $_GET request not working -

i'm new php , answer might easy after several search didn't manage fix simple issue. so i'm trying params url using $_get, here sample code: <?php $ee = $_get["search"]; $fp = fopen('results.json', 'w'); fwrite($fp, "ee : [" . $ee . "]"); fclose($fp); ?> the url use following: http://localhost:63342/friend-s-app/sources/home.html?search=test the json file contains: ee : [] from understood should : ee: [test] here's code i'm calling (angularjs) $http.post("../datas/getprojects.php"). success(function() { $http.get("../datas/results.json") .success(function (response) { $scope.tiles = response.records; }); }); any idea on how fix it? the php code you've provided needs live in file you're accessing url. since that's case, needs "home.php", not "home.html"....

html - How do I get this div to the center? -

so, got currently: http://gyazo.com/5d30270a775462fef170283162a9152e how second sort of table @ same position button, in center? tried everything, can't think of else. please me! current code: .flat-table { display: inline-block; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 115%; overflow: auto; width: 90%; text-align: center; float: right; } th { background-color: #f95252; color: white; font-weight: normal; padding: 20px 30px; text-align: center; } td { background-color: #fff; color: rgb(111, 111, 111); padding: 20px 30px; } this code of table. what do? thanks! make sure surrounding div's floated , align in div center using: margin: 0 auto; look @ example : <div class="top">menu</div> <div class="middle"> <table> <tr><td>test1</td></tr> <tr><td>test2</td...

python cassandra driver : Error attempting to reconnect -

i use python-cassandra driver, , cassandra cluster @ aws. there lots of warning when connecting remotely. have same issue? import cassandra cassandra.cluster import cluster ... in [3]:cassandra. version out[3]:'2.5.1' warning:cassandra.pool:error attempting reconnect 172.31.24.108, scheduling retry in 128.0 seconds: timed out connecting 172.31.24.108

jquery - select the data between two dates from a json data -

i have json file data as, [ [1,622,782,783,"2015-04-21"], [2,622,782,783,"2015-04-21"], [3,622,782,783,"2015-04-22"], [4,622,782,783,"2015-04-23"], [5,622,782,783,"2015-04-24"], [6,622,782,783,"2015-04-28"], [7,622,782,783,"2015-04-28"], [8,622,782,783,"2015-04-29"], [9,622,782,783,"2015-05-04"], [10,622,782,783,"2015-05-05"] ] how can select/load values between dates 2015-04-23 , 2015-04-28 ? quick option here: var data = [ [1, 622, 782, 783, "2015-04-21"], [2, 622, 782, 783, "2015-04-21"], [3, 622, 782, 783, "2015-04-22"], [4, 622, 782, 783, "2015-04-23"], [5, 622, 782, 783, "2015-04-24"], [6, 622, 782, 783, "2015-04-28"], [7, 622, 782, 783, "2015-04-28"], [8, 622, 782, 783, "2015-04-29"], [9, 622, 782, 783, "2015-05-04"], [10, 622, 782, 783, ...

c++ - Find number of rows/columns in a GSL matrix? -

say have gsl_matrix * a . want write function retrieves e.g. number of rows in matrix, without having access else besides object itself. example: int num_rows(gsl_matrix * a){ //some operation(s) on find number of rows in matrix //store number in int r return r; } what write me? from https://www.gnu.org/software/gsl/manual/html_node/matrices.html gsl_matrix defined as: typedef struct { size_t size1; size_t size2; size_t tda; double * data; gsl_block * block; int owner; } gsl_matrix; and the number of rows size1. range of valid row indices runs 0 size1-1. size2 number of columns. range of valid column indices runs 0 size2-1. physical row dimension tda, or trailing dimension, specifies size of row of matrix laid out in memory. so if want number of rows in a use: int num_rows(gsl_matrix * a){ int r = a->size1; return r; }

java - How to upload files to server using JSP/Servlet? -

how can upload files server using jsp/servlet? tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input type="submit" /> </form> however, file name, not file content. when add enctype="multipart/form-data" <form> , request.getparameter() returns null . during research stumbled upon apache common fileupload . tried this: fileitemfactory factory = new diskfileitemfactory(); servletfileupload upload = new servletfileupload(factory); list items = upload.parserequest(request); // line died. unfortunately, servlet threw exception without clear message , cause. here stacktrace: severe: servlet.service() servlet uploadservlet threw exception javax.servlet.servletexception: servlet execution threw exception @ org.apache.catalina.core.applicationfilterchain.internaldofilter(...