Posts

Showing posts from July, 2015

excel - VBA to get a specific string from a multiline string -

i have below string being read notepad drive. while vba reading below string, needid(abc123) store in variable. sometime i'll have below information repeated multiple times different "needid"s , need "need id" saved in array call them later. needid = abc123 name = someone, nameenter code here type = moon = dept = xyz acdi = 96633 dent = test det below code reads above file drive set ofs = ofso.opentextfile("c:\\fileid.txt") txtfileid = ofs.readallenter any idea needid please.

excel vba - Let Value-string, Get value long VBA -

Image
i'm using class module store values position of buttons. use same function add 3 buttons in row, , need change .left position button based on type; ie 'create' button, @ .left value column a for 'update' button, @ .left value column b for 'destroy' button, @ .left value column c i add case select in code, readability think sit better in class module. currently trying following- relevant lines in class module: private pleft long public property left() long left = pleft end property public property let left(strtype string) select case strtype case "create" pleft = prange.offset(0, 4).left case "update" pleft = prange.offset(0, 5).left case "open" pleft = prange.offset(0, 6).left end select end property relevant lines in module: dim button cbutton sub letvalueforleft() set button = new cbutton button.left = "creat

ios - xcode8 list of simulators not showing -

i have been working xcode 8 beta 4 has been working fine until now. list of simulators not showing of projects. tried creating new scheme , did not work. how fix this? deleting derived data , restarting xcode worked in case. rm -rf ~/library/developer/xcode/deriveddata/*

.htaccess - Make PHP Output Errors As HTML Comment -

i have production website not have access full file system; specifically, can't view error log. site running under iis. however, can edit php ini. there page not loading. not want enable errors across entire site, don't want risk sensitive information being revealed. is there way make php output errors wrapped in <!-- --> (a comment) , not make visible users unless check source? is there way make php output errors wrapped in <!-- --> yes there built-in function. looking set_error_handler . juste copy/paste example #1 php doc , replace markup html comment markup.

garbage collection - android collapses so we restart everyday -

guys have application works on tablet.that smart house application.i root tablet because want forbid customers use else application on tablet.application visible , working non stop on screen whenever tablet on.but there problem.the problem when application running 1 day 2 days tablet collapses.that's why needs restarted each time when happens.i think might problem of ram aka main memory.i wonder thought.if use garbage collector or ram cleaner or ram expander, solution me ? thanks in advance. your problem appears memory leak in application. since complex issue identify and/or resolve, try common tools aid you, such as: https://medium.com/freenet-engineering/memory-leaks-in-android-identify-treat-and-avoid-d0b1233acc8#.z178mon4s http://android-developers.blogspot.ch/2009/01/avoiding-memory-leaks.html https://github.com/square/leakcanary

c++ - std::functions and lambda function passing -

i have class takes std::function parameter assign lambda function. works in constructor stops working after that. debugger says f "empty" after running first line. why? #include <iostream> #include <string> #include <functional> typedef std::function<void(std::string)> const& fn; class testclass { public: testclass(fn _f) : f(_f) { f(); } void f() { f("hello"); }; private: fn f; }; int main() { testclass t([](std::string str) {std::cout << str << std::endl; }); t.f(); return 0; } calling t.f() causes fault. why? i can solve changing following: int main() { fn __f = [](std::string str) {std::cout << str << std::endl; }; testclass t(__f); t.f(); return 0; } but again, not work when change fn auto ! int main() { auto __f = [](std::string str) {std::cout << str << std::endl; }; testclass t(__f); t.f(); return 0; } what

java - What values do you return from an ArrayList if the method returns an Enumeration? -

so upgrading old code uses vector arraylist , unsure use replace old vector segment. public enumeration enumeratemapping() { return mappinglist.elements(); } i need replace .elements() arraylist equivalent. if happens know of link translation these helpful well. arraylist (and collection s) implement iterable , should return iterator() : public iterator enumeratemapping() { return mappinglist.iterator(); } it better use generic type instead of raw type, i.e. iterator<elementtype> . as enumeration javadoc suggests, recommended use iterator instead of enumeration : note: functionality of interface duplicated iterator interface. in addition, iterator adds optional remove operation, , has shorter method names. new implementations should consider using iterator in preference enumeration.

sitecore8 - Sitecore Habitat how can I create a basic 404 page? -

i trying create basic 404 page in sitecore habitat, stumped , new sitecore. i've created notfound page in content tree using basic page. i have following in website project. <projectname>.web.config under app_config > include > project folder. <settings> <setting name="preview.defaultsite" value="qube" /> <!-- item not found handler url of page handling 'item not found' errors --> <setting name="itemnotfoundurl"> <patch:attribute name="value">/notfound</patch:attribute> </setting> <!-- link item not found handler url of page handling 'link item not found' errors --> <setting name="linkitemnotfoundurl"> <patch:attribute name="value">/notfound</patch:attribute> </setting> <!-- layout not found handler url of page handling 'layout not found

How can I make an android xml layout for Category and CategoryItem -

i'am new in using java , android studio , wondering how can make layout in 1 activity. myimage what looking listview adapter public class exampleadapter extends baseadapter { list<product> products; private activity context; @override public int getcount() { return products.size(); } public exampleadapter(list<product> products, activity context) { this.products = products; this.context = context; } @override public object getitem(int position) { return products.get(position); } @override public long getitemid(int position) { return position; } @override public view getview(int position, view convertview, viewgroup parent) { final product product = products.get(position); viewholder holder; if (convertview == null) { layoutinflater inflater = context.getlayoutinflater(); convertview = inflater.inflate(r

ios - ViewController persist through segue -

i don't know how explain problem show here video showing problem(s) having: https://youtu.be/dfiwenmj6xc as can see push segue sloppy. want keep alerts label in top right correct data, , not have flash. image go away , not have jitter visible. here part of code in first view class: class weatherviewcontroller: uiviewcontroller, locationservicedelegate, uiviewcontrollerpreviewingdelegate{ var fromwarnignsviewcontroller = false var weatheralerts: weatheralerts! var locationfixachieved : bool = false var locationstatus : nsstring = "not started" var userlocation : string! var userlatitude : double! var userlongitude : double! var usertemperaturecelsius : bool! var hourlyweather2: hourly! var weeklyyweather2: weekly! override func viewdidload() { super.viewdidload() } override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) {

angularjs - Angular Material Calendar incompatibility? -

i'm trying use cool little angular module: https://angular-material-calendar.bradb.net/ when doing bower install get: unable find suitable version angular-material, please choose 1 typing 1 of numbers below: 1) angular-material#~0.11 resolved 0.11.4 , required material-calendar#0.2.14 2) angular-material#^1.0.9 resolved 1.0.9 , required public it looks thing developed in beta, , can't work 1.0.9. know workarounds? module i'm looking for. thanks! use --force-latest or add component version resoltions key in bower.json note more info check issue here . hope helped.

Why is the whole object not being saved in mongodb using seneca-mongo-store? -

i using seneca-mongo-store save entities backend mongodb. here code using save function addobject(object){ connecttomongo('stupiddb') seneca.ready(function(){ var collection = seneca.make$('install') console.log("entering object") console.log(object) collection.save$(object, function(err, reply){ if( err ) console.log(err) else console.log("reply : " + reply) closeconnection() }) }) } the result of execution of code $ node mongoconnect.js 2016-08-08t12:01:25.470z 912dfpdw7ytw/1470657685436/29552/- info hello seneca/0.7.2/912dfpdw7ytw/1470657685436/29552/- entering object { date: 1470657685818, product: 'mcs', release: '16.2.1', 'session id in log files': { '/tmp': 'json object', '/u01/app': 'json object' }, 'cryptographic names check': { '

java - Is it possible to extract a map AND separate variables from URL parameters using Spring MVC? -

public string mymethod(@requestparam string param1, @requestparam string param2, @requestparam map<string, string> map) this i'm doing right now. doesn't work though, because param1 , param2 present in map. there way around this? i'm using here, if it's of help. spring matrix variables may obtained in map. need send url params below. // url : /owners/42;q=11;r=12/pets/21;q=22;s=23 @requestmapping(value = "/owners/{ownerid}/pets/{petid}", method = requestmethod.get) public void findpet( @matrixvariable map<string, string> matrixvars, @matrixvariable(pathvar="petid"") map<string, string> petmatrixvars) { // matrixvars: ["q" : [11,22], "r" : 12, "s" : 23] // petmatrixvars: ["q" : 11, "s" : 23] } for more info refer: http://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-matrix-variables

owl - SWRL: restrict a rule to a specific individual -

lets there class "food" containing individuals "grain" , "fruit" . if want select grain can assign food_type data property individuals (class) food (ind_1) grain food_type ---> "grain_food" (ind_2) fruit food_type ---> "fruit_food" and run code: food(?x) ^ food_type(?x,"grain_food") -> sqwrl:select(?x) but if want job (select grain individual) without needing food_type property? possible directly point specific individual name? it's not clear you're asking, yes, can use individual in swrl rule. e.g., if have individual c class c , can do:     c(c) &longrightarrow; sqwrl:select(c) as long sqwrl:select doesn't require variable (i.e., long can accept individual directly), should fine. if requires variable, opposed individual directly (which go against intent, think), guess use kind of equality predicate, swrbl:equal :     swrlb:equal(c,?x) &longrigh

ruby - save a belongs to object with sinatra -

i'm building blog posts app sinatra. each post have many comments. can create post comments doesn't want create, don't know why. main.rb get "/" @posts = post.all haml :index end post '/new/post' post.create params['post'] redirect to('/') end post '/:id' post.get(params[:id]).comments.create(params['comment']) redirect to('/') end datamapper.setup(:default, env['database_url'] || "sqlite3://#{dir.pwd}/development.db") class post include datamapper::resource property :id, serial property :title, string property :content, string property :photo, string property :rating, integer has n, :comments, :constraint => :destroy end class comment include datamapper::resource property :id, serial property :content, string belongs_to :post end datamapper.finalize index.haml %form.new

Gathering heterogeneous data with hadoop -

we have system, including oracle , microsoft sql dbms, data different sources , in different formats, stores , process it. "different formats" means files: dbf, xls , others, including binary formats (images), imported dbms different tools, , direct access databases. want isolate incoming data , store "forever" , want them later source , creation time. after studies want try hadoop ecosystem, not quite sure, if it's adequate solution goal. , parts of ecosystem should use? hdfs alone, hive, may else? give me piece of advise? i assume want store files contain data -- searchable file archive. the files can stored in hdfs ... or may find system amazon's s3 cheaper , more flexible. store files, manage other data data, namely: location, source, , creation time appending file -- simple tab-separated file or several other formats supported hadoop make easy. you can manage , query file hive or other sql-on-hadoop tools. in effect, you're creat

javascript - Browser downloads the html file instead of opening -

i have created server node.js express open html file in public folder. app.use(express.static(__dirname + '/public')); app.listen(8080); i have done before without problems. in project when try open server in 127.0.0.1:8080 automatically downloads index.html file. tried different browsers result same. update open html file in edge. very slow processing thing. , got stuck when send request server. i tried opening html file separately browser works without problem. and tried giving html file location, result same. i not know exact problem here. got know has content type td-lambda mentioned in comments. found solution this. var express = require('express'); var app = express(); var server = app.listen(8080); app.set({ 'content-type': 'text/html' }); app.use(express.static(__dirname + '/public')); and solved problem.

android - Accidential keystore deletion solutions -

i've accidentally deleted keystore file. options? how can contact goolge support maybe remove previous apk versions, can push app new 1 there no other apk match against. or maybe way generate new keystore behaves original? idea help! migration new app, notifying users via email or notif. ps. tried restore file, it's dead end. i've accidentally deleted keystore file. options? you can through alias if have created while generating keystore file. how can contact goolge support maybe remove previous apk versions, can push app new 1 there no other apk match against for can't update application through keystore file (which lost) , can unpublish application. or maybe way generate new keystore behaves original? no. while generate new keystore file need publish older application new package name , new version using new keystore file. before publish application new keystore , new package name don't need unpublish application if don't

serialization - Use struct in python to deserialize a byte array coming from serial -

i have class sorts of data in it, like: class uartmessage: identification1 = int(0) #byte 0 timestamp1 = int(0) #bytes [1:5] voltage1 = int(0) #bytes [6:7] current1 = int(0) #bytes [8:9] signal1= int(0) #bytes [10:11] identification2 = int(0) #byte 12 timestamp2 = int(0) #bytes [13:17] voltage2 = int(0) #bytes [18:19] current2 = int(0) #bytes [20:21] signal = int(0) #bytes [22:23] identification3 = int(0) #byte 24 the data fill structure come serial. need deserialize data coming serial in shape of structure. reading serial 40 bytes data chunks , need split itit. tried pickle library seems it's not fitted deserializing type of data. found struct cannot understand how use proprely in case. comments in struct, need desearilize chunks of data like: first byte identificator, bytes 1 5 included timestamp , on.... have ideea how can achieve this? thanks first of all, need declare format of incoming bytes according list:

javascript - Json - Node-RED Extract -

noob looking help... i have json stream of data looks this.. { "header" : { "content" : "telegram", "gateway" : "en-gw", "timestamp" : "2016-08-08t13:45:47.032+0100" }, "telegram" : { "deviceid" : "01864892", "friendlyid" : "boardroom-co2-sensor", "timestamp" : "2016-08-08t13:45:47.032+0100", "direction" : "from", "functions" : [ { "key" : "humidity", "value" : 39.00, "unit" : "%" }, { "key" : "concentration", "value" : 830.00, "unit" : "ppm" } ], "telegraminfo" : { "data" : "4e53820e", "status" : "0", "dbm" : -67, "rorg" : "a5&

Elasticsearch - Grouping aggregation - 2 fields -

my mapping is { "myapp": { "mappings": { "attempts": { "properties": { "answers": { "properties": { "question_id": { "type": "long" }, "status": { "type": "long" } } }, "exam_id": { "type": "long" } } } } } } and want group question_id , status i want know every question_id how many has status 1 or 2 p.s. 2 attempts can have same questions first of all, need update mapping , make answers nested field. not making nested make answers lose correlation between question_id field , status field. { &

Convert PARI program to C++ -

i found sequence of interest in oeis , want generate same sequence in c++ programming competition solution working on. however hit roadblock understanding how program given in sequence page works. here program given in page - (pari) test(n)= {m=n; forprime(p=2, 5, while(m%p==0, m=m/p)); return(m==1)} for(n=1, 500, if(test(n), print1(n", "))) (pari) a(n)=local(m); if(n<1, 0, n=a(n-1); until(if(m=n, forprime(p=2, 5, while(m%p==0, m/=p)); m==1), n++); n) (pari) list(lim)={ lim\=1; my(v=list(), s, t); for(i=0, log(lim+.5)\log(5), t=5^i; for(j=0, log(lim\t+.5)\log(3), s=t*3^j; while(s <= lim, listput(v, s); s <<= 1; ) ) ); vecsort(vec(v)) }; i found out pari is, unable convert program c++. suggestions me generate same sequence in c++ appreciated. i tried generate sequence in c++ following code snippet. think missing numbers in between fail fe

hiveql - HIVE on Spark Issue -

i trying configure hive on spark after trying 5 days not getting solution.. steps followed: 1.after spark installation,going in hive console , setting below proeprties set hive.execution.engine=spark; set spark.master=spark://inbbrdssvm294:7077; set spark.executor.memory=2g; set spark.serializer=org.apache.spark.serializer.kryoserializer; 2.added spark -asembly jar in hive lib. 3.when running select count(*) table_name getting below error: 2016-08-08 15:17:30,207 error [main]: spark.sparktask (sparktask.java:execute(131)) - failed execute spark task, exception 'org.apache.hadoop.hive.ql.metadata.hiveexception (failed create spark client.)' hive version: 1.2.1 spark version: tried 1.6.1,1.3.1 , 2.0.0 appreciate if 1 can suggest something. you can download spark-1.3.1 src spark download website , try build spark-1.3.1 without hive version using: ./make-distribution.sh --name "hadoop2-without-hive" --tgz "-pyarn,hadoop-

Websocket does not work in Ionic -

everyone! please, help.. should in order use websocket in ionic app? couldn't find info in docs this. i'm writing in code: .controller('controller', function($scope) { $scope.planets = [{'name': 'Меркурий', 'order': '1'}, {'name': 'Венера', 'order': '2'}, {'name': 'Земля', 'order': '3'}, {'name': 'Марс', 'order': '4'}, {'name': 'Юпитер', 'order': '5'}, {'name': 'Сатурн', 'order': '6'}, {'name': 'Уран', 'order': '7'}, {'name': 'Нептун', 'order': '8'}, {'name': 'Плутон', 'order': '9'}, ]; $scope.sendd

javascript - Display Google AdSense ads to search engine visitor only -

i'm using below blogger/weebly code displaying adsense ads search engine visitor. code not working... ads not showing... whats wrong code? <script type="text/javascript"> if (document.referrer.match(/google|yahoo|bing|altavista|digg/)) { google_ad_client = "xx-xx-xxxxxxxxxxxxxxxxxx"; /* xxxxxxxx xxxxxx xxx xxx xxx xx xxxxxx */ google_ad_slot = "xxxxxxxxxxxxxx"; google_ad_width = xxx; google_ad_height = xxx; var script = document.createelement("script"); script.setattribute("src", src); document.getelementsbytagname("head")[0].appendchild(script); } else { // show visitors not referred search engine } </script> please me, sir. thanks. var script = document.createelement("script"); script.setattribute("src", src); // problem. src variable doesn't exist document.getelementsbytagname("head")[0].appendchild(script); this code correct. adds script element he

r - add multiple lines to a plot_ly graph with add_trace -

i found example add lines plot_ly plot using add_trace command. how can add list of lines plot without using add_trace multiple times? i tried for loop add traces doesn't work expected. my_lines <- list( list(x=1:10, y=2:11, color='red'), list(x=1:10, y=0:9, color='blue'), list(x=1:10, y=3:12, color='green') ) p <- plot_ly() p for(line in my_lines) { p <- add_trace(p, y=line[['y']], x=line[['x']], marker=list(color=line[['color']])) } p but example works expected. p <- plot_ly() p <- add_trace(p, y=my_lines[[1]][['y']], x=my_lines[[1]][['x']], marker=list(color=my_lines[[1]][['color']])) p <- add_trace(p, y=my_lines[[2]][['y']], x=my_lines[[2]][['x']], marker=list(color=my_lines[[2]][['color']])) p <- add_trace(p, y=my_lines[[3]][['y']], x=my_lines[[3]][['x']], marke

ios - Why do I need to set constraint constant after some delay? -

i adding view programatically , changing constant of height constraint not set width screen width in viewdidload method. width set when put line in after 0.2 seconds delay queue. below code added in viewdidload dispatch_after(dispatch_time(dispatch_time_now, (int64_t)(0.2 * nsec_per_sec)), dispatch_get_main_queue(), ^{ careaview = [[[nsbundle mainbundle] loadnibnamed:@"aview" owner:nil options:nil] objectatindex:0]; [_vwcomplaintarea addsubview:careaview]; [self setconstraintlayout:careaview tovw:_vwcomplaintarea]; [_firstviewheightconstraint setconstant:_firstviewheightconstraint.constant + careaview.bounds.size.height]; [_heightforcomplaintare setconstant:careaview.bounds.size.height]; }); -(void)setconstraintlayout:(uiview *)vw tovw:(uiview *)tovw { [vw autosetdimensionstosize:cgsizemake(tovw.bounds.size.width, vw.bounds.size.height)]; [vw autopinedge:aledgetop toedge:aledgetop ofview:tovw]; [vw autopinedg

java - unable to predict when all the threads have finished execution -

here code package pe.entel.ftp; public class myclass implements runnable { public void run() { system.out.println(thread.currentthread().getname()); } public static void main(string[] args) { myclass runnable = new myclass(); threadgroup tg1 = new threadgroup("parent threadgroup"); (int = 0; < 100; i++) { thread t1 = new thread(tg1, runnable, + ""); t1.start(); system.out.println("thread group name: " + tg1.getname()); } while (tg1.isdestroyed()) { system.out.println("yes success"); } system.out.println("completed"); } } while part of o/p thread group name: parent threadgroup thread group name: parent threadgroup thread group name: parent threadgroup thread group name: parent threadgroup thread group name: parent threadgroup completed 84 86 88 90 92 94 96 98 95 97 99 h

php - How to get count children of users -

i want count of chidren. try query not work table colums id, father_id , name select id parent_id , father_id ,name, count(select * users father_id = parent_id) child users use correlated sub-query count: select id parent_id , father_id ,name, (select count(*) users u2 u2.father_id = u1.id) child users u1

add in - How to open the URL for authentication inside the iFrame? -

i trying use rest api authentication in outlook add-in being redirected separate browser window instead of rendering in iframe , control never comes back. because of security constraints cannot implement oauth flow within addin sandboxed iframe, popup window necessary workaround. here best solution achieve oauth flow in popup. microsoft aware of problem , has started work on dialogapi avoid popup window (that may turned off). edit (september 2016): at keluro released open source code sample leverage sign-in technicalities. used more connecting azure ad/office 365 client side using dialogapi , popup fall can reused

python 3.x - Tensorflow clamp values outside specific range -

i have been using tensorflow implement convolutional neural network, have requirement the output values less given value max_val i tried creating matrix filled max_val , using tf.select , tf.greater : filled = tf.fill(output.get_shape(),max_val) modoutput = tf.select(tf.greater(output, filled), filled, output) but doesn't work because shape of output not known statically: [?, 30] , tf.fill requires explicit shape. any idea how implement this? there alternative solution uses tf.fill() initial version. instead of using tensor.get_shape() static shape of output , use tf.shape() operator dynamic shape of output when step runs: output = ... filled = tf.fill(tf.shape(output), max_val) modoutput = tf.select(tf.greater(output, filled), filled, output) (note tf.clip_by_value() operator might useful purposes.)

spring - How to get value from StepExecutionContext -

i have spring batch jdbccursoritemreader. defined @jobscope. see method signature below. @bean @jobscope public jdbccursoritemreader<masterlist> querystagingdbreader( @value("#{jobparameters['" + jobparamconstants.param_from_date + "']}") date jobfromdate, @value("#{jobparameters['" + jobparamconstants.param_to_date + "']}") date jobtodate) { this jdbccursoritemreader part of step 2 in job. in step 1 of job have tasklet. inside tasklet building list of dates jdbccursoritemreader in step 2 know about. my initial thought add list of dates stepexecutioncontext in tasklet so. @bean @jobscope public tasklet createjobdatestasklet( @value("#{jobparameters['" + jobparamconstants.param_from_date + "']}") date jobfromdate, @value("#{jobparameters['" + jobparamconstants.param_to_date + "']}") date jobtodate) { return new tasklet()

php - Not able to login using a login form in Symfony 3.1 -

i've been following tutorial on symfony website ( http://symfony.com/doc/current/security.html ) add login symfony 3.1 project. works fine http basic authentication, when add form_login using tutorial here ( http://symfony.com/doc/current/security/form_login_setup.html ) keeps redirecting login page , not logging in. here security.yml: security: providers: in_memory: memory: users: ryan: password: ryanpass roles: 'role_user' admin: password: kitten roles: 'role_admin' encoders: symfony\component\security\core\user\user: plaintext firewalls: login_firewall: anonymous: ~ dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: provider: in_memory form_login: login_path: /login check_path: /login_check logout: ~ access_c

C# WPF DataGrid.RowStyle set column style -

is possible affect style/behaviorto specified column in specified row in wpf c#? right have this: <datatrigger binding="{binding path=status}" value="2"> <setter property="grid.column" value="0"/> <setter property="isenabled" value="false" /> </datatrigger> the problem right is, entire row disabled. first column disabled in circumstances. this column, disable: <datagridtemplatecolumn header="details" width="100"> <datagridtemplatecolumn.celltemplate> <datatemplate> <button click="showdetails">details</button> </datatemplate> </datagridtemplatecolumn.celltemplate> </datagridtemplatecolumn> this works

How to join 'n' number of files in ordered way efficiently using paste/join or linux or perl? -

thousands of files ends *.tab. first column in each file header. every file have own headers (so different). don't mind have 1 header file. number of rows equal in files , have order. desired output have same order. example files in directory test_1.tab test_2.tab . . . . test_1990.tab test_2000.tab test_1.tab pro_01 0 0 0 0 0 1 1 1 0 1 1 0 .....0 pro_02 0 0 0 0 0 1 1 0 0 0 0 0 .....1 pro_03 1 1 1 1 1 0 0 1 0 1 1 0 .....1 . . . pro_200 0 0 0 0 1 1 1 1 1 1 0 .....0 test_2000.tab pro_1901 1 1 1 1 0 1 1 0 0 0 0 1 .....0 pro_1902 1 1 1 0 0 0 1 0 0 0 0 0 .....1 pro_1903 1 1 0 1 0 1 0 0 0 0 0 1 .....1 . . . pro_2000 1 0 0 0 0 1 1 1 1 1 0 .....0 desired output pro_01 0 0 0 0 0 1 1 1 0 1 1 0 0 ..... 1 1 1 1 0 1 1 0 0 0 0 1 0 pro_02 0 0 0 0 0 1 1 0 0 0 0 0 1 ..... 1 1 1 0 0 0 1 0 0 0 0 0 1 pro_03 1 1 1 1 1 0 0 1 0 1 1 0 1 ..... 1 1 0 1 0 1 0 0 0 0 0 1 1 . . . pro_200 0 0 0 0 1 1 1 1 1 1 0 0 ..... 1 0 0 0 0 1 1 1 1 1 0 0 my code for in *.tab/; paste allcol.tab &l

deep learning - Is there any way to change the default output shape of a fully connected layer in a convolutional neural network? -

Image
i'm reading paper depth prediction using multi-scale cnn. based on paper, used alexnet or vggnet in first scale. i'm interested in using vggnet that. there dark points in mind topic. example, can see in following table, output of second fc layer (1.6 & 1.7 fc layers) has strange shape of 19*14: as understood, fc layers not spatially located, output shape should one-dimensional: 1 * (# of outputs) each sample in mini-batch, (here batch size 16): so question: is there way change parameters of fc layer have such dimension (19*14) @ output? there no such parameters in fc layer, can use reshape layer reshape output size want. the output of fc layer 64x266 . can reshape 64x19x14 . documentation reshape layer: http://caffe.berkeleyvision.org/tutorial/layers.html

html - Table inside div goes out of div in Chrome only. It works fine in all other browsers -

i have div have fixed width table inside width:auto , table has 2 column. tried many things 100%. working solution have input search @ 150px don't understand. the table goes out of div shown in jsfiddle : <div style="border:1px solid black;border-radius:15px;margin-left:10px;float:left;width:180px;height:26px"> <table border="0" style="width:auto;height:100%;border-collapse:collapse;table-layout:fixed"> <tbody><tr> <td> <img id="searchicon" src="/content/icons-png/search-white.png" width="16" height="16" style="margin-left:5px;margin-top:4px;margin-right:5px"> </td> <td> <input id="searchbox" type="search" style="border:1px solid red;border-radius:0 12px 12px 0;height:100%;width:auto" placeholder="search"> <

How to describe the data structure of a data frame in R? -

i looking way describe data structure (not data itself) of data frame in r. df = read.csv2('data.csv') desc(df) output should df.columnname1 df.columnname2 (type) ... try: df_types <- data.frame("col_types" = unlist(lapply(df, typeof))) i use lapply loop on columns getting type. output named list, use unlist convert named character vector , cast data.frame printed output in format you're after.

Linux: maven resources:copy-resources plugin. Parameter with space character -

i have pom resources:copy-resources plugin: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>example</groupid> <artifactid>preprocess</artifactid> <version>1.0-snapshot</version> <build> <plugins> <plugin> <artifactid>maven-resources-plugin</artifactid> <version>3.0.1</version> <executions> <execution> <id>copy-resources</id> <phase>process-resources</phase> <go

inheritance - Can interface in java access to base class variable? -

when create interface reference variable base class type object. possible access variable in it's base class ? how can "bmw" defined in car constructor ? without creating method in interface must implemented in base class return variable. string getname(); , in base class public string getname(){return name;} interface drive(){ void start(); } public class car implements drive{ string name; car(string n){ this.name=n; } public void start(){ } } public static void main(string [] args){ drive d = new car("bmw"); string nameofthecar = d.name; //not work string nameofthecar = ((car)d.name); //not work you have 2 way it. make interface aware of property (implementing in class), eg.: public interface drive { string getname(); } otherwise have cast interface object type contains property you, did it, wrong syntax: string nameofthecar = ((car)d.name); //not work instead of: string nameofthecar = ((car) d).name; //not work

c# - Add XElement that uses namespace -

i create xdocument namespaces in constructor e.g. this.nsxsl = xnamespace.get("http://www.w3.org/1999/xsl/transform"); this.doc = new xdocument( new xelement(nsxsl + "stylesheet", new xattribute("version", "1.0"), new xattribute(xnamespace.xmlns + "xsl", "http://www.w3.org/1999/xsl/transform"), new xelement(nsxsl + "output", new xattribute("method", "xml"), new xattribute("indent", "yes"), new xattribute("encoding", "utf-8")), new xelement(nsxsl + "strip-space", new xattribute("elements", "*"))) ); this document has right structure , looks want. but have function like: private xelement createtemplate(string match, string node, string fork, string select) { return new xelement(this.nsxsl + "template", new xattribute("match&

c++ - How to initialize unique variables in base class (Inheritance) -

if declaring several variables in base class, defined in every derived class, right? want have variables in base class once derived class. example: class base{ public: virtual ~base(); protected: base(); int fileindex; }; class deriveda : public base{ public: deriveda(); virtual ~deriveda(); void dosth(); //using fileindex }; class derivedb : public base{ public: derivedb(); virtual ~derivedb(); void dosthdifferent(); //using same fileindex }; how can that? just make fileindex static variable: static int fileindex; then instances derived classes share same value

notepad++ - How to copy/text in html and paste in new file? -

is there way can search specific pattern project(.html files) , paste new file. using sublime text. and list search , comment keyword not present in 1 more file. example html files <a href="javascript:void(0)" title="getalt('imagealt')">img</a> <a href="javascript:void(0)" title="getalt('imagealt2')">img2</a> <a href="javascript:void(0)" title="getalt('imagealt3')">img3</a> <a href="javascript:void(0)" title="getalt('imagealt4')">img4</a> get keyword'getalt' key in new file imagealt imagealt2 imagealt3 imagealt4 prop file imagealt ="www.abc.com" imagealt2 = "www.abc1.com" imagealt22 = "www.abc11.com" imagealt3 = "www.abc2.com" imagealt4 = "www.abc3.com" search in prop file same name , rest should commented result imagealt ="www.abc.com"

android - Using custom fonts crashes my application -

i using custom font in application using typeface class. when run application crashes , open .otf file in tab. images linked. thanx in advance :-) here java code: textview text = new textview(this); layoutparams params = new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content); //params.setmargins(100,100,500,100); typeface tf = typeface.createfromasset(getassets(),"/fonts/adobearabic-regular.otf"); text.settypeface(tf); text.setpadding(150,100,150,100); text.setgravity(gravity.center_horizontal); text.settextcolor(getresources().getcolor(r.color.white)); //text.setbackgroundresource(r.color.green); text.setlayoutparams(params); here error window: please try below one. typeface tf = typeface.createfromasset(getassets(), "fonts/adobearabic-regular.otf"); you added '/' in front of

scala - Play error on startup: No implementation for play.api.db.Database was bound -

when attempt run play application (play 2.5.4) following error: provisionexception: unable provision, see following errors: 1) no implementation play.api.db.database bound. while locating play.api.db.database parameter 0 @ ds.qb.manage.managequerybuilder.<init>(managequerybuilder.scala:30) while locating ds.qb.manage.managequerybuilder parameter 16 @ router.routes.<init>(routes.scala:107) while locating router.routes while locating play.api.inject.routesprovider while locating play.api.routing.router parameter 0 @ play.api.http.javacompatiblehttprequesthandler.<init>(httprequesthandler.scala:200) while locating play.api.http.javacompatiblehttprequesthandler while locating play.api.http.httprequesthandler parameter 4 @ play.api.defaultapplication.<init>(application.scala:221) @ play.api.defaultapplication.class(application.scala:221) while locating play.api.defaultapplication while locating play.api.application this da

PHP Session not getting started but using other session -

i have code in have used session_start() not working. using php. scenario below : as in php need put session_start() in each file if want access session. have created common file being included on each php page.in common file first line session_start() & have included file in each other php file first line. so when run code session not getting started. it's redirecting same page session not set & not getting values inside session because it's not created. what did, testing created test project. in taken 2 files index.php & index1.php. started session in index.php & used in index1.php. it's running properly. because of code taking session file of test project. so whenever need run code, running test project first (so session created it) & running code. working fine. but alone it's not starting session & other session related checks failing & redirecting same page again & again. why happening ? whats reason behind ? have f

c++ - Editing QSS Stylesheet programmaticly -

well title explain issue have. want have qss stylesheet in specific folder. , want edit selected elements gui, programmatically. since qt doesn't support sass or less, need "manually". have until read qss file , few if statments can value of each element placed on qss file. qtextstream in(qssfile); line = in.readline(); if(line.startswith("qdialog")) { int start = line.indexof("{") + 1; int end = line.indexof("}", start); qdebug() << "qdialog" << line.mid(start, end - start); //"background-color: #404040;" } i read line , if user changes values on gui, save new ones. of course 1 isn't best/right solution how can make better solution issue have? update 1: sample code have added may work, seems "junk" code 7-8 if statements each line. need if can set variables each elements in stylesheet such as: qdialog{ background-color: @dialogbackgroundcolor; min-width: @dial

java - How set Array/List in Spring jdbcTemplate as parameter? -

i have sql query many placeholders '?', builds dynamically, want put array of values replace placeholders. size of array can different every time. array consists parameters in order. return jdbctemplate.query(queries.somequery, new object[] {/* array must here */}, new resultsetextractor<list<string>>() { @override public list<string> extractdata(resultset resultset) } }); example of sql generations: for (int j = 0; j < y; j++) { conditionsbuilder.append("\n , p"+i+".object_id=o.object_id\n" + " , p"+i+".attr_id =?\n" + " , p"+i+".value =?\n"); tablesbuilder.append(",patameters p"+i+" "); i++; } use arraylist : arraylist<object> values = new arraylist<>; in for loop should add values in order appear in query: values.add(value); then turn

How to check undefined in AngularJS? -

can add check undefined value in ng-init .? if there value in scope print else print foobar . currently, should print foobar can add condition in ng-init ? here code http://plnkr.co/edit/bfbawxq6dkdkxwaxp7v8?p=preview <body ng-controller="mainctrl" ng-init="test|| 'foobar'"> <p>hello {{test}}!</p> </body> it's simple: <body ng-controller="mainctrl" ng-init="test = test|| 'aasasas'"> <p>hello {{test}}!</p> </body> you can write write in javascript expression/line. var app = angular.module('plunker', []); app.controller('mainctrl', function($scope) { }); <script data-require="angular.js@1.0.x" src="http://code.angularjs.org/1.2.0rc1/angular.js" data-semver="1.0.7"></script> <div ng-app="plunker" ng-controller="mainctrl" ng-init="test = test|| '

css - Change datepicker bootstrap margin from field -

Image
i want remove margin of date-picker's text field. what want, make date-picker in picture you can modify margin of .datepicker element, e.g.: .datepicker { margin: 5px 0; } change 5px whatever need.

MySQL Query to get a list of events with at least 3 different status? -

i have database containing 2 tables : events (id, name, is_active) event_logs (id, event_id, status, message) i'd list events had @ least 3 different status logs in , still active ( is_active=1 ) , can't come correct mysql query that. (i can add more details if needed, ask :) ). here's sqlfiddle : http://sqlfiddle.com/#!9/a7442 in example, i'm looking event id 2 because contains 3 different status in event_log : info, warning , error. event id 1 , 3 contains less 3 , excluded. thank help! maybe more coffee required... select e.* events e join event_logs l on l.event_id = e.id is_active=1 group e.id having count(distinct l.status) >=3

templates - How to use style on input field in Demandware? -

i want append image in input field in demandware... i wondering use style on demandware's isinputfield tag, can acheive in demandware templates on tag isinputfield formfield="${pdict.currentforms.helloform.nickname}" type="input" much appreciated! isinputfield custom isml tag, implemented in template {cartridge_name}/cartridge/templates/default/util/inputfield.isml you can use parameter rowclass specify css class surrounding div (you can see code uses parameter in template mentioned above) e.g. <isinputfield formfield="${pdict.currentforms.giftcert.purchase.from}" rowclass="label-above" type="input" /> after need provide css styling class have applied.

java - Setting a client receiveTimeout for CXF service above 4 minutes -

i have generated cxf service , set timeouts 120000ms = 2min both: requestcontext.put("javax.xml.ws.client.receivetimeout", 120000); requestcontext.put("javax.xml.ws.client.connectiontimeout", 120000); it working fine, have tested 20s, 1min, 3min - everytime waiting response exacly amout of time. however problem apears when wanted set on 5min . service waiting resposne ~240800ms = ~4min . i'm calling jboss esb service. 1 lasts max 5min . cxf service called inside of simple .jar application pc, there no other servers/containers between (like tomcat etc). any ideas fix timeout settings? using apache cxf 3.0.1 edit what realized i'm getting 2 diffrent messages depends on timeout settings: if set <=4min (via or @pedrofb method), after amount of time i'm getting: org.apache.cxf.interceptor.fault: not send message. @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderi