Posts

Showing posts from April, 2012

bash - Cannot exit from Docker container -

i've got container run as docker run -it --rm --name <container_name> <image>:<tag> normally, fall container terminal can exit exit command. now, have dockerfile ends entrypoint runs simple bash script: #!/usr/bin/env bash # add new user groupadd -r $group --gid $groupid useradd -r $user --uid $userid --gid $groupid # launch application new user su - -c "python <path_to_script>/myscript.py" $user now, once script ends, expected exit container in entrypoint bash script ran again , again (say 10 times). why container have behavior ? su manpage says: -, -l, --login provide environment similar user expect had user logged in directly it spawns shell exit comeback parent container shell. so changing su - -c "python <path_to_script>/myscript.py" $user to su "$user" -c "python <path_to_script>/myscript.py" might solution sidenote : - -c

oauth 2.0 - WSO2 Open Id Connect Single Logout -

how can achieve single logout openid connect identity server 5.1.0 see there documentation ( https://docs.wso2.com/display/is520/configuring+openid+connect+single+logout ) version 5.2.0 can't open link. for logout in both applications right now, i'm following https://stackoverflow.com/a/29965502/525162 want logout second application after first 1 logged off. do need saml sso? possible openid connect 5.2.0 forward? thanks, diogo the documentation work in progress. that's why can't access right now. 5.2.0 have openid connect session management 1.0 spec[1] implemented allow use case have mentioned. ie. if there 2 rp applications relying on wso2 identity server, when end user logs-out of 1 of applications, he/she can automatically logged out of other 1 well. [1] http://openid.net/specs/openid-connect-session-1_0.html

c# - How to implement the DirectCast operator in a type? -

when implementing ctype operator in custom type 1 below, type not casteable using directcast operator: public structure colorinfo ... public shared widening operator ctype(byval colorinfo colorinfo) color return color.fromargb(colorinfo.r, colorinfo.g, colorinfo.b) end operator ... end structure on other hand directly assignable color object, confussing: dim obj color = mycolorinfo then, implement directcast operator firstly obtain typing comfort in environment (instead of using ctype ) , secondly obtain beneffits, if any, of explains msdn docs here : directcast not use visual basic run-time helper routines conversion, can provide better performance ctype when converting , data type object. how can implement in c# or vb.net ?. directcast 'compile-time' cast added type-checking @ runtime. it's meant casting when type inheritance or interface implementation in play. not consider user defined casts, such have her

How to import data from MySql into Hive using Apache Nifi? -

i trying import data mysql hive using querydatabasetable , puthiveql processors, error occurs. i have questions: what output format of puthiveql ? should output table created beforehand or processor that? where can find template mysql hive process? here information questions: the flow files input puthiveql output after have been sent hive (or if send fails), output format (and contents) identical input format/contents. the output table should created beforehand, send puthiveql "create table if not exists" statement first , create table you. i'm not aware of existing template, basic approach following: querydatabasetable -> convertavrotojson -> splitjson -> evaluatejsonpath -> updateattribute (optional) -> replacetext -> puthiveql querydatabasetable incremental fetches of mysql table. convertavrotojson records format can manipulate (there aren't many processors handle avro) splitjson create flow file each of records

Formatting Date Strings in R -

i have 2 columns of differently formatted date strings need make same format, the first in form: vt_dev_date = "6/20/2016 7:45" the second in form vt_other = "2016-06-14 20:21:29.0" if them both in same form down minute great. have tried strptime(vt_dev_date,format = "%y-%m-%d %h:%m") strptime(vt_other,"%y-%m-%d %h:%m") and second one, works , "2016-06-14 20:21:00 edt" but first string, seems because month , hour not padded zeros, none of formating tricks work, becuase if try test_string <- "06/20/2016 07:45" strptime(test_string,format = "%m/%d/%y %h:%m") [1] "2016-06-20 07:45:00 edt" it works, dont think going through every row in column , padding each date great option. appreciated. thanks, josh how using lubridate , follows : library(lubridate) x <- c("6/20/2016 7:45","2016-06-14 20:21:29.0") > x [1] "6/20/2016 7:45"

Algorithm to estimate time complexity of another algorithm -

