Posts

Showing posts from August, 2010

How to execute certain part of code (eg sftp download) in php in certain time interval? If time exceeds, exception is to be handled -

i want put time interval sftp connection in php. if time exceeds 60 seconds connect it, should disrupted , exception handled. don't know how it. i tried do: set_time_limit(60) but, not work. i want put time limit in function: private function __connectsftp() { $this->sftp = new net_sftp($this->host, 22); if (!$this->sftp->login($this->user, $this->password)) { return $this->_requesterrormessage('could not connect server'); } else { return $this->__downloadfile(); } } i tried do: $totime = time()+60; while(time() != $totime){ //connection code } but, sadly doesn't work @ all. i grateful if suggest me can do.

bash - Rundeck sharing variables across job steps -

i want share variable across rundeck job steps. initialized job option "target_files" set variable on step 1. rd_option_target_files=some bash command echo $rd_option_target_files value printed here. read variable step 2. echo $rd_option_target_files step 3 doesn't recognize variable set in step 1. what's way of doing on rundeck other using environment variables? after rundeck 2.9, there data capture plugin allow pass data between job steps. the plugin contained in rundeck application default. data capture plugin match regular expression in step’s log output , pass values later steps details see data capture/data passing between steps (published: 03 aug 2017)

java - How to find difference in dates -

Image
i have directory structure having folders date folder names. i want delete folder except last 2 days date.in case except today's folder , last 2 days.i.e., 23,22,21. here can't use joda-time find difference between dates. here code trying towards this. dateformat dateformat=new simpledateformat("yyyy-mm-dd"); calendar cal=calendar.getinstance(); cal.add(calendar.date, -2); //java.util.date date=new java.util.date(); system.out.println("the date "+dateformat.format(cal.gettime())); string direct="d:\\tempm\\sample\\"+dateformat.format(cal.gettime()); file file=new file(direct); /* if(!file.exists()) { file.mkdir(); system.out.println("folder created"); }*/ string path="d:\\tempm\\sample\\"; file file2=new file(path); for(file fi:file2.listfiles()) { if(!fi.getabsolutepath().equals(direct)) { system.out.println(fi.getabsolutepath

bpmn - Query process instances based on starting message name -

env: camunda 7.4, bpmn 2.0 given process, can started multiple start message events. is possible query process instances started specific messages identified message name? if yes, how? if no, why? if not @ moment, when? some apis incidentmessages? that no out-of-the-box feature should easy build using process variables. the basic steps are: 1. implement execution listener sets message name variable: public class messagestarteventlistener implements executionlistener { public void notify(delegateexecution execution) throws exception { execution.setvariable("startmessage", "messagename"); } } note via delegateexecution#getbpmnmodelelementinstance can access bpmn element listener attached to, determine message name dynamically. 2. declare execution listener @ message start events: <process id="executionlistenersprocess"> <startevent id="thestart"> <extensionelements> <ca

jquery - JsPlumb with Angular2 -

