Posts

Showing posts from January, 2013

How to pass template text to bean from the JSF page -

i have check box has long description. want pass description in email if user selected check box. i don't want write same description in end bean , jsf page. instead want pass front end description bean. how can in jsf <h:selectbooleancheckbox value="#{contactusbean.subscribenewsletter}" /> receive news letters company abc......... and long lengthy description need pass bean. put span around want grab id. on form submission grab content javascript , put in hidden input field , in bean. or, know, write in bean or bundle , grab there. to grab bundle file: create package named "strings" or whatever want call it. create file named "strings.properties". in write content : content=bla bla bla. then grab file such: private final static string bundle_basename = "resources.strings.strings"; private resourcebundle bundle = resourcebundle.getbundle(bundle_basename, facescontext.getcurrentinstance().getview

javascript - Tracking if backspace or delete key is pressed in an input field -

i wondering how can track if users hit backspace or delete key in input field. afterwhich add variable called count each time buttons pressed. have code not seem work; great appreciated, thank you. var count = 0; var input = document.getelementbyid('display'); input.onkeydown = function() { var key = event.keycode || event.charcode; if( key == 8 || key == 46 ) count++; return false; }; multiple lines inside conditional or loop, etc. need wrapped in braces: if( key == 8 || key == 46 ) { count++; return false; } you want add default return true last line differentiate whether entered if or not well.

java - Jmeter Sequencing A Flow -Multiple Threads (Using REST API Token ) -

Image
i trying test following scenario using jmeter. step 1. login request (which returns token) step 2. calling one.api uses token returned in step 1. step 3. calling two.api uses token returned in step 1. step 4. logout. i able achieve above scenario 1 thread works fine. now requirement run same stuff 10 users. 1. 10 login requests should performed. 2. 10 calls one.api should made using 10 different tokens generated. token should not repeated of calls api. 3. 10 calls two.api should made using 10 different tokens generated. token should not repeated of calls api. 4. 10 log out request. i tried assign multiple token, example token1,token2,token 3 etc, can use same one.api dynamically, using http header passing token header value. below not working. x-auth-token value assigned ${$token${__threadnum}} dynamic variable names not seems working, there other way of doing same stuff. it won't work way, jmeter doesn't support nested variable reference, need us

python - Compare columns pandas -

Image
i have 4 columns in 2 dataframes , want check if id1 = id2 , count1 = count2 in columns same , result 1 if match or 0 if don't. code returns 0. think doesn't iterate 1 one , in distinct row numbers. tried zip columns want, don't see difference. have ideas? thank you! import pandas pd file1 = 'file1.csv' file2 = 'file2.csv' df1 = read_csv(file1) df1 = read_csv(file2) id1 = df1['id1'] count1 = df1['count1'] id2 = df2['id2'] count2 = df2['count2'] newresult = pd.concat([id1, count1, id2, count2], axis = 1) id1 = zip(df1['id1']) count1 = zip(df1['count1']) newresult['compare'] = newresult.apply(lambda x: 1 if x['id1'] == x['id2'] , x['count1'] == x['count2'] else 0, axis = 1) import pandas pd import numpy np df = pd.dataframe(np.random.randint(0, 2, (50, 4)), columns=["id1", "id2", "count1", "count2"]) df["com

Android app with two different apks -

i facing strange problem on android app.when run app in emulator runs app when checked on installed app list on emulator, shows 2 apps same name "simplifimed" (my app name) installed.when clicked on other app icon runs app separately shows old version screens.i have tried uninstalling both apps , tried running app again same 2 apps installed. previously app working fine upload google play store have change package name.so have changed package name com.example.simplifimed com.medical_ocr_app.simplifimed used android tools->rename application package eclipse i have checked manifest , everywhere new package name added properly.also new application works fine without error in emulator.only problem installs 2 apps (different apk) can me this? my andriod manifest file follows, <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.medical_ocr_appln

jquery - dynamically add row in Javascript not working in IE -

dynamically adding new rows using javascript. works fine in firefox in ie doesn't work properly. issue : when adding new row ,values fetching previous row. hide cell doesn't work ( newcell.style.display = "none" ) getting undefined in ie ( newcell.childnodes[1].type ) my code: html <table id="coins" class="coins" name="coins"> <tr id="0"> <th> <label>bills/coins</label> </th> <th> <label>qty</label> </th> <th> <label>line amount</label> </th> </tr> <tr id="1"> <td> <cws:productcashlist onchange="productprice(this)"/> </td> <td> <input