is possible develop algorithm estimate time complexity of algorithm? mean, input algorithm , output time complexity of (big-oh, big-omega, , on). not find on web. thank you let me extend @interjay's comment little bit. the halting problem asking if possible design turing machine (you may think program in computer) such given turing machine (again, think program) can decide whether or not input turing machine terminate eventually. one can prove impossible design such turing machine. let consider question, if able design algorithm want, able answer whether given turing machine terminate or not. unfortunately impossible. above argument called "reduction" 1 of popular way show given problem unsolvable.

javascript - Why value of equation has undefined at the end? -

i write simple calculator in js & jquery , i've come across strange behaviour. in code below, see variable equation holds every number pressed on calculator. use eval() well, evaluate. issue is, value of equation variable you'd expect undefined @ end, , cannot figure out why. whole project here: http://codepen.io/ketus/full/xmyrov/ thanks in advance! ps.: know general opinion eval() . used testing can moving. implement own solution after solving problem undefined . $(document).ready(function() { var equation = ''; var input = $('h2[data-value]'); var info = $('#info'); //get keys var keys = $('.key').filter(function() { return $(this).data('key'); }).get(); //get operators var operators = $('.operator').filter(function() { return $(this).data('operator'); }).get(); //clearing input $('.clear').click(function(){ equation

ios - Asymmetrical collection view layout with cells paired or solo -

Image
i spending long time trying accomplish without ideas. have data model, need put collection view. main problem collection views not elastic. the data model can in different structure similar this, , not symmetrical. can in other order but go down . difference side in index goes. i have tried : creating sections in each section gets 2 cells, when creating layout had problem single cell in section must on right side, , next on left. delegate's order opposite, , complications of moving cells around. inserting cell specific index, can set section 2 indexes , insert cell index 1 directly , not 0 . (this impossible because max index should maximum data.count ) should build myself? these things possible collection view @ all?

c# - Resizing controls in WinForm Designer by 32px-steps (VS15) -

i have little problem new custom control. question want resizes 32px-steps create grid, i'm looking event of post-resizing, or similar adjust control's size. has ideas? just enforce size requirements: class mygrid : control { private const int pitch = 32; protected override void onclientsizechanged(eventargs e) { var w = pitch * ((this.clientsize.width + pitch/2) / pitch); var h = pitch * ((this.clientsize.height + pitch/2) / pitch); if (w != this.clientsize.width || h != this.clientsize.height) this.clientsize = new size(w, h); else base.onclientsizechanged(e); } } it not fantastic design-time experience serviceable , simple since doesn't require custom designer. do careful this, hard-coding sizes in pixels not idea these days 4k monitors available , costing less $500. 32 px grid cell going fleck of dust on such screen.

css - Activeadmin assets Not Loading Rails 4.2 -

previously getting error can't quite remember rails 4.2 , activeadmin. changed: @import "active_admin/mixins"; @import "active_admin/base"; to: @import "active_admin/mixins.css"; @import "active_admin/base.css"; this worked fine in debug mode... , got rid of error... css isn't loading in production mode. i'm wondering if there's should change in maybe production.rb or in capfile (i'm using latest capistrano), reflect change made in active_admin.css.sss edit: this error getting before , why made changes made: https://github.com/activeadmin/activeadmin/issues/214 oooookay... error getting related sass (and should've taken screen shot time... oh well...) referred sass not being able process "&" sign... meant version of sass-rails off. so first changed: @import "active_admin/mixins.css"; @import "active_admin/base.css"; back to: @import "active_admin/m

spring - java.io.FileNotFoundException: class path resource [conf/admin/applicationContext.xml] cannot be opened because it does not exist -

i'm using spring security, reason web.xml isn't finding applicationcontext.xml web.xml <context-param> <param-name>contextconfiglocation</param-name> <param-value> classpath:conf/admin/applicationcontext.xml classpath:conf/admin/applicationcontext-security.xml </param-value> </context-param> <filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter-class> </filter> <filter-mapping> <filter-name>springsecurityfilterchain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> my applicationcontext.xml in myproject/conf/admin/applicationcontext.xml, in same place web.xml throws exception:

excel - Copy data between worksheets -

