Posts

Showing posts from February, 2015

postgresql 9.4 - How to open a port in Kubuntu -

i trying set postgres server dont understand should allow connections remote pc through port 5432(i have set 2 .conf files).could explain me how open port? you not obliged allow remote access server. if want , can read know how http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html

python - extracting public key from private key dynamically using M2Crypto -

is possible extract public key private key in pem format in python, m2crypto? want same thing happen when use command: openssl rsa -in mykey.pem -pubout > mykey.pub m2crypto.rsa has load_key function returns rsa object has save_pub_key method. from m2crypto import rsa rsa.load_key('mykey.pem').save_pub_key('mykey.pub')

javascript - Handlebars does not output anything -

at start of file define handlebars etc.: <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> <script src="bower_components/handlebars/handlebars.js"></script> <!-- endbower --> <!-- endbuild --> at end of index.html -file pull in handlebars-file: <!-- build:js({app,.tmp}) scripts/main.js --> <script src="scripts/main.js"></script> <script src="scripts/serverhandler.js"></script> <script src="scripts/driver.js"></script> <!-- endbuild --> the file handlebars-related code driver.js . looks this: driver = { someboolean : false, name : null, starttime: new date(), position : null }; source = $('#drive-buttons-template').html(); template = handleba...

css - How to correct below stylus code (Selectors conditional) -

how correct below code in stylus useshortnames = true if useshortnames [class*="mobile-",class*="m-"] else [class*="mobile-"] float: left padding-right: 20px you can use ternary operator , interpolation here: useshortnames = true selector = useshortnames ? '[class*="mobile-",class*="m-"]' : '[class*="mobile-"]' {selector} float: left padding-right: 20px

static return type in PHP 7 interfaces -

why not possible in php 7, declare interface static return type? let's have following classes: interface bignumber { /** * @param bignumber $that * * @return static */ public function plus(bignumber $that); } class biginteger implements bignumber { ... } class bigdecimal implements bignumber { ... } i want enforce return type of plus() method static , is: biginteger::plus() must return biginteger bigdecimal::plus() must return bigdecimal i can declare interface in following way: public function plus(bignumber $that) : bignumber; but doesn't enforce above. is: public function plus(bignumber $that) : static; but php 7, date, not happy it: php parse error: syntax error, unexpected 'static' (t_static) is there specific reason this, or bug should reported? it's not bug, doesn't make sense design-wise object-oriented programming perspective. if biginteger , bigdecimal implement both bign...

java - Sending information from IntentService to Activity -

my question how can send string "messages" (rises , drops) background running intentservice main activity? want show messages in ui. i tried use eventbus, because it's needs less code , should theoretically more simple user, unfortunatelly it's crashing app try register subscriber in oncreate method. thanks! mainactivity.java import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.menu; import android.view.view; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.menu_main, menu); return true; } public void startservice(view view) { intent intent = new intent(this, myservice.class); startservice(intent); } // method stop service public void stopservice(view ...

High Availability with hot-standby and auto-failover in postgresql -

i asked implement high availability , auto-failover in postgresql , have been searching internet on find right architecture that. i have tried in 2 architectures: redhat cluster ucarp both ways came out pretty bad when i've meet bugs on ucarp restarting master-master after several reboots , redhat cluster fails manage postgresql service. i ask if has ever succeeded implement such architecture , explain me how or refer me tutorial works. the components have are: postgresql @ latest version (9.4), rhel 6.6 , higher, on virtual machines. thanks in advance, aviel buskila.

performance - Mysql Filter matches based on previously selected filter values? -

i'm seeing type of filter everywhere, know magento have same principle. so, deal. easy , solution filter strict value , exclude filter options dont have same value. i'm trying do, this web site , tons of filter value allow selecting multiple values within same attribute. it's maches (i know how filter products selected filter, not it, matches) most logicaly solution eav, many joins make slower query, cron on time "one-happy-table" , , table structure : create table if not exists `filter` ( `productid` int(10) unsigned not null, `attributeid` int(10) unsigned not null, `valueid` int(10) unsigned not null, unique key `productid_attributeid_valueid` (`productid`,`attributeid`,`valueid`), key `productid` (`productid`), key `valueid` (`valueid`), key `attributeid` (`attributeid`) ) engine=memory default charset=utf8 row_format=compact; and here query i'm using accomplish that. query give me results need, slow. select sql_no_cac...

