Daily Archives

Articles indexed Tuesday September 18 2012

Page 4/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • timing response speed of serial device

    - by dario frongi
    I comunicate with a serial device via bluetooth. i send it pid and it responds to me with a data response. i comunicate with him with serial comunicatione one request-response. i want to measure how many response i receive in one second. i think that i have to know the moment when i do the request and the moment whene i receive the response and do the difference. The result(called delta) is the time-to response of device. in the end i have to do 1000ms/delta. how can calculate it ?

    Read the article

  • How to dump STDIN to a file, using C++ STL?

    - by Jimm Chen
    HHello all, this is a straight forward question, but not a straight forward answer can be found by just Googling today. Hope someone can show me a concise answer before I dig into those thick C++ books and finally find the solution out. Thank you. I'm writing this program so to make a workaround in this issue: Why do I get 'Bad file descriptor' when trying sys.stdin.read() in subversion pre-revprop-change py script? Note: Content from STDIN may be arbitrary binary data. Please use C++ STL functions, iostream, ifstream etc . If the file creation/writing failed, I'd like to catch the exception to know the case.

    Read the article

  • Container fix width. Center div dynamic width. want left right divs to fill out remaining width equally

    - by james
    Have Three columns..Combine width of all three is fixed.. 2nd ( center ) column will have dynamic content.. I need left and right column to fill out remaining space ( container width - center column dynamic width )equally. Example: http://jsfiddle.net/htKje/ <div class="container"> <div class="bg"></div> <div>Lorem Ipsum</div> <div class="bg"></div> </div> CSS : .container { width:500px; } .bg {backgrould:#CCC; }

    Read the article

  • Does it mean JVM Suspended?

    - by Joe.wang
    When my application run . I got a message says : Ping: Timed out waiting for signal from JVM. The JVM was launched with debug options so this may be because the JVM is currently suspended by a debugger. Any future timeouts during this JVM invocation will be silently ignored. What does that mean? It seems it will block any web request from outside? because when I upload a file to it, it failed. help me .

    Read the article

  • How to send a Java integer in four bytes to another application?

    - by user1468729
    public void routeMessage(byte[] data, int mode) { logger.debug(mode); logger.debug(Integer.toBinaryString(mode)); byte[] message = new byte[8]; ByteBuffer byteBuffer = ByteBuffer.allocate(4); ByteArrayOutputStream baoStream = new ByteArrayOutputStream(); DataOutputStream doStream = new DataOutputStream(baoStream); try { doStream.writeInt(mode); } catch (IOException e) { logger.debug("Error converting mode from integer to bytes.", e); return; } byte [] bytes = baoStream.toByteArray(); bytes[0] = (byte)((mode >>> 24) & 0x000000ff); bytes[1] = (byte)((mode >>> 16) & 0x000000ff); bytes[2] = (byte)((mode >>> 8) & 0x00000ff); bytes[3] = (byte)(mode & 0x000000ff); //bytes = byteBuffer.array(); for (byte b : bytes) { logger.debug(b); } for (int i = 0; i < 4; i++) { //byte tmp = (byte)(mode >> (32 - ((i + 1) * 8))); message[i] = bytes[i]; logger.debug("mode, " + i + ": " + Integer.toBinaryString(message[i])); message[i + 4] = data[i]; } broker.routeMessage(message); } I've tried different ways (as you can see from the commented code) to convert the mode to four bytes to send it via a socket to another application. It works well with integers up to 127 and then again with integers over 256. I believe it has something to do with Java types being signed but don't seem to get it to work. Here are some examples of what the program prints. 127 1111111 0 0 0 127 mode, 0: 0 mode, 1: 0 mode, 2: 0 mode, 3: 1111111 128 10000000 0 0 0 -128 mode, 0: 0 mode, 1: 0 mode, 2: 0 mode, 3: 11111111111111111111111110000000 211 11010011 0 0 0 -45 mode, 0: 0 mode, 1: 0 mode, 2: 0 mode, 3: 11111111111111111111111111010011 306 100110010 0 0 1 50 mode, 0: 0 mode, 1: 0 mode, 2: 1 mode, 3: 110010 How is it suddenly possible for a byte to store 32 bits? How could I fix this?

    Read the article

  • How to make image's background transparency to 0?

    - by pheromix
    There are images displayed inside a HTML table in a PHP code : The code of this table is : for ($i = 0; $i < $data['list']['cnt']; $i++) { $tabRows[$i][1]['width'] = "45%"; $tabRows[$i][1]['align'] = "center"; $tabRows[$i][1]['value'] = '<img src="'.HTTP_FIGURES.$data['list'][$i]['fig_image'].'" />'; } As you can see the background of the images are seen and they make the page dirty. So I want to remove the background of each image. How to do that ?

    Read the article

  • How to concatenate multiple lines of log file into single variable in batch file?

    - by psych
    I have a log file containing a stack trace split over a number of lines. I need to read this file into a batch file and remove all of the lines breaks. As a first step, I tried this: if exist "%log_dir%\Log.log" ( for /F "tokens=*" %%a in ("%log_dir%\Log.log") do @echo %%a ) My expectation was that this would echo out each line of the log file. I was then planning to concatenate these lines together and set that value in a variable. However, this code doesn't do what I would expect. I have tried changing the value of the options for delims and tokens, but the only output I can get is the absolute path to the log file and nothing from the contents of this file. How can I set a variable to be equal to the lines of text in a file with the line breaks removed?

    Read the article

  • PCRE/PHP regex not matching last "item"

    - by superbarney
    Here's a regex that I've cobbled up: /(.*={76}\s)?\s*(.*?)\s\-\-\s(\d{2}\/\d{2}\-\d{2}\s\d{2}:\d{2})\s\s(.*?)\s(http:\/\/service.*?)\s(\-{76})/is and here's the text I will be parsing: http://p.linode.com/7015 and here's the replacement for the matched text: <item>\n\t<title>$2</title>\n\t<pubDate>$pubDate</pubDate>\n\t<description>$4</description>\n\t<link>$5</link>\n</item>\n\n I have almost come up with a regex needed to parse a block of text into RSS 2.0 XML markup. I've tested it with RegExr and RegexBuddy and it works perfectly except for the last "item" where there is no line breaks after the link (Line 269). In short, the problem is the "iProperty" article in the text is not matched. Any regex gurus willing to help me troubleshoot what's wrong? I've tried /(.*={76}\s)?\s*(.*?)\s\-\-\s(\d{2}\/\d{2}\-\d{2}\s\d{2}:\d{2})\s\s(.*?)\s(http:\/\/service.*?)\s*(\-{76})/is Here's the output that I get: http://p.linode.com/7016 but that didn't work as I expected (i.e. a newline would be optional). Thanks!

    Read the article

  • Runtime error on Did End On Exit in iPhone application

    - by Deepak Pillai
    Does anyone know why im getting runtime error when i click on return button on iphone keyboard. I need to hide keyboard after done editing values to UITextField. So i assigned Did End On Exit to IBAction and the IBAction code below -(IBAction)FinishEditing:(id)sender { [folderName resignFirstResponder]; } When running ma project i facing a runtime error and the variable values shown below argv char ** 0xbffff58c *argv char * 0xbffff6b8 **argv char '/' Console Value (lldb) Any idea to overcome this issue??

    Read the article

  • It says command.ExecuteNonQuery() is not initialized

    - by Alfrezo
    My code: // Get Connection String string conn = WebConfigurationManager.ConnectionStrings["GraduatesConnectionString"].ToString(); // Create connection object SqlConnection connection = new SqlConnection(conn); SqlCommand command = connection.CreateCommand(); try { // Open the connection. connection.Open(); // Execute the insert command. command.CommandText = ("INSERT INTO PersonalInfo(Id,Name,LastName,ContactNumber, Address,Gender, Date_Of_Birth) VALUES(\'" + (this.txtID.Text + ("\',\'" + (this.txtName.Text + ("\',\'" + (this.txtLastName.Text + ("\',\'" + (this.txtContactNumber.Text + ("\',\'" + (this.txtAddress.Text + ("\',\'" + (this.gender + ("\',\'" + (this.txtDateofBirth.Text + ("\',\'" ))))); command.ExecuteNonQuery(); } finally { // Close the connection. connection.Close(); }

    Read the article

  • Python wrapper for Google Maps making Google App Engine crash?

    - by user1679332
    I am currently trying to build a web app using Google App Engine that will involve using the Google Maps API. Since I am coding in python, I tried importing the python wrapper for Google Maps (found here); however, performing the import will cause my web app to crash. Are there any suggestions for how I can fix this problem? I'm guessing the crash might have something to do with the fact that I need to incorporate the google maps python wrapper into my application, but how do I go about doing that? Thanks!

    Read the article

  • Java algorithm for normalizing audio

    - by Marty Pitt
    I'm trying to normalize an audio file of speech. Specifically, where an audio file contains peaks in volume, I'm trying to level it out, so the quiet sections are louder, and the peaks are quieter. I know very little about audio manipulation, beyond what I've learnt from working on this task. Also, my math is embarrassingly weak. I've done some research, and the Xuggle site provides a sample which shows reducing the volume using the following code: (full version here) @Override public void onAudioSamples(IAudioSamplesEvent event) { // get the raw audio byes and adjust it's value ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer(); for (int i = 0; i < buffer.limit(); ++i) buffer.put(i, (short)(buffer.get(i) * mVolume)); super.onAudioSamples(event); } Here, they modify the bytes in getAudioSamples() by a constant of mVolume. Building on this approach, I've attempted a normalisation modifies the bytes in getAudioSamples() to a normalised value, considering the max/min in the file. (See below for details). I have a simple filter to leave "silence" alone (ie., anything below a value). I'm finding that the output file is very noisy (ie., the quality is seriously degraded). I assume that the error is either in my normalisation algorithim, or the way I manipulate the bytes. However, I'm unsure of where to go next. Here's an abridged version of what I'm currently doing. Step 1: Find peaks in file: Reads the full audio file, and finds this highest and lowest values of buffer.get() for all AudioSamples @Override public void onAudioSamples(IAudioSamplesEvent event) { IAudioSamples audioSamples = event.getAudioSamples(); ShortBuffer buffer = audioSamples.getByteBuffer().asShortBuffer(); short min = Short.MAX_VALUE; short max = Short.MIN_VALUE; for (int i = 0; i < buffer.limit(); ++i) { short value = buffer.get(i); min = (short) Math.min(min, value); max = (short) Math.max(max, value); } // assign of min/max ommitted for brevity. super.onAudioSamples(event); } Step 2: Normalize all values: In a loop similar to step1, replace the buffer with normalized values, calling: buffer.put(i, normalize(buffer.get(i)); public short normalize(short value) { if (isBackgroundNoise(value)) return value; short rawMin = // min from step1 short rawMax = // max from step1 short targetRangeMin = 1000; short targetRangeMax = 8000; int abs = Math.abs(value); double a = (abs - rawMin) * (targetRangeMax - targetRangeMin); double b = (rawMax - rawMin); double result = targetRangeMin + ( a/b ); // Copy the sign of value to result. result = Math.copySign(result,value); return (short) result; } Questions: Is this a valid approach for attempting to normalize an audio file? Is my math in normalize() valid? Why would this cause the file to become noisy, where a similar approach in the demo code doesn't?

    Read the article

  • Reportviewer - Print report - matrix report expanding horizontally to multiple pages, avoid repeating row header

    - by abc0077
    I am generating a matrix report dynamically using report viewer version 9.0 in visual studio 2010. If i export save and print then it works normally. If there more columns report expands horizontally across mutiple pages. If i give Print option available in the toolbar of the report viewer. The columns are moved to second page which is correct but the row headers (product 1, product 2) should not be repeated in the second page.In the second page report should have all details except the product information. I am also interested to know whether it is the functionality of this version report viewer.

    Read the article

  • How can I find columns which have non-null values?

    - by aartist
    I have many columns in oracle database and some new are added with values. I like to find out which columns have values other than 0 or null. So I am looking for column names for which some sort of useful values exists at least in one row. How do I do this? Update: This sounds very close. How do I modify this to suit my needs? select column_name, nullable, num_distinct, num_nulls from all_tab_columns where table_name = 'SOME_TABLE'

    Read the article

  • Eclipse plugin installation/update issues

    - by The Elite Gentleman
    I've installed the following Team repository plugins (along with it's dependencies) for Eclipse Helios (using Eclipse updater). MercurialEclipse 1.7.1 Subclipse 1.6.17 Subversive SVN All of these are the latest in Eclipse Marketplace. My problem is when I go to Eclipse "Preferences", under "Team" I only see CVS but under Eclipse Marketplace, I can see that these plugins are installed (it gives me an option to uninstall it). How do I configure my Team repositories to reflect under "Team" in Preferences? Also, there is an update for "Eclipse IDE for Java EE developers, but when I try to update it, the following error occurs: Cannot complete the install because of a conflicting dependency. Software being installed: Eclipse IDE for Java EE Developers 1.3.2.20110301-1807 (epp.package.jee 1.3.2.20110301-1807) Software currently installed: Shared profile 1.0.0.1276787175574 (SharedProfile_epp.package.jee 1.0.0.1276787175574) Only one of the following can be installed at once: toolingepp.package.jee.configuration 1.3.2.20110301-1807 toolingepp.package.jee.configuration 1.3.0.20100617-0521 Cannot satisfy dependency: From: Shared profile 1.0.0.1276787175574 (SharedProfile_epp.package.jee 1.0.0.1276787175574) To: toolingepp.package.jee.configuration [1.3.0.20100617-0521] Cannot satisfy dependency: From: Eclipse IDE for Java EE Developers 1.3.2.20110301-1807 (epp.package.jee 1.3.2.20110301-1807) To: toolingepp.package.jee.configuration [1.3.2.20110301-1807] How do I solve it? Yes, I've spent days Googling for this issue but none solved my problem. Thanks in advance.

    Read the article

  • How to install mod_dav_svn on Centos 5.5

    - by Min2liz
    I'm trying to install mod_dav_svn on my server (Centos 5.5, Apache Apache 2.2.11, DirectAdmin 1.35.1 ), but no luck. I'm using this tutorial: http://wiki.centos.org/HowTos/Subversion#head-ae2d6fa671ad7ebd5d7835c6edbcd15dd2d73c4d So, I'm trying in console: # yum install mod_dav_svn subversion Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.bst.lt * base: centos.bst.lt * extras: centos.bst.lt * updates: centos.bst.lt Excluding Packages in global exclude list Finished Setting up Install Process No package mod_dav_svn available. Package subversion-1.4.2-4.el5_3.1.i386 already installed and latest version Nothing to do Why can't it find mod_dav_svn? Also I tried: #yum search mod_dav_svn Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.bst.lt * base: centos.bst.lt * extras: centos.bst.lt * updates: centos.bst.lt Excluding Packages in global exclude list Finished Warning: No matches found for: mod_dav_svn No Matches found Nothing...

    Read the article

  • php cURL POST how to follow location

    - by One Stuck Pixel
    I am in a bit of a rut with a cURL issue. The post works greate, the data is POSTED just fine and received ok, but the url of the posted page never appears in the browser after the cURL session is executed, for example look at the following code: $ch = curl_init("http://localhost/eterniti/cart-step-1.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "error=1&em=$em&fname=$fname&lname=$lname&email1=$email1&email2=$email2&code=$code&area=$area&number=$num&mobile=$mobile&address1=$address1&address2=$address2&address3=$address3&suburb=$suburb&postcode=$postcode&country=$country"); curl_exec($ch); curl_close($ch); The post works fine and I am taken to the cart-step-1.php where I can process the posted data, HOWEVER the location in the URL address bar of the browser remains that of the script page, in this case proc_xxxxxx.php Any ideas how to get the URL address to reflect the page I am actually POSTED to? Thanks a mill

    Read the article

  • Deploy to JBoss 7 using Hudson Deploy plugin

    - by Uluk Biy
    I have 2 machines where one of them contains the Hudson CI and other JBoss 7 AS. In Hudson, I have installed "Deploy Plugin", created new job and filled required JBoss manager user connection fields. When I run the job, the project successfully built however the deployment process to remote JBoss AS is not being triggered. No errors or messages about the deployment in log. What should I do? EDIT The deployment is triggered (at least expected) as "Post-build Action" with parameters: [x] Deploy war/ear to a container WAR/EAR files : **/*.war Container : JBoss 7.x Manager user name : test Manager password : * * * * JBoss URL : http://192.168.1.2 JBoss JMX Management port : 9990 It is not a separate job.

    Read the article

  • Adding SSL to Heroku site post launch

    - by dineth
    I have a rails API that I want to deploy on Heroku. $20/month for a SSL site on heroku is a little steep given I am not earning anything out of this app yet. I am after advice and wondering if it is possible to add SSL sometime in the future? This is for a iOS app that I'm writing. Basically the idea would be that I continue to use https://myapp.heroku.com through their piggyback SSL. Once I get some cash in, I want to transition to using https://www.myapp.com. At this point the API would still need to work for app users who haven't upgraded to a new version of the app that points to the new domain. Anyone know if this is possible? Would both URLs continue to work? My gut feeling tells me this is not possible. Any advice would help. Thanks!

    Read the article

  • Start and shutdown tomcat via ssh

    - by bxshi
    Updated I find out that the path of jdk it using is wrong. eval: 1: /opt/Java/jdk1.6.0_25/jre/bin/java: not found the Java should be lower case java, how is that happen? When I run this script directly on server, it is just okay. I'm trying to start or shutdown tomcat via a remote client. On my server, I've got 3 different tomcat: tomcat1, tomcat2, and tomcat3. Firstly, I've tried to run tomcat_path/bin/shutdown.sh to stop it via ssh, and the command is ssh [email protected] "cd /home/jake/tomcat2/bin;exec bash ./shutdown.sh" both " and ' are tried, but do not work, the output is eval: 1: /opt/Java/jdk1.6.0_25/jre/bin/java: not found it seems that the shell script runs on my local client, because on server it has this file. Is there any way to run a shell script on remote server correctly? updated I've run ssh [email protected] "sh -x /home/jake/tomcat/bin/shutdown.sh > /home/jake/tomcat.log 2>&1" and the output in tomcat.log is : + PRG=/home/jake/tomcat/bin/shutdown.sh + [ -h /home/jake/tomcat/bin/shutdown.sh ] + dirname /home/jake/tomcat/bin/shutdown.sh + PRGDIR=/home/jake/tomcat/bin + EXECUTABLE=catalina.sh + [ ! -x /home/jake/tomcat/bin/catalina.sh ] + exec /home/jake/tomcat/bin/catalina.sh stop eval: 1: /opt/Java/jdk1.6.0_25/jre/bin/java: not found

    Read the article

  • Not all events appear in Nagios history (archive)

    - by Lars
    in the "Host & Service history" of my check_mk interface I can see various events, but a lot of events are missing. On the default interface at "View Alert History For This Service" or in the logfiles /var/log/nagios/archives/*.log the same issue: I can see many events of the last days, but not all of them. In the /etc/nagios/nagios.cfg the options log_event_handlers, log_initial_status and log_passive_checks are set to 0, the other log_... options are set to 1. I don't think that any of these options causing the problem that not all events are logged. What could cause this problem?

    Read the article

  • How to run a command as administrator on Windows7 from a command line?

    - by Radek
    I need to run tscon.exe 0 /dest:console remotely = not manually on Windows7 as an administrator. More info here How to use tscon on Windows7? I did my research and OPTION 1 - runas for user root (no password) on computer yogurt works C:\>runas /user:yogurt\root cmd Enter the password for yogurt\root: Attempting to start cmd as user "yogurt\root" ... for user administrator (I thought the the password is blank too) on computer yogurt doesn't work. I am asked for password, hit the enter and C:\>runas /user:yogurt\administrator cmd Enter the password for yogurt\administrator: Attempting to start cmd as user "yogurt\administrator" ... RUNAS ERROR: Unable to run - cmd 1327: Logon failure: user account restriction. Possible reasons are blank passwo rds not allowed, logon hour restrictions, or a policy restriction has been enforced. OPTION 2 - setting properties of a batch file so it always runs as administrator. The 'privilege level' section is greyed out for me under Compatibility level. So I am not able to tick the check box Run this program as an administrator

    Read the article

  • Apache only logs PHP errors if LogLevel is set to debug

    - by Sudowned
    I'm developing a CodeIgniter application and for reasons that I do not fully understand errors have stopped being logged in the file specified in the Apache site conf. The page I'm testing is definitely generating a 500 error, but that is not reflected in the logs unless I set LogLevel debug. Setting LogLevel to error or warn results in no errors being logged. I don't think this is a CI issue because I've been developing this site for close to a week now and errors have been logged as expected until I picked the project up again this morning. Though for what it's worth, I've got: error_reporting(E_ALL); set in my index.php.

    Read the article

  • File size limit exceeded in bash

    - by yboren
    I have tried this shell script on a SUSE 10 server, kernel 2.6.16.60, ext3 filesystem the script has problem like this: cat file | awk '{print $1" "$2" "$3}' | sort -n > result the file's size is about 3.2G, and I get such error message: File size limit exceeded in this shell, ulimit -f is unlimited after I change script into this cat file | awk '{print $1" "$2" "$3}' >tmp sort -n tmp > result the problem is gone. I don't know why, can anyone help me with an explanation?

    Read the article

  • Good reasons to keep 32-bit desktop OS's

    - by Mark Henderson
    Server software has been 64-bit only for a while now (Since Server 2008 R2 for Windows, even earlier for Exchange and Sharepoint) and even Ubuntu are pushing you away from 32-bit versions for their server OS's. But is there any good, quantifiable reason to keep a 32-bit desktop operating system maintained? We're preparing our Windows 8 images for the (unfortunate?) few that will be early adopters. The majority of our desktop computers have 4gb or less of RAM, but I would love to not have to bother supporting a 32-bit flavoured operating system any more. Any reason why I should?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >