Posts

Showing posts from July, 2010

leave Android app in final state on espresso test completion -

is possible leave app under test in whatever state it's in @ end of espresso test? don't care if it's failure or success. when working on developing feature , test said feature useful have instrumentation app stop , leave app under test alone in whatever state happens in. allow me play around manually or attach debugger , see going on without running through entire flow manually. anyone know if possible? there multiple actors in play try kill activities... had provide custom rule , custom runner behavior wanted. documented here: https://gist.github.com/dbachelder/4d0588ab6adf0aa6e69a

java - Either show notification or react in application -

i have background service doing work - retrieving user location interval (launched startservice ). special condition reached i'd following: if application in foreground start specific activity. if application not in foreground or closed show notification start required activity on tap. i know how show notification , how handle intent server broadcast receiver example. how can determint if application in foreground? or may can suggest complete better solution? i determint if application in foreground there's couple of ways find out in front, prefer track myself (as helps me apply additional logic if needed). plus it's pretty simple task. make happen need static int based counter somewhere (you can use application object if have one, or have elsewhere, not matter). in each activity 's onresume() increment counter one, , in onpause() decrement one. if counter equals 0 none of activities in foreground perspective in background , post notificat

spotify - Simultaneous output from libspotify -

i'm curious if it's possible use libspotify play multiple files @ once, through different outputs. want able play 1 song through speakers , jump around through other songs on headphones when djing. does know if possible? if it's doable offline files i'm ok that. i'd fine having 2 separate processes running libspotify if that's works. thanks! no, not possible. libspotify stop playback of first track , call play_token_lost() callback.

Update Software when update is available using C# -

i include software update in application check shared location or url such shared url google drive replace old .exe , config files. if new update available, user should notification etc.. guide me on how can achieve or if feasible? it feasible. there 1 solution called clickonce can check updates @ every launch. the other way have program updater since windows won't allow overwrite opened file (the main program can update updater) however, recommend dropbox's public folder host files, has several advantages on gdrive imho (direct download link (gdrive sharing link redirects download page, gdrive host url not report downloaded file size)) edit : use clickonce dropbox's public folder follow steps : (i'll assume have dropbox sync client installed) 1. (not mandatory if plan host 1 project) create subfolder in dropbox public folder :) 2. open project's properties go in "properties tab" 3. first box publish application (select folder cre

javascript - Select2 4.0 clicking item doesn't fire select2:select -

