I am trying to compile mahout, I have temporarily changed the JAVA_HOME variable like this: and I checked that it was changed correctly using this command: which returns: But when I run mahout mvn clean install -DskipTests=true I run into this error: Error: JAVA_HOME is not defined correctly. We cannot execut…
How to write to data register in C, without touching previous writes?
Iam a beginner in C and have this scenario: I can successfully write to a gpio port with data register 0x103 and direction register 0x95. If I want to write to another pin I have to “overwrite” the previously pin. As if I first write 00010000 and then want to make another pin high I need to write …
How to achieve accurate timer in linux kernel
When i write a infrared remote control driver, I have to control delay accurate time during enabling and disabling PWM. At first i used udelay() function in kernel, but i found it’s not accurate at all as i said in another post AFAIK, other timeout functions provided by kernel can’t provide accura…
Validating file records shell script
I have a file with content as follows and want to validate the content as 1.I have entries of rec$NUM and this field should be repeated 7 times only. for example I have rec1.any_attribute this rec1 should come only 7 times in whole file. 2.I need validating script for this. If records for rec$NUM are less tha…
how to auto complete files names on bash script?
I have a bash shell script that cd to directory according to a variable. After that I press Tab and files don’t appear like in terminal. Ex: on read code ups, the files don’t appear when I press tab. Answer The read command requires the -e flag in order to use the readline library to edit the comm…
Bash script unexpected result for while loop
I have following bash script to stop Apache server. I am not getting error but an unexpected result. I got the following answer which I do not expect to be, with an infinite printing: I expect to print: Could anybody please tell me what is happening? Answer This doesn’t work the way you seem to think it…
Cannot access Tomcat via web after EC2 reboot
I rebooted my Amazon EC2 instance, and now I can’t connect to my Tomcat7 web server via the web. Here’s what I’ve tried, to no avail: 1) Confirmed that my settings are correct in Tomcat’s server.xml file: 2) updated my iptables via this post: 3) Reviewed my tomcat catalina.out log (suc…
SO_RCVTIME and SO_RCVTIMEO not affecting Boost.Asio operations
Below is my code When I use Telnet to connect, but not sending data, it does not disconnect from a Telnet timeout.Will need to do to make setsockopt kick in? Thanks! I have modified SO_RCVTIMEO to SO_SNDTIMEO. Still unable to timeout in the specified time Answer Using SO_RCVTIMEO and SO_SNDTIMEO socket option…
FFmpeg audio crossfade
I’m trying to merge several videos using ffmpeg and apply the cross-fade transition in between. I got video cross-fade working by referring to this. At the same time I need to have audio also to have cross-fade applied for original audios associated with each video. I referred several places but they re…
How does C distinguish between a byte long character and a 2 byte long character?
I have this sample code: First run: Well I think this is all expected as p is 1 byte long character defined in ASCII and I am reading 3 bytes. (2 p’s and Line break) In the terminal, again I see 2 characters. Now let’s try with a character that is 2 bytes long: What I do not understand is,