Posts

Showing posts from June, 2011

sql - How should I write query for this? -

i have table columns employee_id, effective_date, salary. ie each employee, have multiple records based on when salary got changed. want print each employee salary latest effective_date. how this? select employee_id, effective_date, salary employees t not exists (select 1 employees tt tt.employee_id = t.employee_id , tt.effective_date > t.effective_date) this may work?

dynamic class creation in python -

i want create class dynamically: class createagent(show.showone): """create compute agent command""" log = logging.getlogger(__name__ + ".createagent") def get_parser(self, prog_name): parser = super(createagent, self).get_parser(prog_name) parser.add_argument( "os", metavar="<os>", help="type of os") parser.add_argument( "architecture", metavar="<architecture>", help="type of architecture") parser.add_argument( "version", metavar="<version>", help="version") parser.add_argument( "url", metavar="<url>", help="url") parser.add_argument( "md5hash", metavar="<

keyboard shortcuts - How to cut/paste multiple lines with Eclipse? -

i assigned alt+x shortcut cut line command in eclipse. on windows, can press alt+x 3 times. when paste (either in eclipse or in application), 3 lines yanked. prefer behavior. on ubuntu, after cutting 3 lines, paste yanks last line. how can consistent eclipse behavior when cutting/pasting multiple lines on both windows , ubuntu? i'm running eclipse kepler.

vb.net - Type '' is not defined on a list -

i error type 'address' not defined on <lists> , on get/set . have looked around cant find why happening. , happens on 1 page other pages used get\set there no errors. suggestion. don't mind c# help. my code sample: inherits resource private const path string = "listings" public sub new() buildings = new list(of building)() 'error @ building features = new list(of feature)() 'error @ feature images = new list(of listingimage)() 'error @ listingimage end sub public property address() address 'error @ address return m_address end set (value address) 'error @ address m_address = value end set end property private m_address address 'error @ ddress and public property buildings() list(of building) 'error @ building return m_buildings end set (value list(of building) 'error @ building m_b

r - "read.table" converts every '+' in a column names to '.' -

i'm reading text file in r, using "read.table" function. text file table columns name. when try read text file, "read.table" converts every '+' in columns name '.'. example if in text file name of column is: "cd34+", after reading "read.table", converted to: "cd34.". tried set stringasfactors false, did not work. does have idea solution? thanks you want use option check.names=false . read.table(header=true, check.names=false, text="a+b c+d 0 1") ## a+b c+d ## 1 0 1 using option allows syntactically-invalid names.

python - How do I return a urllib2 response object from within a Django view? -

i know can use shortcuts module make easier see if manually tried create , return response object myself not work: import urllib2 def djangoview(request): data = '<byte string>' open('body.txt', 'wb').write(data) headers = {'content-type' : 'something', 'accept' : 'somethingelse'} newresponse = urllib2.request('file:body.txt', none, headers) return httpresponse(newresponse) i don't understand trying do. it's contract of view returns instance of django.http.httpresponse - not allowed return else. doing not shortcut, it's necessity.

javascript - Change DOM element CSS with jquery Not -

i have 2 clickable headings. when click one, changes blue. if click other one, changes blue, should "unclick" other heading , change black. i'm trying using jquery not ... $("#pal1, #pal2").click(function(event) { $(this).css({"color" : "blue"}); var pal1 = $(this).attr('id'); var pal2 = $(this).next().attr('id'); $(this).not(pal2).css({"color" : "black"}); //if selected heading not pal1, or not pal2, changed 1 not == $(this) black. }); or that. edit: know can way... wanted use jquery functions reduce code size. plus isn't efficient. $("#pal1, #pal2").click(function(event) { $(this).css({"color" : "blue"}); if ($(this).attr('id') !== $("#pal1").attr('id')) { $("#pal1").css({"color" : "black"}); } else { $("#pal2").css({"color"

c++ - Is it possible to for a directshow source filter to read data from application? -

i looking write directshow source filter reads data application rather reading same file/socket/device. first of is possible? if how can achieve it? have done same in gstreamer using appsrc plugin , since new directshow can please explain. scenario: device -> application -> (directshow source filter) -> (directshow decoderfilter) -> (directshow sink) thanks in advance. it possible have implement communication between source filter , source of data (application). source filter , application can communicate on socket or pipe, or memory mapped files - interprocess communication trick (if application hosting source filter, within single process, establish direct communication). there no standard component or helper attach source filter, need deal raw apis.

ios - MPMediaQuery not returning any results when filtered with MPMediaPropertyPredicate -

i'm working on building ios music player , reason, whenever try , pull in of songs in given album display them in table view query comes empty. i've tried running query songs on device, , works fine, reason when try , filter media predicate nothing returned: // pull playing song's album mpmediaitem *currentsong = [self.store currentlyplayingsong]; nsstring *album = [currentsong valueforproperty:mpmediaitempropertyalbumtitle]; // begin filtering album title mpmediapropertypredicate *albumpredicate = [mpmediapropertypredicate predicatewithvalue:album forproperty:mpmediaitempropertyartist comparisontype:mpmediapredicatecomparisonequalto]; nsset *albumset = [nsset setwithobject:albumpredicate]; mpmediaquery *albumquery = [[mpmediaquery alloc] initwithfilterpredicates:albumset]; nsarray *albumsongs = [albumquery items]; nslog(@"album songs: %@", [albumquery items]); basically, want pull album title playing song , use filter. i've been trying use this

centos - How to make phpmyadmin work with NGINX -

i have tried many things cant seem make work. running centos6 64-bit. latest nginx version installed. cannot seem go http://domain.com/phpmyadmin aftet switching apache. please help, thanks. here default.conf: # default server # server { listen 80 default_server; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/html; index login.php index.php; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy php scripts apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass php scripts fastcgi server listening on 127.0.0.1:9000 # location ~ \.php$ { ro

python - How to configure Bootstrap3 form for use with Django form -

i posted similar question previously, answers did not lead me solution. believe solution lies within template, many answers did not seem address. anyways, believe views.py, forms.py , models.py correct , issue seems calling form within bootstrap3 modal , i'm not quite sure how this. this issue when form filled out validation not occur, nor email sent database. however, on form submit sent thanyou page, @ least know working properly... any direction helpful. index.html <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

python - flask-sqlalchemy multiple relationship types between two tables -

i having trouble setting multiple relationships between 2 models. these 2 models have them now: class product(db.model): tablename='product' id = db.column(db.integer, primary_key=true) name = db.column(db.string(50)) image_id = db.column(db.integer, db.foreignkey('image.id')) image = db.relationship('image',uselist=false,backref=db.backref('product')) class image(db.model): __tablename__='address' id = db.column(db.integer, primary_key=true) normal = db.column(db.string(200)) product_id = db.column(db.integer, db.foreignkey('product.id')) product = db.relationship('product', backref='product_images') product should have one-to-one cover image, , 1 many gallery of other images. however, there circular dependency foreign keys. i in 2 tables. there way implement these 2 relationships? at point code above throws: sqlalchemy.exc.ambiguousforeignkeyserror there

Android Notification click event run chain of activities -

my application has notifications incoming messages. have tabactivity runs after several activities. my question how can open specific tab when click notification ? . for example : a----->b------>c------->d ------> specific tab note : a,b,c normal activities , d tab activity you mean taskbar notification? if yes can use pending intents trick i had problwm same thing check link cannot send data through pendingintent http://www.tutorialspoint.com/android/android_notifications.htm

compilation - Calling Fortran subroutine from C++, undefined reference when linking -

i've got fortran subroutine call c++ program. takes long list of floating-point arguments , uses iso_c_binding intrinsic module: subroutine parasolve ( ...... ) bind (c, name='c_parasolve') use,intrinsic :: iso_c_binding implicit none .... based on i've read, understand need use c++'s "extern" command define external function before calling later. tried 2 ways. first: extern "c" void c_parasolve( .... ); returns "expected unqualified-id before string constant" @ compile time, whereas second: extern void c_parasolve( .... ); compiles fine fails link "undefined reference 'c_parasolve( .... )'" , ld returns 1. i'm compiling with: g++ -c main.cpp etc, and gfortran -ffree-form -std=f2003 -c parasolve.f03 to them .o elfs , attempting link with: g++ main.o otherfiles.o parasolve.o -lgfortran what proper way call fortran function? it looks extern "c" declaration insi

android - PieChart adding scrollview in achartEngine? -

how adding scrollview in piechart graph using achartengine . trying below way add scrollview 1) adding linearlayout(graphview) parent scrollview 2)other way -mrender.setinscroll(true) not working in 1st way not showing graph problem , 2nd way not scrolling view how graphview scrolling (how show piegraph legend item)?? under scrollview have insert android:fillviewport="true"

spring - JAXBException: class java.util.ArrayList nor any of its super class is known to this context -

i new spring integration , while working project requirement. facing below issue marshall pojo(java object) soap response(using spring integration ws): please find below details same: i have sample xsd file below: </xsd:element> <xsd:element name="myuserresponses"> <xsd:complextype> <xsd:sequence> <xsd:element minoccurs="0" maxoccurs="unbounded" name="myuserresponse" type="tns:myuserresponse" /> </xsd:sequence> </xsd:complextype> </xsd:element> <xsd:complextype name="myuserresponse"> <xsd:sequence> <xsd:element minoccurs="0" maxoccurs="1" name="somenumber" type="xsd:string"/> <xsd:element minoccurs="0" maxoccurs="1" name="referenceid" type="x

python - Loading data from a (MySQL) database into Django without models -

this might sound bit of odd question - possible load data (in case mysql) table used in django without need model present? i realise isn't django way, given current scenario, don't know how better solve problem. i'm working on site, 1 aspect makes use of table of data has been bought third party. columns of interest liklely remain stable, structure of table change subsequent updates data set. table massive (in terms of columns) - i'm not keen on typing out each field in model one-by-one. i'd leave table intact - coming model represents set of columns interested in not ideal solution. ideally, want have table in database somewhere (possibly separate main site database) , access contents directly using sql. you can execute raw sql directly against database: see the docs .

bash - How can I make a progress bar (cp copying a directory)? -

i suppose compare number of files in source directory number of files in target directory cp progresses, or perhaps folder size instead? tried find examples, bash progress bars seem written copying single files. want copy bunch of files (or directory, if former not possible). you can use rsync instead of cp this: rsync -pa source destination which give progress bar , estimated time of completion. handy.

How to profile for cache performance of an application that runs natively on Intel MIC architecture -

how check if given data application fits in l1 cache or l2 cache applications run natively on mic. have been searching for time have try out various data fits in l1 cache, l2 cache , neither of caches ? you can see how memory used computation whether malloc or static assignment. check size of l1 cache. l1 data cache on mic, 32 kb. this, calculate size of data can fit in l1 data cache. similar approach can taken l2 cache well. in mic l2 cache of size 512 kb.

javascript - Search enable on press of enter -

i have search textbox has restrictions should not allow special characters, on click of enter key should redirect search page respective search. have added code regex not allowing special characters, how should achieve should redirect proper search page on click of enter when user types search. my result search page name search.aspx . please see js code reference. $(document).ready(function (){ $('#ctl00_topnavigation_txtsearch').bind('keypress', function (event) { var regex = new regexp("^[a-za-z0-9\b _ _%]+$"); var key = string.fromcharcode(!event.charcode ? event.which : event.charcode); if (!regex.test(key)) { event.preventdefault(); return false; } }); }); try in keypress event var searchurl = "search.aspx?tx=" + ctl00_topnavigation_txtsearch.val(); window.location.replace(searchurl);

javascript - JS and CSS are not loading -

when trying access jsp page, css , js not loading. using below syntax same: <!doctype html> <%@page import="java.util.arraylist"%> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href=webcontent/css/example.css /> <link rel="stylesheet" type="text/css" href=webcontent/css/bootstrap.min.css /> <title>example</title> </head> <body> <jsp:include page="header.jsp" /> <jsp:include page="footer.jsp" /> <script src="webcontent/js/bootstrap.min.js"></script> <script src="webcontent/js/jquery.min.js"></script> </body> my css placed under webcontent -> css folder. i tried using context path using ${pagecontext.request.contextpath} i tried using "" value in href tag, of no use. i stuck in issue last 2 days... :( please

Queue/De-Queue between Java and C++ for Android -

is there known way of enquing/dequing data between java , c++ under android? trying show images user various steps perform in c++ problem each step have return java , come c++. i thought of queue usage not sure if thing use or possible use queues. both @ java , c++ end. 2 queues under separate threads. 1 thread (c++) inserting queue , other (java) removing queue. any appreciated. it possible on openjdk without using jni. (in fact have implementation openjdk/hotspot) afaik, end using jni in place in android doesn't use intrincis i.e. ability access off heap memory without jni. is jni on android expensive? have thought takes around micro-second or less.

php - How to add pagination in subcategory collection in magento? -

i have written following code display subcategories <ul class=""> <?php $_categories=$this->getcurrentchildcategories(); if($_categories->count()): $categorycount = 0; foreach ($_categories $_category): if($_category->getisactive()): $cur_category=mage::getmodel('catalog/category')->load($_category->getid()); $layer = mage::getsingleton('catalog/layer'); $layer->setcurrentcategory($cur_category); $catname = $this->getcurrentcategory()->getname(); ?> <li class=""> <div class=""> <div class=""> <div class=""> <a href="<?php echo $_category->geturl() ?>" title="<?php echo $this->htmlescape($_category->getname()) ?>" class=""> <?php $imageurl = mage::getbasedir('media')."/"."catalog"."/"."category".

How does narrowing work in method invocation in Java? -

why giving compile time error? 2 constant @ compile time, therefore narrowing should allowed here since 2 in range of byte. public class test { public static void main(string[] args) { fortest test=new fortest(); test.sum(1, 2); //compile time error here } } class fortest { public int sum(int a,byte b) { system.out.println("method byte"); return a+b; } } the error is: method sum(int,byte) in type fortest not applicable arguements (int,int). edit: think answer lies here: http://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.3 not getting :( you have distinguish between assignment conversion , method invocation conversion . narrowing primitive conversion first of all, @ jls §5.1.3 : 22 specific conversions on primitive types called narrowing primitive conversions : [...] int byte, short, or char [...] note, explains mechanism not places such conversions allowed or not. assignment convers

mysql - Repeat Until Loop not working -

i trying move data 1 table using repeat loop (one record of table1 3 records in table2). codee in phpmyadmin follows: delimiter $ drop procedure if exists dowhile$ create procedure dowhile() begin declare int; set = 50001; repeat insert table1 ( question_id, options, answer ) select table 2.question_id, table2.falsch1, table2.richtig table2 table2.question_id = i; select table 2.question_id, table2.falsch2, table2.richtig table2 table2.question_id = i; select table 2.question_id, table2.falsch3, table2.richtig table2 table2.question_id = i; set = +1; until = 50100 end repeat; end when use select statements replacing i fixed number works fine, somehow variable i not working in statement. few records , change fixed number, t

java - Memory spike in Grails + mongodb -

Image
we facing strange issue in our grails application. total memory consumption shoots in short period. runs long time, @ point, memory consumption rises until there no more memory consume(xmx). may rise 4 gb consumption 20 gb within 5 minutes. once complete memory has been consumed, tomcat becomes unresponsive. not heel if left alone. @ point, expect outofmemory exception. never happens if leave application untouched. can see garbage collector keeps on running(we using new relic), still consumed memory not go down. when noticed garbage collection happening in 1 big blow, changed garbage collector g1gc concurrentmarksweep. has not helped well. analysing non-responsive jvm, took thread dump , found there no deadlocks , lot of our threads in “blocked” state: thread 6632: (state = blocked) - sun.misc.unsafe.park(boolean, long) @bci=0 (compiled frame; information may imprecise) - java.util.concurrent.locks.locksupport.park(java.lang.object) @bci=14, line=186 (compiled frame) - java.

python - Falcon app not running under gunicorn -

i have trivial falcon app : import falcon class thingsresource: def on_get(self, req, resq) : #"""handels requests""" resp.status = falcon.http_200 resp.body = '{"message":"hello"}' app = falcon.api() things = thingsresource() app.add_route('/things', things) i'm trying run using gunicorn way : arif@ubuntu:~/dialer_api$ gunicorn things:app but when when try connect httpie : arif@ubuntu:~$ http localhost:8000/things http/1.1 500 internal server error connection: close content-length: 141 content-type: text/html <html> <head> <title>internal server error</title> </head> <body> <h1><p>internal server error</p></h1> </body> </html> this trivial, don't what's going wrong here? your 7th line, indented when shouldn't be. 6th line refers resq, instead of resp u

jsf - How to store created date on clicking submit button -

how can created date , store database when click command button. <p:inputtext id="diff" styleclass="daysnumber" value="#{daydiffbean.diff}"> <f:valuechangelistener value="#{vacatiobean.vacation.balanceday}" /> </p:inputtext> <h:commandbutton styleclass="sndbutton1" value="#{text['employee.send']}" action="#{vacationbean.addvac}" /> in bean have private static final long serialversionuid = 1l; private date venddate; private date vstartdate; private date createddate; private string isnobody; requestrelax vacation; employee e; private short balanceday; @ejb vacationlocal vacations; @managedproperty(value="#{loginbean.userid}") integer userid; @ejb employeeslocal employees; @postconstruct public void init(){ system.out.println("0"); vacation=new requestrelax(); e=employees.getemployee(userid)

r - Create a vector of unique values out of several columns with overlapping values (based on groups of word parts) -

i asked similar question before, still different. here's original question: stackoverflow.com/questions/24402893/create-a-vector-of-unique-values-out-of-several-columns-with-overlapping-values/24403752?noredirect=1#comment37762312_24403752 in data.frame have 3 columns on subject of row. want additional column unique subject each row. first, how data looks like: date <- c("1","2","3","4","5","6","7","1","2","3","4","5","6","7") comp <- c("a", "a", "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b") ret <- c(-2.0,1.1,3,1.4,-0.2, 0.6, 0.1, -0.21, -1.2, 0.9, 0.3, -0.1,0.3,-0.12) class <- c("positive", "negative", "aneutral", "positive", "

Call to a member function insert() on a non-object Magento -

i using observer event in custom module's config.xml <controller_action_layout_render_before> <observers> <test_check_model_observer> <class>test_check_helper_data</class> <method>checkvalidi</method> </test_check_model_observer> </observers> </controller_action_layout_render_before> now in test/check/helper/data checkvalidi method inserting block in content. > class test_check_helper_data extends mage_core_helper_abstract { > public function checkvalidi($observer) { > $layout = mage::app()->getlayout(); > $content = $layout->getblock('content'); > $block = 'hello! working'; > $content->insert($block); > } but in frontend when filling checkout billing , other information gives me error call member function i

python - Celery Chord Callback error -

suppose have celery code this: @celery.task() def a(a): try: ....... ....... except exception,e: raise @celery.task() def b(b): try: ....... ....... except exception,e: raise def c(c): try: ....... ....... except exception,e: raise def final(): callback = c.s() header = [a.s(something), b.s(something)] result = chord(header)(callback) result.get() now when try run task final() error c.s() takes 1 argument (2 given) because callback applied return value of each task in header. how can fix task c() runs fine???? you can use immutable tasks make independant tasks , not forward result. def final(): # c needs argument, note use of shortcut `si` callback = c.si(something) header = [a.s(something), b.s(something)] result = chord(header)(callback) result.get() as side-note, use of except exception e preferred if you're running python

osx - Using an NSButton with SpriteKit -

i'm tyro cocoa programmer trying learn swift/cocoa/spritekit modifying default os x code. basic question haven't been able find solution. i wanted add functionality delete spaceship sprites after clicking mouse added these methods class: gamescene. override func keydown(theevent: nsevent!) { if (theevent.characters) == "p" { removesprites() } } func removesprites() { self.removeallchildren() println(self) // here track down problem. } so works when press 'p' , println(self) tells me self <skscene> name:'(null)' frame:{{0, 0}, {1024, 768}} so next set-up nsbutton in skview in interface builder , connected ibaction in class: appdelegate @ibaction func buttonaction(sender: anyobject) { gamescene().removesprites() } however time sprites aren't removed , println reports <skscene> name:'(null)' frame:{{0, 0}, {1, 1}} so i'm confused 'other' skscene. how code n

string - Adding different genes for same chromosomal regions to single line in Python -

hi new python , have file chromosomal regions , corresponding genes of region, need include different genes of same region in 1 line like chr12 10954262 10962540 chr12 10880241 11502235 100.0 acacb - chr12 10954262 10962540 chr12 10880241 11502235 100.0 rad52 - chr12 10954262 10962540 chr12 10880241 11502235 100.0 rad52 - chr12 10954262 10962540 chr12 10880241 11502235 100.0 tas2r8 - chr12 10954262 10962540 chr12 10880241 11502235 100.0 tas2r9 - from above lines have out put in single line (like below)with gene names side of chromosomal region instead of multiple lines chr12 10954262 10962540 chr12 10880241 11502235 100.0 acacb, rad52, rad52, tas2r8, tas2r9 your highly appreciated. jyothi assuming filename file containing containing following: chr12 10954262 10962540 chr12 10880241 11502235 100.0 acacb - chr12 10954262 1096254

.net - Adding CSS class through ASPX code -

i using aspx. if have html follows: <div id="classme"></div> i hoping dynamically add css class through code behind file, i.e. on page_load . possible? if want use control on serverside make runat=server or better: use servercontrol in first place. in case should use panel rendered div : <asp:panel id="panelid" cssclass="classme" runat="server"></asp:panel> or codebehind: protected void page_load(object sender, eventargs e) { panelid.cssclass = "classme"; } but if want stay div : <div id="divid" runat="server"></div> codebehind: protected void page_load(object sender, eventargs e) { divid.attributes.add("class", "classme"); }

How to terminate loop gracefully when CTRL+C was pressed in python -

i'm rather new python , i'm stuck following problem. have script processes files one-by-one , writes output separate files according input file name. need break script, i'd let finish processing current file , terminate (to avoid result files incomplete information). how code behavior in python? here tried. a) try-except block x = 1 print "script started." while true: try: print "processing file #",x,"started...", # time-cosnuming time.sleep(1) x += 1 print " finished." except keyboardinterrupt: print "bye" print "x=",x sys.exit() sys.exit() output: script started. processing file # 1 started... finished. processing file # 2 started... finished. processing file # 3 started... bye x= 3 iteration #3 not finished gracefully. b) sys.excepthook originalexcepthook = sys.excepthook def newexcepthook(type, value, traceback): global terminator terminator = true if type == key

Bash prompt changed in terminal -

suddendly bash prompt changed [80-254-70-241]myusername @ ~ $ when in home directory. i have following command in .bash_profile export ps1="\[\033[32m\][\h]\u @ \w \$\[\033[0m\] i think expression in square brackets supposed name of current directory. what number 80-254-70-241 mean , how change back? the string "80-254-70-241" comes parameter "\h", denotes hostname. think got ip , hostname dhcp prompt changed accordingly. if think annoying, can replace "\h" preferred hostname (hardcoded).

Mysql select based of results of another select -

i know can done scripting language, doing 1 sql call magnificent requirement. need select categories, , parent categories of product say have these 2 tables. table 1:categories || category || categoryid || =========================== || fightercraft || 5 || spaceship || 10 || ships || 3 and table 2:catrelationships category || parentcategory =========================== 5 || 10 10 || 3 3 || my restriction i'm able pass 1 parameter query on first table categories. know have fightercraft category, need parent categories in single column. select categories.category,catrelationships.category categories join categories on catrelationships.category=categories.id categories.id=5 need return somehow! result || product || category || fightercraft || 5 || spaceship || 10 || ships || 3 can steer me in right direction? there may better way it, if you're willing assume there's limit on depth of nested categories, f

ios - How to discover which friends accepted invites with Facebook API? -

facebook api v2.0 introduced invitable_friends edge . an example response request edge is: { "data": [ { "id": "avkgk9flfxasdvxnbdv_gyogr6lxa9sklnh...", "name": "anita sujarit", "picture": { "data": { "is_silhouette": false, "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t1.0-1/c0.0.50.50/p50x50/1470158_10201991701127909_302023572_t.jpg" } } } } looking closely @ id, it's not normal facebook user id. instead it's invite token ; token passed requests dialog value to parameter. the invite token, returned on each of friend objects value of field named id, unique (per user , per game) string of variable length. invite token subject expiration, , may change between game sessions. therefore not advisable cache these results, or try assign them given person. the friends edge

html - changed general-sibling combinator for toggling pseudo-element: what is valid -

i've hit mentioned webkit bug. following workaround seems work in specific instances . not succeeding in finding valid combinations. starting (shortened. actual code has 9 child elements create carousel): input[value="1"]:checked ~ .container .carousel p:nth-child(1) { -webkit-transform: translatez(540px) scale(1); opacity: 1; } i've attempted syntax suggested in link input[value="1"]:checked + .container + .carousel p:nth-child(1) { -webkit-transform: translatez(540px) scale(1); opacity: 1; } however disables toggled action. * update * pointed out, did not specify problem. the issue checkbox hack not working on android < 4.1 (as far can tell). using chrome or safari (firefox not functioning code, , being rendered separately) the result of code can seen here see jsfiddle example . worked me input[value="1"]:checked + .container .carousel p:nth-child(1) { -webkit-transform: translatez(540px) scale

jsf - How to import javax.faces library in Eclipse using JDK8? -

based on advice use jsf , following sample run in order learn more jsf , implement technique servlet. however, number of libraries unable imported: package tobedefinedservlet; import javax.faces.bean.managedbean; @managedbean public class hello { final string world = "hello world!"; public string getworld() { return world; } } javax.faces the import javax.faces cannot resolved managedbean managedbean cannot resolved type you have include jsf library example mojarra in classpath of application.

java - Scale bitmap and set as wallpaper - height gets messy -

i'm trying scale bitmap screen size , set wallpaper, i've noticed on devices(where screen bit wider) wallpaper little messy in height. can me scale image in right way? here code: int widthpx = getwindowmanager().getdefaultdisplay() .getwidth(); int heightpx = getwindowmanager().getdefaultdisplay() .getheight(); // bmp = bitmap.createscaledbitmap(bmp, widthpx, heightpx, // true); bitmapdrawable drawable = (bitmapdrawable) background .getdrawable(); bitmap bitmap = drawable.getbitmap(); try { wallpapermanager mywallpapermanager = wallpapermanager .getinstance(getapplicationcontext()); bitmap resizedbitmap = bitmap.createscaledbitmap( bitmap, mywallpapermanager.getdesiredminimumwidth()

python - Excluding directory -

i working on django project , trying run pyflakes on app in it. need exclude "migrations" directory pyflakes. for pep8 can pep8 --exclude=migrations app_name is there similar way pyflakes? i couldn't find proper documentation pyflakes. pyflakes supports list of files or directories; no "exclude" option here's equivalent: pep8 `find app_name | egrep -v migrations` pyflakes manpage: http://man.cx/?page=pyflakes&do%5bgo%5d=go