Posts

Basemap projection -

i have latitude , longitude data in following format 11.422, 47.3156 i want plot these points on basemap, don't know projection use them plotted right. trid out view didn't worked out, please me. you can following documentation at: http://matplotlib.org/basemap/api/basemap_api.html , trying out http://matplotlib.org/basemap/users/examples.html

linux - How to do some task after Asterisk ReceiveFax function calling? -

i have asterisk server installed: , have created dial-plan receive fax: want task after received fax. but, line written after recevefax function called when transmission failed . if transmission success never called line after. my dial-plan: ;######################### fax dialplan implementation start ########################## exten => _15555551212,1,noop(fax receiving ${exten}) exten => _15555551212,n,answer exten => _15555551212,n,ringing exten => _15555551212,n,macro(inboundfax) exten => _15555551212,n,noop(done) exten => h,1, noop(completed...) [macro-inboundfax] exten => s,1,noop(**** fax received ${callerid(num)} ${strftime(${epoch},,%c)} ****) exten => s,n,set(faxopt(ecm)=yes) exten => s,n,set(filename=fax-${strftime(${epoch},,%y%m%d-%h%m%s)}) exten => s,n,set(faxfile=${filename}.tif) exten => s,n,set(faxopt(ecm)=yes) exten => s,n,set(faxopt(headerinfo)=received mycompany ${strftime(${epoch},,%y-%m-%d %h:%m)}) exten => s,n...

c# - Prevent application from changing desktop resolution -

so have old game client annoyingly takes upon change desktop resolution cater 1600x900 resolution achieve full screen, i'm trying figure out how stop happening. i imagine it's calling changedisplaysettings() in user32.dll, if possible block specific dll calls, or perhaps easier way? thanks in advance. edit: should add game client not own have no direct control on it's doing. i have managed breakpoint before changedisplaysettingsa() call , modify lpdevmode parameters achieve want, need figure out how programmatically.

c++ - Compile-time pure virtual functions -

i've tried implementing list container, , decided move general functions sum() base class, can reuse them later in other containers. all base support class needs 3 methods empty() , head() , tail . can't make pure virtual because support class never instantiated. still has use methods implement own methods sum() . i tried this: #include <iostream> using namespace std; template<typename t> class statssupport { public: t sum(void) const { if (empty()) { return t(0); } else { return head() + tail()->sum; } } // other methods }; template<typename t> class list : public statssupport<t> { public: // constructors etc. bool empty(void) const {return head_ != null;} const t& head(void) const {return *head_;} const list<t>& tail(void) const {return *tail_;} // other methods private: t* head_; list<t> *tail_; }; but trying use sum() get...

java - How to perferm different action depending on user input -

i'm trying make simple game (even without interface). supposed type action attack, heavy , light or block). "enemy" responds "light" action. problem? import java.util.scanner; public class game { public static void main(string[] args) { int hp = 10, enemy_hp = 10; string attack = "attack"; string block = "block"; string heavy = "heavy"; string light = "light"; scanner userinput = new scanner(system.in); while (enemy_hp > 0 && hp > 0) { system.out.println("it turn, attack (heavy or light) or try block"); int your_block_chance1 = (int)(math.random() * 4); //chance block attack int enemy_block_chance1 = (int)(math.random() * 4); string action = userinput.next(); if (action.equals(attack)) { //attack system.out.print("you attacked enemy , "); ...

pause in javascript doesn't work in a loop -

this sleep function: function sleep(milliseconds) { var start = new date().gettime(); (var = 0; < 1e7; i++) { if ((new date().gettime() - start) > milliseconds){ break; } } } this function actualize textarea content: luminosidad.prototype.prueba = function(num) { document.getelementbyid("pruebas").value = num; } when want in loop, can see last value. code: for (var = 1; < 8; i++) { sleep(this.opcion.velocidad); this.prueba(i); } on textarea, can see "7", last number. don't actualize correcly. why can happens? (sleep works correctly) why can happens? because never give browser chance show updates you're making, because you're keeping ui thread busy looping pointlessly. busy-waits never right answer situation. in case, you're looking either setinterval of series of settimeout s: function luminosidad() {} luminosidad.prototype.prueba = function(n...

ruby on rails - keen-io Multi-Analyse with difference timeframe -

i need help. i'm using keenio , sdk ruby can run in single query multiple types of analyses different time frame? multi-analysis, in each analyse set time frame. for example: keen.multi_analysis(:users, analyses: { week: { analysis_type: 'count', timeframe: 'this_7_days' }, { month: { analysis_type: 'count', timeframe: 'this_30_days' } }) same in 1 difference tables. p.s. maybe can via javascript? thx! per keen io api documentation , "multi-analysis lets run multiple types of analyses on same data." in other words single multi-analysis query must on same collection/timeframe/filters. if want query different timeframes or collections, need execute multiple queries. as additional technical background: multi-analysis query can executed more efficiently running component parts independently, because on end events read database once , of computations performed in single pass. if component parts o...