i trying use jsplumb display connections between 2 components. what end doing using jquery handle ui element , use render connections, jsplumb library. below: jsplumb configuration if( typeof jsplumb !== 'undefined' && jsplumb !== null ) { jsplumb.ready(function() { jsplumb.deleteeveryendpoint(); jsplumb.setcontainer(this._container); jsplumb.defaults.paintstyle = { strokestyle:'#339900', linewidth:2, dashstyle: '3 3'}; jsplumb.defaults.endpointstyle = { radius:7, fillstyle:'#339900' }; jsplumb.importdefaults({ connector : [ 'flowchart', { curviness:0 } ], connectionsdetachable:true, reattachconnections:true }); jsplumb.endpointclass = 'endpointclass'; jsplumb.connectorclass = 'connectorclass'; }); } js-plumb usage jsplumb.connect({ source: $('#'+entityfrom+'panel'), target: $('#'+entityto+'panel'), anchors: ['righ

openmpi - Open MPI + Scalasca :Can not run mpirun command with option --prefix -

i have installed scalasca(scorep,cube,..) with open mpi peformance measurement . when add option : " --prefix = /my-path" mpirun, "scalasca - analyze" can not executed ( aborted ) . command : scalasca -analyze mpirun -np 1 --host localhost --prefix /home/as/lib/bin /home/as/documents/a.out "/home/as/lib" installed open mpi directory. , error : s=c=a=n: abort: target executable /home/as/lib/bin' directory!` if without "--prefix" , runs .but need "-- prefix" option run on cluster. have installed open mpi on of cluster machines same path (/home/as/lib) . how fix it??? open mpi adds implicit --prefix option if orterun (or of symlinks mpirun , mpiexec , etc.) called full path. in other words: $ /home/as/lib/bin/mpirun ... is equivalent to: $ mpirun --prefix /home/as/lib ... if really need pass --prefix option, e.g. because open mpi installed on cluster nodes in different directory on front-end node, quote

xaml - Fill width on Windows Phone 8.1 -

i'm developing application using windows phone 8.1 sdk, write ui descriptions using xaml markup. i can't text box fill width. i see similar questions posted involve listview. i'm confused. there seems no proportional sizing options. tutorials show use of explicit pixel counts in design. is preferred method on windows? how supposed deal unpredictable screen sizes in windows? the items had, failing fill parent, inside contentcontrol . contentcontrol correctly filled width, child, grid , not. i found solution here – https://stackoverflow.com/a/17627257/5476004 – , echo solution here in case post found else searching same problem. the contentcontrol requires 2 special properties in order child element fill parent. horizontalcontentalignment , verticalcontentalignment . so": <contentcontrol name="mycontent" horizontalcontentalignment="stretch" verticalcontentalignment="stretch"> … </contentcontrol

windows 10 - TortoiseSVN's overlay icon on folder is not 'modified' but 'normal' when file inside that folder is modified -

icon shown 'modified' on file. on folder, inside modified file, icon 'normal'. can tell me setting should change in order see 'modified' icon on modified folder? i'm using tortoisesvn 1.9.4, build 27285 - 64 bit on windows 10. note: in tortoisesvn's settings, under icon overlays set status cache on 'shell' , checked removable, network , fixed driver types. in win registry editor tortoise's overlay identifiers first. the folder on desktop, , desktop on shared disk. moved folder on local disk , set status cache on 'default', since when on 'shell' icon overlays not recursive. works should.

forms - php what does checkbox default value 'on' -

recently while working checkbox, i've go through following test code: <?php if ( isset( $_post['myname'] ) ) { $myvalue = $_post['myname']; echo $myvalue; } ?> <form method="post"> <input type="checkbox" name="myname" /> <input type="submit" name="send" /></form> so, output got after form submission when checkbox checked prints 'on' else nothing (if value not provided on checkbox). , isn't supposed print 1(true) on checking checkbox. 'on' means in php? if don't provide value attribute checkbox, it's value on with <input type="checkbox" name="myname" /> $_post['myname'] value on with <input type="checkbox" name="myname" value="1" /> $_post['myname'] value 1 in both cases when checkbox unchecked , doesn't present in $_post (not set)

Updating AngularJS Model of table inserts new cell and removes another -

i had interesting problem today angularjs thought post: in application have model create html table using ng-repeat, additionally have input field tied model , have registered watch function model. when enter text input field, function writes text selected cell of table. once function completed wired happened. instead of updating value of selected cell, new 1 inserted @ current position , cells shifted right , last cell removed row. have expected cells stayed current position , child elements updated. here short example of code. model: //the model initialized empty strings, later input supplied user $scope.master.rows = [["", "", ""], ["", "", ""], ["", "", ""]]; the html snippet: <table ng-model="master.rows"> <tr ng-repeat="row in master.rows"> <td ng-repeat="col in row" ng-click="master.click($event.tar

python - How to manually populate Many-To-Many fields through JSON fixture in Django -

i have json fixture , want populate many-to-many field json fixture seems django wants 1 pk need pass in lot of integers representing pks other related fields. is there anyway go this. i have used raw_id = ['reference(my table name)'] in modeladmin pks can used reference related fields. the error message is file "/usr/local/lib/python2.7/dist-packages/django/core/serializers/python.py", line 142, in deserializer raise base.deserializationerror.withdata(e, d['model'], d.get('pk'), pk) django.core.serializers.base.deserializationerror: problem installing fixture '/home/user/desktop/file/data/file.json': [u"',' value must integer."]: (kjv.verse:pk=1) field_value ',' you can use jsonfield() django model from django.contrib.postgres.fields import jsonfield raw_id=jsonfield(primary_key=true,db_index=true,null=true) s0 database {raw_id:[1,2,3,4]}

objective c - How to get change in network connection notification from iOS Reachability Class? -

hi want capture whenever user gets network connectivity in application have added apples reachability class , below snippet using in appdelegate class didfinishlaunchingwithoptions method, reachability* reachability = [reachability reachabilityforinternetconnection]; [reachability startnotifier]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(reachabilitychanged:) name:kreachabilitychangednotification object:nil]; and reachabilitychanged selector method below - (void)reachabilitychanged:(nsnotification*)notification { reachability* reachability = notification.object; if(reachability.currentreachabilitystatus == notreachable) nslog(@"internet off"); else nslog(@"internet on"); } but here not getting kind of notification when switch off airplane mode , when network connectivity in phone. am missing anything? i use variable in appdelegate store current network status bool @p

java - i am trying to implement a common interface using two bean class? -

recently practicing spring aop. solving above issue trying use aop " introductions - adding functionality aspect" concepts in code using 2 bean class called "blender & fan" 2 bean implement common interface name "imachine.java" interface implement class name "machinewear.java" when run app.java class getting below exception.how can solve it?? may 09, 2016 2:11:27 pm org.springframework.context.support.classpathxmlapplicationcontext preparerefresh info: refreshing org.springframework.context.support.classpathxmlapplicationcontext@c4437c4: startup date [mon may 09 14:11:27 bdt 2016]; root of context hierarchy may 09, 2016 2:11:28 pm org.springframework.beans.factory.xml.xmlbeandefinitionreader loadbeandefinitions info: loading xml bean definitions class path resource [com/mir00r/spring/aop/beans.xml] may 09, 2016 2:11:29 pm org.springframework.beans.factory.support.defaultlistablebeanfactory preinstantiatesingletons info:

virtual machine - VirtualBox Disk space Expansion -

how increase disk space in oracle vm virtalbox ?i want allocate 80 gb .can me? if disk in .vdi format, can use vboxmanage modifyhd your_disk.vdi --resize size_in_mb if have disk in format, convert .vdi cloning destination format. if have snapshots, resizing not possible, have remove them first or use clone.

tensorflow - creating a variable within tf.variable_scope(name), initialized from another variable's initialized_value -

hey tensorflow community, i experiencing unexpected naming conventions when using variable_scope in following setup: with tf.variable_scope("my_scope"): var = tf.variable(initial_value=other_var.initialized_value()) in above, holds other_var.name = 'outer_scope/my_scope/other_var_name:0' i therefore "reusing" same scope @ point in code. intuitively not see issue this, following happens: var.name = 'outer_scope/my_scope_1/var_name:0' so apparently, tf isn't happy "my_scope" , needs append "_1". "outer_scope" remains same, though. if not initialize "other_var", behaviour not come up. an explanation appreciated! thx mat you might want use tf.get_variable() instead of 'tf.variable`. with tf.variable_scope('var_scope', reuse=false) var_scope: var = tf.get_variable('var', [1]) var2 = tf.variable([1], name='var2') print var.name # var

.net - Sum Average Min Max without using inbuild functions or Methods in C# -

i wrote program calculating sum, average, min & max without inbulit functions or methods. found many techniques , locked in below one. problem is, while doing in normal ways. result came. while transferring windows form, unable output. throws error. private void button1_click(object sender, eventargs e) { int n = int.parse(textbox7.text); int[] numbers = new int[n]; int sum = 0; float average; for(int i=0; i<n; i++) { numbers[i] = int.parse(textbox1.text); } array.sort(numbers); for(int i=0; i<n; i++) { sum += numbers[i]; } average = ((float)sum / n); textbox4.text = numbers[0].tostring(); textbox5.text = numbers[-1].tostring(); textbox2.text = sum.tostring(); textbox3.text = average.tostring(); } the output should like, sum : 45 avg : 15 min : 8 max : 10 i think, problem in code here: textbox5.text = numbers[-1].tostring(); there no entry in array having -1 index. if want show max value in textbox5, need that: textbox5.text = numbers[n-1].tostr

Understanding pdf font -

i have huge list of pdf font types, here have part of it: '/anhchm+helvetica-bold', '/kofane+agaramondpro-regular', '/ajhcpe+advot863180fb', '/fheenc+advp4c4e74', '/fchdee+advtimes-bi', '/ekieme+helvetica', '/oeppam+advot8608a8d1+22', '/pnljmh+mqxhpfadvtt4ff65459', '/mljnob+helvetica-bold', '/fchafa+advtt689d5d16.b+20' some of quite readable such 'helvetica-bold', or 'helvetica', others encoded. i need discover list information like: if it's bold or not, if it's italic or not, text size, , if it's possible more readable font format, 'times new roman', 'arial'. do know libraries this, or can tell me logic of weird names? thank you! these font ids in /resources dictionary, name has no meaning. have inside font dictionary, font descriptor , possibly actual font data (if font embedded) information looking for. bold - there no specif

opengl - Write to gl_FragDepth. Precision? -

Image
what i'm trying do: render each mesh of scene in single pass blend result of each pass final image respect depth of each mesh. i rendering meshes 1 render pass per mesh, storing color , depth in fbo per mesh. depth component each mesh's fbo has 32 bits. finally, screen filling quad rendered , color of each fbo written final fbo out vec4 fragcolor , depth gl_fragdepth , layout(depth_any) out float gl_fragdepth . depth func set gl_lequal . if 2 meshes same, i'd expect see mesh blended last scene because of gl_lequal . noise, fragments of last mesh pass depth test, don't. basically copying depth values 1 fbo , seems induce errors. accessing depth component tried both, binding texture sampler2d , sampler2dshadow . as test did following: instead of full screen quad, meshes rendered again depth test color values of surviving fragments of according fbo written final fbo. gives expected result in case 2 meshes same. where loss of precision come from, wh

jspm or npm to install packages? -

i'm new jspm, transitioning npm-only. have 1 fundamental question. have dependencies in package.json, , runned jspm init, created nice jspm config.js file. question is, point of installing these packages jspm (via jspm install ... )? why not install them through npm? more specifically, in package.json, what's difference between putting these packages inside dependencies: {} vs inside jspm.dependencies: {} assuming building webapp jspm more suitable managing frontend dependencies npm. think webapp npm makes sense when used browserify . 1 key benefit of jspm can load dependencies using systemjs & es6 module loader polyfill . enables load dependencies in browser using es6 module syntax. e.g.: import 'jquery'; keep in mind jspm ment used frontend dependencies. dependencies used build process should keep using npm.

Is it possible to make a Jar that could use on both Android and Java SE(EE)? -

i have been asked question: "is possible write sdk(as jar) uses on both standard java(se/ee) , android enviorment?" . recall slides of memory encounter few years ago tell me not possible because there few type or method not exist on both platform, totally forgot are. could tell me (or not) possible make jar runs on both environment?

javascript - How to link each Marker with it's own infoWindow? -

as can see, i'm iterating json object containing markers info, this: ( i'm using infobox plugin, it's not relevant question) function drawairports() { var markers = []; if ( markers != undefined) { (var = 0; < markers.length; i++ ) { markers[i].setmap(null); } markers.length = 0; } var json = [ {"id":8585885,"airport":"airport name", "lat" : "1.3", "long" : "1.33"}, {"id":8585886,"airport":"airport name 1", "lat" : "-1.3", "long" : "1.33"}, {"id":8585886,"airport":"airport name 2", "lat" : "42.5000", "long" : "1.5000"}, {"id":8585886,"airport":"airport name 3", "lat" : "24.0000", "long" : "54.0000"},

cocos2d iphone - how to change the position of player using left and right button when the player is jumping? -

cocos2d offers 2 ways let player jump up, using jumpto() , jumpby(), people not change position of sprite more when jumping up. how write method sprite can jump "super mario"? some time ago contributed cocos2d code made ccmove , ccjump actions stackable. see here . starting cocos2d 2.1, can apply ccjump actions concurrently other movements. however, if want fine tune how controls of game feel, i'd avoid using ccactions altogether , i'd manage sprite.position directly processing player input.

Disable Spring scheduling when running on jboss -

we have spring 4 webapplication use @enablescheduling , @scheduled . on of our testservers don't want scheduling active. have solved adding profile configuration have @enablescheduling annotation. when running on jetty on mac works fine. when running on jboss (eap 6.3) scheduling enabled if delete @enablescheduling annotation. can on jboss server turns on spring scheduling? any other ideas? tia! -kaj :) i suggest control scheduler job via property: @value(..) private boolean enabled; @scheduled public void myjob() { if (enabled) { // things } }

python - return to base class -

i have code in base module: class start_game(object): def __init__(self): print "you landed on planet , see 3 rooms." print "you need choose 1 room enter" self.door=raw_input("pick number of door (1,2 or 3)>>>") try: assert(int(self.door)>0 , int(self.door)<=3) self.password=('%d%d%d')%(randint(1,9),randint(1,9),randint(1,9)) print self.password self.rooms={'1':medical_room,'2':library,'3':basement,'4':end} while true: # break room=self.rooms[self.door] # print room() if self.door=='1': self.door=room().play(self.password) else: self.door=room().play() this way want run basement module entering 3 number. basement module is

php - Display records from database -

i'm trying display information stored in mysql comments table input i'm having issues that. input named entercomment inserts data db , want redirect showcomment input. html: form action='takedata.php' method='post'> <input type='text' id='entercomment' name='entercomment' width='400px' placeholder='write comment...'> <input type='submit' id='combuton' name='combuton' value='comment!'> <input type='text' id='showcomment' name='showcomment'> </form> php: <?php include "mysql.php"; ?> <?php if (isset($_post['combuton'])){ $entercomment = strip_tags($_post['entercomment']); if($entercomment){ $addcomment = mysql_query("insert comments(comment) values('$entercomment')"); if($addcom

javascript - Mongoose populate - Node.JS creating multiple objects -

task have make array of i.e. dishes logged user selecting favourite. problem instead of 1 array of objectids i.e. dishes:[123456,5678910], 2 separate objects same user 1 dish id in array. i presume problem in schema, can give me idea? var favoriteschema = new schema({ timestamps: true, dishes: [{ type: mongoose.schema.types.objectid, ref: 'dish' }], postedby: { type: mongoose.schema.types.objectid, ref: 'user' } }); edit>> post method demanded .post(verify.verifyordinaryuser, function (req, res, next) { favorites.create(req.body, function (err, favorite) { if (err) throw err; console.log('favorite created!'); var id = favorite._id; favorite.postedby = req.decoded._doc._id; favorite.dishes.push(req.body); favorite.save(function (err, favorite) { if (err) throw err; console.log('updated favorites!'); res.json(favorite); }); }); your post method fine first ti

z.load in apache zeppelin results in error -

Image
i'm trying z.load in apache zeppelin following: %dep z.load("/zeppelin-0.5.6-incubating-bin-all/lplibs/hive/csv-serde-1.0.5-jar-with-dependencies.jar") i error , says (not sure error): must used before sparkinterpreter (%spark) initialized hint: put paragraph before spark code , restart zeppelin/interpreter this zeppelin section first have in notebook i'm not sure complaining about.. right can't check problem, should restart interpreter (pushing restart button) before loading dependency jar file.

Python OpenCV Opening Vid File vs. Opening Webcam -

i cant figure out why not working. the following code works using webcam: import numpy np import cv2 cap = cv2.videocapture(0) # define codec , create videowriter object fourcc = cv2.videowriter_fourcc(*'xvid') out = cv2.videowriter('output.avi',fourcc, 20.0, (640,480)) while(cap.isopened()): ret, frame = cap.read() if ret==true: frame = cv2.flip(frame,0) # write flipped frame out.write(frame) cv2.imshow('frame',frame) if cv2.waitkey(1) & 0xff == ord('q'): break else: break # release if job finished cap.release() out.release() cv2.destroyallwindows() yet when exchange webcam video file, output not generate video. 5.7kb file named output.avi: import numpy np import cv2 cap = cv2.videocapture('input.avi') # define codec , create videowriter object fourcc = cv2.videowriter_fourcc(*'xvid') out = cv2.videowriter('output.avi',fourcc, 20.0, (640,480))

ios - Save photo to camera roll with specific filename -

what try achieve take photo , let user specify if photo belongs category 1 or category 2. have 2 buttons, 1 each category. when user presses button, photo saved camera roll. afterwards, @ home, when sync ipad iphoto, want able sort category, or @ least identify category belongs... i first thought of following : 1) taking photo using ipad camera -- done in app 2) saving photo in camera roll under specific name, such cat1_pict123.jpg or cat2_pict456.jpg i plan use uiimagewritetosavedphotosalbum(myimage, nil, nil, nil ); don't know how / or if possible specify file name ? alternatively, there way "tag" photo before saving camera roll ? comment or else, visible in iphoto ? thank help you can't use file names images saved in photolibrary. save document directory specific name.

activiti - Check task assignee whether in candidate groups -

env: camunda 7.4 given: user tasks have candidate groups assigned @ modelling time. @ runtime user tasks can claimed using taskservice.claim(). expect: assignee in candidate groups. if not, throw authorization exception attempt: add task listener event name 'assignment' every user task programmatically perform check using identity service is practice? if not, suggestions? if alright, how achieve this? similar bpmn-parse-listener tasklistener? (specifically following example got problem upon using activityimpl in method parseusertask of abstractbpmnparselistener add listener: tasklistener vs. executionlistener) thanks! found solution @ add task listener user tasks . although not sure if way of checking assignment practice.

How to import eclipse project library in android studio? -

Image
i followed tutorial 1 load library project in eclipse. have android studio project white in eclipse. how import library projects in android studio? previous compile in eclipse. i have tried file> new->import module-> browser source give error; specify location of gradle or android eclipse project can me please?

c# - WCF Service Access in static class -

public static ienumerable<hospitalentities> getallhospitaldetails(hospitalrequest hospitalrequest) { commonclass commonclass = new commonclass(); try { return mapper.map<ienumerable<hospitaldto>, list<hospitalentities>>(new healthserviceclient().getallhospitaldetails(new hospitalrequestdto { applicationcontext = mapper.map<applicationcontext, applicationcontextdto>(commonclass.applicationcontext), tenantcontext = mapper.map<tenantcontext, tenantcontextdto>(commonclass.tenantcontext), usercontext = mapper.map<usercontext, usercontextdto>(commonclass.usercontext), selectedtenantid = hospitalrequest.selectedtenantid, hospitaldto = mapper.map<hospitalentities, hospitaldto>(hospitalrequest.hospitals) }).hospitalresponsedto); } catch (exception ex) { exceptionpolicy.handleexception(ex, exceptionpolicies.ui_policy, (int32)excep

jquery - FooTable Stop pagination start by default -

Image
how can stop pagination plugins, want single page sorting no pagination. search on google no hope (maybe wrong keyword), please help $('.footable').footable({paginate: false}); should work. if have other issues can find documentation in demos folder of v2 branch on footable git repo. http://fooplugins.com/footable-demos/

http - httpclient hard timout not working properly -

i using closeablehttpasyncclient perform number of requests without waiting other complete , setting hard timout of 1 minute. if suppose there 10 requests taking 4-5 minutes stop. requestconfig requestconfig = requestconfig.custom() .setsockettimeout(3000) .setconnectionrequesttimeout(3000) .setconnecttimeout(3000).build(); closeablehttpasyncclient httpclient = httpasyncclients.custom() .setdefaultrequestconfig(requestconfig) .build(); timertask task = new timertask() { @override public void run() { if (request != null) { request.abort(); system.out.println( "request aborted"); } } }; new timer(true).schedule(task, hardtimeout * 10000); please tell me whats wrong in this.

c# - Reading from an xml file -

i have xml file this: <?xml version="1.0" encoding="utf-8" ?> <logonusersinfo> <generalinformation> <numberofusers>2</numberofusers> <lastuser username="user1"/> </generalinformation> <logonusercollection> <logonuser username="user1" password="password"> <rights> <cancreateproducts value="true"/> <caneditproducts value="true"/> <candeleteproducts value="true"/> <cancreatelogins value="true"/> <candeletelogins value="true"/> <canbedeleted value="true"/> <hasdebugrights value="false"/> </rights> </logonuser> <logonuser username="user2" password="password"> <rights> <cancreateproducts value="true"/>

html - What if my screen resolution is less than layout resolution? -

Image
i try make area this: but problem resolution of screen less layout. best way shape in layout? have use custom % or responsive table, think? use flexbox . you divide layout 2 groups, each sqare of 4x4. on vertical screen, second group wrap , placed below. on horizontal screen, groups placed next each other (same in picture). <div class="wrap"> <div class="group"> <div class="item pic"> <div class="item text"> <div class="item pic"> <div class="item text"> </div> <div class="group"> <div class="item pic"> <div class="item text"> <div class="item pic"> <div class="item text"> </div> </div> then, on small screens make .group element 100vw , on larger screens 50vw .

Expand grid with an ordered pair and a third variable in R -

i have been trying generate combinations of ordered pair of variables third variable, combine every pair (z1, z2) below z3. theta <- seq(0, 2*pi, length = 5) z1 <- cos(theta) ;z2 <- sin(theta) z3 <- seq(-3, 3, length = 5) i use expand.grid function here not appropriate generate combinations of 3 variables destroying ordering. wondering, there function in r can this? appreciated, thank you. we paste 'z1' , 'z2' , expand.grid 'z3'. output ('d1'), split 'var1' i.e. paste d vectors 2 columns. d1 <- expand.grid(paste(z1,z2), z3) transform(read.table(text=as.character(d1$var1), header=false), v3= d1$var2)

javascript - angularjs ng-click not working -

javascript define controller , call function $hhtp , in $scope define model , function want call: myapp.controller('profiletweets', ['$scope', '$http', '$location', function ($scope, $http, $location) { $http({ url: '../profilesname/', method: 'get' }).then(function (itemdata) { $scope.profilesname = itemdata.data; }); $scope.loaddata = function () { alert('hiii'); } }]); and in html i'm calling function loaddata() show in code below <div class="form-group"> <select class="form-control" dir="rtl" style="width:100%;" ng-model="profilesname" ng-options="profiles.profile_name profiles in profilesname" ng-change="loaddata()"> </select> </div> ng-change not working, nothing happen. how fix it? i guess had forgot place ng-controller di

android - How to cancel match request before onRoomCreated event triggers? Google Play Services - Real Time Multiplayer -

how cancel realtime multiplayer match if user cancels match before onroomcreated triggered? @ time there's no room id call leaveroom. gpgmultiplayer.startquickmatch (1, 1); right after user presses cancel reason how cleanup?

How to extend Eclipse's Java editor to recognize my own elements -

i want add references other elements inside javadoc. javadoc should similar to: /** * ... * @my.tag someelement */ i want reuse existing java editor inside eclipse. of course can type above javadoc already, i'd add features: navigation: upon ctrl-click / f3 want navigate editor showing someelement auto-completion: ctrl-space should complete text / show valid alternatives checking: want create warning marker , underline someelement if cannot found i figured out can auto-completion using extension point org.eclipse.jdt.ui.javacompletionproposalcomputer , though seems little more complex had hoped, might on wrong track here? for checking elements might able use org.eclipse.jdt.core.compilationparticipant , can generate markers upon compilation afaik happens every save operation. but how can can manage navigation feature? pointers welcome! for navigation can provide hyperlink detector . you'll want @ how java editor , existing detectors declared in org.

sql server - How to get most frequent values in SQL where value like a variable? -

i have sql table, in store application logs. have column errors, in store values example +------+--------+----------------------------------------------+ | id | name | error | +------+--------+----------------------------------------------+ | 1 | john | flushing folder error on folderid 456 | | 2 | paul | flushing folder error on folderid 440 | | 3 | gary | error connection has timed out on source 320| | 4 | ade | error connection has timed out on source 220| | 5 | fred | error connection has timed out on source 821| | 6 | bob | reading errors occured on folder 400 | | 7 | ade | error connection has timed out on source 320| | 8 | fred | error connection has timed out on source 320| | 9 | bob | reading errors occured on folder 402 | | 10 | ade | error connection has timed out on source 320| | 11 | fred | error connection has timed out on sourc

spring - java.lang.AssertionError: Status expected:<200> but was:<400> -

it's controller... @requestmapping(value = "/user", method = requestmethod.post, consumes = mediatype.application_json_value, produces = mediatype.application_json_value, headers = "accept=application/json") public @responsebody responsemessage getuser(@requestbody availableuser uuid) { logger.info("enter getuser method's body"); return manager.availableuser(uuid); } it's testcontroller... @test public void testgetuser() throws exception { availableuser availableuser=new availableuser(); list<string> lst =new arraylist<string>(); lst.add("test1"); lst.add("test2"); availableuser.setuuid(lst); this.mockmvc.perform(post("/user").contenttype(mediatype.application_json).accept(mediatype.application_json)) .andexpect(status().iscreated()) .andexpect(status().isok()); when(manager.availableuser(availableuser)).thenreturn(message); } i don&

asp.net mvc - error constructor controller MvC 4 -

public partial class registrationcontroller : controller { private readonly ipartnerrepository _partnerrepository; public registrationcontroller(ipartnerrepository partnerrepository) { _partnerrepository =partnerrepository; }} i use autoface dependancy injection , have error: ` no parameterless constructor defined object. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.missingmethodexception: no parameterless constructor defined object. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [missingmethodexception: no parameterless constructor defined object.] system.runtimetypehandle.createinstance(runtimetype type, boolean publiconly, boolean nocheck, boolean& c

php - How to get most visited posts of the week? -

whenever user visits post, have simple function triggers adds +1 single custom field visit counter field post. this means can visited posts of time using new wp_query() using meta value sort, can't life of me figure out way visited posts last x days. as i'm increasing custom field of each post 1, understand there no reference dates or anything, can't imagine coding solution make happen. is there wordpress way determine how many times custom field changed on last 7 days? a solution have counter per-day. say have counter today - let's call 09052016 , , 1 tomorrow called 10052016 . views on last 7 days, take last 7 days' counters , add them together. an easier solution possibly name these incrementally, have 000001 , 000002 , 000003 , forth. this make lot easier write php function allow take 000182 , previous 6 counters. ranking top posts on last 7 days possible calculating value of values: x + (x-1) + (x-2) + (x-3) + (x-4) + (x-5) + (x-6

java - Support Jackson @JsonFilter async DeferredResult -

base on jira i have method: val innerresult: deferredresult[object] = new deferredresult[object]() override def setresult(result: t): boolean = { val beanpropertyfilter: simplebeanpropertyfilter = filter.size match { case 0 => simplebeanpropertyfilter.serializeall() case _ => simplebeanpropertyfilter.filteroutallexcept("id") } val filterprovider = new simplefilterprovider() .addfilter("propertiesfilter", beanpropertyfilter) val wrapper = new mappingjacksonvalue(result) wrapper.setfilters(filterprovider) innerresult.setresult(wrapper) } in response see this: {"headers":{}, "body":[{"id":"573080b50ccded33e08da678"}], "statuscode":"ok"} while want see: [{"id":"573080b50ccded33e08da678"}] what doing wrong? i don't know scala , have trouble following code (where result defined?). perhaps add method declaratio

windows - how to force rabbitmq to start automatically when my pc is rebooted -

Image
well subject says all. rabbitmq server doesn't start automatically when reboot win7 machine. works when start server "rabbitmq-server" command it's kind of annoying whenever reboot machine. started when uninstalled service in order add rabbitmq.config file. had uninstall , install service because , quote rabbitmq website "windows service users need re-install service after adding or removing configuration file". guys have idea on how ? it windows service. make sure set "automatic".

Jenkins user using docker (inside docker container) -

i have dockerfile: from jenkins:1.651.1 copy plugins.txt /usr/share/jenkins/plugins.txt run /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt user root run groupadd docker run usermod -a -g docker jenkins user jenkins i add user jenkins group docker . when access container: jenkins@bc145b8cfc1d:/$ docker ps cannot connect docker daemon. docker daemon running on host? jenkins@bc145b8cfc1d:/$ whoami jenkins this content of /etc/group on container jenkins:x:1000: docker:x:1001:jenkins my jenkins user in docker group jenkins@bc145b8cfc1d:/$ groups jenkins jenkins : jenkins docker what doing wrong? want use docker-commands jenkins user. i'm on amazon ec2 container service. this how start container image: docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker:ro -v /lib64/libdevmapper.so.1.02:/usr/lib/x86_64-linux-gnu/libdevmapper.so.1.02 -v /lib64/libudev.so.0:/usr/lib/x86_64-linux-gnu/libudev.so.0 -p 8080:8080 --nam

google api - JSON response data size issue -

i using discover google analytics platform generate queries in order make callouts ga inside salesforce application. upon creating custom report api query uri generated presents data report in json format. one example uri looks following: https://www.googleapis.com/analytics/v3/data/ga?ids=[my gi id] &start-date=[start date]&end-date=[end date[&metrics=ga%3asessions%2cga%3asessionduration&dimensions=ga%3adayssincelastsession%2cga%3acampaign%2cga%3asourcemedium%2cga%3asocialnetwork%2cga%3adimension2&filters=ga%3asessionduration%3e1&access_token=[my access token] the issue presented data limited 1000 rows max, , not sure how can surpass size view limit. the google analytics api has field can send called max-results if add &max-results=10000 to request paging of 10000 rows. max can set if there more results nextlink returned results can use make more requests additional data.

php - Where is the location of php5.6-fpm.sock? -

i'm connected in vagrant ubuntu 14.04 x64 machine , can't find location of php5.6-fpm.sock under classic location /var/run/php... the location of socket specified in configuration: listen = /var/run/php5-fpm/php5-fpm.socket in: /etc/php5/fpm/pool.d/www.conf you try ps aux | grep php mentioned in comments. look in phpinfo(); use find or locate browse directories typical unix sockets /run

excel - How to merge or copy a column from specific worksheets in multiple workbooks to a new workbook? -

i copy column worksheet x of workbook 1 (up workbook 100) , column worksheet y of same workbooks new workbook or open , empty workbook. column sheet x should copied column of specific sheet xmerge , column sheet y should go column of specific sheet ymerge in new workbook. additional copied columns should inserted columns left right, respectively next column , b, c etc. since there lot of workbooks have consider automate process vba macro. details: workbooks in 1 folder. amount of filled cells in different columns not equal , cells can contain no or error data. use excel 2010. i tried modify following macro code suit needs, unfortunately without success. (source: https://msdn.microsoft.com/en-us/library/office/gg549168(v=office.14).aspx ) this macro copies rows rows instead of columns columns. therefore suppose changes in macro solve problem. irrespective of macro grateful every help. sub mergeallworkbooks() dim summarysheet worksheet dim folderpath string dim nrow long di

c# - ZIP all files and then download -

at first want convert files inside 1 folder .zip , download zipped folder using api , c#. want access these files client side. client side i'm using angularjs , want download file server. put different- different logic not working. try this public string mergefiles(string folder) { using (zipfile zip = new zipfile(folder)) { string[] fileentries = directory.getfiles(folder); foreach (string f in fileentries) { string path = path.getdirectoryname(f.substring(folder.length)); zip.addfile(f, path); } zip.save(folder + "\\files.zip"); } return folder+"\\files.zip"; }

ios - SWRevealViewController with StoryBoard with storyboard Identifier in Swift not segue how to do that -

swrevealviewcontroller how implements storyboard storyboard identifier in swift not segue please me uistoryboard *storyboard = [uistoryboard storyboardwithname:@"storyboardnibname" bundle:nil]; tempviewcontroller *myvc = (tempviewcontroller *)[storyboard instantiateviewcontrollerwithidentifier:@"identifier"]; uiviewcontroller *frontviewcontroller = myvc; rearviewcontroller *rearviewcontroller = [[rearviewcontroller alloc] init]; uinavigationcontroller *frontnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:frontviewcontroller]; uinavigationcontroller *rearnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:rearviewcontroller]; swrevealviewcontroller *revealcontroller = [[swrevealviewcontroller alloc] initwithrearviewcontroller:rearnavigationcontroller frontviewcontroller:frontnavigationcontroller]; revealcontroller.delegate = self; self.viewcontroller = revealcontroller; self.window.rootv

Can this be done with regex? -

i have string different length sub-strings split symbol '_' , sub-strings have split in multiple sub-sub-strings... example: "_foo-2_bar-12_un[3;1]iver[3]se[3-7]" should split in groups this: "foo-2", "2", "bar-12", "12", "un[3;1]", "3;1", "iv", "er[3]", "3", "se[3-7]", "3-7" i've come this: /(?:((?:(?:\[([a-z0-9;-]+)\])|(?<=_)(?:[a-z0-9]+)|-([0-9]+))+))/ig the problem encounter last part. , after finicking around started think whether or not possible. it? any kind of guidance appreciated. you can use following regex: /[^\w_]+(?:\[([^\][]*)]|-([^_]+))/g see regex demo the pattern matches 1+ char alphanumeric sequence ( [^\w_]+ ) followed either [...] substrings having no [ , ] inside (with \[([^\][]*)] - note captures inside [...] group 1) or hyphen followed 1+ characters other _ (and part after - captured group