the problem have on hand is: have excel file multiple worksheets , should populate cells in worksheet b values cells in worksheet a. made little macro doesn't work should. either go in totally different cells, throws , error or copies formula , not value. the specifics are: data in worksheet in complete column h , starts in second row. data in these cells concatenate different fields. the loop should take first value h2 in worksheet , put in worksheet b, b1. move onto h3 in worksheet , put value in worksheet b, c1 , on. it should till there no value left in worksheet column h. sub test2() ' select worksheet worksheets("a").activate ' select first cell data range("h2").select ' loop until no data present until isempty(activecell) ' helper variable startpoint in worksheet b dim integer = 8 ' copy first value selection.copy ' go different worksheet worksheets("b").activate &#

jbpm - drools stateless vs stateful session -

when should use drools stateless session , benefits of using instead of stateful session? in comment here it's said stateless sessions wraps stateful one, means when destory statfeul session after firing rules behave stateful 1 ? perhaps better both (stateful) kiesession , statelesskiesessions provide apis (interfaces) classes based on class abstractruntime. a statelesskiesession provides interface executing set of commands via single execute method call, commands being represented set of objects. useful if want send commands remote session (but not if run session within application). also, such session not react changes done within working memory, usefulness limited, although might perform first , round more efficient stateful session. an execute call implies dispose call, final goodbye session object: release resources garbage collection. to summarize (what described in full in drools documentation) for simple rule evaluations, via remote communication

caffe - can't get access to python lmdb , ' object has no attribute 'Environment'' -

i using lmdb python load data def create_dataset(): img_db_fn = 'data/image_train.lmdb' img_env = lmdb.environment(img_db_fn, map_size=1099511627776) img_txn = img_env.begin(write=true, buffers=true) keys = np.arange(100000) np.random.shuffle(keys) img_fns = glob.glob('data/positive/*.jpg') img_fns += glob.glob('data/negtive/*.jpg') print len(img_fns) , len(jnt_fns) i, img_fn in enumerate( img_fns ): img_datum = get_img_datum(img_fn) key = '%06d' % keys[i] img_txn.put(key, img_datum.serializetostring()) if % 10000 == 0: print 'commit',i img_txn.commit() img_txn = img_env.begin(write=true, buffers=true) img_txn.commit() img_env.close() i got error saying 'img_env = lmdb.environment(img_db_fn, map_size=1099511627776) attributeerror: 'module' object has no attribute 'environment'' i

Entity Framework duplication rows (C#) -

in system, testing dao classes , found bug. when object database , use other object, ef duplicate record. my main code: try { usuariodao usuariodao = new usuariodao(); bugdao bugdao = new bugdao(); tipostatusdao tipostatusdao = new tipostatusdao(); usuario usuario = usuariodao.getbyid(1, true); tipostatus tipostatus = tipostatusdao.getbyid(1, true); bug bug1 = new bug() { tipostatus = tipostatus, descricao = "erro ao salvar dados", dtabertura = datetime.now, usuario = usuario }; bugdao.add(bug1); bugdao.savechanges(); bugdao.dispose(); usuariodao.dispose(); tipostatusdao.dispose(); } catch (exception ex) { messagebox.show(ex.message); } usuariodao code: private sgs

ruby on rails - Cascade of deletes ActiveRecord -

how can add cascade of deletes remove profile, todolist, , todoitem rows user removed. user model: class user < activerecord::base has_one :profile has_many :todo_lists has_many :todo_items, through: :todo_lists, source: :todo_items validates :username, presence: true end profile model: class profile < activerecord::base belongs_to :user validates :first_name, presence: true validates :last_name, presence: true validates :gender, inclusion: %w(male female) validate :first_and_last validate :male_sue def first_and_last if (first_name.nil? , last_name.nil?) errors.add(:base, "specify first or last.") end end def male_sue if (first_name == "sue" , gender == "male") errors.add(:base, "we prevent male name sue.") end end end todolist model: class todolist < activerecord::base belongs_to :user has_many :todo_items, d

knitr - Integrated R/markdown/pandoc bibliographies from multiple sources? -

seems simple problem: have assembled bibliography pubmed in medline xml format. works pandoc-citeproc format citations , produce list of references @ end of document. want integrate citations r packages using , produce unified bibliography in pandoc (via pandoc-citeproc). pandoc-citeproc write yaml , json bibliographies medline xml. i'm ok (possibly manual) merge of r , medline citations before running pandoc. don't see in citation() nor pandoc-citeproc transform medline , citation() output common format can used create unified bibliography. thanks pointers have. i used bibtex package write r citations file library(ggplot2) library(plyr) library(limma) library(bibtex) write.bib( c('bibtex', 'ggplot2', 'plyr', 'biobase', 'limma'), file "r.citations.bib" ) pandoc accepts multiple --bibliography arguments. importantly, if bibliography filename suffixes recognized, can use different bibliography formats (.medl

Java process hangs after executing Oracle stored procedure -

i have batch process written in java 6 ojdbc6 driver (previously ojdbc5 ) connecting oracle 11g. hangs on executeupdate() method. method executes stored procedure more hour. after stored procedure has updated necessary tables , committed transaction, never goes java caller of executeupdate() . works on test server hangs on production server. i suspected ojdbc driver before after upgrading ojdbc6 issue still persists. just want share resolution issue, rewriting procedure , removing cursor fixed it. don't know what's wrong cursor. hope helps.

jdbc - Creating Connection Pool In Standalone Java Application -

i need use connection pool in standalone (as in non-web) java application. work, not allowed use apis without going through layers of security, , job needs completed soon. below attempt @ creating connection pool. i have unit tested code , tested within context of overall application hundred times , in cases tests passed 0 errors, , in addition performance of each run under 3 thousand times faster simple connect, retrieve data, disconnect in serial approach; however, still have nagging concerns there issues approach haven't unearthed yet. appreciate advice has concerning below code. first post on site; please let me know if i've made errors in etiquette. did search site problem before posting. please see below code invocation example. thanks. --jr package mypackage; import java.sql.connection; import java.sql.sqlexception; import java.util.map; import java.util.concurrent.arrayblockingqueue; import java.util.concurrent.blockingqueue; import java.

git - Checking out a branch included some untracked files -

Image
i have run problem where, when check out branch repository, bunch of files show marked "untracked", means shouldn't have been in repository in first place. if delete them locally, git client shows files having been removed , i'm supposed check in "change". on other hand if "remove" 1 through git , try stage it, message file didn't match anything. the thing can these files of characters have accents (they're named in french) , suspect that's what's screwing things up. anyone know how fix this? here screen shot showing problem

r - Ways to add multiple columns to data frame using plyr/dplyr/purrr -

i have need mutate data frame through additional of several columns @ once using custom function, preferably using parallelization. below ways know how this. setup library(dplyr) library(plyr) library(purrr) library(domc) registerdomc(2) df <- data.frame(x = rnorm(10), y = rnorm(10), z = rnorm(10)) suppose want 2 new columns, foocol = x + y , barcol = (x + y) * 100 , these complex calculations done in custom function. method 1: add columns separately using rowwise , mutate foo <- function(x, y) return(x + y) bar <- function(x, y) return((x + y) * 100) df_out1 <- df %>% rowwise() %>% mutate(foocol = foo(x, y), barcol = bar(x, y)) this not solution since requires 2 function calls each row , 2 "expensive" calculations of x + y . it's not parallelized. method 2: trick ddply rowwise operation df2 <- df df2$id <- 1:nrow(df2) df_out2 <- ddply(df2, .(id), function(r) { foocol <- r$x + r$y barcol <- foocol * 100 retu

How to publish and run asp.net core 1 & angular 2 application with IIS? -

how deploy angular 2 (2.0.0-rc.4) , asp.net core web application (.net core 1 – sdk version 1.0.0-preview2-003121) on iis? here link docs: https://docs.asp.net/en/latest/fundamentals/environments.html i have created 5 min video on how setup angular 2 , aspnetcore https://www.youtube.com/watch?v=o3vga1jthje if in visual studio, use publish button deploy. the deployed version exported wwwroot folder

c++ - move-assigning a std::map with an aligned value type segfaults -

the following code segfaults consistently me on clang 3.8 succeeds on clang 3.7. compile clang++ -std=c++14 -o2 test_case.cpp -o test_case in both cases. if compile optimisations off on clang 3.8 program runs completion. i'm guessing compiler taking liberties when optimising - question is: compiler allowed optimise in way, or have found first compiler bug? #include <iostream> #include <map> struct __attribute__((aligned(16))) troublesome { float s; }; int main() { std::map<int, troublesome> m{{0, troublesome{}}}; std::map<int, troublesome> n{{1, troublesome{}}}; std::cout << "got here" << std::endl; // prints m = std::move(n); // segfault happens here std::cout << "got here too" << std::endl; // here on old clang }

inheritance - Java avoiding instanceof by design -

consider following class design: public class supertype { }; public class subtype1 extends supertype { }; public class subtype2 extends supertype { }; public class subtype3 extends supertype { }; public class tuple { supertype t1; supertype t2; public tuple(supertype t1, supertype t2) { this.t1 = t1; this.t2 = t2; } public void dosomething1() { if((t1 instanceof subtype1) && (t2 instanceof subtype3)) switch(t1, t2); else if((t1 instanceof subtype2) && (t2 instanceof subtype1)) t1.dosomething(); else if( ... ) { t1.dosomething(); t2.dosomething(); } else if( ... ) // ... } public void dosomething2() { // same } } since action dependent on 2 types cant avoid instanceof operator moving method subtypes. there way can improve design can avoid using instanceof? i know there lot of similar questions here,

html - Bootstrap broken grid in gallery -

Image
i trying create video gallery shows different number of images per row based on screen size, using bootstrap. i started blog post: http://michaelsoriano.com/create-a-responsive-photo-gallery-with-bootstrap-framework/ my end result here: http://jsfiddle.net/mk2r974o/ <div class="container"> <h2>video gallery</h2> <ul class="gallery row"> <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4"> <figure> <a href="//www.youtube.com/watch?v=0gqk3ivfk0a" data-toggle="lightbox" data-width="960" data-gallery="youtubevideos"> <img src="//img.youtube.com/vi/0gqk3ivfk0a/hqdefault.jpg" class="thumbnail img-responsive"> </a> <span class="label label-info">integration</span> <figcaption class="figure-caption"> streamline integration backend systems u

css - Angular Material - Right Sidebar Bugs, left not, but same code? -

i build first app material framework: http://thommessen.upperyard.de/ when switch website mobile view, , open right sidebar, see bugs in height of site... left sidebar dont bug, same code, kust change id right , class right. can tell me how can be? here code: <div ui-view="header"> <md-toolbar layout="row"> <div class="md-toolbar-tools"> <md-button ng-click="togglesidenav('left')" hide-gt-sm class="md-icon-button"> <md-icon aria-label="menu" md-svg-icon="images/icons/menu.svg"></md-icon> </md-button> <h1>hello world</h1> <span flex></span> <md-button ng-click="togglesidenav('right')" hide-gt-sm class="md-icon-button"> <md-icon aria-label="menu" md-svg-icon="images/icons/student.svg&

.htaccess - Django session cookie fails on IE if you have SSL/TLS enabled on a non-www and www domain name with different sessions -

my website works fine on chrome/firefox/opera but on ie not work. what case: i have website accessible via https you can go https://example.com or https://www.example.com , see same website however, depending on if come or without prefix, session created in django application. this works fine in browsers, except ie. why? browsers detect if need send cookie without or prefix, except ie takes first 1 has ever been created. i have been struggling kinds of apache rewriterules etc, handicap rest api ("method not allowed" post requests). as long users go 1 of both prefixes there no problem, happens users things don't expect. how can solve this?

cordova - Telerik InAppPurchase plugin on Android device worked once, now returns Product Not Available -

i have working alpha version andriod cordova app using telerik plugin, inapppurchase. able test purchase each of consumable products 1 time. products return "not available" in test account although status "valid". current version api of plugin doesn't seem have method sets product "consumed" product again "valid" , "available". can please explain how reset products consumable products again available repurchase? many thanks, fio i ran same issue. if changed android version number on apk , installed on device, , did not upload google play, "not available purchase." once publish version checkout work again.

Liquibase rollback to tag -

i new liquibase , trying rollback feature working. running liquibase in windows. executed install tagged database @ version_1.0. ran update tagged database @ version_1.1. trying rollback version_1.0 here command running: liquibase rollback version_1.0 this gives error --changelogfile needed ran this liquibase --changelogfile=v001/master.xml rollback version_1.0 i provide name of change log file executed during update, nothing gets. update contains 2 create table statements , tables not dropped. missing in rollback process? liquibase not tag database really. tags know changessets need rolled back. the rollback done execute rollback tags in changeling.

javascript - Magento adminhtml: "sendMail" is not a function -

i'm developing custom admin page magento (i know i'm bit out of usual way develop magento's extensions). have function called sendmail that, when button clicked, calls controller sends mail. fine first time run (so know it's not routing problem, javascript one), second 1 error uncaught typeerror: sendmail not function . here code: button piece (this added page through javascript) "<td><button onclick='sendmail("+"\"<?php echo mage::helper('adminhtml')->geturl('adminhtml/sendbrochure/send/'); ?>"+"?isajax=true"+"&id="+resultlog[i].id+"\")'>send brochure</button></td>"; sendmail function : function sendmail(link){ sendmailpath = link; sendmail = new xmlhttprequest(); sendmail.open("get", sendmailpath, true); sendmail.setrequestheader("content-type","application/x-www-form-urlencoded");

ios - How to check phone numbers stored in the phone against the firebase database? -

i using firebase , swift. once user signed in firauth, , validate user's phone number complete country code such as: +18585555555 i store username, logindate , phonenumber firebase db , use phone key. format: "users" : { "+18585555555" : { "lastlogindate" : "2016.07.15 21:39:26 gmt+3", "name" : "john", "phone" : "+18585555555" }, "+18585555556" : { "lastlogindate" : "2016.07.15 15:46:16 gmt+3", "name" : "jane", "phone" : "+18585555556" }, "+18585555557" : { "lastlogindate" : "2016.07.15 16:13:46 gmt+3", "name" : "richard", "phone" : "+18585555557" } } } i contacts using contact store ios9 so: private func allcontacts() -> [cncontact] { let contactstore = appdelegate.

html - How to add a specific item's image as a background image in rails -

this 1 frustrating me. i'm using paperclip images, , adding them model offer that's fine. problem adding them in background image on index page offer code looks this: <div class="product-image"></div> <style> .product-image { width: 50%; height: 200px; margin-left: 25%; border-radius: 50%; background-image: url(<%= image_tag offer.image %>); background-size: cover; background-repeat: no-repeat; background-position: center; } </style> when inspect on chrome, code looks this: background-image: url(<img src="/system/offers/images/000/000/033/original/headphones.jpg?1468610654" alt="headphones" />); anybody know fix? said, images working fine. if put line of code in <%= image_tag offer.image %> , image shows. appreciated. you using image_tag helper creates html tag you should use asset_url helper asset_url('url image in asset folder')

Not running bat file is not looking for files -

good day. tell me how implement batch file had not worked. batch file checks presence of 2 files (2 txt file - 123.txt , 321.txt) c drive, after checking if are, remove them you can directly delete them without checking: del /q /f "c:\123.txt" "c:\321.txt" 2>nul if want checking anyway: if exist "c:\123.txt" del /q /f "c:\123.txt" if exist "c:\321.txt" del /q /f "c:\321.txt"

excel - how to use value in cell to count up to a number -

Image
i need formula. have spreadsheet user enters integer in 1 cell. need use value place formula in cell. so, example, user enters 24 in cell. need place simple sum formula in 24th cell of row left , highlight red. there way this? you put sum formula in if() function true when row = value in cell: =if(row()=$e$2,$e$3-sum($b$1:$b1),"")

java - Regenerating system in my game not working as intended -

i programming simple 3d java game in free time, , implementing health system, 5 hearts, , when, instance, swim in lava lose 1 heart every 0.4 seconds, when out of lava should regenerate 1 heart every 2 seconds, not working intended. losing of health works, step out of lava stay @ amount of hearts have left , won't regenerate any. here relevant piece of code problem: public void updatehealthbar(player player, screen screen) { if(player.isswimminginlava) { player.isgettingdamage = true; if(system.currenttimemillis() >= lasttime) { lasttime = system.currenttimemillis() + 400; this.playerhealth--; } else { player.isgettingdamage = false; } } if(!(player.isswimminginlava) && !(this.playerhealth < 5) && system.currenttimemillis() >= lasttime) { lasttime = system.currenttimemillis() + 2000; this.playerhealth++; } } i think part !(this.playerhealth &

three.js json loadingmanager model not displayed -

i want preload models , textures loadingbar in project. use loadingmanger three.js have problems preloading json models. load unable display them. here example . you can see in console 200 meshs created. 100 asteroids , 100 ships. withoud loadingmanger can display models (asteroids) there should no problem model. can see in example asteroids loaded without loading manager. here simplified code problem $(function(){ if ( ! detector.webgl ) detector.addgetwebglmessage(); var debugscene = true; var controler, camera, controls, scene, renderer; var objectcontrols; var ship1geometry,ship1material; //////////////////////////////////////////////////////// //loadmanger //////////////////////////////////////////////////////// var manager = new three.loadingmanager(); manager.onprogress = function ( item, loaded, total ) { $('#loader').css({width:(math.round(loaded / total *100))+&qu

vba - Run-time error '1004' Method 'Worksheets' of object'_Global' failed -

i believe have unqualified reference issue code below, based on i've read. think need reference workbook i've tried number of ways of doing this, unsuccessfully. able assist? dim f filedialog, str string set f = application.filedialog(msofiledialogfilepicker) f.show str = f.selecteditems(1) dim xl excel.application set xl = new excel.application xl.visible = true xl.workbooks.open (str) dim wst worksheet, wsa worksheet, wse worksheet, wsi worksheet, lr long, lrow long worksheets.add(after:=worksheets(1)).name = "table" set wsa = worksheets("active") set wst = worksheets("table") one example, of i've tried set wb = xl.workbooks.open(str) thank you! you there. define variables first. dim xl excel.application set xl = new excel.application xl.visible = true dim xlwb excel.workbook '** added line set xlwb = xl.workbooks.open(str) rest of code looks @ first glance

node.js - Passport Not calling callback -

using passport first time , realize when log data inside strategy callback doesn't displayed in console, how works or doing wrong? passport.use(new googlestrategy({ clientid: process.env.google_client_id, clientsecret: process.env.google_client_secret, callbackurl: process.env.callback_url, passreqtocallback: true }, function (accesstoken, refreshtoken, profile, done) { console.log('this should displayed'); done(profile) } ); route looks this: app.get('/api/v1/authenticate/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/plus.login'] })); i had same issue , solved calling authenticate this: passport.authenticate('facebook', { scope: ['email', 'public_profile', 'user_likes', 'user_birthday'], callbackurl: "http://localhost:1337" + req.url }, function (err, user) { if (err) return res.negotiate(err); // })(req, res

css - Font-size not applied to <h2> element in Outlook 2010 -

i have font-size: 14px !important applied both h2 , a elements in following markup: <h2><a href="#">content</a></h2> . heading appears gigantic (like default h2 heading) in outlook 2010. font-size rule isn't applied. why? here's more complete portion of code: <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%"> <tr style="padding:0;text-align:left;vertical-align:top"> <th style="margin:0;color:#686868;font-family:helvetica,arial,sans-serif;font-size:11px;font-weight:400;line-height:1.2;margin:0;padding:0;padding-bottom:0!important;text-align:left"> <h2 class="small-text-center" style="margin:0;margin-bottom:10px;color:#063972!important;font-family:times new roman,georgia,sans-serif!important;font-size:14px!important;font-weight:700!important;line-height:1.2;margin:0;margin-bottom:0!importa

Java garbage collector - When does it collect? -

what determines when garbage collector collects? happen after time or after amount of memory have been used up? or there other factors? it runs when determines time run. common strategy in generational garbage collectors run collector when allocation of generation-0 memory fails. is, every time allocate small block of memory (big blocks typically placed directly "older" generations), system checks whether there's enough free space in gen-0 heap, , if there isn't, runs gc free space allocation succeed. old data moved gen-1 heap, , when space runs out there, gc runs collection on that, upgrading data has been there longest gen-2 heap, , on. gc doesn't "run". might run on gen-0 heap (and collections that), or might check every generation if has free lot of memory (which necessary rarely). but far only strategy. concurrent gc runs in background, cleaning while program running. gc's might run part of every memory allocation. incremental co

android - My project cant see send or received messages -

it keeps crashing @ 1 point on 2 activities: @override protected void onpostcreate(bundle savedinstancestate) { super.onpostcreate(savedinstancestate); activityutilities.customiseactionbar(this); } my activityutilities.customiseactionbar leads to: public class activityutilities { public static void customiseactionbar(activity activity) { int titleid = 0; if(build.version.sdk_int>=build.version_codes.lollipop) titleid = activity.getresources().getidentifier("action_bar_title", "id", "android"); else titleid = r.id.action_bar_title; if(titleid>0){ textview titleview = (textview) activity.findviewbyid(titleid); titleview.settextsize(22); } } } the error code i'm getting is: 11-01 16:19:40.991 17854-17854/com.ajapps.app e/androidruntime: fatal exception: main 11-01 16:19:40.991 17854-17854/com.ajapps.app e/androidruntime: pr