Posts

Showing posts from June, 2014

xml - How to access an attribute with a computed name -

i want read value of attribute using variable compute name: <xsl:variable name="topman"> <xsl:for-each select="//all_resources/*/*/*"> <xsl:if test="contains(@name,'chan' )"> <xsl:variable name="element_name" select="name(..)"/> <xsl:variable name="fchansub" select="(//all_resources/*/*[$element_name = name()]/@usedele)"/> <xsl:value-of select="(//all_resources/*[(substring-before($element_name, '_')) = name()]/@[(concat('neibr_', $fchansub)) = name()])"/> </xsl:if> </xsl:for-each> </xsl:variable> there problem line 6. reading value correct. basically, having structure neibr_hm1, neibr_nr, etc.. want read value in neibr_(hm1 or nr). without seeing input or expected output can't 100% sure, think you're pretty close: change @[(concat('nei

open in WebView instead of deep link on iOS -

my iphone app has webview may show url registered 1 of installed applications (e.g. yelp). want page open in app. actually, don't care if further links switch app, first view should remain within our app. i can find app-specific workarounds, https://stackoverflow.com/questions/29587313 pinterest, looking fo generic solution. you can use same solution suggested in link posted app-specific workarounds, block links not http or https: nsurl *url = [request url]; if (![url.scheme isequal:@"http"] && ![url.scheme isequal:@"https"]) { return no; } if there other schemes support, add them statement.

How can I modify part of a url when using Python Requests? -

how can automatically increment day in url? reportdate = "https://secure.logmeinrescue.com/api/setreportdate.aspx?bdate=06/25/2015&edate=06/23/2015&authcode=secretauthcode" setreportdate = requests.get(reportdate) requests doesn't have url editing functionality. parse url manually urlparse , splitting query params, getting date , incrementing datetime , rebuild string pass requests.

swift - How to add a notification? -

i want add local notification in project. in detailviewcontroller , have 2 labels date , hour . is possible add notification based on date , hour ? if yes, can explain how set it? code: detailviewcontroller : import uikit class detailviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate { // mark: - outlet @iboutlet var imageprofilo: uiimageview! @iboutlet var labelnome: uilabel! @iboutlet var pillstable: uitableview! // mark: - variabili var profilo: profilomodel! // mark: - metodi standard del controller override func viewdidload() { super.viewdidload() pillstable.datasource = self pillstable.delegate = self imageprofilo.layer.cornerradius = 30 datamanager.sharedinstance.detail = self if let test = profilo { //title = profilo!.nome labelnome.text = profilo!.nome imageprofilo.image = profilo!.immagine if profilo!.immagine.size.width > profilo!.immagine.size.height { imagepr

How to setup cloud9-ide to reference other Javascript files? -

i can't cloud9 reference functions/variables in other files. example set simple html5-app: <!doctype html> <html> <head> <title>testapp</title> </head> <body> <div id="menucontainer"></div> <script type="text/javascript" src="js/lib.js"></script> <script type="text/javascript" src="js/main.js"></script> </body> </html> see, reference objects in lib.js within main.js: var menu=new lib.menu('menucontainer',{'file','edit','about'}); but cloud9 editor warns me, lib unknown variable (and of course code completion out of question). under visualstudio try enforce reference like: /// <reference path="js/lib.js" /> is similiar possible in cloud9? how set up? there isn't way cloud9 linter (cloud9 uses eslint lint javascript) know

sql - Cannot create row of size greater than 8060 (a wierd case for this error message) -

i getting error "cannot create row of size 8766 greater allowable maximum row size of 8060." this happens in query has lot of columns, 300, of type "int" or "float". query calculates hrm report has 31 columns (one each day). posting query here take space, if insist, could. sure 300 columns of float (4 or 8 bytes) , varchars should never exceed 8060 bytes. still, error happens. problem is, happens in wierd way. in first level of query, looks this: select title, k0present, k1present, k2present, ht,k0_t, case when bla bla bla bla when bla bla bla bla end y01, case when bla bla bla bla when bla bla bla bla end y02 ... case when bla bla bla bla when bla bla bla bla end y31 (_inner_query_) order title now, inner query has 300 columns. here in outer query have 37 columns. causes error message. however, if change this: select *, case when bla bla bla bla when bla bla bla bla end y01, case when bla bla bla bla when bla bla bla bla end y02 ... ca

angularjs - Parse $routeParams in the config object -

i trying dynamically set title each page of angular app. setting title of page in $routeprovider configuration so: angular.module('app.assets').config(['$routeprovider', function($routeprovider) { $routeprovider. when('/assets/:id', { templateurl: 'app/components/assets/views/view.tpl.html', controller: 'assetviewctrl', data : { pagetitle: 'assets:id' } }); }]); the problem page title 'assets:id' verbatim. possible parse value of 'id' similar first parameter of when ? i.e /assets/:id -> assets/1991 . instead of using data, might want resolve variables: when('/assets/:id', { templateurl: 'app/components/assets/views/view.tpl.html', controller: 'assetviewctrl', resolve: { data: ['$route', function($route){

How do I prevent transitive dependencies from a test-scoped dependency from getting packaged in my WAR in Maven? -

i’m using maven 3.2.3. in pom have test dependency <dependency> <groupid>org.mainco.subco</groupid> <artifactid>core</artifactid> <version>${project.parent.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> however, notice maven bringing in jar files test-jar dependent on compile time. below excerpt mvn dependency:tree … [info] +- org.mockito:mockito-all:jar:1.9.5:test [info] \- org.mainco.subco:core:test-jar:tests:80.0.0-snapshot:test [info] +- org.mainco.subco:session:jar:80.0.0-snapshot:compile [info] | +- org.springframework.data:spring-data-jpa:jar:1.1.0.release:compile [info] | | +- org.springframework.data:spring-data-commons-core:jar:1.3.0.release:compile [info] | | \- org.slf4j:jcl-over-slf4j:jar:1.6.1:runtime [info] | \- org.ap

php - Click a button with XPath using an id from the same row -

im testing using phpunit , need create , delete same things. create called test, want able find , delete it. have multiple delete buttons on page, , works doing - $this->click("xpath=(//img[@title='delete'])[11]"); but choosing [11] example, using delete button row 11. , if test isnt row 11 example, delete not wish delete. i wish try , delete specific row finding row id attached it. the row may have words "test" followed more information within columns. delete button @ end titled 'delete'. wish find row id or words 'test' , find , use 'delete' title on row. any help? edit -example image of row. grab first text, , use last button on right titled 'delete' http://i.stack.imgur.com/s4bne.png second edit - whole table, contains of rows , within rows contains td's (obviously, you'd know). ill find text im trying find. tr count 4th of 6. this shows td containing delete, td containing 'test pr

How can I break a `RemoveAll()`statement in C# -

i'm using removeall() statement, foreach element of list, , based in condition returned delegate, removes or not element list. this: x.removeall(delegate(string y) { if (y == "abc") return true; return false; }); i want break foreach removeall, upon fulfilling condition, no longer try remove elements. this: x.removeall(delegate(string y) { if (foo() || bar()) break; //stop trying remove elements if (y == "abc") return true; return false; }); have way without auxiliary variable? p.s: using auxiliary variable know how do. there 2 real options. variable telling not remove more items: var done = false; list.removeall(item => { if(done) return false; if(foo() || bar()) { done = true; return false; } return item == "

How to convert AY music file to FLAC preserving metadata in Linux? -

i have bunch of *.ay files having metadata (artist, title , "misc"). how can convert them *.flac preserving metadata? there lot of useful ay-tools source code on http://bulba.untergrund.net/progr_e.htm : ay-files splitter – parses metadata ay , saves simple ini file ay wav converter you can try build them linux free pascal. write script pass metadata , wave wav-to-flac converter (e.g. ffmpeg). also can make own tool "ymengine sdl" library.

reactjs - Switching between similar routes in React Router -

i have kind of route: <route name="itemdetails" handler={itemdetails} path="/item/:itemid"/> it leads page, containing full product description. there few "related items". each of them contains link different "itemdetails" page. when i'm clicking on 1 of links, route changing in browser address bar, content not. why? rest of routes works well. also, if reload page, content refreshing , it's mutching route in browser address bar it might because of incorrect url listener tried this: router.run(routes, function (handler) { react.render(<handler/>, document.getelementbyid('example')); }); and this: router.run(routes, router.hashlocation, function (root) { react.render(react.createelement(root, null), document.body); }); here itemdetails code: var react = require('react'); var store = require('../../stores/app-store'); var preloader = require('../template/app-preloader'); var

domain openerp how to compare 2 date fields in odoo -

i create method when change date received product , qty date of stock.move, declare start_date = fields.datetime() in class def onchange_project(self, cr, uid,start_date): """ onchange handler of start date. """ pool_stockmove =self.pool.get('stock.move') domain =[('date','>=',start_date)] ids = pool_stockmove.search(cr, uid, domain) it works fine method want compare "date of stock" between start_date date >= start_date , date <= start_date. want format date method on hr_timesheet cr.execute('select id \ hr_timesheet_sheet_sheet \ (date_from <= %s , %s <= date_to) \ , user_id=%s \ , id <> %s',(sheet.date_to, sheet.date_from, new_user_id, sheet.id)) if cr.fetchall(): return false thanks dates stored in string format. can compare using sql in hr ex

python - wxPython Plot overlapping -

Image
i designing gui , got problem configuration of plots. won't post whole script because hundreds of lines long. show problem , specific code segment: so see ugly grey block polar plot. don't know how remove it, or make small possible. i need display multiple plot on 1 page. another minor problem {0.2,0.4,0.6,0.8,1.0} axis values polar plot. here comes script extract, hope can me. import matplotlib.mlab mlab mne.connectivity import spectral sp import matplotlib matplotlib.use('wxagg') matplotlib.figure import figure matplotlib.backends.backend_wxagg import figurecanvaswxagg figurecanvas self.figure2 = figure(figsize=(1,2)) self.axe2 = self.figure2.add_subplot(111) self.z_plot = figurecanvas(self, -1, self.figure2) self.axe2.set_axis_bgcolor('white') self.axe2.set_title("connectivity - channel") self.axe2.set_xlabel("frequencs [hz]") self.axe2.set_ylabel("value [ ]") self.axe2.set_ylim(0, 1.05) pylab.setp(self.axe2.get

android - Record video and store in private mode -

i need save video files recorded camera in way can not accessed application or user connecting device pc. i want can access files application created them. this how set output path files record video: mediarecorder videorecorder; //(...) videorecorder.setoutputfile(environment.getexternalstoragedirectory().getpath() + "/myfile.mp4"); is possible in private mode? this saves internal storage, it's accsesible app. file file = new file(getfilesdir(),filename); videorecorder.setoutputfile(file.getabsolutepath()); if want know more: http://developer.android.com/training/basics/data-storage/files.html

How to override Slack channels in Travis-CI notification when encrypting the token? -

the online documentation travis-ci notification on slack says: overriding channel possible, add configuration # separating them account , token. notifications: slack: '<account>:<token>#development' however, if want encrypt credentials way recommended: travis encrypt "<account>:<token>" --add notifications.slack will work fine. when try: travis encrypt "<account>:<token>#development" --add notifications.slack i new encrypted token, notifications come on default channel set @ integration time. doing wrong? note: use enterprise versions of (slack, travis, github), in case may play role. the command isn't correct, it's missing .rooms property @ end. should be travis encrypt "account:token#channel" --add notifications.slack.rooms

javascript - Failing to delete entry from MongoDB database using Node.JS Express Jade -

for life of me cannot seem find solution this. every tutorial , resource got doesn't seem help. want delete entry mongodb database can't seem able jade view, database router , database want. want able delete entry database.jade view , route it, not view nor router. when run code below keep getting 404 error route it's trying access. my app.js file below: var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieparser = require('cookie-parser'); var bodyparser = require('body-parser'); var router = express.router(); var routes = require('./routes/index'); var users = require('./routes/users'); var database = require('./routes/database'); var methodoverride = require('method-override'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set(&

database - MS-Access - unique records -

i have dataset lot of students, each own student number. each student has done multiple quizzes. have done quiz more once. can find out how many quizzes in total each student has completed i'd find out how many different unique quizzes each student has done. example, student may have completed 6 quizzes, have completed 3 unique quizzes (maybe did each unique quiz twice). how can in access? it have tables names , column names answers can fined tuned exact setup easier. for sake of example, assume have 1 table, called table1 , has columns student , quiz , quiz being name (unique identifier) of quiz taken. an sql count of unique quizzes student took, this: select a.student, count(a.quiz) quizcount (select distinct student, quiz table1) group a.student the (select distinct student, quiz table1) in case called sub-query, means query inside query. purpose of sub-query resultant table can count has unique quizzes student took accomplished keyword distinct. the as

c# - Connecting standalone UCMA application to SIP trunk provider -

i trying make outbound call standalone ucma application sip provider (gamma) authenticates based on connecting ip address. here code trying achieve (lifted straight michael greenlee ( http://blog.greenl.ee/2012/06/15/outbound-calls-ucma-lync-server/ ): applicationendpointsettings endpointsettings = new applicationendpointsettings("sip:02037571***@80.229.80.***"); // ext. ip ... callestablishoptions options = new callestablishoptions(); options.connectioncontext = new connectioncontext("88.215.61.***", 5060); // gamma ext. ip conversation conv = new conversation(_endpoint); audiovideocall avcall = new audiovideocall(conv); avcall.beginestablish("sip:07709411***@88.215.61.***", options, ar2 => { try { avcall.endestablish(ar2); } catch (exception ex) { console.writeline(ex); } }, null); the attempt dial fails gamma returning 403 forbidden-source endpoin

omnet++ - How to collect traffic data and macroscopic statistics in Veins? -

hello stackex community. i implementing scenarios in veins 3.0 , wish collect traffic statistics such average waiting time, average energy consumption, etc simulation. please on how generate , interpret these information. thanks tracimobility records statistics can directly use or build on. see, example totalco2emission . other statistics might have implement yourself, e.g., after detecting car stopped time . see omnet++ user manual pages on result recording , analysis general information on how , tic toc tutorial concrete example.

java - fusion of images without using of buffereimage -

i merge many images one, instantiate bufferedimage : for (int i=0;i<listimagetmp.size();i++) { if (listimagetmp.get(i)!=null) { image src = listimagetmp.get(i); bufferedimage bimage = new bufferedimage(src.getwidth(null), src.getheight(null), bufferedimage.type_int_rgb); // draw image on buffered image graphics2d bgr = bimage.creategraphics(); bgr.drawimage(src, 0, 0, null); bgr.dispose(); int[] pixels = ((databufferint) bimage.getraster().getdatabuffer()).getdata(); for(int x =0; x<bimage.getwidth();x++){ for(int y =0; y<bimage.getheight();y++){ int newrgbvalue = pixels[y * bimage.getwidth() + x]; int oldvalue = bufferedimage.getrgb(x, y); if((newrgbvalue > oldvalue) && (oldvalue != -16777216) && (newrgbvalue == 16777215)){ newrgbvalue = oldvalue;

javascript - How to force Template.dynamic to re render -

i read , tried lots of solution wasn't able force template.dynamic render again. in html >> <body> {{> template.dynamic template=template}} </body> in meteor.isclient >> template.body.helpers({ 'template': function() { return page.template; } }); i have function on hashchange event change value of page.template , event works fine , value changed every time, can't force template.dynamic render again. page.template string i have function page.gettemplate() > return page.template try options i'm using last version of meteor 1.1.0.2 i not sure how app organized should easy task. use reactivevar save active template-name wish have selected. i made simple meteorpad you. looking for. http://meteorpad.com/pad/ophk4kqjisztrsa9k/simpledynamictemplateswitch cheers tom

html - Screen burn prevention javascript program -

this question has answer here: uncaught referenceerror: $ not defined? 31 answers i creating information kiosk display production information. screen on constantly. while information contained within large table refreshed periodically, want pass line through screen periodically reduce screen burn effect. found code, , it's want do, cannot work: jsfiddle i created simple html page.when check developer console, following error: referenceerror: $ not defined. i new javascript, , have been trying figure out how incorporate code page. var $burnguard = $('<div>').attr('id','burnguard').css({ for bit of code above, have specify either 'div' or make div in page , give id? page have include link jquery? appreciated. you missing reference jquery. here code need. sho know can add /show end of jsfiddle url , righ

likelihood in EM algorithm -

regarding em algorithm. if understand correctly, likelihood obtained in e-step (for instance in baum–welch algorithm likelihood can obtained form forward-backward procedure). however, final step in each em-iteration m-step. means likelihood computed in step k, "belongs" parameters of step (k-1). so, or missing something? the em algorithm aims at, given model, finding parameters of model maximize likelihood of data. the focus on parameters , not on likelihood value. from understanding, e-step meant compute expected value of log-likelihood function. in practise, consists in computing values needed m-step, using current parameters values. in m-step, parameters maximize likelihood (or lower bound). can subsequently compute likelihood value new parameters. are working hmms? if yes, can specify quantities computed @ each step. hope can help! :)

c# - Using Dependency Injection for hardware abstraction -

i've been playing around dependency injection in connection hardware abstraction. so, have hardware devices want control within c# application. these devices have root device used access leaf devices. structure quite simple: leafdevice1 & 2 connected through interface1 rootdevice1, leafdevice3 connected rootdevice2 , forth. now thought can solve issue dependency injection since "leaf" devices don't care how they're connected long they're connected specified interface. i'm wondering if dependency injection using ioc container best way it. main reason doubts is: use named dependencies time. if connect device b , c root device want make sure they're referring exact same device. also, use lot of singleton scopes since named dependency xyz should exist once. so in situation configuring container means gluing lot of named dependencies. as understand it, using ioc containers makes sense when want specify implementation injected. far can see, i&#

C++ should a function be overloaded or if statement is enough? -

good afternoon everyone. i have question regarding function overloading in c++. there big function in class , task make more human readable , reduce it's complexity. in function, 2 similar code blocks exist. difference in parameters , couple of additional lines. i want create function out of blocks avoid repeating, how better do? should overload new function or add if statement inside function if 1 parameter has or value, couple of additional lines should executed well? what best approach? the function looks this void f1(){ //some code { //some code block //some other line belongs block //the code block continues } { //the same kind of code block //this line different //the code block continues } //some code } so, want make function out of code blocks, not same , require different operations performing right in middle. example: void boo(){ //code block //if(blah) execute additional line //else line //code block } or overloa

java - Exit while loop -

i wondering how exit while loop in class. my "slave" app connected websocket through "master app" . "slave app" checking if there new files in directory. for future, analyse these new files. in slave app, i've got callback tells me if started/paused/stopped... what have , launch loop method when "master app" started (via callback started?), stop loop when master app stopped ... and.... my loop class : public class loop extends thread { private boolean progisfinished; public loop() { } public void run() { try { waitingforfiles(); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } public void waitingforfiles() throws exception { progisfinished = false; final file folder = new file("folder"); long sleepduration = 10000; arraylist<file> newfilelist; int cou

javascript - cant make new routing in Polymer 1.0 starter-kit (via page.js and iron-page) -

i new polymer , start polymer 1.0 starter-kit i understand structure of polymer app , used page.js making new rout this. window.addeventlistener('webcomponentsready', function() { // use page.js routing. micro // client-side router inspired express router // more info: https://visionmedia.github.io/page.js/ page('/', function () { app.route = 'home'; }); page('/users', function () { app.route = 'artworks'; }); //my new routing def. <<<<<<<< page('/artworks', function () { app.route = 'artworks'; }); page('/users/:name', function (data) { app.route = 'user-info'; app.params = data.params; }); page('/contact', function () { app.route = 'contact'; }); // add #! before urls page({ hashbang: true }); }); as understood page.js sets app.route values , polymer

apache - RewriteRule with question marks htaccess -

i know been asked lot still did not succeeded i have in htaccess rewriterule ^embed/([0-9a-za-z]{12})$ /cgi-bin/index_dl.cgi?op=video_embed&file_code=$1 [l] rewriterule ^embed/([0-9a-za-z]{12})/(\d+)x(\d+)$ /cgi-bin/index_dl.cgi?op=video_embed2&file_code=$1&w=$2&h=$3 [l] i want rewriterule ^embed/?v=([0-9a-za-z]{12})$ /cgi-bin/index_dl.cgi?op=video_embed&file_code=$1 [l] rewriterule ^embed/?v=([0-9a-za-z]{12})/(\d+)x(\d+)$ /cgi-bin/index_dl.cgi?op=video_embed2&file_code=$1&w=$2&h=$3 [l] adding ?v= rewritecond %{query_string} ^v=(.*)$ [nc] rewriterule ^embed/%1([0-9a-za-z]{12})/(\d+)x(\d+)$ /cgi-bin/index_dl.cgi?op=video_embed2&file_code=$1&w=$2&h=$3 [nc,l] rewriterule ^embed/%1([0-9a-za-z]{12})$ /cgi-bin/index_dl.cgi?op=video_embed&file_code=$1 [nc,l] not working example mysite.com/embed/?v=abcde mysite.com/embed/?v=abcde/6x6 currently mysite.com/embed/abcde mysite.com/em

How to return the program flow at the beginning in Ruby -

i have player class in ruby solution. in class can define 2 players. need make validation , if names of players same, need throw message , in case same, need return program beginning. below code: class player print "first player, put name press enter: " name1 = gets.chomp print "second player, put name press enter: " name2 = gets.chomp if name1.eql?(name2) abort "put different name players!" end end you need loop name1 = name2 = nil while name1 == name2 print "first player, put name press enter: " name1 = gets.chomp print "second player, put name press enter: " name2 = gets.chomp if name1 == name2 print "put different name players!" end end you can place object, is, class has no sense @ all. defined class, put code body of class without wrapping method. it should be class player def play name1 = name2 = nil while name1 == name2 print "first player,

c++ - Normalising an image in opencv -

i have rgb image stored in mat datastructure. converting image grayscale using cvtcolor function in opencv. after trying normalise image range [0,1]. using default normalize function of opencv. check correctness, tried printing pixel values , equate matlab values(matlab values in range [0,1]). values differ lot. me make both results same. below opencv , matlab codes. mat img1 = imread("d:/input.png", cv_load_image_color); cvtcolor(img1, img1, cv_bgr2gray); img1.convertto(img1, cv_32fc1); cv::normalize(img1, img1, 0.0, 1.0, norm_minmax, cv_32fc1); (int = 0; < img1.rows; i++) { (int j = 0; j < img1.cols; j++) { cout << img1.at<float>(i, j) << endl; } } matlab code: i=im2double(imread('input.png')); gi=rgb2gray(i); display(gi) i don't think want normalize here. matlab conversion rgb2gray uses equation: 0.2989 * r + 0.5870 * g + 0.1140 * b. there's no expectation have minimum value of 0.0 or maximum

Creating #temp before CTE SQL Server 2012 -

i need create #temp table before list of cte:s start can use in end perform calculations. this have written far: select distinct sum(x+y) total #summary table cte_start ( select distinct * tablex ) .... i have tried creating #summary cte , writing before from. not work. i have looked @ similar questions on: cte&temp table i have not found helpful. how can create #temp table before cte_start begins processing? you need terminate statement before cte semicolon, otherwise sql server doesn't know with isn't part of previous statement, example part of table hint. for example: select distinct sum(x+y) total #summary table; cte_start ( select distinct * tablex ) select * cte_start

database - FB Application with custom DB -

2 quick question: is possible build facebook application saving user profile informations (name, surname, phone numners, ecc.) on external custom database (so, not fb database), obvioulsy after user approval, etc. even if answer of above question "no", know way pull out user profile information users use fb application , formally agree give personal information within app? know if possible both technical pov , legal pov that´s privacy policy for. in general, should store data after telling user store, data, how long store , how can entries deleted database. btw, can´t phone number. technical way, please go facebook docs: https://developers.facebook.com/docs

java - Class Main$MapClass not found on EMR -

Image
i trying run map-reduce job on emr (amazon) after checked on local computer , i'm getting error: error: java.lang.runtimeexception: java.lang.classnotfoundexception: class main$mapclass not found @ org.apache.hadoop.conf.configuration.getclass(configuration.java:1720) @ org.apache.hadoop.mapreduce.task.jobcontextimpl.getmapperclass(jobcontextimpl.java:186) @ org.apache.hadoop.mapred.maptask.runnewmapper(maptask.java:733) @ org.apache.hadoop.mapred.maptask.run(maptask.java:342) @ org.apache.hadoop.mapred.yarnchild$2.run(yarnchild.java:162) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.subject.doas(subject.java:415) @ org.apache.hadoop.security.usergroupinformation.doas(usergroupinformation.java:1491) @ org.apache.hadoop.mapred.yarnchild.main(yarnchild.java:157) caused by: java.lang.classnotfoundexception: class main$mapclass not found @ org.apache.hadoop.conf.configuration.getclassbyname(configuration.java:1626) @ org.apache.hadoop.conf.con

HTTPS with gunicorn? -

i running gunicorn 19.0 on debian server serve django 1.8 site. running nginx serve site's static assets. my dns managed gandi , have cloudflare in front of server. site running happily on http. serve on https. question how go this. i have generated certificate following gandi's instructions . have server.csr , myserver.key file on server. i have script run gunicorn , have amended point @ these certificate files: exec gunicorn ${django_wsgi_module}:application \ --certfile=/home/me/server.csr --keyfile=/home/me/myserver.key --name $name \ --workers $num_workers \ --user=$user --group=$group \ --bind=unix:$sockfile \ --log-level=debug \ --log-file=- the script seems run cleanly usual, if go https://example.com or http://example.com there nothing there (521 , 404 respectively). is there additional step need carry out? the gunicorn logs show following: starting myapp hello [2015-06-25 10:28:18 +0000] [11331] [info] starting gunicorn

java - Spark Cassandra connector filtering with IN clause -

i facing issues spark cassandra connector filtering java. cassandra allows filtering last column of partition key in clause. e.g create table cf_text (a varchar,b varchar,c varchar, primary key((a,b),c)) query : select * cf_text ='asdf' , b in ('af','sd'); sc.cassandratable("test", "cf_text").where("a = ?", "af").toarray.foreach(println) how count specify in clause used in cql query in spark? how range queries can specified well? just wondering, spark code above work? thought spark won't allow where on partition keys ( a , b in case), since uses them under hood (see last answer question): spark datastax java api select statements in case, cassandra spark connector, allowed stack where clauses, , in can specified list<string> . list<string> valueslist = new arraylist<string>(); valueslist.add("value2"); valueslist.add("value3"); sc.cassandratable("

python - csv dictReader encoding not correct -

i have following script read utf-8 csv: def readcsv(f, bdgs): open(f) csvfile: reader = csv.dictreader(csvfile, delimiter=';') row in reader: key, val in row.iteritems(): print type(key), key,':',type(val),val print type(row), row if row['objectid'] not '': # magic which yield : processing following files: ['fenetre.csv'] <type 'str'> type de fenêtre_uniqueid : <type 'str'> uid-100 <type 'str'> type de fenêtre_checkdelete : <type 'str'> <type 'str'> type de fenêtre_nom : <type 'str'> fenetre 2006-2010 <type 'str'> type de fenêtre_intercalaire : <type 'str'> 1 <type 'str'> liste des fenêtres_hauteur : <type 'str'> 3.29 <type 'str'> objectid : <type 'str'> 3760 <type 'str'> liste des fenêtres_nb vantaux

android - FloatingActionButton setVisibility() not working -

i can't hide floatingactionbutton . here code: xml: <coordinatorlayout> <appbarlayout android:id="@+id/appbar"> <collapsingtoolbarlayout> <imageview/> <android.support.v7.widget.toolbar /> </collapsingtoolbarlayout> </appbarlayout> <nestedscrollview /> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" app:layout_anchor="@id/appbar" app:layout_anchorgravity="bottom|right|end"/> </coordinatorlayout> and i'm calling: fab.clearanimation(); fab.setvisibility(view.gone); i'm trying hide fab, seems setvisibility + clearanimation not work if fab in coordinatorlayout . even if call fab.clearanimation , animation still triggered. can me? if issue animation, try invalidating fab behavior . visibility, should null anchor have set in layout: coordin