Posts

Showing posts from February, 2012

java - tomcat started without error, but when I try to access the website it return 404 -

i following steps in website: http://www.codejava.net/frameworks/spring/spring-4-and-hibernate-4-integration-tutorial-part-1-xml-configuration , after finished coding part, drag , drop project tomcat8.0 server, based on log seems right.. here log oct 14, 2015 10:27:37 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:springmvchibernatexml' did not find matching property. oct 14, 2015 10:27:37 pm org.apache.catalina.startup.versionloggerlistener log info: server version: apache tomcat/8.0.27 oct 14, 2015 10:27:37 pm org.apache.catalina.startup.versionloggerlistener log info: server built: sep 28 2015 08:17:25 utc oct 14, 2015 10:27:37 pm org.apache.catalina.startup.versionloggerlistener log info: server number: 8.0.27.0 oct 14, 2015 10:27:37 pm org.apache.catalina.startup.versionloggerlistener log info: os name:

c# - Add reference to assembly which in turn has a project reference -

i have solution 1 has 2 projects -> project , project b. project references project b. (i.e project dependent on project b). i have solution 2 has multiple projects. 1 of projects here references dll (copied folder in solution 2 bin\debug of project soln 1). solution 2 compiles fine. during runtime of solution 2 when code tries execute code dll dependent on dll b, throws exception says not load file or assembly dll b. if add reference dll b, error goes away. do have refer dll b or there way in can avoid referring dll b in solution 2 because not use explicitly? first order of business in visual studio is, if have access source codes, csproj, better idea load these projects each solution depends on. second order of business is, best way reference library has project in solution reference whole project, instead it's dll output. not have solve issues paths (debug/release) , works more smooth , during compilation certain, either last updated dll used or gets compil

Importing an element from another URL into an HTML file -

let's have element in foo.html. how can import , embed in html file? have tried using jquery .load ? so in another.html have: <div id="place-to-embed-element"></div> <script> $( "#place-to-embed-element" ).load( "foo.html #imported-id" ); </script> hope helps!

Issue in yii2 timezone formatter -

in php.ini timezone utc. system timezone utc. yii defaulttimezone utc. datetime attribute gets converted timezone "asia/kolkata" before saving db. eg: utc time 12:00hrs input 17.30hrs expect in db 12:00hrs , in view 17.30hrs got in db 17:30hrs , in view got 23:00hrs. web.php: 'formatter' => [ 'class' => 'yii\i18n\formatter', 'dateformat' => 'php:d-m-y', 'datetimeformat' => 'php:d-m-y h:i a', 'timeformat' => 'php:h:i a', 'timezone' => 'asia/kolkata', ], you can choose save specific timestamp value using predefined format. let's take have defined datetime field in backend integer , want save integer. can set behavior this public function behaviors() { return [ 'timestamp' => [ 'class' => timestampbehavior::classname(),

c# - Constructor Invocation using Dynamic Linq Select Expression -

i'm using dynamic linq . i can following: iqueryable<person>().select("new(id id, firstname + surname name"); this creates iqueryable ( not iqueryable<object> ) containing anonymous type. but given have following class: public class listitem { public listitem() { } public listitem(int id, string name) { this.id = id; this.name = name; } public int id { get; set; } public string name { get; set; } } i select directly type iqueryable<person> invoking constructor of listitem , equivalent following: iqueryable<person>().select(p => new listitem(p.id, p.firstname + p.surname)); i've tried variants such as: // illegal - new expects form "new()" - exception "'(' expected" iqueryable<person>().select("new listitem(id, firstname + surname)"); // doesn't work, "no property 'listitem' exists on type 'person'&qu

How to write a proxy pool server (when a request comes, choose a proxy to get url content) in python? -

i not know proper name such proxy server, you're welcome fix question title. when search proxy server on google, lot implements maproxy or a-python-proxy-in-less-than-100-lines-of-code . proxies server seems ask remote server url address. i want build proxy server, contains proxy pool(a list of http/https proxies) , have 1 ip address , 1 port serve incoming requests. when request comes, choose proxy pool , request, , return result back. for example have vps ip '192.168.1.66'. start proxy server @ vps ip '127.0.0.1' , port '8080'. i can use proxy below. import requests url = 'http://www.google.com' headers = { ... } proxies = { 'http': 'http://192.168.1.66:8080' } r = requests.get(url, headers=headers, proxies=proxies) i have see impelement like: from twisted.web import proxy, http twisted.internet import reactor twisted.python import log import sys log.startlogging(sys.stdout) class proxyfactory(http.httpf

