Posts

Showing posts from August, 2015

How to get the list of all projects/jobs in jenkins using java programaticaly? -

i newbie jenkins , trying access list of jobs/projects in jenkins , project files in java not groovy , parsing xml files. ps: feel free edit thread! if downvoting comment reason! like @vitalii said better in groovy or other scripting languages or parse api/xml file workspace job list. for case can making class extending trigger , using job object of class trigger. note: include other default classes jenkins plugin requires , make sure plugin runs every minute code execute properly. public class xyz extends trigger<buildableitem> { @override public void run() { logger.info("project name"+job.getname()); } }

javascript - AngularJS - Click event (in directive) triggers when anywhere in the parent is clicked -

Image
i'm going best explain issue - bear me. this whole thing directive file selection: the directive has ng-transclude component contains few directives, contained in own divs. parent directive: <div class="extra-cells"> <div ng-transclude class="extra-cells-row"></div> </div> ng-transclude content: <div file-upload-directive> <div bo-if="config.drive"> <div google-picker> <div>google drive</div> </div> </div> <div bo-if="config.dropbox"> <div dropbox-chooser> <div>dropbox</div> </div> </div> <div bo-if="config.link"> <div ng-click="selectlink()"> <div>paste link</div> </div> </div> </div> ng-transclude content(visual): the click event...

json - Trouble with new fields in Nest API data model? -

com mates- i notice nest (late may 2015) added hvac_state , wheres api data model. not, however, see these new fields in json output when querying device. there roll-out date these new fields or else missing? else see hvac_state , wheres ? much thanks, nick looks have change permissions client in nest developer site v3.

r - Interpolating Gridded 3D Data to a finer scale -