R Date origin for formatting -

i read this example using origin set date start time. reading in csv dates number of days , read in factors. example: $ admin_date : factor w/ 318 levels "37362","37735" i convert date formats measure number of days , months between events. when try of different origin such as: df$admin_date_new <- as.numeric(df$admin_date) df$admin_date_new <- as.date(df$admin_date, origin="1900/01/01") i following: $ admin_date_new: date, format: "1900-08-31" is finding correct origin or when converting numeric is there quick way find origin necessary? read help("as.date") , got was: ## date given number of days since 1900-01-01 (a date in 1989) as.date(32768, origin = "1900-01-01") ## excel said use 1900-01-01 day 1 (windows default) or ## 1904-01-01 day 0 (mac default), complicated excel ## incorrectly treating 1900 leap year. ## dates (post-1901) windows excel as.date(35981, origin = "1899-12-30&quo

xml - Android: textColor of disabled button in selector not showing? -

i trying make button selector button can have following states: enabled/disabled pressed/not pressed according states mentioned above. need manipulate button's: text color background image the button starts off being disabled should have disabled textcolor , disabled button background. can see default textcolor (specified in style) , no background image! here selector button_selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:state_enabled="false" android:textcolor="#9d9fa2" android:drawable="@drawable/button" /> <item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/button_pressed"/> <item android:state_pressed="true"

ios - How to display 3 cells per row in UICollectionView? -

