Posts

c++ - openmp: recursive task slower than sequential even with depth limit -

i have big binary tree on want expensive calculations. want parallelize these methods using openmp , task pragmas. as test, have parallelized freetree function , have created big example test tree. in order prevent spawning many tasks, have limited tasks creation top 2 levels of tree. 4 tasks created. below minimal working example: #include <chrono> #include <iostream> class node { public: int data; node* l; node* r; node(node* left, node* right) : l(left), r(right) {} }; node* createrandomtree(int depth) { if (depth == 0) return new node(null, null); return new node(createrandomtree(depth - 1), createrandomtree(depth - 1)); } void freetree(node* tree) { if (tree == null) return; freetree(tree->l); freetree(tree->r); delete tree; } void freetreepar(node* tree, int n = 0) { if (tree == null) return; node *l = tree->l, *r = tree->r; if (n < 2) { #pragma omp task fre...

statistics - R aov Function - adjusting the alpha value..? -

i have used aov() function im wondering if there way or function allows user define alpha value..?# i'm assuming these tend industry standard of 0.05....what if wanted aov function yield p-value based on 0.03...or 0.01 alpha values...? you can extract p-values of object returned aov with pvalues <- summary(fit)[[1]][ , 5, drop = false] where fit <- aov(...) . now, can compare p-values alpha level, e.g., 0.01: pvalues < 0.01 this returns true or false .

c++ - Static data initialised when my program EXITS -

sometimes put initialisation code in constructor of static object, this. namespace { struct init { init (); }; init :: init () { // whatever } init init; } yes, know bad in general because can't rely on order of initialisations between translation units, sometimes, things, it's okay. anyway don't syntax , today tried out this. namespace { int init = [] () -> int { // whatever return 0; } (); } when program ran, whatever code ran after main() ! i know static initialisations happen in arbitrary order, thought specification required all , in whatever order, happen before main() enters. is compiler misbehaving or there further subtlety? #> gcc -v using built-in specs. collect_gcc=gcc collect_lto_wrapper=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper target: i686-linux-gnu configured with: ../src/configure -v --with-pkgversion='ubuntu/linaro 4.8.1-10ubuntu9' --with-bugurl=file:///usr...

android - GCC ARM cross compiler won't compile simple Hello world -

i installed arm c compiler android using apt-get install gcc-arm-linux-gnueabi . installed successfully, wrote simple hello world program: #include <stdio.h> int main(){ printf("hello world"); return 0; } i saved hello.c , tried compile using: arm-linux-gnueabi-gcc hello.c -o hello says: usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find crt1.o: no such file or directory usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find crti.o: no such file or directory collect: error: ld returned 1 exit status

makefile - how to make clean without any modification? -

i have makefile huge library, when modify files not want compile library , make clean , @ first compile files clean. how can make clean without other modifications? i have used .phony: clean force clean: force rm *.o rm *.mod force: i resolve problem using: ifneq ($(makecmdgoals),clean) -include $(objs:%.o=%.d) endif as zhertal says there's no way know sure without seeing definition of clean rule, @ least. there 2 possibilities this. the first clean target listing prerequisite causing rebuild. unlikely, i've seen people things before. the second, , more likely, cause you're using method described in gnu make manual automatically generating prerequisites, add %.d pattern %.o pattern rule , -include .d files. problem here make try make sure makefile date first before running targets, , means trying rebuild included .d files, means recompiling everything. you have 2 options fix this. first put include line ...

gracenote - Feature Request : Configuration preference for single best match. MusicID -

i have been using mobile developer kit couple of weeks , have tested "gnoperations.recognizemidfilefromfile" method android kit on large number of files single best match response configured. pretty impressed results. 95% accurate when result found did realized around 20% percent of files recognized single best match identify part of compilation album while think default best single match identify song part of single,an album of artist when applicable before being identify being part of compilation album, ep or soundtrack album. after looking @ documentation, didn't see let me configure . suggestion have property can set in config object similar "content.coverart.sizepreference" property used specify covert art size preference. property : "content.singlebestmatch.albumpreference" , different values "single, album, compilation, dj_mix, soundtrack, live_album" i happy hear comments of gracenote team on or else.

python - Pyinstaller issue with subprocess.check_output on onefile executable under windows -

there requirement of running subprocess.check_output catch ouptupt of 7zip in application. simple code using output = subprocess.check_output(["path/to/7zip", "l", "path/to/archieve"], shell=true) print output as expected works when run ide. same goes crazy , not working after compiled in onefile executable using pyinstaller. other subprocess command subprocess.call works after converting script in executable. how use subprocess.check_output in executable? i use following:- windows 7 python 2.7.5 pyqt4 pyinstaller 2.1 any appreciated. ok. got solved self. used os.popen command accomplish same task. sake of completeness, posting solution code below:- out = os.popen("path/to/7zip l path/to/archieve").read() print out