objective c - First call to toggleFullScreen: doesn't work (it used to!) -

i have document based application based on xcode template. it’s not using core data. my application simple: document window has primary window set full screen collection behaviour in interface builder toggle fullscreen menu item works expected, window control. in code, calling togglefullscreen: using following: nswindow * window = [nsapp mainwindow]; [window togglefullscreen:self]; once before timer fires, , once after time period has finished revert non-full sceen mode. recently, has stopped working - first call has no effect whatsoever. i've set breakpoint before first call , executes no effect. i’ve set nswindowdelegate class testing, responds windowdidenterfullscreen: , windowdidexitfullscreen: when user toggles full sreen manually using menu item, or using standard window control. the function windowdidfailtoenterfullscreen: in delgate never gets called after first toggle fails. the second call (which uses exact same code ) works - takes window fullscr

ruby on rails - Does using multiple ActionMailer classes increase memory overhead? -

i'm using 2 mailer classes in rails 3.2 app. 1 adminmailer, dedicated sending emails internal team, , 1 usermailer send emails our registered users. usermailer beginning feel bloated, 35 methods (i.e. 35 different emails) in , counting. take subset of these emails fit under theme, , extract them out third mailer class make code more manageable , readable. my question is: introduce more memory overhead on app need instantiate more mailer classes? i tried searching on google & stack overflow didn't seem find on topic. thanks! every request in rails initialises ~50k objects. 1 class more or less doesn't not make difference. instance basecamp3 has on 40 mailers (source: https://twitter.com/dhh/status/656905137898786816 ). splitting mailers many classes make easier test (single responsibility, less stubbing/mocking). don't worry, split them many classes! won't affect performance. of 'waiting time' in rails comes database interaction.

sublimetext2 - Sublime text 2 forces uppercase Ll' in comments -

this strange. in emberjs code, have comments properties. whatever reason l's in comments in every *.js files uppercase. if try change them lowercase, upper case. if remove comment wrapper, 'l' becomes lower case. if restore comment wrapper, automagically becomes upper case again. not happen on colleagues installation of sublime. have version 2.0.2 build 2221. if copy text notepad, l's lower case. here's example: property determines if textarea disabled @property disabled @type boolean @default false disabled: false, remove comment wrapper: property determines if textarea disabled @property disabled @type boolean @default false disabled: false its not camelcase issue can see, have comments there multiple l's , they're uppercase, example cell. happens l's. does know what's going on? setting says, don't change case of l's?

How do you set the root page in an AppHarbor ASP.NET MVC website? -

i'm publishing asp.net web application (this default application vs2013) , publishes fine. when visit application http://someapp.apphb.com i "welcome nginx" page. http://someapp.apphb.com/home works. is there setting on appharbor need change, or need make change webapp? you can set default document in web config file <configuration> <system.webserver> <defaultdocument> <files> <add value="index.html" /> </files> </defaultdocument> </system.webserver> </configuration>

python 3.x - Python3 How do I get assertEqual to print all the contextual info? -

i'm using unittest.testcase in python 3 , needing more info printed when assertequal finds problem. my test function includes statement: self.assertequal(result, exp_result, "test_svg_glyph_scale test #" + str(test_num)) upon finding error, it's supposed print result , exp_result , string that's in call assertequal . however, it's truncating __repr__ outputs result , exp_result : fail: test_scale (__main__.test_svg_glyph) ---------------------------------------------------------------------- traceback (most recent call last): file "svg_glyph_test.py", line 322, in test_scale self.assertequal(result, exp_result, "test_svg_glyph_scale test #" + str(test_num)) assertionerror: glyph[15 chars]5000,-0.5000) l(0.0000,1.0000) [75 chars] ]) != glyph[15 chars]5000,0.5000) l(0.0000,1.0000) [74 chars] ]) : test_svg_glyph_scale test #1 it's [15 chars] , [75 chars] see know what's being r

sails.js - Orientdb fetch plan returning ID instead of record -

i querying class sails-orientdb adapter sailjs. expect see last_comment field expanded gives me id. in orientdb studio same sql below shows last_comment expanded questions.query("select * questions fetchplan last_comment:0 order createdat desc", function (err, retrievedquestions) { if (err) res.send(500,"error") res.send(200, retrievedquestions); }); how can resultset return expanded? orientdb v2.0.12 can try level:1 questions.query("select * questions fetchplan last_comment:1 order createdat desc", function (err, retrievedquestions) { if (err) res.send(500,"error") res.send(200, retrievedquestions); });

qt - Dynamically change position of grid layout items -

Image
i have grid layout shows images on image bellow. want able swap 2 images @ position. the hierarchy this: scrollarea->gridlayout->label[n]->pixmap there n labels in grid layout created dynamically in code. it possible delete create again in column/row want, i'm trying find more elegant way this. tips? if want use grid layout... void yourclass::swapwidgets(qwidget *widgeta, qwidget *widgetb) { int indexa = yourgridlayout->indexof(widgeta); int indexb = yourgridlayout->indexof(widgetb); int row1, column1, rowspan1, columnspan1; int row2, column2, rowspan2, columnspan2; yourgridlayout->getitemposition(indexa, &row1, &column1, &rowspan1, &columnspan1); yourgridlayout->getitemposition(indexb, &row2, &column2, &rowspan2, &columnspan2); yourgridlayout->takeat(indexa); yourgridlayout->takeat(indexb); yourgridlayout->addwidget(widgetb, row1, column1, rowspan1, column

angularjs - Using $timeout within my app -

i'm using $timeout service , i'm wondering why 'mainctrl.date.raw' variable won't update every second. ideas? angular.module('myapp', []) .controller('mainctrl', ['$timeout',function($timeout){ var mainctrl = this; mainctrl.date = {}; $timeout(function(){ mainctrl.date.raw = new date(); }, 1000); }]); use $interval instead, since $timeout fire function once when timer finishes, , $interval fire function when counter finishes, , start again counter, until clear it. angular.module('myapp', []) .controller('mainctrl', ['$interval',function($interval){ var mainctrl = this; mainctrl.date = {}; $interval(function(){ mainctrl.date.raw = new date(); }, 1000); }]);

excel - How to enter integer number as hour into "hh:mm" custom-formatted cell -

i have excel data entry template column each cell contains time person worked hours , minutes. cell given day have custom formatting hh:mm . my problem when enter 8 (or other integer), convenient when entering full 8 hour work days, cell displays 00:00 , formula bar shows input converted 08.01.1900 00:00:00 . when enter 8:00 (or 8: ) in cell, format correctly applied , becomes 08:00 . is there way fix issue integers become hours of workday? my restrictions template cannot become macro enabled , data must entered in fields show data sheet printed , uses hours per day calculate total hours per month. any on appreciated!

html - How to set border radius to table border? -

this question has answer here: css3's border-radius property , border-collapse:collapse don't mix. how can use border-radius create collapsed table rounded corners? 20 answers table { width:100%; } table, td, tr { border: 1px #000000 solid; border-collapse: collapse; border-radius: 10px; } tr { height:50px; } .price { width: 65%; text-align: center; background-color: #000000; color: #ffffff; font-size: 1.5em; border-color: #c0c0c0; border-radius: 10px; } .buy { width:35%; text-align: center; background-color: red; color: #ffffff; border-color: #c0c0c0; } <table> <tr> <td class="price">$180</td> <td class="buy">buy</td> </tr> <tr> <td class=&quo

javascript - disable calendar in datepicker -

i'm using datepicker twice on 1 page. 1 regular, , should picking month of year. unfortunately css style <style>.ui-datepicker-calendar {display: none;}</style> disables calendar both. setting handler on trigger beforeshow like: $('.date-picker').datepicker( { changemonth: true, changeyear: true, showbuttonpanel: true, beforeshow: function(date) { $(".ui-datepicker-calendar").css("display", "none"); alert('fired when selected'); } }); also doesn't help. trigger working, calendar still there. can do? appreciated. you can use css class disable: .disable{display:none} and apply second class in div want hidden. <div class="ui-datepicker-calendar disable"> calendar here ... </div>

python - Removing/Adding an Object from a Collection in SQLAlchemy -

issue @ hand: removing user group , adding user group many-to-one table relationship      (many users 1 group) using: sqlalchemy 1.0.9, python 2.7.9 db operates off of crud operations: 1. create group (e.g. 'admin') 2. retrieve group ( using either group name or id ) 3. update:    a) update : add_user group ('joe' 'admin')    b) update : remove_user group ('bob' 'editor') 4. delete group i newbie trying hands dirty, smartly here. 1. attempting remove .user group() in function: update_remove_user without deleting user user() . found similar want on stacks here. , in sqlalchemy docs 2. adding user existing group. right now, function creating group , user instead of retrieving group , adding user it. model: base.py class group(base): __tablename__ = 'groups' id = column(integer, primary_key=true) group_name = column(string(50), unique=true) created_on = column(datetime, default=datetime.utcnow)

