Posts

jenkins - Python: How do you use lxml to parse xml tags with periods? -

i attempting parse jenkin's job xml files using lxml module python. looks this: <triggers> <hudson.triggers.timertrigger> <spec>h h(6-21)/3 * * *</spec> </hudson.triggers.timertrigger> i using lxml's handy objectify module, gets confused when try this: root.triggers.hudson.triggers.timertrigger.spec = 'something' i attributeerror: no such child: hudson . of course there's no attribute named hudson! how 1 work goofy piece of xml this? for additional context, here code: from lxml import objectify import jenkins j = jenkins.jenkins('http://local.jenkins.instance') xml = j.get_job_config('job_name') root = objectify.fromstring(xml) root.triggers.hudson.triggers.timertrigger.spec = 'something' it make sense triggers.hudson.triggers.timertrigger interpreted trying access <timertrigger> element in following structure, hence complained hudson child element not found when gi...

java - Creating an overlay activity -

i trying create overlay activity sitting in corner of screen taking small portion of screen, while rest of screen interactive tap on displaying on rest of screen. far unsuccessful in obtaining goal. have added these properties window don't seem work. hello.xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="50dp" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/tepp" > </relativelayout> what can solve problem? from can remember, 1 activity can active @ given time. while small activity in corner running, other activitys paused , wont able interact them. should try using fragment instead. can have multiple fragments visible @ same time. although believe 1 fragment can active @ given time activity , when click on different fragments, 1 click on becomes active , can interact it. might achieve looking for. ...

encryption - What SHA2 hash function does Realm dot net use -

on realm xamarin page says realm supports encrypting database file on disk aes-256+sha2 supplying 64-byte encryption key when creating realm. which sha2 hashing function use. sha256? yes, realm uses sha256 validate data integrity. curious difference makes? or curious?

javascript - VueJS: Loop through JSON-object -

i use json , loop through each items using vuejs' v-for . i'm using array store translations of dataset. translations located in data.translations . but happens: http://d.pr.it/1k1yb this source code of template: <!--suppress --> <template> <div class = "uk-form-row"> <span class = "uk-form-label">{{ data.type | trans }}</span> <div class = "uk-form-controls uk-form-controls-text"> <a href = "#{{ data.type }}" data-uk-modal class = "uk-placeholder uk-text-center uk-display-block uk-margin-remove"> <p class = "uk-text-muted uk-margin-small-top">text...</p></a> </div> </div> <div id = "{{ data.type }}" class = "uk-modal"> <div class = "uk-modal-dialog uk-modal-dialog-large"> <ul class = "uk-tab" v-el:t...

java - How to get class reference for a generic class -

i new java (coming actionscript 3.0 background) , trying port actionscript code java (as3signals jsignal) i trying class name of generic class in order pass super call. in actionscript 3.0 super(vector.<tilevo>,boolean); the above piece of code pass class references constructor vector of tilevo , boolean. in java doesn't seem work , know doing wrong: super(asvector.class<tilevo>,boolean.class); to write short, how class reference asvector class composed of tilevo objects? thank you! later edit: i realised code not displayed (treated html) posting source code: public signal(class<?>... params) { this.params = params; } i need pass signal class references via constructor. new signal(int.class) example works i need know how can pass signal's constructor class of object of form: asvector<tilevo> i tried asvector.class<tilevo> , doesn't seem work! at compile time, generic type paramete...

node.js - How do I make this curl call with nodejs request module -

i able send request browsermob using curl so: curl -x put -d "pageref=car" localhost:9000/proxy/8081/har/pageref . however, inside nodejs using request module. equivalent command using request module? assume request.put(url, data, callback) when try request.put('localhost:9000/proxy/8081/har/pageref', {form: { pageref: encodeuri(browser.platform) + encodeuri(browser.browsername) + encodeuri(browser.version) }}) , get error: invalid protocol @ request.self._buildrequest (/users/dragonite/pixel/node_modules/request/request.js:336:53) @ request.init (/users/dragonite/pixel/node_modules/request/request.js:503:10) @ new request (/users/dragonite/pixel/node_modules/request/request.js:97:8) @ request (/users/dragonite/pixel/node_modules/request/index.js:50:11) @ function.request.put (/users/dragonite/pixel/node_modules/request/index.js:121:27) @ repl:1:10 @ replserver.self.eval (repl.js:110:21) @ interface.<anonymous> (repl.js:239...

What is the best practice for a jenkins hearbeat script? -

i have multiple jenkins instances running not have slave/master relationship. best way have them monitor each other , warn admin if 1 instance goes down. current approach using have job on instance triggers job on instance b, in turn checks resources of instance b healthy. instance b performs same trigger process on instance a. setup? best way trigger job , output status? is setup? if works use case, setup; is, don't find tweaking scripts frequently, or being falsely alarmed. there may cases using job queue problematic - e.g. there many jobs execute before one, or long-running ones block heartbeat processed. then, perhaps possible keep 1 job executor free perform jobs heartbeat; 1 (job restrictions) seems fit. additionally, coupling heartbeats sequentially means after first failure, there no more information other nodes in sequence; when instance down, don't know state of instance b. i'd check server monitoring software: nagios , cacti etc. you...