Posts

r - how to graph using geom_area? -

does know why data not graphing? data_frame univ_apps ---------------------------- timeappreceived chr may_12_2002, march_4_2002 bs_ms_phd factor 1 bs 2 ms 3 phd appid int rn89 qw23 et43 sample data -------------- timeappreceived bs_ms_phd appid sept_2_1989 1 rn89 sept_2_1989 2 dq11 oct_1_2011 1 bg32 etc univdata = ggplot(univ_apps, aes(x= yearappreceived, y= appid, fill=as.factor(bs_ms_phd))) + geom_area(position="stack") am missing command graph? the data frame shown, "timeappreceived" chr. guess data type of "yearappreceived" same "timeappreceived". should convert numeric. try following code. univdata = ggplot(univ_apps, aes(x= as.integer(yearappreceived), y= appid, fill=as.factor(bs_ms_phd))) + geom_area(position="stack"); univdata by way, if appid not numeric, shoud convert them too. appid integer, isn't it?

laravel - php how to pass authorization bearer in unirest -

i have unirest code running in laravel 4.2: (doesn't work) <?php $headers = array('authorization', 'bearer tokenasdkaskdn231das2'); $body = array(); $respons = unirest\request::get("https://api.request", $headers, $body); ?> // , <?php unirest\request::auth('tokenasdkaskdn231das2', ''); $header = array(); $body = array(); $respons = unirest\request::get("https://api.request", $headers, $body); ?> i tried running in getpostman url: - https://api.request header: authorization : bearer tokenasdkaskdn231das2 it works. don't why not in unirest. i have working code using auth basic: authorization: basic c2tfdgvzdf9unta0owfhnja1m2m5ytaymtdizwe3oda3mgzizjuwmto= in php: unirest\request::auth('c2tfdgvzdf9unta0owfhnja1m2m5ytaymtdizwe3oda3mgzizjuwmto=', ''); this 1 simple. this correct, said: unirest\request::auth('token here', ''); ...

iphone - IAP Restoration -

i got problem working on restoration of purchased product. every time user clicks on restore button unlock content works before checking if user logged in, had purchased or not. unlocks. here question: how right? add code restoration function , purchase one. btw purchasing works perfect. func restorepurchases(){ println("hello") skpaymentqueue.defaultqueue().addtransactionobserver(self) skpaymentqueue.defaultqueue().restorecompletedtransactions() } func buyproduct(){ skpaymentqueue.defaultqueue().addtransactionobserver(self) let payment:skpayment = skpayment(product: product) skpaymentqueue.defaultqueue().addpayment(payment) } func paymentqueue(queue: skpaymentqueue!, restorecompletedtransactionsfailedwitherror error: nserror!) { showalert("error", message: "hoho") } func paymentqueue(queue: skpaymentqueue!, updatedtransactions transactions: [anyobject]!) { transaction:anyobject in transaction...

java - Got this error : This class should provide a default constructor for dbHelper -

package com.mytelco.ahliang125.mytelco; import android.content.context; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; /** * created ahliang125 on 4/29/2015. */ public class dbhelper extends sqliteopenhelper { //databaserecord public static final string database_create_record = "create table " + databaserecord.database_table_record + " (" + databaserecord.key_id + " integer primary key autoincrement, " + databaserecord.name + " text not null, " + databaserecord.title + " text not null, " + databaserecord.link + " text not null," + databaserecord.remark + " text not null, " + databaserecord.priority + " text not null, " + databaserecord.username + " text not null);"; //databaserecord public static final string data...

ios - How to allow connections only from authorized iphone apps to backend -

we developing iphone app connects custom aws api build. besides oauth, there other way can allow our paid users connect our backend api? meaning, there sort of key can assigned users buy our apps tied there apple id's paid possible or maybe there meid?

unit testing - How to test the main package functions in golang? -

i want test few functions included in main package, tests don't appear able access functions. my sample main.go file looks like: package main import ( "log" ) func main() { log.printf(foo()) } func foo() string { return "foo" } and main_test.go file looks like: package main import ( "testing" ) func foo(t testing.t) { t.error(foo()) } when run go test main_test.go get # command-line-arguments .\main_test.go:8: undefined: foo fail command-line-arguments [build failed] as understand, if moved test file elsewhere , tried importing main.go file, couldn't import it, since it's package main . what correct way of structuring such tests? should remove main package asides simple main function run , test functions in own package, or there way me call functions main file during testing? when specify files on command line, have specify of them here's run: $ ls main.go main_test.go $ go ...

javascript - fadeOut then fadeIn sequentially -

i'm trying fade out 1 image, fade in image in same spot. so far i've got fiddle , can see changes image before .fadeout() function finishes, when changing image via clicking thumbs. i've read jquery doesn't run sequentially standard (which code assuming does), tried adding in completed function, so: $('#image').fadeout('fast', function() { $('#image').html('<a href="' + image + '" data-lightbox="image-1" data-title="' + title + '"><img src="' + image + '" class="image"/></a>'); $('#image').fadein('fast'); }); however issue still present. should fix this? i wouldn't destroy , recreate elements; i'd update attributes. i'd include .stop(true, true) cancel previous animation , jump straight end before starting fadeout, in case clicks quickly. var images = [ 'http://i.stack.imgur.com/...