How Do I Get System Account Permissions or run app with system rules in C# -

i want remove sections registry system\currentcontrolset\enum\usb, cant delete properties (windows10) string user = environment.userdomainname + "\\" + environment.username; registrysecurity msec = new registrysecurity(); registrysecurity msec = new registrysecurity(); registryaccessrule newrule = new registryaccessrule( user, registryrights.fullcontrol, inheritanceflags.objectinherit | inheritanceflags.containerinherit, propagationflags.none, accesscontroltype.allow); registrykey hkusb = hklm.opensubkey(registrypath, registrykeypermissioncheck.readsubtree); registrysecurity security = hkusb.getaccesscontrol(); if (containsrule(security.getaccessrules(true, true, typeof(securityidentifier)), newrule)) { console.writeline("access"); console.readkey(); return; } security.addaccessrule(newrule); hkusb.setaccesscontrol(security); <----error here hkusb.close(); showkeytree(hkusb, "+"); console.readkey(); this code allows me delete sections exept

visual studio - check if the c# method is used in the project -

is there way or plugin see if method (get list of methods) in project not been used? i can list of methods in project using . how check if method being used in project type.getmethods() this hard find in large project. can try several approaches. right click on function -> find references. these references death code. check references each. , again after find out if used or not. search method name text , check occurrences. repeat callee if needed. another simple approach put breakpoint inside , run application , go throw scenarios. hardly go throw scenarios. can cover part of it. sometime can tricky if reflection used. such method called reflection , hardly find out reference search. no approach 100%. can try combination of them.

angularjs - Creating button with ng-repeat that has an array with functions -