c# - Inject dependency with "constructor scope" - autofac -

i using autofac 3.5.x , have setup similar this: public class servicea : iservicea { } public class serviceb : iserviceb { public serviceb(iservicea sa) { } } public class servicec : iservicec { public servicec(iservicea sa) { } } public class serviced : iserviced { public serviced(iservicea sa, iserviceb sb, iservicec sc) {} } in container have following registrations: builder.registertype<servicea>.as<iservicea>(); builder.registertype<serviceb>.as<iserviceb>(); builder.registertype<servicec>.as<iservicec>(); builder.registertype<serviced>.as<iserviced>(); here want: when request new iserviced container, want same iservicea instance injected iserviced , dependencies iserviceb , iservicec . not looking global singleton scope though. next time ask iserviced instance must created new instance of iservicea (i know cannot create instance of interface, think point). to illustrate; when ask autofac container iserviced wan...

angularjs - How to use tabs in Ionic with a abstract state parameter / clear cache on navigation -

i have home screen list of groups. each list item links same abstract state parameter (gid, groupid). .state('group', { url: "/group/:gid", abstract: true, templateurl: "templates/group.html" }) .state('group.members', { url: '/members', views: { 'group-members': { templateurl: 'templates/group-members.html', controller: 'memberctrl' } } }) .state('group.events', { url: '/events', views: { 'group-events': { templateurl: 'templates/group-events.html', controller: 'eventctrl' } } }) .state('group.settings', { url: "/settings", vi...

ios - How do I get my Activity Indicator to start at the right time? -

from read can activate with button put right after button action starts http post , upload, right starts spinning right after function has finished, after upload complete, opposite of expect. i'm new swift please explain answer nubie. many thanks. @ibaction func upload(sender: anyobject) { myactivityindicator.startanimating() var imagedata = uiimagepngrepresentation(myimageview.image) if imagedata != nil{ var request = nsmutableurlrequest(url: nsurl(string:"http://www.example.com/upload.php")!) var session = nsurlsession.sharedsession() request.httpmethod = "post" var boundary = nsstring(format: "---------------------------14737809831466499882746641449") var contenttype = nsstring(format: "multipart/form-data; boundary=%@",boundary) // println("content type \(contenttype)") request.addvalue(contenttype, forhttpheaderfield: "content-type") ...

mysql - php insert into the database is not working -

i trying insert information database not working. following code: $sql4 = "insert favorites (posted-date,posted-time,posted- datetime,journalid, by) values ('test','test','test','test','test')"; try $sql4 = "insert `favorites` (`posted-date`,`posted-time`,`posted-datetime`,`journalid`, `by`) values ('test','test','test','test','test')"; also check if connecting database correctly. and have @ table , fields if of correct type , exists.

mysql - using "AND" and "OR" in an SQL query -

i trying optimize query. there 3 different lookups in table, think, not required. this original query, want optimize. select distinct(productid) q_products visibility=1 , status=0 , productid in (productidlist) union select distinct(q_products.productid) q_products,q_product_apply_access q_products.productid=q_product_apply_access.productid , q_product_apply_access.partnerid='partnerid' , q_product_apply_access.apply_status=0 , q_products.visibility=3 , q_products.status=0 , q_products.productid in (productidlist) union select distinct(q_products.productid) q_products,q_product_aff_access q_products.productid=q_product_aff_access.productid , q_product_aff_access.accid='accountid' , q_products.visibility=2 , q_products.status=0 , q_products.productid in (productidlist) let me walk through query, 1) selecting distinct productid q_products have v...

c# - Why is nearly all the bottleneck in my Managed application External Code? -

Image
i wrote tool reduces number of cubes in voxel world combing them larger cubes. it's entirely managed application, written in c#, , pretty ton of searching in several hashset . does, think performance reasonable, visual studio 2015 rc profiler isn't helping me assess that. as can see image above, 80% of time spent in "[external code]". , doesn't seem make difference whether just code enabled or disabled each time run profiler. highly doubt it's spending 80% of time doing garbage collection, i'm wondering if might bug profiler.

powershell - Adding new item into XML output file -

i combined external ip address current hardware information output file. pc info #lists computer information $cpu = get-wmiobject -class win32_processor $mb = get-wmiobject -class win32_baseboard $bios = get-wmiobject -class win32_bios -computername . #$user = get-wmiobject -class win32_computersystem $last = get-wmiobject -class win32_networkloginprofile | {($_.numberoflogons -gt 0) -and ($_.numberoflogons -lt 65535)} | select-object name,@{label='lastlogon';expression={$_.converttodatetime($_.lastlogon)}},numberoflogons $props = @{ "name" = $cpu.name "description" = $cpu.description "mb manufacturer" = $mb.manufacturer "mb product" = $mb.product "bios verison" = $bios.smbiosbiosversion "bios manufacturer" = $bios.manufacturer "bios serial" = $bios.serialnumber "~last logon" = $last ...

c# - How to display a video behind gui on mobile with Unity3D -

is possibile play video, mp4 or other format, behind gui in unity3d mobile? using class movietexture works on desktop, unfortunately movietextures aren't supported on ios/android. and handheld.playfullscreenmovie plays movie in full screen. there other method? (or solid plugin) yes. vuforia unity - how create simple videoplayback app you can put ui in front of video.

php - Cannot send email using PHPMailer -

i trying send email using phpmailer. code have written. $mail = new phpmailer; $mail->issmtp(); $mail->host = 'smtp.gmail.com'; $mail->smtpauth = true; $mail->username = 'shamir.towsif@gmail.com'; $mail->password = '*********'; $mail->port = 25; $mail->from = 'shamir.towsif@gmail.com'; $mail->fromname = 'shamir towsif'; $mail->addaddress('shamir.towsif@gmail.com', 'shamir towsif'); $mail->addreplyto('shamir.towsif@gmail.com', 'information'); $mail->ishtml(true); $mail->subject = 'here subject'; $mail->body = 'this html message body <b>in bold!</b>'; $mail->altbody = 'this body in plain text non-html mail clients'; if(!$mail->send()) { echo "message not sent.\n"; echo "mailer error: " . $mail->errorinfo; } else { ...

ios - Immutable value type [string] only has mutating members named append -

i'm trying append new store object stores array in user struct...i added mutating func append struct i'm still missing i'm still getting the immutable value type [store] has mutating members named 'append' error import foundation import uikit struct user { var name: string var stores: [store] mutating func append(newstore: store) { stores.append(newstore) } } extension user: printable { var description: string { var printedname = ("\(name string, stores [store])") return printedname } } struct store { var name: string var data: [[string: string]] } extension store: printable { var description: string { var printedstores = ("\(name string, data [[string : string]])") return printedstores } } @ibaction func done(segue: uistoryboardsegue) { let addstoreviewcontroller = segue.sourceviewcontroller as! addstoreviewcontroller let store ...

css - Video Inserted to HTML web page -

i'm new html , i'm building site based on template. i'm trying insert video when paste url of video(youtube, save , refresh, page's field in video should blank white , if right click says "video not loaded". html code video is: <object class="alignimages" type="application/x-shockwave-flash" style="width:420px; height:315px;" data="https://www.youtube.com/watch?v=-y8qxojuyhg"> <param name="movie" value="https://www.youtube.com/watch?v=-y8qxojuyhg" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> i have tried other things too, without success. ideas? the easiest way add youtube video site implement iframe element. when looking @ video, click "share", "embed" , copy/paste code html file also, remember close tags. <object>...

c# - Conflict when running IIS and WCF application listening on the same port (443) -

i'm in process of doing server migration, , i've come across issue when trying host wcf application , iis @ same time using same ip address , port. (this works on our other server) the new server windows 2012 r2 standard it running iis 8.5.9600.16384 i'm trying create exact copy of previous installation, of our existing clients continue work when switch flicked (on tuesday). the wcf application runs windows service. when 'start' web-site, can access web-services on there. if stop web-site , start wcf application, can access wcf's services. if re-start web-site, wcf services stop working. basically, can't both work @ same time, worked fine on previous server. am missing setting somewhere? the addresses i'm listening on are... https://test.banana.com/webservices/myservice.asmx and https://test.banana.com/wcfservice/mywcf.rem *i'm using dummy domain name example **also, live server has different domain name, there's...

windows - How to take name from file with specific extension and use it as variable in batch script? -

can tell me how take name specific file specific extension (.pdf) , use variable? in advance... for %%f in (*.pdf) ( set x=%%f ) echo %x% assuming there's 1 pdf in current directory.

linux - Using wget to acces to a video download link -

i'm new bash scripting , heard of "wget" decided write script download .mp4 file streamcloud (or whatever) link. i use like: wget -q -o - http://somelink.com | grep keyword (i redirect wget standard out) but problem i'm having i've realized i'm getting source of page have wait few seconds until can click "go video" button. i'm stuck on , don't know how access source of page i'm interested in, i'd able grep .mp4 link. heard of post request honest don't know how use much. sorry if newbie in shell scripting, it's am. thanks lot. appreciated. in query, asking write output of wget file. works more redirection. try: wget -e --robots=off -r --level=0 -nc --accept mp4 somewebsite.com this work if files saved .mp4 extension. --level=0 exception. try command without --level switch.

Maven Grails Project won't run (using GGTS) -

i imported project groovy/grails tool suite , when run project on , click "run as: run on server" 404 error. additionally, separate issue debug not seeing source correctly when stopped @ breakpoint when running via maven run config (mvn grails:run-app). this question may under descriptive - if need additional details answer question let me know.

javascript - What is the benefit of using protractor for applications non angular? -

i'm implementing automated tests , know benefits of automating non-angular applications protractor. what advantages comparing use of webdriverjs? protractor provides convenient , well-designed api , abstraction layer on webdriverjs javascript selenium bindings. actively developed , maintained google developers. aside browser , by , element , element.all , $ , $$ global syntactic sugar , multiple unique locators , easy way add custom locators, there set of built-in expected conditions used browser.wait() , sync non-angular apps. also, don't forget convenient way configure protractor tests . also, there several built-in plugins extend protractor's built-in features. there accessibility, timeline, nghint , console plugins implemented. in other words, protractor you'll pure vanilla webdriver provides , more on top. also, see: protractor vs selenium. easier? protractor - testing angular , non angular sites

excel vba - System does not support specified encoding -

i receiving error: "system not support specified encoding" when run procedure (i deleted api key string personal, if want test string can api key developer.zoopla.com) i not sure why happens. code works fine website. sub test() dim map xmlmap set map = activeworkbook.xmlmaps(2) map.databinding.loadsettings "http://api.zoopla.co.uk/api/v1/property_listings.xml?minimum_beds=1&maximum_beds=1&area=sands+end&api_key=xxxxxxx" map.databinding.refresh end sub

java - configure maven profiles in spring boot @activeprofile annotation -

i have been reading lot , can't find solution tells me how inlucde maven profiles in @activeprofiles annotation . possible or not? the issue trying solve h2 , flyway start before tests execute not happening. configuration decscribed in maven profiles in pom.xml. when tests run in teamcity picks maven profile , execute standalone can't find configuration h2 , flyway , fail on starting. ... can't find solution tells me how inlucde maven profiles in @activeprofiles annotation. do mean active spring profiles based on maven profile, if so, can configure in pom.xml: <profiles> <profile> <id>mvnprofile</id> <properties> <spring.profiles.active>springprofile</spring.profiles.active> </properties> <dependencies> <dependency> </dependency> </dependencies> </profile> ... </profiles> in test class configure profiles should run on .....

Lilypond function; add a rhythm to a note -

Image
how can write lilypond function takes in note , outputs note rhythm? say: input: c' output: c'8 c'16 c' in lilypond documentation can find example: rhythm = #(define-music-function (parser location p) (ly:pitch?) "make rhythm in mars (the planets) @ given pitch" #{ \tuplet 3/2 { $p 8 $p $p } $p 4 $p $p 8 $p $p 4 #}) \new staff { \time 5/4 \rhythm c' \rhythm c'' \rhythm g } hopefully can adapted want! replace mars rhythm own. , please note space needed between variable $p , durations.

Finding matching objects in Java -

i'm trying match 2 objects based on values. except, it's not a.a = a.a , a.a = a.b , a.b = b.a . means overriding equals option it's not right option. while sorting these objects make matching time quicker, population small unnecessary. also, compareto isn't right either same reason given equals . do make own method in case? there 4 fields match why not using if statement front. public boolean isopposite(object other) { return (this.a == other.b) ? true : false; } there possibility object implement/extend base object take on more fields , implement own way of matching. i'm considering using linkedlist because know quicker use arraylist , i've been considering map s. edit: better explanation of objects public class obj { public string a; public string b; public string c; public double d; } the relationships follows: obj obj1, obj2; obj1.a == obj2.b //.equals string of course obj1.b == obj2.a obj1.c == ob...

php - How to block remote requests -

in our wordpress theme check user license wp_remote_get() request. users reported host didn't allow remote requests. question how can test myself locally development, how can simulate block remote request. searched lot found nothing works. i use apache, php , mysql (latest versions) thanks! my best try edit hostfile. mac hostfile located @ $ sudo nano /etc/hosts and add following line , save. 169.254.1.1 yourdomain.com to recreate users problems.

bash - Awk sum rows in csv file based on value of three columns -

iam using awk process csv files: awk 'begin {fs=ofs=";"} (nr==1) {$9="tpmc"; print $0} (nr>1 && nf) {a=$2$5; sum6[a]+=$6; sum7[a]+=$7; sum8[a]+=$8; other[a]=$0} end {for(i in sum7) {$0=other[i]; $6=sum6[i]; $7=sum7[i]; $8=sum8[i]; $9=(sum8[i]?sum8[i]/sum6[i]:"nan"); print}}' input.csv > output.csv it doing sum of rows in columns 6,7,8 , division of sum8/sum6 rows same value in column 2 , 5. i have 2 questions it 1) need same functionality calculations must done rows same value in columns 2,3 , 5. have tried replace a=$2$5; with b=$2$3; a=$b$5; but giving me wrong numbers. 2) how can delete rows value: date;dbms;mode;test type;w;time;totaltpcc;neworder tpm except first row? here example of csv.input: date;dbms;mode;test type;w;time;totaltpcc;neworder tpm tue jun 16 21:08:33 cest 2015;sqlite;in-memory;tpc-c test;1;10;83970;35975 tue jun 16 21:18:43 cest 2015;sqlite;in-memory;tpc-c test;1;10;83470;35790 d...

c# - Why does this jQuery cause *all* my jQuery to fail? -

i've added jquery in attempt conditionally show elements: $(document).on("click", '[id$=btnaddfoapalrow]', function (e) { if $('[id$=foapalrow3]').not(":visible"); $('[id$=foapalrow3]').slidedown(); } else if $('[id$=foapalrow4]').not(":visible"); $('[id$=foapalrow4]').slidedown(); } }); this code based on code here ; changed "is" "not" because need act when row not visible. ...but not not work (clicking "+" button (btnaddfoapalrow) not make rows visible), causes other jquery precedes non-functional, too. wrong jquery above, , why obtrusive/obstructionistic? here jquery context/your reading pleasure: $(document).ready(function () { console.log('the ready function has been reached'); /* "sanity check" can verified jquery script running/ran */ }); /* if select "yes" (self-identify ucsc faculty, staff, or s...

javascript - Timeout with bind, call & apply methods -

Image
up until now, i've used var self = this before creating function need access parent. bind() method seems more appropriate way , i'm exploring option, along apply() , call() methods. this came compare three: jsfiddle (function(){ this.say = function(text){ console.log(text); } this.run = function(){ console.clear(); settimeout(function(){ this.say('bind'); }.bind(this), 1000); settimeout(function(){ this.say('call'); }.call(this), 1000); settimeout(function(){ this.say('apply'); }.apply(this), 1000); } this.run(); })(); but script leaves me questions: why don't call() , apply() methods respect timeout bind() method , 1 should use? is there difference between following syntaxes behave similarly: settimeout( fun...

