Posts

Featured post

java - Why is there a "deadbranch" in my code? -

below code working fine until last if-else. appears i've done wrong boolean variables cangraduate , onprobation. perhaps i'm reassigning them incorrectly in prior if-else statements. deadbranch occurs @ else half of last if-else. package lab5; import java.util.scanner; public class lab5 { public static void main(string[] args) { //creates scanner object scanner scanner = new scanner(system.in); //part ii //creating variables double gpa; int totalcreditstaken; int mathsciencecredits; int liberalartscredits; int electivecredits; boolean cangraduate = true; boolean onprobation = false; //prompts user imput system.out.println("what gpa?"); gpa = scanner.nextdouble(); system.out.println("what's total amount of credits you've taken?"); totalcreditstaken = scanner.nextint(); system.out.println("how many math , science credits have taken?"); mathsciencecre...

c - Calling close() on a valid file descriptor for a COM port blocks forever if the device has been powered off on Mac OS X -

i'm writing application in c on mac os x communicates bluetooth device using com ports. if bluetooth device powered off after connection has been made, subsequent calls close block indefinitely. note using aio_read , aio_write read , write device. if device left powered on, close succeeds expected. example: /* open com port */ int fd = open (g_comname, o_rdwr | o_noctty | o_async ); /* ensure fd valid, work, power off bluetooth device */ /* wait until aysnc io complete */ while (aio_cancel(fd, null) == aio_notcanceled) {} /* application hang here */ close(fd); what doing wrong? guess os waiting confirmation device, never gets anything. there anyway force close connection? edit: as suggested, setting o_nonblock did trick: fcntl(fd, f_setfl, o_async)

permissions - PhpStorm 9: Why doesn't the remote path's directories/files display when connected via FTP -

Image
i trying connect remote host in phpstorm 9 via ftp , connects host not display files/directories. i able ftp , see files/directories fine via filezilla same ftp profile/settings used in phpstorm 9. why not able see files/directories via ftp in phpstorm 9? try switching between active ans passive ftp modes (option located in advanced options dialog of deployment settings/preferences page.

php - Why is APCu segfaulting inside a Docker container? -

i'm trying run php 5.5 (with fpm) apcu inside docker container. i'm using boot2docker on osx. when try run php-fpm -i , segfaults. running in gdb , following backtrace: (gdb) run -i starting program: /usr/local/sbin/php-fpm -i [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". program received signal sigsegv, segmentation fault. 0x00007ffff542474c in __pthread_rwlock_init (rwlock=rwlock@entry=0xffffffffffffffff, attr=attr@entry=0x7ffff1bda988 <apc_lock_attr>) @ pthread_rwlock_init.c:40 40 pthread_rwlock_init.c: no such file or directory. (gdb) bt #0 0x00007ffff542474c in __pthread_rwlock_init (rwlock=rwlock@entry=0xffffffffffffffff, attr=attr@entry=0x7ffff1bda988 <apc_lock_attr>) @ pthread_rwlock_init.c:40 #1 0x00007ffff19ca9d0 in apc_lock_create (lock=lock@entry=0xffffffffffffffff) @ /tmp/pear/temp/apcu/apc_lock.c:180 #2 0x00007ffff19d0135 in apc_sma_api_init (sma=0x7fff...

java - Having trouble removing from a queue and adding to another -

i have input file containing many strings , ints. ex. blah 40 hello 10 asdf 20 etc... i have read them queue hold them. need take them out of queue , add priority queue whenever int equals ints in data file. this have far.. for(int = 0; i<=50; i++) { object x = normalqueue.dequeue(); //this makes x equal line of data file dequeued. if(i == x.secondint) //secondint objects method gets integer in data file { pqueue.insert(x); //inserts x pqueue if = second int in data file } else { normalqueue.enqueue(x); //adds x queue1 normalqueue.switchends(); //swaps 1st , last node } } the problem having is printing out 2 files of data file. i'm not quite sure intend happen when running code, happen this: given following input: blah 40 hello 10 asdf 20 (i'm assuming add elements of queue when reading file, ordering data-file retained) in first 40 iterations of loop taking "blah 40" out o...

unity3d - Why is my Object not filled -

i trying create select object script in unity. what should when hover on object colors red (and does) , when press "1" gameobject's targethighlighted filled object hovering on @ moment. in debug.log works fine, targethighlighted is filled. when press "1" targethighlighted object still left empty. doesn't matter if press while hovering on object or away it. my full code more extensive this. section of code contains problem, reduced this. can explain me how come when press "1" the debug.log doesn't show targethighlighted or targetselected ? basically why mouseenter , mouseexit log right object, settarget function doesn't? using unityengine; using system.collections; public class targetselectionscript: monobehaviour { // store current selected gameobject gameobject targethighlighted; renderer rend; color initialcolor = color.white; color selectedcolor = color.red; public gamecontrollerscript gam...

java - maven 3.3 support for Websphere 8.5.5 - pom.xml -

i not find way deploy war file in websphere 8.5.5 using maven's pom.xml. see there plugin called was6-maven-plugin-1.2.1. , can support 6+, 7+, 8+ seems. but not deploy war file using plugin. throws following error. [error] failed execute goal org.codehaus.mojo:was6-maven-plugin:1.2.1:installapp (default-cli) on project test: bad archive: c:\test.war -> [help 1] please comment on... my pom.xml configuration fyr: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>was6-maven-plugin</artifactid> <version>1.2.1</version> <executions> <execution> <id>integration-test</id> <phase>integration-test</phase> <goals> <goal>installapp</goal> </goals> </execution> </executions> <configuratio...