i have array of objects 2 keys. key label text go on button. , action , function want happen when user clicks ( ng-click ) button. when this, no error thrown, function not work :( my js: var mybtns = [{ label: 'btn1', action: function() { alert('hi') } }]; my html inside directive this: <button type="button" ng-repeat="abtninfo in mybtns" ng-click="abtninfo.action()"> abtninfo.label </button> here simple fiddle: http://jsfiddle.net/ppe34vlj/1/ on other hand if try <button ng-click="{{abtninfo.action}}"> , throws error: > "error: [$parse:syntax] http://errors.angularjs.org/1.4.4/ $parse/syntax?p0=%7b&p1=invalid%20key&p2=2&p3=%7b%7babtninfo.action%7d%7d&p4=%7babtninfo.action%7d%7d" of course in situation array no longer function string: var mybtns = [{ label: 'btn1', action: '$scope.restore()' }]; this simple fid

node.js - TypeError: io.sockets.clients is not a function -

i following tutorial @ link (step 7). installed both node.js either socket.js , when go page , try send image error on server missing error handler on `socket`. typeerror: io.sockets.clients not function @ socket.<anonymous> (c:\users\utente\projects\webrtc\server.js:30:31) @ emitone (events.js:77:13) @ socket.emit (events.js:169:7) @ socket.onevent (c:\users\utente\projects\webrtc\node_modules\socket.io\lib\socket.js:330:8) @ socket.onpacket (c:\users\utente\projects\webrtc\node_modules\socket.io\lib\socket.js:290:12) @ client.ondecoded (c:\users\utente\projects\webrtc\node_modules\socket.io\lib\client.js:193:14) @ decoder.emitter.emit (c:\users\utente\projects\webrtc\node_modules\socket.io\node_modules\socket.io-parser\node_modules\component-emitter\index.js:134:20) @ decoder.add (c:\users\utente\projects\webrtc\node_modules\socket.io\node_modules\socket.io-parser\index.js:247:12) @ client.ondata (c:\users\utente\projects\webrtc\node_modules\socket.io\lib\client.js:175:1

big ip - F5 LTM config through tmsh - At least one monitor -

f5-ltm version 11.6 hi, i'm looking syntax create pool via tmsh 2 monitors (monitor_a, monitor_b) 'availability requirement' set 'at least...' '1' health monitor(s) checked https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/bigip-tmsh-reference-11-6-0.html no avail. shows following syntax: create pool ... monitor [name] thanks in advance here's example: tmsh create ltm pool mypool \ monitor min 1 of {http https} \ members add { 192.168.103.10:80 192.168.103.11:80}

implementations of lisp functions -

in c, if want see function how work, open library provides function , analyze code. how can implementations of lisp functions seen? example, intersection function you can @ source code of lisp functions. for example, source files clisp, 1 common lisp implementation, available here: http://www.clisp.org/impnotes/src-files.html if want examine implementation of functions related lists, can @ file: http://clisp.cvs.sourceforge.net/viewvc/clisp/clisp/src/list.d

css - Selenium Webdriver Python select a dropdown error local variable element referenced before assignment -

this question has answer here: selenium python unboundlocalerror: local variable 'element' referenced before assignment 1 answer i trying select drop down element getting error error traceback (most recent call last): file "c:\webdriver\clearcore\testcases\operationspage_testcase.py", line 59, in test_add_and_run_clean_process process_lists_page.click_select_a_preview_to_import_configuration_from_dropdown_from_clean_task_tab(globals.datapreview_crm_name) file "c:\webdriver\clearcore\pages\operations.py", line 113, in click_select_a_preview_to_import_configuration_from_dropdown_from_clean_task_tab select = (select(self.get_element(by.xpath, 'html/body/div[2]/div[2]/div/div[4]/div/div[2]/div/div[3]/div/div[7]/div/div[3]/div/div[4]/div/div[2]/div/div[4]/div/div[3]/div/div[3]/div/div[4]/div/div[2]/div/div[3]/div/div[2]/div/di

java - is it possible to change the original variable when it is passed as an argument to the function -

this question has answer here: how pass primitive data type reference? 8 answers am trying change value of variable when passed argument function, original value remains same, possible change?(i,e in below code want value of x 11) public class runy { public static void main(string [] args) { int x=10; int y=change(x); system.out.println(x); system.out.println(y); } public static int change(int a) { a+=1; return a; } } i,e in below code want value of x 11) with current code, won't possible if want change value of x , don't need y , can int x=10; x=change(x); // store return value of change 'x'

jquery - How to load tabs in url using hash -

hi there fellow people of stackoverflow! have question how load tab called #a , 1 called #b using http://mydomaine.com/index.html#a or #b. it's basic bootstrap code. don't know jquery need help. <ul class="nav nav-tabs"> <li class="active"><a href="#a" data-toggle="tab">gutter</a></li> <li><a href="#b" data-toggle="tab">jenter</a></li> </ul> you use when page loads: $( document ).ready(function() { switch(window.location.hash) { case '#a': //do need if break; case '#b': //do need if b break; default: //default action } });

htons and ntohs not working? C UNIX networking -

i'm new network programming in c , started off trying send array read keyboard server. problem whenever read length of array keyboard, add 2/3 , not right anymore. example: length or array give: 2 client read keyboard 4 or 5 elements , if itry print them afterwards, don't have value gave them. totally different numbers. this how client looks like: #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> int main(int argc, char* argv[]) { int sockfd; struct sockaddr_in server; /*char msg[1000], serv_reply[2000];*/ if ( (sockfd = socket(af_inet, sock_stream, 0)) < 0) { perror("error in creating stupid sock client "); exit(errno); } puts("socket created in client "); memset(&server, 0, sizeof(server)); server.sin_addr.s_addr = inet_addr("127.0.0.1"); s

html - two extra blank page add when printing -

i using using css property printing, 2 page added in print. tried these thing:- .print:last-child { page-break-after: auto; } but not working i tried:- html, body { height: auto; } but problem still there. and when using this:- .print{ page-break-after: } it prints blank page before please add page-break-after: avoid or page-break-before: avoid , can reduce element spacing affect. if give me url/js fiddle link easier fix issue. have hanged many times on print version

jquery - how to set readonly to a datepicker -

i have following html table layout: <table id="mytable"> <tbody> <tr><td rowspan="2">row text</td><td><input type="text" value="" readonly /></td><td><input type="text" value="" readonly /></td><td><input type="text" value="" readonly /></td></tr> <tr><td><input type="text" value="" /></td><td><input type="text" value="" /></td><td><input type="text" value="" /></td></tr> </tbody> </table> jquery datepicker attached every input fields table row input fields of first row readonly. when user selects date second row add 30days selected date , put respective input field of first row jquery below: $('table#mytable > tbody> tr > td > input[type="text"]&

java - How to access SQLite Database from another class -

i'm need access sqlite database created in 1 class other activity. want access public void getimage(view view) { but app crashes when use it. here activity: public class cameratodatabase extends activity { private static final int camera_request = 1888; public imageview imageview1; imagehelper = new imagehelper(this); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_camera_to_database); button b = (button) this.findviewbyid(r.id.camera); b.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { intent cameraintent = new intent( android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent, camera_request); } }); } protected void onactivityresult(int requestcode, int resultcode, intent data) {

Spring Hibernate Relation Mapping -

i'm looking in 1 of project. i'm having company class , bank class. company class , bank class mapped using many many relation using hibernate. how start? i'm done creating company module inserting data table , same bank. how show mapping between both? flow goes - add company -> edit/update -> add bank previous company detail -> bank add/update -> view all, needed show list of companies , respective banks. i assume use junction table done this: company.class @manytomany(fetch = fetchtype.lazy, cascade = cascadetype.all) @jointable(name = "nameofjunctiontable", catalog = "yourdatabasename", joincolumns = { @joincolumn(name = "companyid", nullable = false, updatable = false) }, inversejoincolumns = { @joincolumn(name = "bankid", nullable = false, updatable = false) }) private collection<bank> banks; bank.class @manytomany(fetch = fetchtype.lazy, mappedby

regex - html5 pattern match float and/or percentage -

i'm working form validation , want use pattern attribute validate input field. field has following criteria: it must number (integer or float) can allow 2 decimal point (e.g.: 100.24) only 1 dot allowed (e.g.: 100.25.35 not valid) may end percent(%) sign (but not necessary) so should exact pattern regex that. i'm trying following code how implement percent condition? <input type="text" pattern="[0-9]+([\.][0-9]{0,2})?" title="this must number 2 decimal places and/or %"> you there. add %? pattern: input:invalid { color: red; } <input type="text" pattern="[0-9]+(\.[0-9]{0,2})?%?" title="this must number 2 decimal places and/or %">

jquery - Get css from text at the position of the cursor -

i'm trying wrap simple rte private purposes. i'd toggle bold/italic/underline buttons when user clicks in text. i've been reading several posts include selection either selected mouse or double click. jquery's select works on selection, , not point clicked. understand there's not css cursor location, select word user clicked. how can css properties of word index clicked? i'm using div that's editable. some of posts i've been reading: jquery select() get current word in paragraph on click event in jquery

node.js - Cannot get node hello world app to deploy on GCloud -

i cannot life of me the hello world app google provides work. following tutorial here: https://cloud.google.com/nodejs/getting-started/hello-world i have followed steps , hello world code runs on local machine. however, when try run gcloud preview app deploy app.yaml --promote following output: you deploy following modules: - empirical-lens-111022/default (from [c:\users\zakpt\downloads\nodejs-getting-started-1-hello-world\nodejs-getting-started-1-hello-world\app.yaml]) deployed url: [https://empirical-lens-111022.appspot.com] want continue (y/n)? y beginning deployment... verifying managed vms enabled , ready. provisioning remote build service. copying certificates secure access. may prompted create ssh keypair. error: (gcloud.preview.app.deploy) couldn't connect docker daemon. i have no idea do, since docker isn't mentioned @ in tutorial, , googling has shown solutions osx. on windows 10

rounding - PHP Round unexpected result -

i have problem php round function. rounds function not working correctly: $value = 562.92578125; round($value,1); // return 562.9 (correctly) round($value,2); // return 562.9299999999999 (wrong) round($value,3); // return 562.926 (correctly) as workaround try use: number_format(round($value, 1), 1); number_format(round($value, 2), 2); number_format(round($value, 3), 3); also, have here: can rely on php php.ini precision workaround floating point issue

finish() and android activity lifecycle -

there things don't know android activity lifecycle, don't me started on fragments!: once method resume() called proceed executed end if finish() or startactivity(new intent(..)) called. public void onresume(){ // stuff aaa .... startactivity(new intent(..)); // more stuff bbbb // far? setresult(result_code, intent); finish(); // how here? far? // how make sure started in app finished off well? ie activities started activity finished? } btw, similar top interview question. onpause() still called after finish()? how onstop()? lastly, know how finish() not mainactivity such activities have started under application, ie started mainactivivity, going application called application. yes code after call finish() called. when call finish() next function executed onpause() . if want close activities on stack this: setresult(result_close_all); finish();

javascript - Why does sails.js ignore /config/env/production.js and use process.env.PORT instead? -

i've set port 8080 in /config/env/production.js , set environmental variable node_env production. however, when lifted sails, ever got launch @ port 8000. realized set port environmental variable , right result, i'd prefer use normal config files. have no local.js configuration file, that's not overwriting. doing wrong? [15:12:50] nodejs @ myserver : /apps/myapi/ $ cat config/env/production.js /** * production environment settings * * file can include shared settings production environment, * such api keys or remote database passwords. if you're using * version control solution sails app, file * committed repository unless add .gitignore * file. if repository publicly viewable, don't add * private information file! * */ module.exports = { /*************************************************************************** * set default database connection models in production * * environment (see config/connections.js , config/models.j

selenium - Double click on label not detected -

i using selenium smart client, have ordinary html5 label defined double click. some how selenium not trace double click event , fail test. i have check source of page , found label this. <label ondblclick="addtogrid($(this))">variable_counter</label> fire doubleclick event manually on xpath. command : fireevent target : xpath of html control value : dblclick (note doubleclick not work.)

bash - To get logs information in between particular time-stamp using shell script -

i want extract infromation logs using shell script particular time range . line in logs looks this: [16:34:34:911][13-10-2015]:no free accounts available i need extract data in specific intervals. example in between 16:00 17:00 .i new shell script.i have tried grep command . can suggest me how ?

search - Return top viewed items by country using data from Google Analytics -

so have app written in go on app engine have items in datastore , provide search through search api. users can view items , doing feeds view events country information google analytics . i understand how use information e.g. return top viewed items country ? i have researched topic quite bit, have not found approach yet. there rank in search , value different each country cannot use that. i can see having different indexes (one per country) , using rank field or rank field per country provide want. if items hundreds of thousands or more? if offer trending might need updated across whole dataset , not counter? best approach? maybe limitation of can on app engine? how 1 approach , maybe search elastic search? thanks in advance! try report: google analytics > reporting > behavior > site content > pages

java - JFrame.setsize() not doing anything -

for reason, can't seem work: public class app { public static void main(string[] args){ jframe frame = new jframe("hi"); frame.setsize(300, 400); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setvisible(true); } } no matter size pass setsize(), resulting window when run program still tiny. suggestions? you try code,will jframe. , setprefered method in program import java.awt.*; import java.awt.event.*; import javax.swing.*; public class jframedemo { public static void main(string s[]) { jframe frame = new jframe("jframe source demo"); frame.addwindowlistener(new windowadapter() { public void windowclosing(windowevent e) { system.exit(0); } }); jlabel jlbempty = new jlabel(""); jlbempty.setpreferredsize(new dimension(175, 100)); frame.getcontentpane().add(jlbempty, borde