Image
i have netcdf file of probability surface. it's 30x30 grid of 0.25 degree lat/lon intervals probability surface described in z dimension. can import panoply, netcdf viewer: and it's breeze (checking 1 box) interpolate/smooth raw data finer grid size: however, don't want visualize data, want plot in r along bathymetry , point data. no problem, have not found straightforward way interpolate gridded data in r. here's code use import , plot data: library(rnetcdf) nc <- open.nc("132235-1.nc") print.nc(nc) tmp <- read.nc(nc) probs<-tmp$likelihoods xran <- range(tmp$longitude) yran <- range(tmp$latitude) zran <- range(probs,na.rm=t) lon <- tmp$longitude lat <- tmp$latitude[30:1] z <- array(probs, dim=dim(probs)) z <- z[,rev(seq(ncol(z)))] z <- z[,seq(ncol(z))] prob.pal<-colorramppalette( c("#c1ffc1","#8fbc8f","#2f4f4f") ) zbreaks <- seq(0.0001, 0.063, by=0.001) cols<- c(p...

android - What is CoordinatorLayout? -

just had @ demo app of new android support design library. it's provided chris banes on github . throught app, coordinatorlayout used heavily. also, many of support design library classes such floatingactionbutton , snackbar , appbarlayout etc. behaves differently when used inside coordinatorlayout . can please shed lights on coordinatorlayout , how different other viewgroup s in android, or @ least provide correct path towards learning coordinatorlayout . here looking for. from docs the design library introduces coordinatorlayout , layout provides additional level of control on touch events between child views, many of components in design library take advantage of. https://android-developers.googleblog.com/2015/05/android-design-support-library.html in link see demo videos of above mentioned views. hope helps :)

html - Cannot center a row -

Image
i have 4 columns in row , cannot row centered. it's weird... if @ pic @ bottom, can see row not centered looking @ vertical border under "most read" blue square. html file: <div class="block-section"> <div class="sm-section-wrapper"> <div class="row"> <div class="sm-preview-title"> read </div> </div> <div class="row"> <div class="col-3"> <div class="sm-preview-wrapper"> <h3 class="preview-sm"> hello world </h3> <h2 class="preview-sm"> vestibulum id ligula porta felis euismod semper. </h2> </div> </div> <div class="col-3"> <div class="sm-preview-wrapper"> <h3 class="preview-sm"> ...

php - Throttling attempts not being recorded into database -

hi trying create login throttling object oriented php, have created structured code can not work object oriented far heres code: public function find_failed_login($email = null) { if(!empty($email)) { $query = "select * {$this->table} email = '".$this->db->escape($email)."'"; return $this->db->query($query); } } public function record_failed_login($email) { $count = 1; $time = time(); $failed_login = $this->find_failed_login($email); if(!$failed_login) { $query = "insert {$this->table} (email, count, last_time) values ('".$this->db->escape($email)."', {$count}, {$time})"; return $this->db->query($query); } else { $query = "update {$this->table} set email = '{$email}', count = count + 1, last_time = {$time}"; ...

java - Timer not resuming after game loosing focus -

i have recurring task. schedule in standard way ( timer libgdx one: com.badlogic.gdx.utils.timer ): timer.schedule(mytask, 2, 2); when user wants pause game, call: timer.instance().stop(); to pause execution of task. when user resumes game call: timer.instance().start(); this works well, if user: pauses game makes game loose focus (e.g, focusing on different window) resumes game the task never fired again. ideas how can solved? update i've opened issue possible bug in libgdx : https://github.com/libgdx/libgdx/issues/3181 turns out indeed bug in libgdx. fixed , issue gone (i'm using libgdx 1.6.2-snapshot version). thanks go great team of libgdx!

c - Strange error while adding a feature to my little game (0xC0000005) -

hello everyone, i decided time ago write own version of minesweepers practice , did it. game ran perfectly, after deciding add "choose difficulty" option window freezes , error message, saying program not respond. line 0xc0000005 appeares. have tryed many, many things: moving code main() seperate function( now in int playgame() ), allocating more memory in heap, creating seperate .c file store piece of code, nothing worked sofar. came code after few weeks, still have no clue why happening. can me this? hope code not hard read. added comments explaining what. still new c. #include <stdio.h> #include <stdlib.h> #include <time.h> #include "diflvl.c" int displayfiled(char **field); //prints out map of field int combine(char answer, int answer1); //combines user input , field numeration int randomizer(int **minearray); //generates random mine map int difficulty(); int playgame(); int main(){ ...

javascript - error reading the response :Invalid XML error -

Image
i m checking if username exists in database using ajax php& mysql. browser throwing following error in popup: error reading response: invalid xml my hanleserverresponse() function: function handleserverresponse() { // retrieve server's response packaged xml dom object var xmlresponse = xmlhttp.responsexml; // catching potential errors ie , opera if (!xmlresponse || !xmlresponse.documentelement) throw("invalid xml structure:\n" + xmlhttp.responsetext); // catching potential errors firefox var rootnodename = xmlresponse.documentelement.nodename; if (rootnodename == "parsererror") throw("invalid xml structure:\n" + xmlhttp.responsetext); // getting root element (the document element) xmlroot = xmlresponse.documentelement; // testing received xml document expect if (rootnodename != "response" || !xmlroot.firstchild) throw("invalid xml structure:\n...

getDuration on mp3 file streams: java.io.IOException: mark/reset not supported -

i use getduration on local mp3file successfully, when getduration on remote mp3stream results in error: java.io.ioexception: mark/reset not supported. successful getduration on local mp3: public static void getdurationoff() throws unsupportedaudiofileexception, ioexception { int sumtime = 0; file file = new file("d:\\java\\musicmp3\\src\\images\\water_lily.mp3"); audiofileformat fileformat = audiosystem.getaudiofileformat(file); if (fileformat instanceof taudiofileformat) { map<?, ?> properties = ((taudiofileformat) fileformat).properties(); long microseconds = (long) properties.get("duration"); //total seconds sumtime = (int)(microseconds / 1000000); system.out.println("total seconds :"+sumtime); } } failed getduration on remote mp3: public static void getdurationon() throws unsupportedaudiofileexception, ioexception { ...

asp.net - Foreach bind items to Datatable with C# and JSON -

datatable dtinventory = new datatable(); dtinventory.columns.add("itemid", typeof(string)); dtinventory.columns.add("itemimageurl", typeof(string)); dtinventory.columns.add("itemname", typeof(string)); dtinventory.columns.add("tradeable", typeof(string)); string json = new webclient().downloadstring("storejson.txt"); jtoken jsoninventory = jtoken.parse(json); jobject jsonitemdata = jsoninventory["storedata"].value<jobject>(); foreach (jproperty jitemid in jsonitemdata.properties()) { string sitemid = jitemid.name.trim().tostring(); (int = 0; < jsonitemdata.count; i++) { datarow dtrow = dtinventory.newrow(); dtrow["itemid"] = sitemid.tostring(); dtrow["itemimageurl"] = jsonitemdata[sitemid]["icon_url"].tostring(); dtrow["itemname"] = jsonitemdata[sitemid]["m...

c++ - unable to determine the template type even it is passed in -

this question has answer here: where , why have put “template” , “typename” keywords? 5 answers i have following code: template <typename t> struct data { struct embed { t t; }; }; struct functor { template <typename t> void foo( typename data<t>::embed & e) {} }; template <typename t, typename f> struct caller { f f; template <typename t> void invoke() { typename data<t>::embed e; f.foo<t>(e); //compiler error pointed line } }; then specialized template as: caller<int, functor> c; c.invoke(); compiler error : error: expected primary-expression before '>' in f.foo<t>(e); line. seems compiler doesn't know t specified in template declaration on function. take out explicit specified t in foo.invoke(e) line result could not deduce tem...

mongodb - $elemMatch (projection) returns selected array element -

var ids = ['50478c35889a450000000001', '50478c35889a450000000002']; var posteridarray = ['50478c35889a450000000234', '50478c35889a450000000234']; post.find({_id: {$in: posteridarray}) .select({ comments: { $elemmatch: {$in: ids }}}) .exec(function (err, doc) { console.log(doc.comments); // ['50478c35889a450000000001'] }); // note: returns 1 comment id // need find post comments restricted id , filter

regex - RewriteRule acting strange -

i want url this: localhost/dir/images/pic1.jpg to rewriten to: localhost/dir/subdir/index.php?folder=images&picture=pic1.jpg so put simple .htaccess file in localhost/dir/ : rewriteengine on rewriterule ^(.*)/(.*)$ subdir/index.php?folder=$1&picture=$2 [l] and expect folder='images' , picture='pic1.jpg' in localhost/dir/subdir/index.php instead have folder='subdir' , picture='index.php'   strange thing when modify .htaccess file call index.php same directory (not 'subdir') works well: rewriteengine on rewriterule ^(.*)/(.*)$ index.php?folder=$1&picture=$2 [l] i folder='images' , picture='pic1.jpg' in localhost/dir/index.php script that happening because rewrite rule looping , matching target string subdir/index.php pattern .*/.* . use condition stop loop: rewriteengine on # if request not valid directory rewritecond %{request_filename} !-d # if request not valid file rewriteco...

c# - “Invalid mode encountered: 9” when decoding with NSpeex -

here code: public byte[] decode(byte[] encodeddata) { short[] decodedframe = new short[160]; // should same number of samples on capturing side int decoderbytes = decoder.decode(encodeddata, 0, encodeddata.length, decodedframe, 0, false); } when call method: byte[] decodedbuffer = this.decode(file.readallbytes(@"c:\users\admin\desktop\123.ogg")); i “ invalid mode encountered: 9 ” error. how fix it? did wrong? you can try https://sites.google.com/site/cobnut3d/ there examples c #

php - PDOException “could not find driver” -

i have installed debian lenny apache, mysql, , php , receiving pdoexception could not find driver . this specific line of code referring to: $dbh = new pdo('mysql:host=' . db_host . ';dbname=' . db_name, db_user, db_pass) db_host , db_name , db_user , , db_pass constants have defined. works fine on production server (and on previous ubuntu server setup). is php installation? searching internet has not helped, experts-exchange , examples, no solutions. you need have module called pdo_mysql. looking following in phpinfo(), pdo_mysql pdo driver mysql, client library version => 5.1.44

android - Phonegap build issue with Plugins -

my first here .. last week have problem phonegap build .. my plugin tab doesnt catch plugins added !! for last week searched every single site .. doesnt have answer .. i have tried plugins cli way , phonegap build , npm , gpb add xmlns:gap .. changing version issue phonegap build want change 3.5 went 3.7 or 3.3 !! , search plugins working phonegap version didnt working -_- dont know more .. <?xml version='1.0' encoding='utf-8'?> <widget id="com.my.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <gap:plugin name="com.performanceactive.plugins.camera" version="1.4" /> <gap:plugin name="org.apache.cordova.camera" version="0.2.3" /> <gap:plugin name="com.phonegap.plugins.barcodescanner" /> <gap:plugin name="org.apache.cordova...

compilation - What happens when I leave xmlns:android out? -

i digging around android project , found 1 of style.xml files missing namespace statement: xmlns:android="http://schemas.android.com/apk/res/android" . however, doesn't caused error (so far). brings me wonder if there necessity include namespace or there safety check?

c++ - How to set opacity to png image with transparent background using Magick++ -

Image
i'm using imagemagick render images. open png file magick::image , draw on magick::image , set opacity png image. , save jpg file . in saved file transparent background becomes black. example code: image newimage; newimage.size(geometry(1000, 1000)); newimage.fillcolor(color(50, transparentopacity / 2, 50)); newimage.draw(drawablerectangle(0, 0, 1000, 1000)); image originalimage("test-image-1.png"); originalimage.opacity(transparentopacity / 2); newimage.composite( originalimage, 300, 100, atopcompositeop ); newimage.magick("jpg"); newimage.write("testimage3.jpg"); is possible set transparency 50% image , full transparent background? the issue line: originalimage.opacity(transparentopacity / 2); the source, "test-image-1.png", has alpha-channel looks like... when set opacity 50%, you're setting whole channel, not reducing level 50%. alpha-channel altered originalimage.o...

routing - SAPUI5: Is it possible to map a folder like structure to a list control in sap.m Master view? -

i want map folder structure list control in sap.m master view. please have @ thie demo app named shopping cart . see master->master->detail navigation. category products (product) detail. i studied source code. navigation above realized using routing. for projects, have similar. however, no simple m->m->d structure. data received in json form sap enterprise portal folder structure. each folder can have other folders or files. data structure like this, may have n levels of folders: { "root": [ { "name" : "folder a", "iscollection": true, "content" : [ { "name" : "sub folder a", "iscollection": true, "content" : [ {"filename":"ipsumprimisin.xls","datatype":"application/vnd.ms-excel"},{"filename":"idornare.mp3","datatype":"audio/x-mpeg-3"} ] } ] }, {...

mysql - Match Where Multiple Columns are... PHP PDO -

i have search query works, not way had hope. here: try{ /* create search query. */ //include database config file. include('config.php'); //get values angular. $valuespost=$_post; $values=array(); foreach ($valuespost $rows) { $decodedvalues=json_decode($rows, true); $values[]=$decodedvalues; } //get table post values. $table=$values[0]["table"]; //get limit post values. $limit=$values[0]["limit"]; //get offset post values. $offset=$values[0]["offset"]; //get orderby post values. $orderby=$values[0]["orderby"]; //unset whole array unset($values[0]); //create cats fields $cats=array_keys($values[1]); if(empty($cats)) { $cats = null; } else { foreach($cats &$val){ $val="cat_id = :".$val; } $cats=implode(" or ", $cats); ...

Django Rest Framework Routers with multiple viewsets -

i attempting create api using drf 3.1. started creating manangement functions using modelviewset , registering these defaultrouter. worked , default api root view generated appropriate links when viewed in browser. created more restricted viewsets standard users using readonlymodelviewset, problem occurred when tried register these restricted viewsets router readonlymodelviewsets appear overwrite links on api root view. generated urls appear work when typed browser links on api root view not expected serializers.py class adminunitserializer(serializers.hyperlinkedmodelserializer): ''' model serializer admin users containing fields ''' url = hyperlinkedidentityfield(view_name='unit-detail') class meta: model = unit fields = ('url', 'id', 'name', 'symbol', 'converters_from', 'converters_to') class userunitserializer(serializers.hyperlinkedmodelserializer): ''' model serializer ...

scala - In one-to-many, how to express "where exists" in slick? -

let's assume 2 tables: cats, cat personality traits, personality_trait were cat has id , personality_trait has id , string trait . e.g. == cat == id | name --------------- 0 | tom 1 | garfield 2 | kitty == personality_trait === id | trait --------------- 0 | stubborn 1 | stubborn 1 | sleepy 1 | moody 2 | sleepy 2 | moody how cats have @ least traits i'm interested in? e.g. how garfield when i'm looking stubborn , moody i thinking of like personality_trait.groupby(_.id).filter { case (id, traits) => <predicate on traits> }.map(_._1) i found solution, albeit inelegant , potentially inefficient: val desiredtraits = set("stubborn", "moody") (for { catid <- personality_trait.filter(_.trait insetbind desiredtraits) .groupby(_.id).map { case (txnid, foundtraits) => (txnid, foundtraits.length) }.filter { case (txnid, foundtraitcoun...

laravel - Updating a pivot table -

i have pivot table id | product_id | user_id i wish update pivot table, by: product::find($productid)->attach($userid); this produce like id | product_id | user_id 1 1 1 but when again not want update pivot table if values exists. the above attach method like: id | product_id | user_id 1 1 1 1 1 1 i know can use sync, removes table, not wish this. know can use: product::find(1)->user()->updateexistingpivot(1, []); but works when data in table. what im looking way firstorcreate on pivot table. you can add boolean sync method adds value , doesn't remove existing value. the code looks this. first value can int or array. product::find(1)->user()->sync([1], false);

scala - Pattern match on Tuple2 of Success -

i have 2 future s of try , want if both of them complete. both future s independent. here code def a1: future[try[string]] = future { success("a1") } def a2: future[try[int]] = future { success(2) } val r1 = { c1 <- a1 c2 <- a2 } yield (c1, c2) r1.map { case tpl: (success[string], success[int]) => println("success") case _ => println("failure") } this prints success . problem because pattern matching on tuple2 , because of erasure if second element failure first case executed. if change a2 def a2: future[try[int]] = future { failure(new internalerror("error")) } and again execute this val r1 = { c1 <- a1 c2 <- a2 } yield (c1, c2) r1.map { case tpl: (success[string], success[int]) => println("success") case _ => println("failure") } now when a2 returns failure above code still prints success . how fix this? non pretty solution check elements of tuple...

javascript - Is it possible to publish items with multiple conditional fields from a collection? -

consider case, have party object, party object has few info fields party, location, time, guests, etc.. has few fields set privacy of info fields, showlocation, showguests, etc.. these hide info users not invited. how can send client fields "show" field true? when publish single item can use this: (merge not real function) meteor.publish("party", function (_id) { var party = parties.findone({_id: _id}); var fields = merge( {name: 1, title: 1, creatoruserid: 1}, (party.showlocationanddate ? {location: 1, date: 1} : null), (party.showguests ? {guests: 1} : null) ); return parties.find({_id: _id}, {fields: fields}); }); when publish multiple items single condition can use this: meteor.publish("parties", function () { var fieldswithlocation = { name: 1, title: 1, creatoruserid: 1, location: 1 }; var fieldswithoutlocation = { name: 1, title: 1,...

matlab - How to set Sample time for all components within a subsystem? -

Image
i have subsystem trying make, , within subsystem discrete filter block. trying place mask on subsystem, , have dialog set sampling rate of discrete filter block. possible , how? subsystem can seen on left & contents within on right. see documentation how sampling rate works subsystems, take @ this .

php - how to get id of unique column -

insert article , find tags in it insert 1 tag , 1 reference 1 one know last_insert_id() of tag $tags = array('strawberries','blueberries','food','strawberries') function hashtaginsert($tags) { /// commit transaction $lastinsertid = $this->db->lastid(); // last insert id of article foreach ($tags $val) { $sql = 'insert tags (tag, added) values (:tag, now()) on duplicate key update occurrence = occurrence + 1'; $this->db->boolquery($sql, array(':tag' => $val)); $sql2 = 'insert tags_refs (article_id, tag_id) values (:lastinsertid, last_insert_id())'; $this->db->boolquery($sql2, array(':lastinsertid' => $lastinsertid)); } } i wrote script take care of it. , works. unfortunately there bit problem duplicities because there unique column. if there duplicity there origin tag , don't know i...

angularjs - single cache for all subdomains -

i have project developed in angular . has 5 modules , each have sub-domain. example : drinks.example.com # lists drinks of particular user foods.example.com # lists foods particular user i able set cookie .example.com since there parameter option setcookie. but when create cache data, browser creates separate cache each of sub-domains. there way tell browser use same cache sub-domains.

vba - Me.dirty or Me.Recordset.EditMode -

which option best know if screen data have been modified or not. have form linked ado recordset. example use me.dirty or me.recordset.editmode . 1 choose? thx i think better me.recordset.editmode (more accurate think) so not using me.dirty flag testings (instead using recordset.editmode ) think better put correct value flag after modifying record setting me.dirty true or false

linux - Why my limit on CPU does not validate via cgroups -

/etc/cgconfig.conf ... group memlimit { memory { memory.limit_in_bytes = 8589934592; } } group cpulimit { cpu { cpu.shares = 1024; } } /etc/cgrules.conf: @gatewayer memory memlimit/ @gatewayer cpu cpulimit/ and i've restarted services via commands: service cgconfig restart service cgred restart after execute python script user belongs group gatewayer , see pid when executing cat /cgroup/memory/memlimit/cgroup.procs , limit have been applied on running process. however, limit on cpu not take effect, , cat /cgroup/cpu/cpulimit/cgroup.procs doesn't print pid expected. i tried check on process, , turns out same result, memory limited cgroups whereas cpu not: $ cat /proc/18113/cgroup 174:blkio:/ 173:net_cls:/ 172:freezer:/ 171:devices:/ 170:memory:/memlimit 169:cpuacct:/ 168:cpu:/ 167:cpuset:/ could give me help? many thanks. it seems cgroups setting cpu.shares should correctly applied. modern computer have mu...

unicorn - NGINX not responding -

i have 3 sites configured on server using nginx , first 2 working fine. 1 static site , 1 running rails (using unicorn). have attempted mirror nginx/unicorn configurations. for non-working site, "problem loading site" in browser , absolutely nothing in nginx error logs (even @ debug level) or unicorn log. nothing when attempt curl site. i have double checked dns pinging domain name , running out of ideas. i've tried making default server , browsing ip address. thoughts on how should go debugging? @ least understand if nginx seeing these requests or not. nginx configuration: upstream unicorn-signup { server unix:/home/signup/app/tmp/sockets/unicorn.sock; } server { listen 80; listen [::]:80; root /home/signup/app/current/public; server_name signup.quote2bill.com; # configure unicorn (nginx acts reverse proxy) location / { try_files $uri @unicorn; } location @unicorn { ...

c# - Displaying multiple properties from a List<T> in a horizontal fashion in a Listbox -

i'm reasonably new c# (apprentice, 5 months in, 3 weeks training) , 1 of assignments create event driven computer program using c# in form of shopping basket. i'm nearing end of assignment , i'm designing shoppingbasketform . have class orderitem , contains properties productname , quantity etc. have class shoppingbasket , contains property of list<orderitem>orderitems . how go making lstboxbasket on form display list<orderitem>orderitems properties horizontally in shopping basket fashion? thanks in advance. eg of ideal display, ignore code block, easiest way show it: oranges 5 £1.20 apples 3 £0.80 oranges being productname , 5 being quantity , £1.20 being latestprice . as others have mentioned, if using datagridview or listview allowed, simple task. but since must use listbox , set drawmode property ownerdrawnfixed , , handle listbox.drawitem event, this: mylistbox.drawitem += new drawitemeventhandler(this.d...

mongodb - Upserting on embedded document -

i have following document strucutre { "_id" : "nmbyyasdsa", "objectid" : "asdsd" "text" : "test", .... "publishedat" : isodate("2015-05-28t15:31:51z"), "updatedat" : isodate("2015-05-28t15:31:51z"), "data" : { ..... "likecount" : 0, "replycount" : 0 } } that use synchronise database external api. this, poll api once every minute , bulk upsert, matching on object id keep database date. problem data subdocument doesn't updated when upserting, ideas why? my bulkwrite method mongo.collection.prototype.upsertbulk = function(matcher, documents, options) { if (_.isempty(documents)) { throw error('empty list of documents provided'); } options = options || {}; var operations = documents.map(function(_document) { _document._id = random.id(); var operation = { updat...

java.lang.NoSuchMethodError: org.hibernate.annotations.common.reflection.java.JavaReflectionManager.setMetadataProvider -

i error when trying use configuration.buildsessionfactory(serviceregistry) java.lang.nosuchmethoderror: org.hibernate.annotations.common.reflection.java.javareflectionmanager.setmetadataprovider here relevant hibernate dependencies : <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>4.3.10.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate</artifactid> <version>3.5.4.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>5.1.3.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid> hibernate-validator-annotation-processor </artifactid> <version...

How to change font-size of paper-input in Polymer 1.0 -

in polymer 1.0 can change font-size of iron-input component example: input { font-size: 24px; } if use iron-input component within paper-input-container not work. if use paper-input component not work well. so, how do it? in advance. you can using --paper-input-container-input mixin. can use on own element or via <style is="custom-style"> . don't forget semicolons after every mixin.

java - Representation of inner source-retained annotation -

we have class: public class myclass { @retention(retentionpolicy.source) private @interface myinterface { } @myinterface public void hello() { } } as can see, has inner, source-only annotation. question is: should exported binary (jar) contain myclass$myinterface.class file or not? if @ retention, can not, because annotation should discarded compiler. still added list of inner classes in myclass.class , , myclass$myinterface.class file created. when run an annotation processor against class public class myprocessedclass extends myclass {} the annotation processing fails if call myclass.getenclosedelements() and myclass$myinterface.class not present. processing ok, if myclass$myinterface.class present. ( original problem ) my question is: should exported binary (jar) contain myclass$myinterface.class file or not? it should. 13.1. form of binary : every class must contain symbolic references of member types, , local , ano...

Webpack plugin for rails assets compatible manifest -

i'm trying replace rails asset pipeline webpack based pipeline. i've got dev setup webpack-dev-server , hot reloading etc working beautifully. i'm trying achieve compilation step production mimic how rails compiles assets (digesting / generating compatible manifest.json file) such can still use helpers javascript_include_tag etc. i'm stuck. i've read lots of tutorials on using webpack rails, end writing own view helpers load assets. i'm trying avoid because don't want overhead or devs need understand different pipeline. want config asset_host= work out of box using cdn etc. ultimately, want similar gulp-rev-rails-manifest generates rails-asset-pipeline compatible manifest file on compilation, haven't found plugin (yet) exists webpack. so... is possible run webpack build through gulp stream using webpack only (ie not using gulp-webpack) can use above gulp plugin. reason don't want use gulp-webpack takes on entries / output etc , find w...

html - Floated span sticking to one line, but want to flow onto new lines -

i have list uses float show keys , values on alternative sides of div. the problem i'm having when there's long string key, floated, instead of breaking onto multiple lines, entire line moves down onto new line. here's example : http://jsfiddle.net/3djakgf7/ this displays fine, if there multiple values after weight loss surgery (for example, 'weight loss surgery, arm lift'), entire line drops down next, , interrupts flow of floats below. in example: http://jsfiddle.net/3djakgf7/1/ how can make float starts on line opposite left key, , drops down next line when runs out of room, , pushes following list items down line it? <ul class="post-meta"> <li> <span class="post-meta-key">procedure</span> <span class="pull-right">weight loss surgery, arm lift</span> </li> <li> <span class="post-meta-key">age</span> <span...

javascript - Jquery - Show current div when click a link and hide others -

when click on show/hide link shows both divs , want show related div. how can that? don't want use id's each div. jsfiddle <div class="main-box"> <a href="#" class="show_hide">show/hide</a> <div class="slidingdiv"> first div. </div> </div> <br/> <div class="main-box"> <a href="#" class="show_hide">show/hide</a> <div class="slidingdiv"> second div. </div> </div> and $(document).ready(function(){ $(".slidingdiv").hide(); $(".show_hide").show(); $('.show_hide').click(function(){ $(".slidingdiv").slidetoggle(); }); }); into click function, change code this: $(".slidingdiv").slideup(); $(this).next().slidetoggle(); https://jsfiddle.net/pzc8vy9b/6/

javascript - How get 400 Bad Request in variable -

i have answer rest - result = <400 bad request> and want show error user using angularjs. i have fuction in controller $scope.update = function (id) { topic.get({id: id}, function (result) { $scope.name = result; $('#savetopicmodal').modal('show'); console.log(result); }); }; please - how error in variable , show variable. thank you to access error have define error handler in description of angular $resource api. $scope.error = error; $scope.update = function (id) { topic.get({id: id}, function (result) { $scope.name = result; $('#savetopicmodal').modal('show'); console.log(result); }, function (error) { console.log(error); $scope.error = error;...

jquery object items in array not defined -

i have array filled objects so: var taskarray = [{ id: 247, value: "pin lot" }, { id: 249, value: "excavate" }, { id: 245, value: "water & sewer installed" }, { id: 246, value: "pin footings" }, { id: 248, value: "footings" }, { id: 251, value: "footing inspection & pour" }, { id: 250, value: "foundation walls" }]; and when go console logs so: console.log(taskarray); console.log(taskarray[0].taskid, taskarray[0].task); it says array empty. doing wrong ? the objects in array not have properties taskid , task . instead console.log(taskarray[0].id, taskarray[0].value); either use above or create array objects having properties taskid , task . var taskarray = [{ id: 247, value: "pin lot" }, { id: 249, value: "excavate" }, { id: 245, value: "water & sewer installed...

how to perform file upload using Volley in android? -

i want upload files(images,documents etc) android application server.i'm using volley library network calls in application. i'm using following code upload files not performing operation.(showing volley timeout error finally) public class multipartrequest extends request<string> { private multipartentity entity = new multipartentity(); private static final string file_part_name = "file"; private final response.listener<string> mlistener; private final file mfilepart; private string mstringpart,accesstoken; public multipartrequest(string url, response.errorlistener errorlistener, response.listener<string> listener, file file,string accesstoken) { super(method.post, url, errorlistener); mlistener = listener; mfilepart = file; this.accesstoken = accesstoken; buildmultipartentity(); } private void buildmultipartentity() { entity.addpart(file_part_name,...

c++ - Using DLL in C# -

i´m trying use old c dll in c# windows forms app. seems i´m using wrong datatype output parameter. dll source code: #ifdef __cplusplus #define export extern "c" __declspec (dllexport) #else #define export __declspec (dllexport) #endif export int callback complemento (lpstr) ; export int callback matchcode (lpstr, lpstr, lpstr, lpstr); c# dll export [dllimport( @"<mydir>fonetica.dll", charset = charset.ansi)] public static extern int matchcode( string n, string s, string e, [marshalas(unmanagedtype.lpstr)] out string retorno); c# dll usage code string match = string.empty; matchcode(pefi.nome, string.empty, string.empty, out match); the tree first parameters input , last 1 output. i´m receiving exception: system.accessviolationexception unhandled message=attempted read or write protected memory. indication other memory corrupt. source=mscorlib stacktrace: @ system.string..ctor(sbyte* value) @ ...