Posts

Showing posts from May, 2010

php - Fractal API call does not return content -

i worte api methods fractal package output content. when call specific resources, returns empty. to check if working performed prints of content variables inbetween. example, if take $incidents variable in index function returned entries in database expected. the same true, when call $collection variable in respondwithcollection method in api controller. data available here well. browser output this: { "data": { "headers": {} } } to keep simple, method show results of database: class apiincidentscontroller extends apicontroller { protected $incidenttransformer; protected $fractal; function __construct(incidenttransformer $incidenttransformer){ $this->incidenttransformer = $incidenttransformer; $this->beforefilter('auth.basic', ['on' => 'post']); $this->fractal = new manager(); parent::__construct($this->fractal); } public function index() { $inci

mysql - How to Merge Databases on Google Cloud SQL? -

i exploring google cloud sql , need have ability merge data bases continuous integration reasons cannot figure out how (on cloud sql instance). the instance contains 3 databases: development , staging , , production . i run simular command on server instance running mysql following: mysqldump -n -t -u <myuser> --password=<mypassword> development | mysql -u <myuser> --password=<mypassword> staging if try run command via server instance has access (remote) db instance, following error: mysqldump: got error: 1045 (28000): "access denied user 'myuser'@'localhost' (using password: yes)" when trying connect i thinking need pass ip address in command(??) - not know how. so question how connect google cloud sql instance via server instance has permissions access (remote) database server? any appreciated! -j i needed pass -h <db-ip> in command. i.e.: mysqldump -n -t -u <myuser> -h <xxx

Phalcon model hasManyToMany relation with additional condition -

is there option add additional conditions phalcon wizard function hasmanytomany? i've checked phalcon docs not list possible options hasmanytomany (alias , foreginkey listed). if cannot done hasmanytomany there other phalcon option available - eg. retrieve , filter on model load event? simple example: have 3 tables group, relation , user, , use relation table create 2 properties in user model - active_groups , inactive_groups. code: class groupmodel extends model { public $id; public $name; } class relationmodel extends model { public $id; public $related_id_one; public $related_id_two; public $active; } class usermodel extends model { public function initialize() { $this->hasmanytomany( "id", "relationmodel", "related_id_one", "related_id_two", "groupmodel", "id", array( '

curve fitting - Why B-Spline are defined only where basis funcition sum to 1? -

Image
i'm looking understand b-spline. don't understand why << curve defined order basis functions overlap>>, order degree+1 (for cubic order 4). found number equal order of basis functions overlap sum 1, , maybe linked fact curve start here. the first phrase in: http://www-evasion.imag.fr/~francois.faure/doc/inventormentor/sgi_html/ch08.html in "knot sequence" section. pasted you: the definition of curve states, nurbs factors of basis function sum 1. outside interval, sum lower 1. e.g. take 2 points p1 , p2 (and give them coordinates like). combination q = 0.5*p1 + 0.5 * p2 gives point q in middle of p1 , p2 (as 0.5 + 0.5 = 1). point q' = 0.2 * p1 + 0.2 * p2 sit? try out...

laravel - How do I remove texts after the second comma in php -

how can remove texts in sentence after second comma nothing if has no two commas in sentence? i tried following: substr($str, 0, strpos($str, ',', strpos($str, ',')+1)) but problem here if don't have 2 commas in $str , funtion outputs nothing, i'm getting blank area. is there anyway check existence of 2 commas , remove text after second comma or nothing otherwise. try this: $commascount = count(explode(',', $str)); if ($commascount > 2) { $str = substr($str, 0, strpos($str, ',', strpos($str, ',')+1)); }

debugging - Tracing Segmentation Fault in Qt -

i'm working on embedded linux application in qt , running sigsegv problems i'm unable trace. i'd love able post code qt creator shows me assembly code , doesn't provide of stack trace through. i can see crash happens in qapplicationprivate::notify_helper(qobject*, qevent*) after attempt branch invalid address. can see called qapplication::notify() that's stack information qt creator gives me. thing can think of @ point previous segmentation faults looked had killing qtimer (many of timers i'm using single shot) dumped disassembly , never determine qtimer causing issue. crash sporadic while 1 seems pretty consistent. can suggest might able more information allow me track down source of fault? can provide additional details needed, though might need know should looking. edit: turns out cause of previous error array index wasn't bounds checked. still see crash appears related qtimer disassembly points qobject::starttimer(int) can't see obvious

sql server 2008 r2 - Conditional Split Transformation To Multiple Sheets In SSIS -

i trying insert data 3 excel sheets sql table based on condition given in ssis conditional split transformation. when run package first time, succeeds after getting below error: [excel destination [133]] error: ssis error code dts_e_oledberror. ole db error has occurred. error code: 0x80004005. [excel destination [133]] error: ssis error code dts_e_inducedtransformfailureonerror. "input "excel destination input" (144)" failed because error code 0xc020907b occurred, , error row disposition on "input "excel destination input" (144)" specifies failure on error. error occurred on specified object of specified component. there may error messages posted before more information failure. [ssis.pipeline] error: ssis error code dts_e_processinputfailed. processinput method on component "excel destination" (133) failed error code 0xc0209029 while processing input "excel destination input" (144). identified component returne

r - How does dplyr::do work with data.table -

the dplyr::do not seem work data.table : # works data.frame(1) %>% do(data.frame(1)) ## x1 ## 1 1 # same data.table not work data.table(1) %>% do(data.frame(1)) ## error in do_.data.table(.data, .dots = lazyeval::lazy_dots(...)) : ## argument ".f" missing, no default some investigation lead functions do , do_.data.table : do ## function (.data, ...) ## { ## do_(.data, .dots = lazyeval::lazy_dots(...)) ## } ## <environment: namespace:dplyr> dplyr:::do_.data.table ## function (.data, .f, ...) ## { ## list(.f(as.data.frame(.data), ...)) ## } ## <environment: namespace:dplyr> how work? arguments of do_.data.table not compatible gets do . , result of do_.data.table list instead of data.frame . how use do or do_ data.table input? i know can use df %>% data.frame %>% do(...) , hoping direct solution. it looks do_ .f arguments , return in list. data.table(1) %>% do_(data.frame(2), data.frame(3), .f = functi

Shorten a long url for users in .htaccess -

how shorten example.com/user.php?name=foo&id=20 to example.com/foo/20 ? i on free webhost , htaccess file has 2 lines rewriteengine on rewritebase / please help try this: rewriteengine on rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([a-za-z0-9]+)/([a-za-z0-9]+)/?$ /user.php?name=$1&id=$2 [qsa,nc,l] rewritecond checks if requested filename directory or file , passed unchanged , rewriterule skipped.

Symfony Form customize array for entity type -

in symfony2.6.6 project have category entity. don't know how use doctrine tree extension create tree category entity like: category 1 child category 1 child category 2 category 2 child category 3 ... now when creating form type creating new category want customize array of parent field. the code use $builder->add('parent', 'entity', array('class' => 'acmeblogbundle:category', 'property' => 'title')); generates array title expected. want array values append '-' every level of tree. category 1 example '- category 1' , child category 1 '-- child category 1'. how can that? sorry if has been asked before, don't know how search that. okay, let's have property getlevel() return current item's level. in category entity file, create simple method, example getindentedtitle thar return pre-defined category based on level. public function getindentedtitle() {

tfs2010 - TFS defualt value on state change is not displayed in query -

my tfs task work item has state rule sets default value of 'remaining effort' based on value of 'estimated effort' field. 'estimated effort' field original estimate , 'remaining effort' field updated esitmates user works on task. in order save user time, created rule defaults 'remaining effort' field value of 'estimated effort' field. used default want filled in if user forgets enter value themselves. far item edit window, seems work fine. value appears in 'remainig effort' field , if task item re-opened value still displayed in field. however, if item saved, value never appears in query table , not represented in report. can fix deleting value, saving task, re-entering value , saving again since negates value of state rule, i'd rather not use method. any ideas? i using visual studio 2010 scrum plugin tfs.

How do I smartly subset an array in R with dynamic dimensions? -

i'm crafting simulation model, , think problem has easy fix, i'm not used working arrays. let's have array, array1 , has 3 dimensions. first 2 of constant , equal length, l , third dimension can of length 1 x @ given time. i want able periodically subset array1 create second array, array2 , composed of up to last y "sheets" of array1 . in other words, if length of third dimension of array1 greater y, want last y sheets of array1 but, if it's less y, want sheets of array1 . i know can crudely pull off using tail function , little finagling: tmp1 = tail(array1, (l*l*y)) array2 = array(tmp1, dim = (l, l, (l*l/length(tmp1)))) but seems there more elegant way of doing this. there equivalent of tail arrays in r? or there way array2 produced via simple logical indexing of array1 ? or perhaps apply function used somehow? were after this? a <- array(1:(3*4*5), dim=c(3,4,5)) x <- dim(a)[3] y <- 2 a[, , seq(to=x, len=min(x, y))] ,

MATLAB Merging Arrays -

i unable figure out how merge 2 arrays. data arrays , b. a = [ 0 0; 0 0; 2 2; 2 2;] b = [ 1 1; 1 1; 3 3; 3 3; 4 4; 4 4; 5 5; 5 5;] and need final array "c" after merging: c = [ 0 0; 0 0; 1 1; 1 1; 2 2; 2 2; 3 3; 3 3; 4 4; 4 4; 5 5; 5 5;] i've tried using different ways reshaping each array , trying use double loop haven't got work yet. in actual data inserting 9 rows of array b following 3 rows of array , repeated 100 times. so, there 12 new merged rows (3 rows array , 9 rows array b) repeated 100 times final row number == 1200. array actual data has 300 rows , actual array b data has 900 rows thanks, here's solution using reshape : a = [ 6 6; 3 3; 5 5; 4 4;] b = [ 0 0; 21 21; 17 17; 33 33; 29 29; 82 82;] a_count = 2; b_count = 3; w = size(a,2); %// width = number of columns ar = reshape(a,a_count,w,[]); br = reshape(b,b_count,w,[]); cr = [ar;br]; c = reshape(cr,[],w) the [] in reshape means "how ever many need total numbe

javascript - jQuery change name on mute button -

i need mute button, can sound muted , unmuted, want button change when click on mute button, change unmute on button function mutebutton() { var lyden_er_muted = $("#kor").get(0).muted; if (lyden_er_muted == true) { $("#kor").get(0).muted = false; $("#snorken").get(0).muted = false; $("#tramper").get(0).muted = false; $(".mute").text("mute music"); } else{ //1: mute lyden $("#kor").get(0).muted = true; $("#snorken").get(0).muted = true; $("#tramper").get(0).muted = true; $(".mute").text("unmute music"); } }

Get OperationFailure error with PyMongo 2.7.1 -

i run operationfailure error pymongo 2.7.1 following code: db.business.update( {'_id': objectid(business_id)}, { '$set': {'photos.primary': photo_url}, '$push': {'photos.secondary': old_primary_url} } ) i following error, when primary member has value <class 'pymongo.errors.operationfailure'>: '$set' empty has idea tackle this? best

AngularJs not working in Bootstrap Modal -

it works fine when page opened not when open modal. expressions show literal text. have use angular bootstrap ui? have example of how done? modals stored partials you need use http://angular-ui.github.io/bootstrap/ its simple use, include javascript, little ccs , angular.module('mymodule', ['ui.bootstrap']); once added have todo things different way, plenty of examples on angular site. 1 of main issue solves problems when href # used. this may not fix you, should using it. have plunk?

google compute engine - Unknown egress traffic on brand new GCE instance -

i'm new google compute engine , setup new instance become web server. firewall rules left @ default when instance created, leaves open few ports (rdp, ssh, etc) administration. no software installed or dns records pointing server created , left instance running. after couple weeks, looked @ billing , there on 300 mebibytes of data billed due egress traffic china , america. i'm wondering if normal. is there particular reason hundreds of megs of traffic went out on brand new, firewalled instance? google cloud service offer kind of network analysis tool breakdown traffic type/destination? thanks advice. you can use google cloud stackdriver monitoring see history of ingress , egress traffic of vm instances. more information of traffic (like ips, packets, requests, etc..) need install third party monitoring tool or use packet capturing tool (wireshark, tcpdump,...) analyze traffics.

System update will not download upgraded Kernel - Project Tango -

i have new project tango device. when system updates says there new build. when go upgrade gives me statement saying "couldn't download 501.8mb." it gives me option retry download. doesn't anything. have tried 2 different ways reset. 1 through boot load , other through system settings. anyone have suggestions? the tango website here: https://developers.google.com/project-tango/hardware/tablet says: the battery must @ least 25% charged begin update. recommend charging device while update runs avoid interruptions. did check battery level , confirmed charged enough start?

javascript - what is the best (simplest) way to store the state of a check box for seven days on phones without using local storage -

i building simple app should store state of switch / checkbook period of 7 days. issue have website using build said app doesn't accommodate local storage on phones. yet simple way store switch / checkbook state without doing through local storage or linking online database haven't simplest clue of how manage or set let alone create database. code options have available work html, css , javascript website using buildfire. so i've built many apps on buildfire. here comments: you can use localstorage on plugin. however, multiple instances of plugin share same localstorage need aware of , give variables distinct name prepending them instanceid you know datastore read-only on device. should use userdata (ref: https://github.com/buildfire/sdk/wiki/user-data:-save-user-data-from-the-widget ) allow save state per user per instance , cross device. used datastore yet allows user write own profile buildfire.userdata.save ( {checked:true} ///obj save , usertoke

JSTL arithmetic losing precision -

this question has answer here: is floating point math broken? 20 answers why jstl block resulting 0.9999999999999999, , fix? <c:set var="one" value="0.1"/> <c:set var="two" value="0.7"/> <c:set var="three" value="0.1"/> <c:set var="four" value="0.1"/> <c:out value="${one+two+three+four}"/> jb nizet's comment correct, here's how deal it. you should consider using fmt:formatnumber function when dealing floating point numbers. here url: http://www.tutorialspoint.com/jsp/jstl_format_formatnumber_tag.htm and here example: <c:set var="one" value="0.1"/> <c:set var="two" value="0.7"/> <c:set var="three" value="0.1"/> <c:set var="four" val

C# - passing in a boolean that might change elsewhere, but I don't want to change in the method -

i have method needs react iscanceling flag. should able changed elsewhere , noticed within method, don't want able change boolean within method. have below, think able read bool if passed in boolean changed elsewhere, want ensure iscanceling cannot changed within context. possible? public static bool dosomething(ref bool iscanceling) { while(whileloopflag && !iscanceling) { //dothething() } } use cancellationtokensource / cancellationtoken allow code external method cancel it. in addition having api object can notify of cancellation, synchronize underlying boolean such objects can used multiple threads without problems.

php - Why is my echo variable not displaying upon submission? -

i working on school project php have 2 files, checkblank.php , form.php. displays correctly , submitting form well, not displaying echo $message fields not filled in. here code: if(isset($_post['submitted']) , $_post['submitted'] == 'yes') { foreach($_post $field => $value) { if(empty($value)) { $blank_array[] = $field; } else { $good_data[$field] = strip_tags(trim($value)); } } if(@sizeof($blank_array) > 0) { $message = "<p style ='color: red; margin-bottom: 0; font-weight: bold'> have not filled in fields. please fill in the: <ul style='color: red; margin-top: 0; list-style: none' >"; foreach($blank_array $value) { $message .= "<li>$value</li>"; } $messa

python - How to run tests django rest framework tests? -

i'm learning django rest framework. wrote simple test this: from rest_framework import status rest_framework.test import apitestcase class clinictestcase(apitestcase): def getlist(self): factory = apirequestfactory() request = factory.get('/clinic/') self.assertequal(response.status_code, status.ok) my api returns empty json array request. don't know is, how run test? when use command: python manage.py test i get ran 0 tests in 0.000s as output. it's not written in documentation how run tests. i believe test methods need start test . change def getlist def testgetlist or def test_get_list . as other python tests (see https://docs.python.org/2/library/unittest.html#basic-example ), if methods not start test not run tests.

java - How to do a timer listener? -

this question has answer here: how set timer in java? 5 answers i new java , want make program execute determined actions if time detected. example: start timer, when 30 segs have gone, display message, after 3 minutes have gone, execute action, etc, etc. how can this? thank you use timer class, can this: public void timer() { timertask tasknew = new mytask(); timer timer = new timer(); /* scheduling task, first argument task performing, second delay, , last period. */ timer.schedule(tasknew, 100, 100); } } this example of class extends timertask , something. class mytask extends timertask { @override public void run() { system.out.println("hello world timer task!"); } } for further reading timer docs timer schedule example

css - Can you create two versions of a stylesheet (minified and unminified) using Sass and Compass? -

i use sass , compass create theme's stylesheet. , in config.rb file can set compile expanded (normal) or minified version of style.css. is possible set config.rb create both, end style-min.css , style.css? in link can find answer question. https://coderwall.com/p/gqqfgw/sass-compass-compile-two-different-files-for-development-and-production-environment-take-2

eclipse - sts 3.6.4 crashes(not responding) on start-up, Windows 8.1, 64X -

have dl sts 3.6.4, 64x, few times. have unzipped/extracted 7 zip, peazip, , windows os's zip. windows zip didn't work @ all. 7 & pea seem have worked when try run sts, freezes, 'not respondig'. suggestions? dl local: https://spring.io/tools/sts/all pic: http://screencast.com/t/sm8rlabkm3

c - Why this program with execl breaks if not run with sudo? -

this diner_info program: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { printf("diners: %s\n", argv[1]); printf("juice: %s\n", getenv("juice")); return 0; } and compiled file called diner_info and here program: #include <stdlib.h> #include <stdio.h> #include <unistd.h> int main(int argc, char *argv[]){ char *my_env[] = {"juice=peach , apple", null}; execle("diner_info", "diner_info", "4", null, my_env); } when run program this: korays-mbp:hello2 koraytugay$ sudo ./a.out diners: 4 no problem... but when do not include sudo getting segmentation fault. why? operating system os x. it shouldn't, , made mistake first binary. tested on mac , on ubuntu 14.04 box, , both base runs fine: brenohl@sid:/tmp$ ./a.out diners: 4 juice: peach , apple brenohl@sid:/tmp$ cat diner.c #include <stdlib.h> #inc

r - Adding and specifying legend to the multiple chart.rolling Correlation plots -

Image
for simplicity, suppose have following zoo object: x.ts<- structure(c(103.7, 103.2, 103.1, 105.4, 102.1, 103.5, 103.1, 102.6, 102.2, 104.6, -2.1, -1, -3, 2, -1, 1, -1, -1, -1, 0, -25, -25, -25, -25, -25, -25, -21, -21, -20, -20), .dim = c(10l, 3l ), .dimnames = list(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), c("a", "b", "c")), index = structure(c(1985, 1985.08333333333, 1985.16666666667, 1985.25, 1985.33333333333, 1985.41666666667, 1985.5, 1985.58333333333, 1985.66666666667, 1985.75), class = "yearmon"), class = "zoo") i interested in plotting rolling correlation between each pairs of time series in object. used chart.rollingcorrelation performanceanalytics package , plot charts follow: par.corr<-par(mfrow=c(1,2), oma = c(1, 1, 1, 1), mar = c(2, 2, 2, 2)) chart.rollingcorrelation(x.ts[, 1, drop=false],

GPS heading in Python -

i working on gps project in python , need help. can't figure out how heading part work. want statement true heading of e.g. 355 degrees +/- bit of error. problem getting around 360 degrees. like if ((heading – headerror) % 360) <= gps.heading <= ((heading + headerror) % 360): if use heading of 355 error of 20 , gps reads 4 , both north. 335 <= 4 <= 15 how can check if it's in range of 335 15 335 360 , 0 15 ? one simple implementation: def between(head, low, high): """whether heading head between headings low , high.""" head, low, high = map(lambda x: x % 360, (head, low, high)) if high >= low: return low <= head <= high return low <= head < 360 or 0 <= head <= high first converts arguments headings between 0 , 360 , determines situation we're in, whether can simple comparison, or need account 0 / 360 . in latter case, explicitly checks between low valu

java - Database transactions logging in ejb 2.0 -

i need re-designing application. explain scenario. application built on ejb 2.0 , oracle. during transaction(x) @ nth step there exception serialize required object in catch block , start new transaction(y) after specified time period nth step. while reaching nth step transaction (x) had performed db updates/inserts/deletes . these rolled transaction (x). want log of updates , re perform our new serialized object in 1 step . can suggest way ?? there no support in ejb programming model recording , playing sequence of events. have build infrastructure track yourself.

average - I am getting error messages concerning my coding. I know Scanf is not a java function, so I am hoping to get help converting it -

i know scanf not java function, i'm hoping can me understand how convert this. research on topic difficult piece together. this code: import java.util.scanner; public class average { scanner scanner = new scanner (system.in); int main (){ int counter; int number; int total; float average; total = 0; counter = 0; system.out.println("enter number 0 end: "); scanf("%d", &number); while (number != 0) { total = total + number; counter = counter + 1; system.out.println("enter number 0 end: "); scanf("%d", &number); } if(counter != 0) { average = (float) total / counter; system.out.println("average %.2f\n", average); } else { system.out.println("no valid numbers have been entered."); return 0; } }

java - android how to collections.sort the object? -

this question has answer here: sort java collection object based on 1 field in it 5 answers now have 3object user[0] = new user("a", "a"); user[1] = new user("b", "b"); user[2] = new user("c", "c"); there have many variable in object such as: age, name, email then program running..... user[0].setage(6); user[1].setage(5); user[2].setage(7); how can young old user name? i want return: b,a,c here class public class user{ int age; string name; string email; public user(string name, string email){ this.name = name; this.email = email; } public int getage(){ return x; } public void setage(int age){ this.age = age; } } you can either make user comparable , have it's natural ordering age: public class user impl

debugging - Different C# Output Between Release and Debug -

i've little c# program here produces different output between debug , release versions. empty output release version is, think, consistent c# language specification. program should not produce output, yet debug version does. i've run both release , debug versions command line (outside vs environment) , same inconsistent output. i've decompiled debug version (using ildasm) , re-compiled ilasm. when this, newly compiled program behaves release version. can imagine when de-compile , re-compile being left out i've not been able determine what's different. regarding exe file size: both release , debug versions produced vs have same file size: 5,120 bytes. when de-compile , re-compile, both versions again have same, smaller file size: 3,072. the program quite small , i've looked @ il in reflector , can't see cause difference in output. does have (hopefully detailed) explanation of why there difference? please note i'm not trying make debug , rel

c# - XML Deserialization of attributes -

i have complicated xml structure hierarchical process, stage, step, task follows: <process> <stage stagename="data gathering" stagepage="page_da.html" status="not started" selected="true"> <stageusers> <user alias="pneelakandan" fullname="prasaanth neelakandan" role="dev" email="pneelakandan@exchange.com" organization="windows"/> <user alias="sguo3" fullname="wen jiao" role="dev" email="sguo3@exchange.com" organization="windows"/> </stageusers> <step stepname="data acquistion - general" steppage="page_dageneral.html" status="not started"> <stepusers> <user alias="pneelakandan" fullname="prasaanth neelakandan" role="dev" email="pneelakandan@exchange.c

linux - How to find process using TCP port? -

after starting http couple of times error instance of go has not stopped!? listen tcp :9000: bind: address in use i have experienced nodejs able kill process.. unfortunately seems can't find process id , kill it.. how "free" tcp port? if on unix system can use netstat find out process listening on port: sudo netstat -nlp | grep 9000 turns out -p option not available on os x. if using os x can this: lsof -n -i4tcp:$port | grep listen who listening on given tcp port on mac os x?

In Spring, how can I block access to a path based on a property in my UserDetails object? -

i’m using spring 3.2.11.release, spring security 3.1.4.release can upgrade spring security module if solves problem. in userdetails object, have below property … public class myauthenticationuser implements userdetails, credentialscontainer { … public boolean issampleuser() { return issampleuser; } // issampleuser then have controller, looks like @controller @requestmapping("/basedir") public class basedircontroller { @requestmapping(value = “/page1”, method = requestmethod.get) public modelandview dogetpdresources(final model model, final principal principal) throws ioexception { … } @requestmapping(value = “/page2”, method = requestmethod.get) public modelandview dogetpdcenter(final model model, final httpservletrequest request) throws ioexception { return new modelandview("basedir/pdcenter"); } … what easiest way block access every metho

r - Merge based on 2 columns values - Check for duplicate key values error -

i have 2 data tables following columns - ddate,fnumber,file,model , fnumber,ddate,model,model_id,file . update first table values second table matched ddate , fnumber columns. if use merge : dtpt <- merge(dtpt, dtat, = c("fnumber", "ddate"), all.x = true) then following error - error in vecseq(f__, len__, if (allow.cartesian || notjoin) null else as.integer(max(nrow(x), : join results in 8568291 rows; more 8537179 = max(nrow(x),nrow(i)). check duplicate key values in i, each of join same group in x on , on again. if that's ok, try including j , dropping by (by-without-by) j runs each group avoid large allocation. if sure wish proceed, rerun allow.cartesian=true. otherwise, please search error message in faq, wiki, stack overflow , datatable-help advice. i tried search duplicated records in dtat : setkeyv(dtat, c("fnumber", "ddate")) dtat[duplicated(dtat)] but returns 0 rows. i tried use matc

xaml - Callisto Custom Dialog Custom Styling for Windows App -

is there way customize styling of callisto custom dialog other background? want change font size , color of title property of custom dialog. suggestions without messing base style? reference: https://github.com/timheuer/callisto/wiki/customdialog the customdialog's template calculates it's title's foreground colour contrasts background , sets fontsize 26.6667: <stackpanel margin="13,19,13,25" horizontalalignment="center" width="{templatebinding width}" maxwidth="680"> <local:dynamictextblock foreground="{binding relativesource={relativesource mode=templatedparent}, path=background, converter={staticresource colorcontrast}}" x:name="part_title" text="{templatebinding title}" fontfamily="segoe ui" fontsize="26.6667" fontweight="light" margin="0,0,0,8" /> <contentpresenter margin="0" x:name="part_content" fo

java - Background Images With JFrame -

Image
this 1 section of yahtzee game i'm working with. trying set background yahtzee.png file in project folder. commented out attempt so, because it's not working out me. there better way set up? exframe(int numplayers) { frame = new jframe(); frame.setsize(450+150*numplayers,700); frame.settitle("yahtzee!"); frame.setdefaultcloseoperation(jframe.exit_on_close); this.numplayers = numplayers; this.numgridrows = 20; this.buttonwidth = 140; this.numcreatebutlabcalls = 0; this.component = new dicecomponent(buttonwidth*2); this.cbuttons = new jbutton[numgridrows]; this.cbuttonstext = new string[numgridrows]; this.clabels = new jlabel[numplayers][numgridrows]; this.statuslabel = new jlabel("<html>new game has been started!<br>please select dice wish hold or click on scoring button</html>"); this.score = new yahtzeescore[numplayer

hpc - Detect errors with torque and grid engine and prevent execution of dependent tasks -

i have shell script queues multiple tasks execution on hpc cluster. same job submission script works either torque or grid engine minor conditional logic. pipeline output of earlier tasks fed later tasks further processing. i'm using qsub define job dependencies, later tasks wait earlier tasks complete before starting execution. far good. sometimes, task fails. when failure happens, don't want of dependent tasks attempt processing output of failed task. however, dependent tasks have been queued execution long before failure occurred. way prevent unwanted processing? you can use afterok dependency argument. example, qsub command may like: qsub -w depend=afterok:<jobid> submit.pbs torque start next job if jobid exits without errors. see documentation on adaptive computing page.

I am reading from an external file in java that consists of strings. I am trying to cut the string short and add them to an array called strings -

private scanner c; public void openfile3() { arraylist<string> list3 = new arraylist<string>(7); try { c = new scanner(new file("irstudents.txt")); } catch (exception e) { system.out.println("could not find file"); } while (c.hasnextline()) { list3.add(c.nextline()); } string[] arraythree = list3.toarray(new string[list3.size()]); arrays.sort(arraythree); system.out.println(arrays.tostring(arraythree)); int size = arraythree.length; string [] names; for(int j = 0; j<size;j++) { string word = arraythree[j]; string newword = word.substring(6, 15); i trying put characters of string 6-15 string array called names. have put them array called arraythree want put shortened versions of string array called names. string[] names = new string[size]; (int j = 0; j < size; j++) { names[j] = arraythree[j].substring(6, math.min(15, arraythree[j].length()

reactjs - Why does React strangely render the <p> (paragraph) tag? -

Image
react doing strange things <p> tag. using same markup structure, <p> tag vs <div> tag produces different results. example, var withp = ( <p> withp <div /> </p> ); var withdiv = ( <div> withdiv <div /> </div> ); here generated markup looks in chrome: here live jsbin demo. why react render <p> differently <div> ? <p> can not have nested block elements . chrome (not react) transforming markup make valid.

cypher - Neo4j - query performance degradation -

here query: match (p:publisher)-[r:published]->(w:woka)-[s:authored]-(a:author) match (l:language)-[t:used]->(w:woka) (a.author_name =~ '.*camus.*' , a.author_name =~ '.*albert.*') return p.publisher_name, w.woka_title, a.author_name, l.language_name; the first time executing result returned in 3.8 seconds. second execution couple minutes later result returned in 15.1 seconds. more executing longer response time. third execution response time increasing , several moments later getting results between 30 , 90 seconds. i user of (development) database. no data added or deleted or changed there. no indexes dropped or created there. when closing 2 out of 3 connections database response time goes 15 seconds. memory set 4gb init , max 8gb. server has 16gb total memory. what happening here? why response time differs much? how big graph? allocates lot of heap caching , there not enough space running queries without garbage collection. i presume

Adding a bar to a bootstrapped firefox extension -

i'm trying develop first firefox extension , chose bootstrapped one, because can (not having install nothing). now, i'm trying find @ least documentation start, , need know how can add panel browser, history panel, personalized components, buttons , inputs. i'm confused because there lot of ways in developing extensions, want preserve bootstraped method. idea how add panel or read? (i have read this, , didn't helped https://developer.mozilla.org/es/docs/extensions/bootstrapped_extensions )

Adding FavIcon to Sharepoint 2013 Site -

Image
when upgraded sharepoint 2010 sharepoint 2013, our favicon no longer being displayed. internet search offered couple of solutions. 1 method suggested placing file in c:\program files\common files\microsoft shared\web server extensions\15\template\images , performing iis reset. not having access server , not wanting disrupt production site iis reset, opted handle upload site library , master page change. i found following easy change make. these steps took: upload .ico file site / siteassets library make note of url uploaded .ico file (right click , choose copy shortcut menu in sharepoint designer, open master page file - v4.master or custom file search line: sharepoint:spshortcuticon.. (if have custom master page , line missing, copy v4.master , place in head section.) paste url of .ico file step 2 spshortcuticon element on iconurl property save, checkin, , approve master page. that's it. .ico file appear in browser tabs , in url address bar depending

rest-client gem: 401 unauthorized with token -

i using rest-client gem try , make post api. the restclient.post helper requires 3 arguments pass headers that: .post(url, params, headers). have tried more this? restclient.post(' http://api.example.com/ ', {key: 'value'}, authorization: 'a2m...') https://github.com/rest-client/rest-client/issues/339#issuecomment-71787018 i have followed advice above receive restclient::unauthorized - 401 unauthorized response. my code: restclient.post "http://api.example-dev.com:7000/v1/resources", {key: 'value'}, :authorization => 'yyyyyyyy' i have success below curl command not above restclient.post. successful curl: curl -i -x post -d 'test[key]=1234' -h "authorization: token token=yyyyyyyyyyyyyy" \ http://api.example-dev.com:7000/v1/resources this should produce same request curl: `restclient.post "http://api.example-dev.com:7000/v1/resources", {:test => {key: '1234'

correlation - Replicate R cor() function in Tableau -

why there no tutorial online replicating r's basic cor() function in tableau. can find tutorials visualize correlations of values dimension. want see how variables in data correlated each other. and support @user1036719 all, i have figured out simplest way solve own problem. introduction of tableau 9.0, can load .rdata files directly tableau. here how go it: 1) save() correlation matrix .rdata file. 2) connect tableau .rdata file 3) put "measure names" in columns field & "rownames" in rows field. 4) set marks "automatic" "square" 5) drag "measure values" on "color" marks category voila! you're done. new r integration simpler solution have found online.

c - Expected expression before 'struct' - Error -

i'm using crossstudio ide make simple function prototype initializes uart baudrate , other parameters stm32f30x arm processor. goal of function prototype print baudrate initialization peripheral (stm32f30x.c), expected '9600'. instead error "expected expression before 'usart_init'" returned. there 3 files in total: 1) config_uart.c -> contains function prototype 2) stm32f30x_usart.c -> contains initializing function, call config_uart.c 3) stm32f30x_usart.h -> contains prototype struct definition config_uart.c body void comm_initial (void) { typedef struct usart_init usart_init; void usart_structinit(usart_initstruct); printf("%d\n", usart_init->usart_baudrate); } from stm32f30x_usart.c body void usart_structinit(usart_inittypedef* usart_initstruct) { /* usart_initstruct members default value */ usart_initstruct->usart_baudrate = 9600; usart_initstruct->usart_wordlength = usart_wordlength_8b;