python - Issues sending and receiving a GET request using Flask -

i'm having issues correctly sending , receiving variable request. cannot find information online either. html form below, can see i'm sending value of 'question' i'm receiving 'topic' radio button in form (though code is not below). i want send 'topic' using post use 'question'. i'm aware form method post though i'm not sure how cater both post , get. html form: <form method="post" action="{{ url_for('topic', question=1) }}"> my second issue i'm unsure how receive 'topic' , 'question' form. i've managed receive 'topic' seen below i'm not quite sure how receive 'question'. preferably better url so: www.website.com/topic/sometopic?question=1 for code below, found online request.args[] used receiving requests though i'm not sure if correct. flask: @app.route('/topic/<topic>', methods=['post', 'get']) def...

Mysql/php treating left/right quote differently from regular quotes, how to stop it? -

i having trouble submitting form data mysql database. mysql/php seems treating open , closed quotes (a.k.a. “ , ”) differently other characters such regular (") or (<) (>) or (&). what gets submitted database &#8220 , &#8221 , don't want that. want open , closed quotes appear other character. odd if hit "back button" on browser , resubmit same post, want submitted database. want (“) , (”) submit correctly on first try. i haven't tested characters see work , don't, have tested , appears open , closed special quotes ones giving trouble. here query structure: $content = mysql_real_escape_string($_post['content']); $topictitle = mysql_real_escape_string($_post['topictitle']); $topiccategory = mysql_real_escape_string($_post['topiccategory']); $date = date('y-m-d h:i:s'); $query = "insert `ttable` (`topictitle`,`user`,`cat`,`postcontent`,`posttime`,`replylast`) values ('".$topictitle....

verilog - Mux Implementation -

i'm trying make 2x1 mux in verilog, variation each input technically 2 inputs, , same goes output. however, still behaves 2x1 mux. code looks this: module mux ( output [11:0] out_0, output [11:0] out_1, input sel, input [11:0] in_a_i, input [11:0] in_b_i, input [11:0] in_a_q, input [11:0] in_b_q ) assign out_0 = (sel) ? in_a_i : in_b_i; assign out_1 = (sel) ? in_a_q : in_b_q; endmodule when try build in xilinx however, i'm given oh useful error: syntax error near "assign" i don't understand what's wrong assign line, missing simple? missing semicolon ( ; ) after module declaration. module mux ( output [11:0] out_0, output [11:0] out_1, input sel, input [11:0] in_a_i, input [11:0] in_b_i, input [11:0] in_a_q, input [11:0] in_b_q ) ;

python - how can I add text to these rectangles? -

this code have started use make start menu. # need colours!! black = (0,0,0) white = (255,255,200) red = (200,0,0) green = (0, 200, 0) bright_red = (255, 0 ,0) bright_green = (0, 255, 0) bright_white = (255, 255, 255) def main(): pygame.init() screen = pygame.display.set_mode((600, 600)) pygame.display.set_caption("crazypongmainmenu") menu = cmenu(50, 50, 20, 5, "vertical", 100, screen, [("start game", 1, none), ("options", 2, none), ("exit", 3, none)]) menu.set_center(true, true) menu.set_alignment("center", "center") state = 0 prev_state = 1 rect_list = [] pygame.event.set_blocked(pygame.mousemotion) while 1: if prev_state != state: pygame.event.post(pygame.event.event(event_change_state, key = 0)) prev_state = state e = pygame.event.wait() if e.type...

servlets - Random occurrences of java.net.ConnectException -

i'm experiencing java.net.connectexception in random ways. my servlet runs in tomcat 6.0 (jdk 1.6). servlet periodically fetches data 4-5 third-party web servers. servlet uses scheduledexecutorservice fetch data. run locally, fine , dandy . run on prod server, see semi-random failures fetch data 1 of third parties (canadian weather data). these urls failing (plain rss feeds): http://weather.gc.ca/rss/city/pe-1_e.xml http://weather.gc.ca/rss/city/pe-2_e.xml http://weather.gc.ca/rss/city/pe-3_e.xml http://weather.gc.ca/rss/city/pe-4_e.xml http://weather.gc.ca/rss/city/pe-5_e.xml http://weather.gc.ca/rss/city/pe-6_e.xml http://meteo.gc.ca/rss/city/pe-1_f.xml http://meteo.gc.ca/rss/city/pe-2_f.xml http://meteo.gc.ca/rss/city/pe-3_f.xml http://meteo.gc.ca/rss/city/pe-4_f.xml http://meteo.gc.ca/rss/city/pe-5_f.xml http://meteo.gc.ca/rss/city/pe-6_f.xml strange: each cycle, when periodically fetch data, success/fail on map: some succeed, fail, never ...

linux - Android init.rc: unable to Create Symbolic Links -

i'm beginner of android. i'm trying make symlink modifying init.rc file. when insert below code, see result in adb shell. can't find need. symlink /data/.hidden /.hiddenlink i had success generating /data/.hidden directory. failed make hidden symbolic link directory. i think there no syntax error in above command in init.rc file. don't know why happened. could give me solution? i think can try this symlink /data/.hidden /.hidden somehow of android paths need give same name soft link of target file/folder name. worked me doing trick.

python - CSS not rendered in custom template for 404 and 500 pages django 1.8 -

this folder structure music -music -feature -static -feature core.css -css other css files -js -img -templates 404.html 500.html index.html -feature about.html detail.html template.html manage.py views.py django.shortcuts import render def error404(request): return render(request,'404.html') urls.py urlpatterns = [ url(r'^featured/(?p<pk>[0-9]+)/$', views.detailview.as_view(), name='detail'), url(r'^about/$', views.about, name='about'), url(r'^faq/$', views.faq, name='faq'), ] handler404 = 'mysite.views.error404' the custom 404.html file gets rendered no css.and css works fine on other pages when set debug=false to check custom 404 er...

Eclipse Android Layout: Without dp-values? -

if want have picture in center of layout, use: "center vertically" , "center horizontally". want picture have in center of left side. don't want use marginleft=..dp. want work without dp. there possibility "center vertically" etc? here code dp-values. can use instead of marginleft"38dp"? <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/imageview1" android:layout_width="150dp" android:layout_height="150dp" android:layout_centerinparent="true" android:layout_marginleft="41dp" android:src="@drawable/rosezwei" /> </relativelayout> if understood correctly want image center @ 25% of screen width....

android - AsyncTaskLoader doesn't run -

i want implement asynctaskloader in project using compatibility package, followed loader manual in android docs. the problem loader nothing, seems loadinbackground() never called any idea of what's wrong in code? ( expandablelistfragment extends fragment ,but doesn't override critical method ) thank :-) /**edit: i realized (late, i'm moron) asynctaskloader abstract class need subclass it... m(__)m leave question in case comes here behind me, knows... public class agendalistfragment extends expandablelistfragment implements loadermanager.loadercallbacks<jsonarray> { private treemap<integer, arraylist<evento>> mitems = new treemap<integer, arraylist<evento>>(); private agendalistadapter madapter; private progressbar mprogressbar; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view root = inflater.inflate(r.layout.fra...

javascript - Kue worker with with createClientFactory: only subscriber commands may be used -

i'm working kue workers set , have discovered strange. if create queue using default kue redis connection works perfectly: var kue = require('kue') , redis = require('redis'); var q = kue.createqueue(); q.process('cypher', function(job, done){}); the worker starts perfectly. however, if try override default redis connection 1 of own error: connection in subscriber mode, subscriber commands may used when execution hits q.process function below: var kue = require('kue') , redis = require('redis'); var redisclient = redis.createclient(); var q = kue.createqueue({ redis: { createclientfactory: function(){ return redisclient; } } }); q.process('cypher', function(job, done){}); it doesn't seem sense. thought maybe committing classic async error, following same error. any insights? redisclient.on('connect', function () { console.log('gotten here!!...

Make `==` a generic funciton in R -

i make == generic function. when run: setgeneric("==") , definition not appear change: > `==` function (e1, e2) .primitive("==") > setgeneric("==") [1] "==" > `==` function (e1, e2) .primitive("==") and when call setgeneric("`==`") , following error: > setgeneric("`==`") error in setgeneric("`==`") : must supply function skeleton ‘`==`’, explicitly or via existing function i can define == function with: `==` <- function(x,y) 42; and can use setgeneric on it. i'd have put body of original == there, seems clunky. so there way make == generic in s4? thanks mrflick's response: it turns out == generic (implement in c). don't need call setgeneric . rather, can use setmethod . setmethod("==", c(e1="class1",e2="class2"), funciton(e1,e2) { .... })

GIT sems to be corrupting XLS Files -

i have xls file i've commited git repository, , pushed git repository stash . i've created , commited file on osx. when download stash using osx, file still intact. however, when clone repository on linux rhel6, different checksum? can use .gitattributes ensure file has same checksum on platforms? this due git thinking text file, , converting crlfs lfs. try putting following in .gitattributes file , see if fixes issue: * -text .

What is the name of type T && in C++? -

this question has answer here: what t&& (double ampersand) mean in c++11? 4 answers if have function f(t *) describe f takes pointer t . f(t &) f takes reference t . how pronounce f(t &&) ? it depends on context. when t known type t&& rvalue reference . when t template parameter t&& universal reference .

java - jUnit Usage of setUp and tearDown -

this question has answer here: setup/teardown (@before/@after) why need them in junit? 6 answers being new junit have done far setting dependencies (i.e. creating objects) within test methods itself. questions: eclipse mocks unused variables, though. setup , teardown for? is practice create objects within setup , null them out via teardown ? what other use cases methods above? what purpose of working pre-suite setup , teardown . can give example when comes in handy? cheers, andrew being new junit have done far setting dependencies (i.e. creating objects) within test methods itself. if initialized , cleaned correctly there nothing wrong approach. have way, if different tests need different dependencies. eclipse mocks unused variables, though. setup , teardown for? unused variables have nothing setup , teardown methods. should eit...

ios - How can I avoid having NSFileWrapper use lots memory when writing the file -

i have app using nsfilewrapper create backup of user's data. backup file contains text , media files (compression not relevant here). these backup files quite large, on 200 mb in size. when call nsfilewrapper -writetourl... appears load entire contents memory part of writing process. on older devices, causes app terminated system due memory constraints. is there simple way avoid having nsfilewrapper load memory? i've read through every nsfilewrapper question on here find. suggestions on how tackle this? here current file structure of backup file: backupcontents.backupxyz user.txt - folder1 - audio files asdf.caf asdf2.caf - folder2 - audio files asdf3.caf again, please don't tell me compress audio files. band-aid flawed design. it seems move/copy of files directory using nsfilemanager , make directory package. should go down path? when nsfilewrapper tree gets written out disk, attempt perform hard-link of or...

android - Robolectric in CI environment -

i'm running issue robolectric tests pass in terminal with: ./gradlew test , same command, configured tools on circleci gives me error: java.lang.runtimeexception: java.lang.illegalargumentexception: maxsize <= 0 @ org.robolectric.robolectrictestrunner$2.evaluate(robolectrictestrunner.java:238) @ org.robolectric.robolectrictestrunner.runchild(robolectrictestrunner.java:185) @ org.robolectric.robolectrictestrunner.runchild(robolectrictestrunner.java:54) @ org.junit.runners.parentrunner$3.run(parentrunner.java:290) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:71) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:288) @ org.junit.runners.parentrunner.access$000(parentrunner.java:58) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:268) @ org.robolectric.robolectrictestrunner$1.evaluate(robolectrictestrunner.java:149) @ org.junit.runners.parentrunner.run(...