Image
i used custom flow layout according this post . here implementation: @implementation customlayout -(void)preparelayout{ [super preparelayout]; // [self invalidatelayout]; if(self.collectionview){ cgsize newitemsize=self.itemsize; // number of items per row int itemsperrow=3; float totalspacing=self.minimumlinespacing*(itemsperrow-1); newitemsize.width=(self.collectionview.bounds.size.width -totalspacing)/itemsperrow; if(self.itemsize.height>0){ float itemaspectratio=self.itemsize.width/self.itemsize.height; newitemsize.height=newitemsize.width/itemaspectratio; } [self setitemsize:newitemsize]; } } @end this i've got: did miss? i've come across other posts no luck far. //make use of uicollectionviewdelegateflowlayout protocol class rvc: uicollectionviewcontroller { //some code } extension rvc: uicollectionviewdelegateflowlayout{ func collectionview(collectionview: uicollectionview, layout collecti

javascript - How to work around VIS Timeline group ordering bug in Chrome? -

vis.js timeline has bug in chrome (only). changes ordering of groups when there more 10 groups (trucks). in this exmaple in chrome browser truck 11 display in first row , truck 2 display after truck 10 . in other browsers ordering of groups correct. how can make chrome display groups in right order? example: http://jsfiddle.net/parhum/rcsrfaka/ html code: <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.9.0/vis.min.css"> <div id="js__timeline"></div> js code: <script> /** * url parameter * http://www.netlobo.com/url_query_string_javascript.html */ function gup( name ) { name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"); var regexs = "[\\?&]"+name+"=([^&#]

sip - Asterisk: Where asterisk stores it's data -

i'm finding place asterisk stores it's data. example: command "show sip peers" return sip peers ip address , status. wonder stored in drive. i didn't install mysql or db sip registrations stored in astdb mentioned before. believe asterisk 11 astdb sqlite database.

javascript - How to add class after append in Backbone.js? -

back again question todo-app. currently development going good. it's possible add todo's, delete todo's, edit todo's , 'finish' todo's. you can see result far here: http://todoapp.lusenet.com/ the app contains views: todoview , appview. appview renders application using todoview. when application gets loaded, initialize function of appview gets called. happens there: initialize: function(){ this.input = this.$('#addtodo'); this.todocollection = new app.todocollection(); // create collection this.todocollection.fetch({reset: true}); // fetch items this.listento(this.todocollection, 'reset', this.addall); this.listento(this.todocollection, 'add', this.addone); } so create new collection, fetch models in there, fires reset event. reset calls addall function. this addall function: addall: function(){ var = 0, self = this; this.$('#todolist').html(''); // clean

Browser detect code in PHP not detecting Opera -

i found code in php documentation . seems nice , simple code, can detect google chrome, firefox, ie , safari cannot detect opera. output in opera: browser: google chrome 45.0.2454.93 on windows reports: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/45.0.2454.93 safari/537.36 opr/32.0.1948.69 need in modifying code can detect opera. <?php function getbrowser() { $u_agent = $_server['http_user_agent']; $bname = 'unknown'; $platform = 'unknown'; $version= ""; //first platform? if (preg_match('/linux/i', $u_agent)) { $platform = 'linux'; } elseif (preg_match('/macintosh|mac os x/i', $u_agent)) { $platform = 'mac'; } elseif (preg_match('/windows|win32/i', $u_agent)) { $platform = 'windows'; } // next name of useragent yes se

java - Repeat entire test class in TestNG, with different parameters -

i have code testing site selenium webdriver. there 4 @test methods, , @dataprovider 3 values. so, in total twelve tests run. public class sometest { webdriver driver; @dataprovider(name = "urls") public object[][] createdata1() { return new object[][] { {"url 1"}, {"url 2"}, {"url 3"}}; } @beforemethod //right i'm setting weddriver chrome, //i'll need run test firefox, chrome, , ie public void setupwebdriver(){ driver = webdrivers.getchromedriver(); } @aftermethod public void closewebdriver(){ driver.quit(); } //test methods below @test(dataprovider = "urls") public void test1(string url){ //test 1 url } @test(dataprovider = "urls") public void test2(string url){ //test 2 url } @test(dataprovider = "urls") public void test3(string url){ //tes

Android Wear - code to read LogCat output programmatically and continuously is not working -

hi wrote code read logcat output continuously within background thread started background service in app. not think there errors in code it's not working. in thread , have: @override public void run() { process process = null; string cmd = "logcat -v time | grep 'audiofocus requestaudiofocus()'"; try { process = runtime.getruntime().exec("su"); dataoutputstream os = new dataoutputstream(process.getoutputstream()); os.writebytes("logcat -c" + "\n"); os.writebytes(cmd + "\n"); os.flush(); } catch(exception e) { } bufferedreader reader = new bufferedreader(new inputstreamreader(process.getinputstream())); string line; try { while ( (line = reader.readline()) != null ) { log.e(staticval.tag, line); // code write line own log file } } catch(exception e) { } } i added permission manifest: <us

hook - C# How would I intercept all packets and find out the IPs through hooking? -

actually have 3 questions: 1- according nazar grynko answer, intercepting 3 functions(send , recv,and connect) me anticipate packet in machine? 2- if hooked 3 functions, how intptr points sockaddr structure p/invoked native function? 3- send, , recv not having sockaddr, how figure out addresses? thank in advance. the functions described part of posix standard. means when use these functions on windows, you're calling wrapper translates system call . can send packets without use of function (e.g, using windows api). see answer number one. won't you. you'd have provide hook processes. the functions describe use file descriptor posix construct, , user-mode simulated on other systems. to inspect traffic must use driver you. might want @ pcap.net c# project aimed @ problem, , provides driver , api necessary.

jsoup - Failing to start java program ClassNotFound exception received -

trying start java program on linux fails locate jsoup jar file. have checked other questions , found on how add libraries while compiling , while trying run not sure if doing correctly because still fails load library.... i enter following commands: root@vps5441:/var/www/var/www/timetableloader# javac -cp /var/www/var/www/timetableloader/jsoup-1.8.1.jar:/var/www/var/www/timetableloader/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar. timetableloader.java root@vps5441:/var/www/var/www/timetableloader# java -cp /var/www/var/www/timetableloader/jsoup-1.8.1.jar:/var/www/var/www/timetableloader/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar. -classpath /var/www/var/www/timetableloader/ timetableloader and following error when program tries access jsoup library. exception in thread "main" java.lang.noclassdeffounderror: org/jsoup/jsoup @ timetableloader.main(timetableloader.java:46) caused by: java.lang.classnotfoundexcep

javascript - How to resolve mysql queryAsync (promisify pool) until result will not complete? -

i'm working bluebird promises lib old code looks this: var sql1 = this.pool.queryasync("1.sql").get(0); var sql2 = this.pool.queryasync("2.sql").get(0); var sql3 = this.pool.queryasync("3.sql").get(0); return promise.join(sql1, sql2, sql3, function (sql1result, sql2result, sql3result) { //fetching results.. }); now need cancel perform queries if result full. speaking: var commonresult = []; while(commonresult.length < 20) { commonresult.push(sqlresult); }

mongodb php query in documents with nested objects -

so here sample of document in mongodb collection: { "_id" : objectid("561e0de61c9218b7bf9877c3"), "date" : numberlong(20151014), "hour" : numberlong(10), "productid" : objectid("5614ba9c2e131caa098b4567"), "productname" : "test", "producerid" : objectid("5617802151f8adf4db329d52"), "producername" : "producer", "producerrate" : numberlong(300), "producermedium" : "emailer", "totallead" : numberlong(6), "verifiedlead" : numberlong(3), "unverifiedlead" : numberlong(2), "unqualifiedlead" : numberlong(1), "totalearning" : numberlong(660), "consumers" : [ { "consumerid" : objectid("5617802151f8adf4db329d54"), "consumername" : "consumer1",

django - How to disable/disconnect m2m_changed signal during testing? -

i trying load fixture during django test case, m2m_changed signal kicks in , gives error (the signal checks foreignkey in related state). this answer suggests using disable_for_loaddata decorator, m2m_changed doesn't have raw field . i have tried: class daystests(apitestcase): fixtures = ['initial_data.json'] # fixture loaded before disabling m2m_changed def setup(self): m2m_changed.disconnect(days_handler, sender=foo.days.through) def test_api(self): # test logic. initial data loaded before disabling m2m_changed signal. what right way disconnect/disable m2m_changed signal? you should try disable signal not in setup method in setupclass because it's executed before loading fixtures. possible way use it: @classmethod def setupclass(cls): super(daystests, cls).setupclass() m2m_changed.disconnect(...)

html - bootstrap: Image in tab messed up with other tab displays -

Image
well trying put image left of nav tabs, seems isnt right. tabs align top of image, while want opposite, tabs should align bottom of image. can see screenshot more details of how messed up: below html code use bootstrap, know how solve display issue? <ul class="nav nav-tabs nav-justified"> <li class="nav nav-item"><img src="{$image}" class="img-responsive"></li> <li id="atab1" class="nav-item"><a href="#tab1" data-toggle="tab" class="nav-link active">about</a></li> <li id="atab2" class="nav-item"><a href="#tab2" data-toggle="tab" class="nav-link">posts</a></li> <li id="atab3" class="nav-item"><a href="#tab3" data-toggle="tab" class="nav-link">goods</a></li>

javascript - How to filter an object array by a string with underscore.js -

this how object array looks like: [ {"id":"1","name":"john"}, {"id":"2","name":"jose"}, {"id":"3", "name":"mike"} ] i want filter string "jo" can bring me first , second item. how can make return objects in same "object array" form such this: [ {"id":"1","name":"john"}, {"id":"2","name":"jose"} ] the object filtered on autocomplete dropdown menu created "select2.js" library. this create using examples in stackoverflow far: ("something do" part have failed, other parts work well) $parameterselect.select2({ data : { results : $scope.parameters, text : 'name' }, // init selected elements value initselection : function (element, callback) { var initialdata = []; $(element.val().spl

javascript - resizing divs with jquery crashes window -

i've split page 3 divs , i'm trying set dimensions jquery each div same size window. my code working after few consecutive window resizes div resize begins lag. lag gets bigger , bigger more resize window until browser window appears crash. is there can make resize smoother , prevent crash? here's code: $(document).ready(function() { sectionsize() function sectionsize() { var w = [] var h = [] var docwidth = $(window).width() var docheight = $(window).height() w.push(docwidth); h.push(docheight); $(".section").css({ "height": h, "width": w }); $(window).on('resize', function() { w.push(docwidth); h.push(docheight); sectionsize() }); } }) body { margin: 0; } .section { position: relative; } .section p { position: absolute; bottom: 5px; left: 45%; } #top { background-color: blue; } #mid

xml - Change the restrictions of a simpletype element in child type -

i have type hierarchy in xsd following: type -> type b -> type c... now type b defined like: <xs:complextype name="typeb"> <xs:complexcontent> <xs:extension base="typea" > <xs:sequence> ... <xs:element name="elementa" minoccurs="0"> <xs:simpletype> <xs:restriction base="xs:int"> <xs:mininclusive value="0"/> <xs:maxinclusive value="10"/> </xs:restriction> </xs:simpletype> </xs:element> </xs:sequence> </xs:extension> </xs:complexcontent> </xs:complextype> type c not need add elements type b defined like: <xs:complextype name="typec"> <xs:complexcontent> <xs:extension base="typeb"> </xs:extension

email - PHP message sends "undefined" -

i have mail.php sends out email. code i'm using. <?php if(isset($_post['submit'])){ $to = $_post['email']; $subject = 'your results!'; $message = $_post['message']; $headers = 'from: example@example.com' . "\r\n" . 'reply-to: example@example.com' . "\r\n" . 'x-mailer: php/' . phpversion(); //mail($to, $subject, $message, $headers); //header("location: thankyou.php"); echo $message; } ?> the contents of email supposed .innertext of of div have on index.php page. if echo out message, output appears page (mail.php) when comment/uncomment necessary parts email myself message receive "undefined". is $message not defined? here form , javascript i'm using <form action="mail.php" method="post" onsubmit="this.message.value = document.getelementbyid('box').innertext;"> <input type="email" name="email&

regex - AWK Replace strings by the same strings with underscores -

i have 3 files. 1 original file, contains part of lines of original , file modified parts have replace original. , not know start. can me? match file: demandé de montrer grandes vacances de faire montré remis bien posé n ' quand il l ' arrière du véhicule modèle essence replace file: a_demandé_de_montrer grandes_vacances de_faire a_montré a_remis bien_posé n_' quand_il_l_' arrière_du_véhicule modèle_essence original file: 120km/h, la consommation tourne autour de 7.5l/100km si le vent est dans le dos... ce jour, je suis totalement satisfaite ce moment-là aux grandes vacances on m'a demandé de montrer le bon. chacun son choix chaque fois c'est moi qui dois les recontacter. eux de faire leurs avis.... l'achat, le vendeur m'a montré comment rabattre le siège arrière, mais quand il l'a remis en place, ce n'était pas bien posé. l'arrière du véhicule, il était inscrit qu'il s'agissait d'une diesel, alors que c'est

linux - Create service tomcat - Start and Shutdown -

i installed apache tomcat start service, have go path $home/apache-tomcat-8.0.28/bin , run script ./startup.sh start , ./shutdown.sh shutdown. how can make service tomcat start service tomcat stop or way not need go path of tomcat on ubuntu? /etc/init.d/tomcat stop /etc/init.d/tomcat start

How do I know which are the first characters before "/"? asp.net vb.net -

i have string that: dim temp string = "batch 634239100a/45 pcs booked out vladut moraru on 10/15/2015" or dim temp string = "batch 322.3/4 pcs booked out vladut moraru on 10/15/2015" or dim temp string = "batch 322/3/4 pcs booked out vladut moraru on 10/15/2015" i want display 322/3/ batch : 322/3/ pcs : 4 i want display : 322/3/ of string i thought i'd find 322/3/4 , give split after last / , find value before / , how? the easiest thing use regularexpression , there limitations this, you're including date in string. if numbers in format of nnn/nnn/nn and appear before date work... dim regexmatch system.text.regularexpressions.match regexmatch = system.text.regularexpressions.regex.match(mystring, "(\d{3}/\d{3})/(\d{2})") if regexmatch.success dim batch string = regexmatch.groups(1).value dim pcs string = regexmatch.groups(2).value end if the regex (\d{3}/\d{3})/(\d{2}) breaks down as...

c# - Unable to hit Web Api in .Net MVC -

hi starting mess webapi setup rest api angular app. i added "web api 2 controller read/write actions" i try test typing url in browser 404. everything pretty out of box. webapiconfig.cs looks like public static class webapiconfig { public static void register(httpconfiguration config) { config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); } } routeconfig.cs is public class routeconfig { public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.

java - Can't access ArrayList in other view? android null pointer exception -

i trying access arraylist of integers previous class set in previous view doesn't seem saving arraylist correctly when go new view think deletes whatever there? is there anyway access "lightinfo" set? connecttest declaration public class connecttest extends mainactivity { textview out; private static final int request_enable_bt = 1; private bluetoothadapter btadapter = null; private bluetoothsocket btsocket = null; private outputstream outstream = null; // known spp uuid private static final uuid my_uuid = uuid.fromstring("00001101-0000-1000-8000-00805f9b34fb"); // insert server's mac address private static string address = "a4:5e:60:eb:3c:e8"; arraylist<integer> temp = ((mainactivity) getapplicationcontext()).lightinfo; call temp creates error: string finalmessage = ""; (int = 0; < temp.size(); i++) { finalmessage = finalmessage + temp.get(i

excel vba - Filter the list in a combox in vba form as you type -

i have problem on how apply filter in combo box , requiry records. i using combo box named customers contains names of customers (approx 3000) array called settings.customerarray i want shrink list automatically type text in combo box, idea adapt this method somehow achieve want. not working code looks this, not refresh form correctly. private sub project_comboboxcustomer_change() dim e, temp me temp = .project_comboboxcustomer.value if not .project_comboboxcustomer.matchfound .project_comboboxcustomer.clear if len(temp) each e in cpearson.getcolumnfrom2darray(settings.prosjektcustomerarray, 1) if (e <> "") * (e "*" & temp & "*") .project_comboboxcustomer.additem e end if next if .project_comboboxcustomer.listcount > 0 .project_comboboxcustomer.listin

How avoid redundant variable in angularjs -

i have 2 controllers. the first 1 listcontroller.js: app.controller('listctrl', function($scope, $http, $controller, $window) { $scope.user = [{id:1,name:'rina'},{id:2,name:'anna'},{id:3,name:'yuna'}]; }); and second editcontroller.js app.controller('editctrl', function($scope, $http, $controller, $window) { $scope.user = [{id:1,name:'rina'},{id:2,name:'anna'},{id:3,name:'yuna'}]; }); as u can see. used variable $scope.user in both controller. want used once. mean want avoid redundant codes. how can call variable in of controller. suggestions? you can add service, responsible providing data. app.service('usersservice', function() { this.getusers = function() { return [{id:1,name:'rina'},{id:2,name:'anna'},{id:3,name:'yuna'}]; } }); then in controllers can put this: app.controller('listctrl', function($scope, $http, $controller, $

php - Multidimensional associative array as response in NuSOAP -

i have problems response in soap. in general can not undertand how response multidimensional associative array soap-client. used nusoap v 1.123 library. so have code in soap-server: $server->wsdl->addcomplextype( 'returndatainside', 'complextype', 'struct', 'all', '', array( 'message' => array('name' => 'message', 'type' => 'xsd:string', 'nillable' => 'true'), 'value' => array('name' => 'value', 'type' => 'xsd:string', 'nillable' => 'true'), ) ); $server->wsdl->addcomplextype( 'returndataoutside', 'complextype', 'array', 'all', '', array(), array(), 'tns:returndatainside' ); $server->register('test', array('param_1' => 'xsd:i

android - Docker ENV command no longer valid when using docker run -

i trying build android application within docker container, i'm having trouble setting environment variables when call docker run . i've created dockerfile @ ci/dockerfile looks like: from centos maintainer jonathan maltz <my@email.com> # install development tools run yum -y groupinstall "development tools" # yum update run yum -y update # install java (openjdk) run yum -y install java-1.7.0-openjdk-devel # install 32bit library run yum -y install glibc.i686 run yum -y install libstdc++.i686 run yum -y install glibc-devel.i686 run yum -y install zlib-devel.i686 run yum -y install ncurses-devel.i686 run yum -y install libx11-devel.i686 run yum -y install libxrender.i686 # install android sdk run cd /usr/local/ && curl -l -o http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && tar xf android-sdk_r24.4.1-linux.tgz # environment variables env android_home /usr/local/android-sdk-linux env path $path:$android_home/tools env path

tsql - Explanation for the fn_dblog() function's output on SQL Server 2008 R2 -

i have query me basic information regarding transaction log ( .ldf ) file. here is: with cte ( select allocunitname, operation, context, [lock information], sum(convert(bigint, [log record length])) totaltranlogbytes, sum(convert(bigint, [log record length])) * 100 / sum(convert(money, sum(convert(bigint, [log record length])))) over() percentoflog sys.fn_dblog(null,null) group allocunitname, operation, context, [lock information] ) select allocunitname, operation, context, [lock information], totaltranlogbytes, percentoflog cte percentoflog >= 0 order totaltranlogbytes desc unfortunately, don't understand output... i'm concerned top row query's results, it's largest amount of space used in transaction log, simple! however, there other columns, allocunitname , operation , context . in case, get:

hadoop - How to run logistic regression of mahout from java code instead of command prompt? -

i know algorithm , how run command prompt. there specific code call logistic regression mahout , providing predictors , target ,other inputs? mahout's onlinelogisticregression described here: https://mahout.apache.org/users/classification/logistic-regression.html and example available in mahout's source code: https://github.com/apache/mahout/blob/master/examples/src/main/java/org/apache/mahout/classifier/sgd/trainlogistic.java#l72

If PHP sends two headers, which will be effective? -

if have 2 headers like: header("cache-control: public"); header("cache-control: private"); which effective (first or last)? on script second header() used: <?php header('location: http://google.de'); header('location: http://stackoverflow.com'); on script second header() used: <?php header("cache-control: public"); header("cache-control: private"); if header defined multiple times, last 1 used!

Prototype design pattern example (c++) -

i learning prototype design pattern , confused example represented on this article sourcemaking . class stooge { public: virtual void slap_stick() = 0; virtual stooge* clone() = 0; }; class larry : public stooge { public: void slap_stick() { cout << "larry: poke eyes\n"; } stooge* clone() { return new larry; } }; class moe : public stooge { public: void slap_stick() { cout << "moe: slap head\n"; } stooge* clone() { return new moe; } }; class curly : public stooge { public: void slap_stick() { cout << "curly: suffer abuse\n"; } stooge* clone() { return new curly; } }; class factory { public: static stooge* make_stooge( int choice ); private: static stooge* s_prototypes[4]; }; stooge* factory::s_prototypes[] = {0, new larry, new moe, new curly}; stooge* factory::make_stooge( int choice ) { return s_prototypes[choice]->clone(); } int main() { v

canvas - Replace javascript context.arc with an image -

i have code draw circle on canvas. create: function(){ context.beginpath(); context.arc(this.x, this.y, this.radius, 0, math.pi * 2, false); context.fill(); } is possible replace circles images? looks duplicate of html5 canvas - fill circle image . there's clipping example on mdn: https://developer.mozilla.org/en-us/docs/web/api/canvas_api/tutorial/compositing#a_clip_example

html - Image is not centered with background -

i centering image in following code center background fades.i have managed put image in center background color. how fix ? please tell how position image well? html <section id="contact"> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-10 col-md-5 centered"> <img src="something.jpg" alt=""> </div> </div> </div> </section> css #contact { background-color:black; } .container { text-align: center; position:absolute; margin:0; padding:0; top:50%; left:50%; transform: translate3d(-50%, -50%,0); } #contact .centered { float:none; margin:0 auto; } #contact img { border-radius:50%; border: 4px solid #fff; } if give outer position absolute , container position relative , can , left, top 50% values, make them in outer div because put them 1 within other #contact{ bac

Awk calculation rounding output to integers -

i have calculation , need it's output whole number, might return 1 desimals. echo $((ram/50)) | awk '{printf( "%.0f\n", $1*0.$1 )}' so, ram/50, in case, returns 36, piped awk. want awk multiply number 0.the number itself, so: 36*0.36. return 12.96, want rounded 13. command now, 36*0.36 calculation doesn't work , printf removes .96, dosen't round off. your problem related operator precedence. multiplication higher precedence string concatenation, need parentheses in order make work expect: echo 36 | awk '{ printf "%.0f\n", $1 * ("0." $1) }' in version, order of operations means you're multiplying field 1 0, concatenating field 1, before passing result printf .

sql - Like Operator does not work -

Image
i have following code in sql server 2014 enterprise: select c.id dbo.content c c.id = 8753495 , c.content '%paypal%' this code used know if content has match word paypal , returning 0 results, , id, know has in content word "paypal" . i've tried different words of content , words it's working , others doesn't. the database content table both use sql_latin1_general_cp1_ci_as collation. can me? edit: purpose of query else, not return id, found problem on operator, give part failing also tried upper/lower still doesn't work here creation script. create table [dbo].[content]( [id] [int] not null, [content] [nvarchar](max) null, constraint [pk_content_1] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on, fillfactor = 100) on [primary] ) on [primary] textimage_on [primary] go thanks replies. edit 2: question isn&#