Posts

Ant to add workspace folder in classpath as a dependent project -

i have 1 ant project xyz , want, when put project 1 random workspace, , when build xyz automatically add workspace folder config (already present in workspace) , task (already present in workspace) classpath dependent project. well, if projects in workspace follow same standard classfile folder, let's project/build : project1/ build/ class files... project2/ build/ class files... project3/ build/ class files... xyz/ build.xml .. set classpath in xyz/build.xml this: <project basedir="."> <path id="my.classpath"> <dirset dir=".." includes="**/build"/> </path> <javac classpathref="my.classpath"> ... </javac> </project> in way, of .class files produced in every project else in workspace included in compilation of xyz. in case know projects want include in xyz's classpath, have set this: <projec...

java - Replacing a string parameter with a List for a recursive method -

i struggeling simple problem last 3 hours. rewrote class , replaced 2 string parameters lists. problem is, when calling rekursive method add 1 character first string parameter. , when length of parameter hits length of 7 prints out. string never gets longer 7. replaced integer list since string consisted of numbers. list though keeps getting longer , longer , have no idea why. hope explained properly. if not, ask me please. the question super easy answer guys. here first class, works. package uebung4; public class permall_alt { static int counter = 0; private static void permutation(string word, string str) { int n = str.length(); // system.out.println(str + " str"); // system.out.println(word + " word"); if (n == 0) { if ( (integer.parseint(word.substring(0, 1))) > (integer.parseint(word.substring(1, 2))) && (integer.parseint(word.substring(1, 2))) < (integer.parseint(word.substring...

c# - How can i convert a float number to a string? -

how can convert float number string? for (float = 1000000000; < 10000000000; i++) { //temp never change , it's value 1000000000 string temp = convert.toint64(i).tostring(); } this number big , want save string on file like 1000000001 1000000002 1000000003 how can convert float number string? obviously: i.tostring() . see the documentation learn how apply formatting in order achieve desired output. however, couple notes: a variable named i commonly indicates int , not float . iterating for , variable of type float obscure. are sure want use floating-point data type, when treat integer? consider using long or decimal . temp never change , it's value 1000000000 float 's precision not enough store number big 1000000000 , discards least significant places. wikipedia : “all integers 6 or less significant decimal digits can converted ieee 754 floating point value.” that's why result seems same. side effect, for c...

c - Conversion to ‘int’ from ‘float’ may alter its value -

my code: #inlcude <math.h> #include "draw.h" /*int draw(int x, int y)*/ draw(rintf(10 * x), rintf(8 * y)); i warning: conversion ‘int’ ‘float’ may alter value. i can't change draw float, since need draw points. rounding inevitable. ideas? the return type of rintf float produces warning. can either explicitly cast int suppress warning (i.e., (int) rintf(10 * x) , or use way of rounding (e.g., if values known non-negative, (int) (10.0f * x + 0.5f) ) or lrint (preferably tgmath.h ), although returns long may cause warning depending on compiler , settings.

java - Picasso fails to load an image but provides no error message? -

i'm running issue on devices (non-nexus devices) on varying versions of android (kitkat , marshmellow) throwing error when try use picasso load image image view. have no idea i'm doing wrong, provides no error message other calling "onerror" method. things i've checked: the image string non-null , points valid string on device. picasso non-null. switching on logging see if relevant shows there (it doesn't). the code: picasso.setloggingenabled(true); picasso.load(msourceimageurl) .resize(mwidthpx, mheightpx) .centercrop() .error(r.drawable.shape_rounded_rectangle_gray) .placeholder(r.drawable.shape_rounded_rectangle_gray) .into(imageview, new callback() { @override public void onsuccess() { system.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& onsuccess"); ...

user - Instagram Sandbox Invites page redirects to the developer register page -

i have app in sandbox mode , have sandbox user pending . (it has been @ least day since user added). user can use app , has given authorization; however, user's likes returns empty response (i know can access liked media other authorized sandbox users, user has liked media account set admin). instagram api documentation states user may go developer site , accept/decline sandbox invites sandbox invites tab except user shown developer register page instead. know going on/how fix this? instagram made sweeping changes it's api , way accessed recently. result of lockdown sandbox invite process glitchy @ best. myself ran issue of invites not showing up. it seems, moment, way access invite fill out developer form(i used http://localhost:8000 url , random phone number not exist, although try without 1 might not necessary). should automatically forward invite page invited user can accept or decline sandbox invite. it's bit of mess , lack of documentation / ind...

multithreading - how to control process in python? -

i want run several process in parallel without giving cpu work cpu can other jobs. in python, use os.system call binary. , theses call independent , can parallel. these binary may run different length of time. what want example, keep 8 of them run in parallel, if 1 exit early, start one. what doing this: count = 0 f in files: count = count + 1 cmd = exe if (count != 8): cmd = cmd + " &" else: count = 0 os.sytem(cmd) but not ideal if cmd without & runs long or short. i tried multiprocessing module, p=pool(8) print(p.map(f,list_of_args)) but in case not running 8 processes in parallel of time. since of them exit early. there no need synchronization. i have 16 cpu cores , want half of them(8 processes runs in parallel) you'd better not use os.system subprocess.popen more powerful , safe. subprocess.popen not block on call don't need append '&' @ end of command. for question it...