Posts

Showing posts from January, 2013

javascript - How to add a signIn button in a website and update it based on user authentication -

i working on playframework believe question more general topic of web implementation. creating website want put signin button on top right corner of home page , update based on user authentication. i.e. if user logged in there my profile , logout button , if not there signin button. know how implement using different pages uses different routes, in case can load complete page don't want load complete page instead use popup window signin/signup , want user redirect on same page after signing in ( click on signin -> signin form popup -> submit -> signed in ) url shouldn't changing in process. have seen type of design in many popular websites don't know how build one. i did research , found, can using jquery's ajax call. of ajax call can request data server in background (here request html) , update current page dom. in case supposed update dom of navbar's top right corner request html part don't know how it? new website designing, design or t...

CSS page-break-after for background image -

is there way use css property of page break background image? page-break-after:always; i m using repeat background image , when writing print stylesheet, there way ensure background image on single page, background image end @ bottom of page , split.

properties - Gradle task check if property is defined -

i have gradle task executes testng test suite. want able pass flag task in order use special testng xml suite file (or use default suite if flag isn't set). gradle test should run default standard suite of tests gradle test -pspecial should run special suite of tests i've been trying this: test { if (special) { test(testng_special.xml); } else { test(testng_default.xml); } } but undefined property error. correct way go this? if (project.hasproperty('special')) should it. note you're doing select testng suite won't work, afaik: test task doesn't have test() method. refer https://discuss.gradle.org/t/how-to-run-acceptance-tests-with-testng-from-gradle/4107 working example: test { usetestng { suites 'src/main/resources/testng.xml' } }

Stop SAS EG project if error is encountered -

i tried putting before programs (using option include code in pre-processing): options errorabend; it trigger warning popup next files executed. example: a -­> b -> c -> d if has error, popup saying error occured , server has disconnected, however, b, c, , d run. want project execution stop @ a. i have several old projects tens if not hundreds of programs , therefore don't consider using macro ( is there way make sas stop upon first warning or error? ) while checking errors option. what can done? thank you! edit: sas entreprise guide 7.1 i think best way write in macro, like: %macro error_check; 'your process a'; %if &syserr > 0 %then %do; %goto exit; %end; /* if systemerror value greater zero, go exit directly */ 'your process b'; 'your process c'; 'your process d'; %exit: /* careful, not semicolon*/ %mend; just try not put %if &syserr loop inside "data-run sta...

.net - How to read weight from scale using ethernet connection -

hi first post please bare me. i have mettler toledo xs32000l scale , trying read weight via ethernet connection , vb.net (2010) application. have found plenty of information/code serial(com) connection nothing ethernet connection. communication mode: client & server remote host address: 192.168.0.2. remote host port number: 8001 local server port number: 8000 (scale ip: 192.168.0.1) i able ping scale reply. have tried using hyperterminal no luck. appreciated, , post can many others come. thanks! other resources code vb application serial connection: http://control.com/thread/1240210560 another helpful link(but not me): http://vb.net-informations.com/communications/vb.net_socket_programming.htm alright - despite criticism, going post solution after hours of researching. created tcp client , modified settings (ip, port, etc.) helps future programmers! imports system.net.sockets public class form1 private sub form1_load(byval sender system.object, byval e...

c++ - How to compose a hierarchy of decorated classes without copying data -

i have 3 classes hierarchically related: pattern , has protected field _panels of type std::vector<panel> . panel , in turn, has protected field _edges , of type std::vector<edge> . edge , finally, has protected field _verts , of type std::vector<eigen::vector2f> . i have pure virtual class renderable , has pure virtual function virtual void render() . want create specialized versions of each of 3 classes inherit renderable , example: class vpattern : public pattern, public renderable { public: void render() { ... } protected: ... private: ... }; // class vpattern however, _panels field still contain instances of panel , , not vpanel . mean have put drawing logic edge , panel in draw function of pattern , not ideal. is there different approach here i'm not seeing avoid this? using wrapper class more suitable approach? is there reason can't have drawable virtual class has pure virtual function draw() drawable descen...

java - Failed to load class "org.slf4j.impl.StaticLoggerBinder" after loading required dependencies -

i building maven project , deploying in jetty server , issue. in ${jetty_home}/lib, having jcl-over-slf4j-1.7.2.jar, jul-to-slf4j-1.7.2.jar, slf4j-api-1.7.2.jar. along maven project, having <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>1.7.2</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.2</version> <scope>provided</scope> </dependency> in mvn dependency tree, slf4j, see following: [info] +- org.slf4j:slf4j-log4j12:jar:1.7.2:compile [info] | \- log4j:log4j:jar:1.2.17:compile [info] +- org.slf4j:slf4j-api:jar:1.7.2:provided (scope not updated compile) apart this, have commons-logging-1.2.jar bundled project. build maven project , if run using eclipse je...

android - How to fade out audio/music between scenes? -

i'm trying music fade out when start android game. music plays in main menu , should fade out when player clicks play. can music stop, not fade out. im trying fade out using this: using unityengine; using system.collections; public class musicscript : monobehaviour { static musicscript instance; bool donefading; void start() { if(instance == null) { instance = this; dontdestroyonload(gameobject); } else if (instance != this) { destroy(gameobject); } } void update() { if (application.loadedlevelname == "flappy drone gameplay screen") { fademusic(); if (donefading == true) { destroy(gameobject); } } } ienumerator fademusic() { (int = 9; > 0; i--) { debug.log("here"); instance.audio.volume = * 0.1f; ...

javascript - Browserify Error: Parsing file, Unexpected token -

i trying use npm module browserify. when run $ browserify build/widget.js -o bundle.js , recieve following error: error: parsing file /users/nir/browsewidget/node_modules/react-spin/src/main.js: unexpected token (29:6) @ deps.parsedeps (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:436:28) @ fromsource (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:375:44) @ /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:369:17 @ concatstream.<anonymous> (/usr/local/lib/node_modules/browserify/node_modules/concat-stream/index.js:36:43) @ concatstream.emit (events.js:129:20) @ finishmaybe (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:460:14) @ endwritable (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:469:3) @ concatstream.writable.end (/usr/local/lib/node_modules/browserify/node_modules...

omnet++ - Getting the location of two different modules -

i have 2 types of submodules in network. adhochost standard definition in inet framework. module of type imobility mobility type of type randomwpmobility , both standard inet modules. i can location of modules of type adhochost code: module = simulation.getmodulebypath("mynet.host[1]"); c = mobilityaccess().get(module)->getcurrentposition(); host[*] being of type adhochost . but when replace host[1] blockage[1] (blockage of type imobility ), before running simulation error appears: error in module (mymobilecontroller) mynet.mymobilecontroller during network initialization: model error: module (imobility)mobility not found. the module mymobilecontroller module contains fraction of code. module not need move. duty record location of mobile modules in network. what problem? the 'mobilityaccess' code expects pass networknode contains submodule named mobility type imobility . in first case true (with standardhost) in secon...

php - Use single quotes within a string for prepared statement -

i have condition in query need filter on first , last name in users table. variables set this: $firstname = input::get('firstname'); $lastname = input::get('lastname'); $myparameters = array(); $filterfirst = "'%" . $firstname . "%'"; $filterlast = "'%" . $lastname . "%'"; my sql query being set (dynamically): $sqlstring = "select t1.id,t1.first_name, t1.last_name, t2.function " . "from users t1 join user_details t2 " . "on t1.id = t2.user_id"; if($firstname && $lastname){ $sqlstring .= " lower(first_name) lower(?)" . " or lower(last_name) lower(?)"; $myparameters = [$filterfirst,$filterlast]; } else{ if($firstname){ $sqlstring .= " lower(first_name) lower(?...

.net - Regular expression lookhead lookbehind -

i need regular expression .net, have input field telephone number. i use regex format value ( 050 33 11 00 ) format: +32(0)50/33.11.00 but when insert following value 09 323 23 56 want following result: +32(0)9/323.23.56 i've been looking @ lookahead can't find working solution. i'm using folowing regex: (\x2b{1}3{1}2{1}\x28{1}\d{1}\x29{1}\d{2}\/\d{2}\.\d{2}\.\d{2}) works first value. the regex placed on textbox editmask, instant live sanitizing. textedit.mask.editmask = editmask; you can use following replacement: \b0(\d{1,2})\s+(\d{2,3})\s+(\d{2})\s+(\d{2})\b this regex match full "words" starting 0 , followed 1 or 2 digits, whitespace, 2 or 3 digits, whitespace, 2 digits , again whitespace , 2 digits. replace +32(0)$1/$2.$3.$4 see demo .

java - Getting SIP headers through Asterisk manager -

i trying elaborate sip messages coming asterisk server , edit them on fly using java. ami supposed work fine that. although can't send sip messages though socket, cause every-time tried edit chan_sip.c server breaks down. haven't find way access information other classes of manager. don't want save information file or database cause delay whole process. using kamailio not option cause want make comparison of both solutions need asterisk. is there path should follow done? can't figure why editing chan_sip.c bothers asterisk making him nonfunctional.. seams no way qualification. task seams complex me(i have more 10 years experience, including asteirsk internal , c/c++ programming).try using dialplan only

Loading java classes into ORACLE database error : ()Ljava/util/List;) catch_type not a subclass of Throwable -

i trying load java classes database using loadjava tool, getting warning causing error when calling java methode plsql procedure. error : ora-29552: verification warning: java.lang.verifyerror: (class: com/mq/rimsmqtoolsin, method: mqread signature: ()ljava/util/list;) catch_type not subclass of throwable i think dependencie issue missing java class need resolved using loadjava tool not figure jar need used , how correct cmd using laodjava ? nb: tried use jar file contains java.util.list.class still warning when loading java version: java -version java version "1.6.0_39" java(tm) se runtime environment (build 1.6.0_39-b04) java hotspot(tm) 64-bit server vm (build 20.14-b01, mixed mode) to load first compile using shell script: javac -source 1.4 \ -target 1.4 \ -classpath ./com.ibm.mq.jar:./connector.jar:$classpath \ $sources then load : loadjava -force -definer -resolve -synonym -grant rims_user_role -user $db_connect_string -verbose $class...

Is it possible to chain function calls in PHP? -

if have functions function function1 ( $myparameter ) { ... } function function2 ( $myparameter ) { ... } function function3 ( $myparameter ) { ... } when call function1( function2( function3( $myparameter ) ) ) i call this: function3( $myparameter ) -> function2() -> function1() function3( $myparameter ) sent parameter function2() a php plugin exists (or else) ? thx you can chained objects methods returning instance (with $this ) here trivial example. class foo { function function1() { echo "i'm function1\n"; return $this; } function function2() { echo "i'm function2\n"; return $this; } function function3() { echo "i'm function3\n"; return $this; } } $bar = new foo(); $bar->function3()->function2()->function1();

css - HTML video to cover 100% div -

i have html video want use replacement background image fullscreen, overflows , covers entire page instead of constraints of header. html: <header id="masthead" class="site-header" role="banner"> <video autoplay loop poster="<?php bloginfo('stylesheet_directory'); ?>/img/main.jpg" id="bgvid"> <source src="<?php bloginfo('stylesheet_directory'); ?>/vid/dumbells.webm" type="video/webm"> <source src="<?php bloginfo('stylesheet_directory'); ?>/vid/dumbells.mp4" type="video/mp4"> </video> </header> css: video#bgvid { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100; -webkit-transform: translatex(-50%) translatey(-50%); tra...

html5 - Controlling glyphicon spacing and text link within a unordered list for a horizonatial nav menu -

how control vertical spacing between 2 items stacked, centered , vertically within unordered list item? glyphicon on top of text link within unordered list item in navigation menu. what css rules such thing happen. <!doctype html> <html lang="en-us"> <meta charset="utf-8" /> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" title="style"> <head> <style type="text/css"> /* adding display: inline-block; style attribute display content horizontally. add nav's <li> elements in css. i'm guessing every <li> may have glyph. add text-align:center on <li>'s within nav in css align <li>'s content in middle. */ *{ margin:0; padding:0; } /* target 1 icon, */ .glyphicon.glyphicon-globe { padding:3px 0 0 0; margin: 0 0 -15px 0; font-size: 17px; } n...

android - How to center linearlayout with 6 buttons on the center on portrait and landscape orientation? -

what want achieve: center layout both orientation. <scrollview android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="#fffffce0"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="#fffffce0" android:weightsum="1"> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="121dp" android:background="#fffffce0" android:layout_margintop="42dp" android:id="@+id/linearlayout" android:gravity="center_horizontal" android:layout_alignparenttop="t...

oracle11g - SQL Plus (Oracle 11) -

how can know largest table in database , owns it? select segment_name table_name, sum(bytes) table_size user_segments segment_type='table' group segment_name or should use ( top ) or ( rowcount ) rownum won't here rownums calculated before ordering , want largest table. with q ( select segment_name table_name, sum(bytes) table_size user_segments group segment_name ) select hlp.table_name, hlp.table_size (select q.*, dense_rank() over(order q.table_size desc) rn q) hlp hlp.rn = 1; this trick. clause common table expression (cte) , valid in context of following select under alias "q". wanted avoid multiple calls sum. the dense_rank() function inside subquery in clause assings consecutive values of partition or order, in our case descending table size. the subquery needed select first row. regarding use of data dictionary tables haven't checked result.

jquery - Link suddenly not click-able after media-query -

i'm officially stumped. after including simple jquery slideup script in bottom of page (to show/hide divs onclick), 2 links in navbar (which 2 ul's) no longer "clickable"-- happens when browser size shrunk width (still @ reasonable size). clickable , jquery works fine browser window wider. tremendously appreciated. ready throw computer out window. here links: <ul id="second"> <li><a id="partials/art.html">art</a></li> <li><a href="#designinfo" class="navlink"> design</a></li> <li><a href="#illustrationinfo" class="navlink">illustration</a></li> </ul> <ul id="first"> <li><a href="#aboutinfo" class="navlink"> about</a></li> <li><a href="#contactinfo" class="navlink"> contact</a>...

windows - Mercurial (hg) can't access file ='FRX' -

on home laptop windows 7 x64 ( ntfs ) of mercurial repositories become stuck after unknown reason. problem when try run hg log or hg diff : can't access file d:\user\my-hg-repo-root-path\='frx' in same time, icoming , pull , update , push , add , commit work well. so, last several days live without history or diff preview on home laptop. i've not found reason such problem, same frx means. know reason of problem? pagerextension ? that's ='frx' might coming from. @ ~/.hgrc .

grails - AsciidoctorJ with explicity jruby dependency results in IncompatibleClassChangeError -

i followed helpful advice ( https://github.com/asciidoctor/asciidoctorj/issues/313#issuecomment-119372587 ) asciidoctorj working in development environment adding explicity dependency on jruby: compile 'org.jruby:jruby:9.0.0.0.rc1' compile 'org.asciidoctor:asciidoctorj:1.5.2' however, when pushed code our qa environment following message: caused by: java.lang.incompatibleclasschangeerror: found interface org.objectweb.asm.fieldvisitor, class expected @ org.jruby.java.codegen.realclassgenerator.defineoldstyleimplclass(realclassgenerator.java:104) @ org.jruby.java.codegen.realclassgenerator.createoldstyleimplclass(realclassgenerator.java:63) @ org.jruby.javasupport.java.newinterfaceimpl(java.java:1183) @ org.jruby.java.proxies.javainterfacetemplate.jcreateproxy(javainterfacetemplate.java:281) @ org.jruby.java.proxies.javainterfacetemplate.access$000(javainterfacetemplate.java:30) @ org.jruby.java.proxies.javainterfacetemplate$4.call(javai...

inheritance - C++ Error in compiling due to pointer class -

my code doesn't compile when try running it. many errors don't understand why errors pop in first place. of errors involve header file. of errors i'm missing ';' before '*' in header file. furthermore says int assumed in header file comment in code happens. this error im getting compiler: 1`>\\csupdatevm\labusers\uuu_uuuuu\documents\visual studio 2013\projects\expection\expection\game_implementation.cpp(25): error c2276: '&' : illegal operation on bound member function expression` in header file have: #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; //#include <exception> class board{ public: void displayboard(); void createboard(); void insert(int temp_move, char temp_player); bool islegal(int move); vector<char> getboard(); private: const int num_squares = 9; ...

Apache2 does not restart after upgrade Debian wheezy and php 5.5 -

just upgraded debian wheezy 6 , decided upgrade php 5.5 @ same time, impossible restart apache running, has since stopped. service apache2 restart apache2: syntax error on line 236 of /etc/apache2/apache2.conf: not open configuration file /etc/apache2/mods-enabled/php5_cgi.load: no such file or directory action 'configtest' failed. the lines mentioned above in conf file are: # include module configuration: include mods-enabled/*.load include mods-enabled/*.conf i tried go php 5.4, each time reinstall 5.5 comes back. i had similar problem. don't know exact cause, suspect configuration file not compatible across versions. for me, worked was apt-get purge apache2 apt-get install apache2

javascript - Create an alert on div after third click count -

how can create alert after div being clicked third time? tried examples already, failed on making work. here's code far (without count part): $("div").one( "click", function() { $(this).css({ background: "red", cursor: "auto", }); $(this).append( "0" ); $("span").append( "0" ); }); fiddle http://jsfiddle.net/7gosayyo/ need use javascript keep track of how many times has been clicked. <button onclick="clicking()>click me</button> var nclicks = 0; var nmaxclicks = 3; function clicking() { // increment counter each time item clicked nclick++; // on 3rd click.... if (nclicks == nmaxclicks){ // enter code thing looking alert("max clicks hit! " + nclicks); } }

feature selection - MATLAB ReliefF Output -

the outputs of matlab feature selection algorithm relieff ranked , weights. http://in.mathworks.com/help/stats/relieff.html how 2 outputs related? from docs: ranked indices of columns in x ordered attribute importance, meaning ranked(1) index of important predictor. weight attribute weights ranging -1 1 large positive weights assigned important attributes. so relieff doesn't give list of predictors important, gives list of weights give idea of how important predictors are. weight(4) , example, weight of fourth predictor. weight(ranked) return ordered list of weights rank (highest lowest). you note weight values predictors 4 & 3 in case relatively close. might indicate although particular set of data 4th predictor appears ranked first, 4th , 3rd predictors both important , given different set of data ranking change. for example, fisheriris data set contains 150 measurements of 4 predictors. if take two-thirds of them can different result: load...

angularjs - angular js - scope variable dont change on 2 way data binding -

i new angular js. my controller : var myapp= angular.module('myapp', ['ngroute']); // configure our routes myapp.config(function($routeprovider) { $routeprovider // route home page .when('/', { templateurl : 'pages/person.html', controller : 'personcontroller' }) // route contact page .when('/add', { templateurl : 'pages/addgroup.html', controller : 'groupcontroller' }); }); myapp.controller('groupcontroller', function($scope) { $scope.user = 'alex'; $scope.print = function() { alert($scope.user); }; }); my view : <div ng-controller="groupcontroller"> name: <input type="text" ng-model="user"> <button ng-click='print()'>print</button> {{user}} </div> when change inp...

linux - /usr/bin/ld: cannot find -ldcmimage -

am trying compile dcmbeam using make on centos 7 -x64, getting these errors: make c++ -g -o -i/usr/include/libxml2 -d_reentrant -d_xopen_source_extended -d_xopen_source=500 -d_bsd_source -d_bsd_compat -d_osf_source -d_posix_c_source=199506l -wall -l/usr/local/dicom/lib -o dcmbeam dcmbeam.o -ldcmimage -ldcmimgle -ldcmdata -lofstd -lz -lpthread /usr/bin/ld: cannot find -ldcmimage /usr/bin/ld: cannot find -ldcmimgle /usr/bin/ld: cannot find -ldcmdata /usr/bin/ld: cannot find -lofstd collect2: error: ld returned 1 exit status make: *** [dcmbeam] error 1 any ideas trying find? , location looking at? attach src code zipped on dropbox, link: download src code thanks alot! being 1 of dcmtk developers, looked @ error log , seems forgot link "oflog" library (which has been introduced dcmtk 3.6.0 ).

mysql - How can I use a parameterized query to search on a column by its name? -

my users should able search database entering search term in input box , selecting column they'd search on dropdown box. however, can't find way parameterize query in golang such column name recognized column name instead of value. let me give example: rows, err := db.query("select * mytable ? = ?", col, searchstr) i turned on mysql logging , resulting query: 41 execute select * mytable 'username' = 'foo' clearly username should not have single quotes around it. how can parameterize query? have write application logic check each query proper column names , use string manipulation add column name query (perhaps using placeholder character find-and-replace)? this trying keep safe bad args (prevent things sql injection) isn't designed replacement on other value. want insert table name. unfortunately code aware of col 's type (string) , quotes because in sql it's nvarchar , that's how literals written...

Android Photo Camera Upload with Retrofit - ASP.NET MVC Endpoint -

want able on fly post image back-end android app. doing wrong here? keep receiving internal server error, know endpoint , working (able call other clients) i have asp.net mvc endpoint setup this: [httppost] public jsonresult postimage(int id, string accesstoken, httppostedfilebase img) in android code, using retrofit setup this: @multipart @post("/endpoint/postimage") void postimage( @part("id") int id, @part("accesstoken") typedstring accesstoken, @part("img") typedbytearray img, callback<boolean> callback); i have image handling code this: bytearrayoutputstream bos = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.png, 0, bos); byte[] bitmapdata = bos.tobytearray(); // convert typed typedbytearray typedbytearray = new typedbytearray("application/octet-stream", bytes); typedstring str = new typedstring("mystring"); restadapter adapter = new re...

php - laravel 5 Query Builder error "must be of the type array, object given" -

ok trying perform mysql query join tables , return results. so in controller have array of serviceids when print_r() looks this: array ( [0] => 50707 [1] => 50709 ) the name of array $serviceids okay call function 1 of models. scope seen below: $services = services::getwatchlistinfo($serviceids)->get(); this scope function in model: public function scopegetwatchlistinfo($serviceids){ $services = db::table('services') ->join('reviews','services.serviceid','=','reviews.serviceid') ->select('services.name','services.type','services.review_count_approved','reviews.escalate','reviews.average_rating') ->wherein('serviceid',$serviceids); return $services; } okay should results both services , reviews table service id in array. instead getting following error. argument 1 passed illuminate\database\gram...

lua - Torch: luajit out of memory on simple task -

i trying load mnist dataset in th repl , mean subtraction following: file = torch.load('data/mnist.t7/train_32x32.t7', 'ascii') data = file.data:type(torch.getdefaulttensortype()) mean = data:mean() data:add(-mean) the last line causes following error: .../torch/install/bin/luajit: not enough memory i running on laptop 16gb of ram. mnist has been loaded data not sure why doing data:add(-mean) cause issue. ideas? thanks the problem was trying print whole matrix (which large) console. this can overcome doing either data = data:add(-mean) or data:add(-mean); - notice semicolon answer provided soumith chintala on torch gitter.

javascript - Passing array is not modified with $http Angular service -

i learning angular stuck trying use $http service , json array. have array called names . can show content inside function, outside shows error: typeerror: cannot read property 'name' of undefined . think array not beeing modified properly. don't know why. took code example w3shools.com ( http://www.w3schools.com/angular/tryit.asp?filename=try_ng_customers_json ). modified little bit. why when want show content of name variable second time error? var names = []; $http.get("http://www.w3schools.com/angular/customers.php") .success(function(response) { names = response.records; console.log("the name is: " + names[0].name); }); console.log("and name again: " + names[0].name); $http.get() asynchronous service . try snippet instead checking change on model: $scope.name = []; $http.get("http://www.w3schools.com/angular/customers.php") .success(function (response) { $scope.name = respons...

html - Fixed div and fluid height div under -

i have fixed header height , subheader, want subheader fill whole page, when that, there’s slight offset causing scrollbar appear resize window in height: header { width: 100%; height: 55px; z-index: 10; background: #263238; } .sub-header { background: #37474f; height: 95vh } <header></header> <div class="sub-header"></div> i’ve googled , googled , can’t find answer. the 2 height settings not equate 100%. 95vh leaves 5vh , header set 55px , such, instead of 95vh sub header, calc(100vh - 55px) . you need ensure body not have margin set. body{ margin:0; } header { width: 100%; height: 55px; z-index: 10; background: #263238; } .sub-header { background: #37474f; height: calc(100vh - 55px) } <header></header> <div class="sub-header"></div>

java - Web project doesn't run on server if a dependent project is opened in eclipse -

i'm developing web application eclipse 4.4.2 , maven , tomcat v7.0 . application consists of appsuite ( <packaging>pom</packaging> ) appmodel ( <packaging>jar</packaging> , has auto-generated classes) appuserinterface ( <packaging>war</packaging> , depends on appmodel ) appuserinterface , appmodel modules of appsuite . the issue i'm facing if have 3 projects opened in eclipse , try run appuserinterface on server, gets moved tomcat webapps folder correctly ( *.class files of appuserinterface , libs including appmodel.jar ) tomcat throws exception java.lang.noclassdeffounderror: com/app/model/classname but if close project appmodel in eclipse runs fine when run appuserinterface on server. i suspect eclipse becomes confused if appuserinterface shall work local appmodel . any thoughts resolve error, can have 3 projects open @ same time , still run appuserinterface ? edit: java.lang.noclassdeffounderror: com...

javascript - OpenLayers 3 FeatureOverlay override feature style -

i have web map written using openlayers 3.0, trying upgrade openlayers 3.6. featureoverlay seems behave differently. have kml layers styles defined each feature, , want use featureoverlay style override highlight features mouse moves on them. in ol3.0 worked fine, in ol3.6, feature style takes preference on featureoverlay style, hover highlight not show up. functionality changes seems defeat point of having featureoverlay class - may temporarily change feature style. is there way override feature style when adding features featureoverlay? define kml layer: var layer = new ol.layer.vector({ source: new ol.source.vector({ url: layerurl, format: new ol.format.kml({ extractstyles: true }) }) }); define featureoverlay: var hoveroverlay = new ol.featureoverlay({ map: map, style: new ol.style.style({ stroke: new ol.style.stroke({ color: "orange", width: 3 }) }) }); add fe...

Android - App crashing because of TextWatcher -

when write number in edittext works fine when delete number app crashes. this code: final edittext et2 = (edittext) findviewbyid(r.id.edittext2); final edittext et3 = (edittext) findviewbyid(r.id.edittext3); et2.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { // todo auto-generated method stub } @override public void beforetextchanged(charsequence s, int start, int count, int after) { // todo auto-generated method stub } @override public void aftertextchanged(editable s) { decimalformat df = new decimalformat("#.00"); string et2string = et2.gettext().tostring(); int et2int = integer.parseint(et2string); double finpriceadulto = (priceadulto * et2int); textview tvpriceadulto = (textview) findviewbyid(r.id.textview7); ...

function - Quickest way to return snapshots of Exponential Moving Average in postgresql -

i collecting , graphing data , 1 of things need calculate exponential moving average of data. have data stored in postgres. based on stack page read ( how calculate exponential moving average on postgres? ) have following function. create or replace function ema_func( state double precision, inval double precision, alpha double precision) returns double precision $body$ begin return case when state null inval else alpha * inval + (1-alpha) * state end; end $body$ language plpgsql volatile which using aggregate put together: create aggregate ema(double precision, double precision) ( sfunc=ema_func, stype=float8 ); i graphing stock information given day have 7000-8000 pieces of data. don't need of information graph data (depending on window settings, 1 pixel might worth somewhere around 60 seconds) want pull snapshots of data every nth second. wrote function me , has saved me time. create or replace function emasnapshots( ptable varchar, t...

sql server - Changing Stored Procedure Structure -

i have stored procedure gets information multiple tables , displays data. need no longer @ order_detail_serials table , @ order_serial table. not sure how change structure so. assistance in matter appreciated. alter procedure [dbo].[status] ( @begin_date smalldatetime, @end_date smalldatetime ) begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; -- gather orders date range product codes select distinct orders.ordernumber internal_id, orders.ponumber client_id, orders.altordernumber altonumber, orders.shipid shipping_method, orders.shipdate ship_date, order_details.productid productid, products.productcode parent_item_code, orders.orderstatus order_status #orders_header_info orders inner join order_details on orders.ordernumber = order_details.ordernumber inner join products on order_details.productid = products.productid orders....