i'm using select2 4.0 , when load data json file none of created elements fire select2:select event. thought have event delegation, examples on website seem fine. i've been breaking head on past hour , don't understand i'm missing. right i'm using select item, doesn't work: $("body").on("click", "#select2-select-results .person-entry", function() { var $this = $(this); var name = $this.data('name'); select2.find('option').val(name).text(name); }); binding $(...).on('select2:select'); never fires, $(...).on('select2:open); does. i'm not sure what's going on. what did notice however, when data has been loaded, no <option> tags created. this entire javascript that's handling thing: (function($) { "use strict"; var term = null; var select2 = $("#select"); select2.select2({ allowclear: true, ajax: {

android - ListView Adapter calling getView with the same index 3 times despite there being 17 items in arraylist -

as title says, adapter doesn't work. i've given arraylist of string arrays. arraylist contains 17 string arrays. result should 17 rows in list view. alas, fails me. @override public view getview(int index, view arg1, viewgroup parent) { layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); view view = inflater.inflate(r.layout.courses_list, parent, false); textview modulecode = (textview) view.findviewbyid(r.id.modulecode); modulecode.settext(list.get(index)[0]); log.i("list-get", integer.tostring(index)); textview modulename = (textview) view.findviewbyid(r.id.modulename); modulename.settext(list.get(index)[1]); textview modulecredits = (textview) view.findviewbyid(r.id.modulecredits); modulecredits.settext(list.get(index)[2]); checkbox c = (checkbox) view.findviewbyid(r.id.modulecheck); c.setchecked(true); return view; } this logcat outputs:

winforms - Windows Forms Chart: Get mouse cursor coordinates in Chart axis scale? -

Image
i have problem following sample: when click @ place marked '1' on screenshot, can position in pixels mouseclick event in pretty easy way: private: system::void chart1_mouseclick(system::object^ sender, system::windows::forms::mouseeventargs^ e) { point chartlocationonform = chart1->findform()->pointtoclient(chart1->parent->pointtoscreen(chart1->location)); cursorposx = e->x - chartlocationonform.x; cursorposy = e->y - chartlocationonform.y; } after printing these values out, position in pixels, position marked '2' equal (0,0). what after clicking spot in '1' is x: 40 y: 178.5 , which coordinates inside chart . there civilised way (i mean other considering padding, margins , borders of chart , calculating these coordinates myself)? one of ideas create sort of invisible cursorx , cursory , use methods , still seems more fancy way solve simple problem real, straight-forw

python - form not being loaded into template -

i trying implement form in django not appearing. checked inspector on browser , not see @ meaning not being loaded. if there other information needed. let me know. project structure: /beerad urls.py /index views.py /templates /index index.html /templates /home home.html /navbar navbar.html /userapp forms.py views.py urls.py userapp/forms.py: class registrationfrom(forms.form): username = forms.charfield(max_length=50, widget=forms.textinput(attrs={"id": "signup-username", "name": "username", "placeholder": "username"})) first_name = forms.charfield(max_length=50, widget=forms.textinput(attrs={"id": "signup-firstname", "name": "firstname", "placeholder": "first name"})) last_name = forms.charfield(max_length=50, widget=forms.textinput(attrs={"id&q

php - Downloading Blobs from TrueVault with spaces in the filename -

i'm using truevault rest api upload/download blobs per documentation @ https://docs.truevault.com/files to download existing blob, i'm passing blob url directly client's web browser (firefox) via php header redirect. client able download blob content truevault without issue, when using firefox i've noticed if blob being downloaded has spaces in filename, filename truncated when downloading. for instance, if upload blob truevault filename 'test file.txt', gets downloaded firefox 'test'. i've seen behavior in other php apps , fix has been put quotes around filename in response headers, seen here . i've traced response headers truevault when downloading , can see filename being passed client without quotes around name. since client downloading blob directly truevault, there's nothing can in code affect behavior. else seeing behavior? suggestions? strict-transport-security: max-age=31536000 server: gunicorn/18.0 date: wed, 29 apr

regex - last element of array matching scala -

good afternoon! i'm using scala , want match first 3 element of list , last one, no matter how of them in list. val mylist:list[list[int]] = list(list(3,1,2,3,4),list(23,45,6,7,2),list(3,3,2,1,5,34,43,2),list(8,5,3,34,4,5,3,2),list(3,2,45,56)) def parse(lists: list[int]): list[int] = lists.toarray match{ case array(item, site, buyer, _*, date) => list(item, site, buyer, date)} mylist.map(parse _) but : error: bad use of _* (a sequence pattern must last pattern) understand why it, how can avoid? my use case i'm reading hdfs, , every file has exact n (n constant , equal files) columns, want match of them, without writing case array(item1, item2 , ..., itemn) => list(item1, item2, itemk, itemn) thank you! you not need convert lists arrays, because lists designed pattern matching. scala> mylist match { case item :: site :: buyer :: tail if tail.nonempty => item :: site :: buyer :: list(tail.last) } res3: list[list[int]] = list(list(3,

c# - Is there a way to set the image source from a webcontrol's text in ASP.NET? -

i don't have code or anything, i'm wondering if can set image source dynamically, because need text parameter webcontrol label in order set image source. any suggestions? the answer specific question asked is, yes can. if want code so, show have tried , can there.

java - Spring Integration Websocket and SSL -

i'm writing simple spring integration flow processes data , subsequently sends message websocket exists in ssl enabled web server notify clients of new data. the initial request websocket succeeds , application cert sent server correctly. when second request sent upgrade connection websocket, no longer sends application cert , 403 forbidden server response. is there special configuration in websocketcontainer or websocketclient need set make sure certificate passed web server? i'm using stomp on sockjs client.

python - I cannot click the Admin button nested inside the iFrame -

i automating our web application using python selenium webdriver. log application , want click administration button. when run code cannot find administration button xpath. have tried few different ways. if enter //div[7]/div/div in selenium ide , click find highlights administration button. not know why won't find when run code. prefer use css faster xpath. need please. i following error: selenium.common.exceptions.nosuchelementexception: message: unable locate element: {"method":"xpath","selector":"html/body/div[2]/div[2]/div/div[2]/div/div[2]/div/div[7]/div/div"} i inspect html element. full html follows: <html style="overflow: hidden;"> <head> <body style="margin: 0px;"> <html style="overflow: hidden;"> <head> <body style="margin: 0px;"> <iframe id="__gwt_historyframe" style="position: absolute; width: 0; height: 0; border: 0;&qu

c# - How to get distinct keys when a Dictionary's key is a string array -

i have variable called data defined as: dictionary<string[], dictionary<string, float>> data as can see, key string array , value inner dictionary. each key can have items like: {"xxx", "ccc", "wpr", "qpr"} {"xxx", "abd", "xyz", "qpr"} {"yyy", "ddd", "kgo", "abc"} how can use linq distinct first items of key? example, in example above, should xxx , yyy result. 2 of these keys have xxx , 1 has yyy first items. the array of strings in key of dictionary used row identifier. data dictionary contains data exported excel. inherited application cannot redefine variable. key used identify , grouping of totals in excel. why original developer did way. the string keys have same length. something like... var result=data.keys.select(k=>k[0]).distinct();

ruby on rails - Param is missing or the value is empty ROR -

Image
good day, trying update rating of user using form_for populate text_field of current rating , update user entered value. far, seems simple doesn't seem , getting error. highly appreciated! user controller: def edit_rating @ad = ad.find(params[:id]) @user = user.find(@ad.user_id) if @user.update_attributes(user_params) flash[:notice] = "user updated successfully" redirect_to(:action => 'index') else end end def user_params params.require(:user).permit(:firstname, :lastname, :email , :password , :location, :rating) end edit_rating view: <h2> edit user rating </h2> <h4> name: <%= @user.firstname %> </h4> <p> current rating: <%= @user.rating%> </p> <%=form_for(:user , :url => {:action => 'edit_rating' , :id => @user.id}) |f| %> <p> updated rating: <%= f.text_field(:rating) %>

sql - Average Number on entries where ID is the same as another table -

Image
i have database making microsoft access 2013, there 2 tables. first table has productid primary key, second table has unique reviewid productid of product review referring to. in first table products information kept, want have field averages ratings given in it's reviews (kept in second table). how average it's rating without averaging rating reviews, , reviews specific product? based on descriptions i've created table called tblproducts following data: i've created table called tblreview following data (here i've assumed have field store value each review's rating i've called reviewrating .. , i've assumed reviews rated 0-10): i created query: select tblproducts.productname, avg(tblreview.reviewrating) avgofreviewrating tblreview inner join tblproducts on tblreview.productid = tblproducts.productid group tblproducts.productname; ...which results in: note select query, won't put average review rating in original

php - Calling a public, static function in an abstract class -

i guess question geared more towards language-geeks. have following class: <?php abstract class scopefactory { public static function dostuff() { } } now, i'm able call function, so: scopefactory::dostuff() and works happily. i've coded under impression abstract classes not used directly - , have implemented concrete class in order callable. my impression of static not require instance callable. could explain me why legal, , if should be? i'm curious finer details. static methods in oop not change internal state, therefore can call static methods abstract class.

Django with python 2.7 utf-8 problems -

i have problems width encoding characters in (html) template. in database there results : Čaša Šišanje that words in croatian language. in settings.py language_code have set : language_code = 'hr-hr' tryd language_code = 'hr' . problem when database returns record in forms: category = forms.modelchoicefield(queryset=category.objects.all().filter(type_id="2"), widget=forms.select(attrs={'class': 'selectpicker'}), label=('kategorija'), initial='1', ) and record field must render in html page, selectpicker. when try load page error: exception type: unicodeencodeerror exception value: 'ascii' codec can't encode character u'\u0107' in position ordinal not in range(128) python version : 2.7.9 django version : 1.7.7 in models.py , model : class category(models.model): id = models.autofield(primary_key=true)

sql server - CONVERTING SQL NVARCHAR(MAX) TO XML and getting a Value from XML string -

i trying read nodes of column -where xml string stored. column of type nvarchar(max). the following script create table - set ansi_nulls on go set quoted_identifier on go create table [dbo].[xml_dummy]( [id] [int] identity(1,1) not null, [name] [nvarchar](50) null, [xmlvalue] [nvarchar](max) null ) on [primary] textimage_on [primary] go the following script enter values - insert [dbo].[xml_dummy] ([name] ,[xmlvalue]) values ('abcd' ,'<?xml version="1.0" encoding="utf-8"?> <staffv xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <employee_number>123456</employee_number> <title>mr</title> <initials>j</initials> <forename>pearl</forename> <surname&

browser sync - Gulp tasks chaining -

i'm using gulp compile .less files , inject changes in browser live-reload. this task created: var gulp = require('gulp'); var less = require('gulp-less'); var watch = require('gulp-watch'); var plumber = require('gulp-plumber'); var livereload = require('gulp-livereload'); var path = require('path'); var postcss = require('gulp-postcss'); var autoprefixer = require('autoprefixer-core'); var mqpacker = require('css-mqpacker'); var csswring = require('csswring'); gulp.task('less', function() { var processors = [ autoprefixer({browsers: ["last 2 version", "> 1%", "ie 9", "ie 8", "ie 7", "ios 6"]}), mqpacker, csswring({ preservehacks: true, removeallcomments: true }) ]; gulp.src('./css/style.less') // compile entry file .pipe(plumber()) .pipe(less({ paths: ['./css/'],

json - Unusual date format -

i'm meant parsing open data, has unsual date format scheme i've never encountered before , wondering if had ideas might shed light on it, here example: "incorporationdate":41137, "accounts": {"accountrefday":31, "accountrefmonth":8, "nextduedate":42155, "lastmadeupdate":41517, "accountcategory":"dormant" }, "returns":{"nextduedate":42260, "lastmadeupdate":41867 } any ideas welcome! edit: thanks pointing me in direction of excel dates, nayone happen have function in js(preferably)for converting iso 8601. thanks dont know right format or not, when copied numbers excel , converted date , got this 41137 8/16/2012 42155 5/31/2015 41517 8/31/2013 42260 9/13/2015 41867 8/16/2014 and date 8/31/2013 seems referring accountrefday & accountrefmonth

Lua string concatenation in Json blob -

i have question string concatenation. i have example trying append value inside json block variable value example: clock = os.clock() body = "{\"name\":\"stringvalue\" .. clock }" print(body) when run following output: {"name":"stringvalue" .. clock } what expecting {"name":"stringvalue0.010117"} how make variables value added string? this instance using [[ ]] delimited strings useful: clock = os.clock() body = [[{"name":"stringvalue]] .. clock .. [["}]] print(body) to continue using double quoted string, variable assignment following (note how quote after stringvalue not escaped): body = "{\"name\":\"stringvalue" .. clock .. "\"}"

java - MyBatis mapper exception not caught when running multiple statements in one insert tag -

i using mybatis execute set of queries on database. insert tag looks below. <insert id="dosomething"> insert statement....; insert statement... update statement.....; update statement... </insert> this method being invoked spring task defined in spring file run in interval of 10 seconds. weird thing happening whenever exception due data base in update statement. don't exception caught @ java code called. , task stops running point , never come back. is because of me trying update statement in insert tag? causing task stop ever?

c# - Where to Find the default wpf chart template? -

Image
i'm using wpftoolkit. want change of wpf chart based on default chart style template. i noticed chart instance has properties titlestyle legendstyle chartareastyle plotareastyle think modifing these properties change of chart. where find these default style templates? you can extract default controltemplate s visual studio directly: in wpf designer, select relevant control, or place mouse cursor on relevant control in xaml. press f4 open properties window. open miscellaneous category find template property, or type template in search field @ top of window. click on little square right of template field , select convert new resource... option: in popup dialog, name new controltemplate added , decide want defined: click on ok button. taken how extract default control template in visual studio? question.

ggplot2 - Why is GGally::ggpairs significantly slower in RStudio vs. base R? -

per title, know why rendering ggpairs plot ggally package takes longer in rstudio vs. base r (or terminal)? example: start.time <- sys.time() ggpairs(mtcars) end.time <- sys.time() time.taken <- end.time - start.time time.taken running in rstudio on machine takes on order of 5 times longer base r. have experienced same slow down regardless of os (windows vs. mac). are there workarounds? other packages? specifically, how render like: ggally::ggpairs(iris, color = "species") without leaving rstudio? i had similar issues, , spent time trying figure out why. found 4 significant issues (not exhaustive list). if situation mine, 1 , 2 main concerns. the ide. rstudio performs ggpairs slower r. your computing environment. don't have resources test extensively, we're talking gpu, since graphics processing issue. number of variables. more variables = exponential growth in time. sequential operations. if working on low-power machine, sl

javascript - Get dynamic elements from page HTML? -

i new front end development have quite bit of end dev experience. i've tried few different approaches javascript below , of things tried. i have following code shows products. in n each loop product list. at bottom of page have add button. i need data-id of each product productid, price price , value of qty input field can send through cart. i can't values , have tried few different things. <div class="col-md-2"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">@html.displayfor(modelitem => product.code)</h3> </div> <div class="panel-body"> <div class="text-center" id="user_image"> <img src="../../images/chickenbreast.jpg" class="img-thumbnail" />

Managing Multiple Reverse SSH Tunnels -

i want install number of raspberry pis @ remote locations , able log in them remotely. (will begin 30-40 boxes , grow 1000 individual raspberry pis soon.) i need able remotely manage these boxes. going easier route, forwarding port on router , setting dhcp reservation, requires either support company we'll doing install (many of don't have it), or require 1 of our people physically installing each box. my tentative solution have each box create reverse ssh tunnel our server. question is: how feasible be? how easy manage many connections? issue small local server have 1000+ concurrent ssh connections? there easier solution problem? my end goal able ship box, have them plug in, , able access it. thanks, w an alternate solution to: install openvpn server on server machine. how install openvpn server on pi . additionally, add firewall rules block traffic directed client's ssh , other services ports (if desired), administrating machine(s). run openvpn

Meteor setInterval on server side -

what have do, use meteor.setinterval on server side? when use it, it's work, get: exception in setinterval callback: error: method not found [404] i20150429-15:47:50.897(2)? @ [object object]._.extend.apply (packages/ddp/livedata_server.js:1502:1) i20150429-15:47:50.897(2)? @ [object object]._.extend.call (packages/ddp/livedata_server.js:1472:1) i20150429-15:47:50.897(2)? @ app/server/cronjob.js:35:43 i20150429-15:47:50.897(2)? @ [object object]._.extend.withvalue (packages/meteor/dynamics_nodejs.js:56:1) i20150429-15:47:50.897(2)? @ packages/meteor/timers.js:6:1 i20150429-15:47:50.898(2)? @ runwithenvironment (packages/meteor/dynamics_nodejs.js:108:1) i error try this: meteor.setinterval(function(){ console.log("test"); }); why happens? you need specify delay interval, e.g., 5 seconds: meteor.setinterval(function(){ console.log("test"); }, 5000); it's hard know behavior without specified time interval.

rails import csv data from dynamic url -

i'm newbie ror. i'm trying import data asp url: i've ticket passed url returns informations time_created, time_updated, owner, notes. i've tried putting code in view: <% file = open("http://xxx.xxx.xxx/utility/ticket_dettagli.asp?tt="+@ticket.ticket) %> <%= csv.new(file, col_sep: ',').readlines |row| %> <%= ticket.create! row.to_hash %> <% end %> without success...any suggestion? why trying in view? think, there should rake task import tickets form csv or class method in model ... see: http://railscasts.com/episodes/396-importing-csv-and-excel @ticket - variable? how declare it?

ruby on rails - Change the structure of hash -

i have hash below: { '3.2':{ 'abc-4536':{ "a" : "sfsdfs", "b" : "qweqda", "pa": "printer" }, 'abc-2345':{ "a": "sdfswer", "b": "werwewe", "pa": "newspaper" }, 'abc-4536':{ "a" : "sfsdfs", "b" : "qweqda", "pa": "printer" }, ... } } so, have arrange this: { '3.2':{ "printer":{ 'count': 2 }, "newspaper":{ 'count': 3 }, } } i have count , group "pa" key inside '3.2'. ideas ? assuming have array of specified objects: array.map{ |x| { x.first[0] => x.first[1].map { |k,v| [v['pa'], "calculated value"] }.to_h } } or if have 1 hash: { hash.first[0] => hash.first[1].map { |k,v| [v['pa'], "c

android - How to use intent startactivityforresult method? -

i created library, , library has 4 activity. move between theese activitys intent, dont know how send result data, main application? start library this: intent intent = new intent(this, libraryfirstactivity.class); startactivityforresult(intent, 1); @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == 1){ if (resultcode == result_ok){ string result = data.getstringextra("result"); log.d("result", result); } if (resultcode == result_canceled){ toast.maketext(this, "canceled", toast.length_short).show(); } } } i start libraryfirstactvity. in libraryfirstactivity go librarysecondactivity: intent intent = new intent(this, librarysecondactivity.class); startactivity(intent); finish(); but can go librarythirdactivity too, or other. how can return main app onact

node.js - why I can't "overwrite" a method in javascript? -

Image
i override function of js object adding prototype. var originalobject = function(){ this.somefun = function(){ // ... } } var otherobj = function(){ this.otherfun = function(){ originalobject.prototype.fun = function(){ return 'this overwritten function.'; } var o = new originalobject(); return o.fun() } } this way when execute new otherobj().otherfun() have expected result ( 'this overwritten function.' ), if function i'm trying add part of originalobject var originalobject = function(){ this.fun = function(){ return 'this original function'; } this.somefun = function(){ // ... } } then result not expected one, infact new otherobj().otherfun() returns 'this original function' . so, this way add method prototype , override it? , important why can't "overwrite" function in prototype? in js objects there 2 levels

ubuntu - SSH push to git from remote server -

i having hard time following situation: have remote virtual server store our website files, access server through ssh connection in ubuntu terminal. on current desktop ubuntu have 2 ssh keys should - 1 public , 1 private. in git have added public key local machine. if try connect this: ssh git@gitlab.domain.com pty allocation request failed on channel 0 welcome gitlab, x x! connection gitlab.domain.com closed. if connect our remote server , try perform git push git asking me provide password account git@gitlab.domain.com ? can give me directions going wrong , how handle this? regards if understand question correctly. able connect gitlab server local machine git push fails remote server. need set keys push on remote server. can either copy .ssh/ directory home directory on remote server uses keys. your connection remote server not have access keys being treated anonymous push , gitlab trying verify are.

PHP / Apache - Best way to validate HTTPS connection -

i learn best way , in terms of security , validate request made using ssl (over https). my environment php , apache. can think of many ways it. possible check $_server['server_port'] , $_server['https'] variables. it possible force apache listen port 443 , disable port 80. possible use sslrequiressl directive in apache. and believe there many other options. so, how right way?

performance - Is there any way to make this Haskell program faster? -

mind following haskell program: -- lambda calculus adt data term = fun (term -> term) | num !double instance show term show (num x) = "(num "++(if fromintegral (floor x) == x show (floor x) else show x)++")" show (fun _) = "(<function>)" -- lambda calculus term application (#) :: term -> term -> term (fun f) # x = f x infixl 0 # -- have floats primitives performance float_tochurch :: term float_tochurch = fun (\ (num n) -> fun (\f -> fun (\x -> if n <= 0 x else (f # (float_tochurch # (num (n - 1)) # f # x))))) float_add :: term float_add = fun (\ (num x) -> fun (\ (num y) -> num (x + y))) -- function compiled lambda calculus. -- sums nats 0 til number. sum_til :: term sum_til = (fun(\v0->((((((float_tochurch # v0) # (fun(\v1->(fun(\v2->(fun(\v3->(fun(\v4->((v3 # v2) # (((v1 # ((float_add # v2) # (num 1))) # v3) # v4))))))))))) # (fun(\v1->(fun(\v2->(fun(\v3->

android - how to group two barchat from mpandroidchart lib -

Image
i want display in groups of 2 barcharts following barcharts: any feedback appreciate. here code: public class barchartactivitymultidataset extends demobase implements onseekbarchangelistener { private barchart mchart; private seekbar mseekbarx, mseekbary; private textview tvx, tvy; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.activity_barchart); tvx = (textview) findviewbyid(r.id.tvxmax); tvy = (textview) findviewbyid(r.id.tvymax); mseekbarx = (seekbar) findviewbyid(r.id.seekbar1); mseekbarx.setonseekbarchangelistener(this); mseekbary = (seekbar) findviewbyid(r.id.seekbar2); mseekbary.setonseekbarchangelistener(this); mchart = (barchart) findviewbyid(r.id.chart1); mchart.setdescription(""); colortemplate ct = ne

haskell - Why would eta expansion degrade the performance of fib? -

i read this article says eta expansion degrade performance of fib , code below, fib1 faster other implementations. explains in slower versions, fib' redefined every argument x. don't it. give more detailed explanation? import system.environment import control.monad main = (mode:num:_) <- liftm (map read) getargs case mode of 1 -> print $ fib1 num 2 -> print $ fib2 num 3 -> print $ fib3 num 4 -> print $ fib4 num fib1 :: int->integer fib1 = (map fib' [0..] !!) fib' 0 = 1 fib' 1 = 1 fib' n = fib1 (n-1) + fib1 (n-2) fib2 :: int->integer fib2 x = map fib' [0..] !! x fib' 0 = 1 fib' 1 = 1 fib' n = fib2 (n-1) + fib2 (n-2) fib3 :: int->integer fib3 = (map fib' [0..] !!) fib' 0 = 1 fib' 1 = 1 fib' n = fib' (n-1) + fib' (n-2) fib4 :: int->integer fib4 x = map fib' [0..] !! x fib' 0 = 1 fib

java - How to use mention feature in Facebook using user account id in Facebook4jar api? -

i trying make simple code using java , uses in facebook4jar .i want mention group members using ids numbers . searched on web, , understood " make mention using member id,you should use form @[id:0]".i trying this.but not work on following code ",if condition working . program executes code inside if statement , , print group members ids , comments them words not mention form. import facebook4j.facebook; import facebook4j.facebookexception; import facebook4j.facebookfactory; import facebook4j.groupmember; import facebook4j.post; import facebook4j.reading; import facebook4j.responselist; import facebook4j.auth.accesstoken; public class test { public static void main(string[] args) throws facebookexception,interruptedexception { facebook facebook = new facebookfactory().getinstance(); facebook.setoauthappid("****", "***"); facebook.setoauthpermissions("user_friends,user_groups,user_photos,user_videos,user_birthday,user_statu

recursion - Recursive query in PostgreSQL. SELECT * -

i have recursive query retrieve children of given person with recursive recursetree(id, parent_id) ( select id, parent_id tree parent_id = 0 union select t.id, t.parent_id tree t join recursetree rt on rt.id = t.parent_id ) select * recursetree; as can see, i'm specifying list of columns retrieved. want use select * (i have many columns in real table, , can changed in future). there way columns without defining each column individually? you don't need specify columns in with part. if leave out, column names determined first query in union : with recursive recursetree ( select * tree parent_id = 0 union select t.* tree t join recursetree rt on rt.id = t.parent_id ) select * recursetree;