Search Results

Search found 16 results on 1 pages for 'silvio iannone'.

Page 1/1 | 1 

  • Lingering tcp connection in LISTEN state

    - by Silvio Donnini
    My java application can sometimes be killed by an external script. This can be done either with SIGTERM or with SIGKILL. The application is a server which receives many connections per second, and it can be killed while trying to serve them. I would like to restart the application whenever it's killed, so I have prepared a script for that purpose. The problem is that, once the app has been killed, the new application instance can't bind to the port used by the previous instance, because the "Address is already in use". The previous instance's process has been definitely terminated, anyway the offending listening port is still there, but it is assigned to bash (or sh on other machines). Obviouly, my goal is to restart the application and let it bind successfully to the previous address. I've tried waiting more than 200 seconds before restarting to no avail, anyway I can't afford to wait that much. I've encountered this problem on all the machines I've ran the application (which is a jetty server with java 1.6). Any suggestion is appreciated, thanks, Silvio

    Read the article

  • cron doesn't execute it's commands

    - by Silvio Keller
    I created an own small server with Debian. Last night i updated it. It created an error while generating the initrd and it didn't boot. Today i booted from another filesystem and did dpkg --configure -a with chroot. I also checked the filesystem. Now everything should be ok. But cron doesn't work:-( It is the same /etc/crontab-File but it doesn't work. I reinstalled cron and tried many things. Is there a way to see cron's log? I only readed about rsyslog, but i have not installed rsyslog, because the server is based on a minimal system (Freeagent Dockstar). Has someone an idea? Best regards Silvio Keller Update There is no file /var/log/syslog and dpkg -l|grep syslog gives me no output, so i think syslog is not installed. It is only a minimal system. cron -l gives: cron: can't lock /var/run/crond.pid, otherpid may be 687: Resource temporarily unavailable So i stopped cron with /etc/init.d/cron stop and executed cron -l again, this gives no output. At this moment i tried to start cron with /etc/init.d/cron start: Starting periodic command scheduler: cron failed! But there's no additional error info... But i see there's now in the background a proccess called cron -l which runs. If i stop it /etc/init.d/cron start works: Starting periodic command scheduler: cron. I used the crontab-file /etc/crontab, this worked for me always. Till i updated my kernel and the initrd it doesn't. The file's content is: SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) 00 5 * * * root dummy 23 45 * * 7 root dummy 00 * * * * root dummy */1 * * * * root dummy 00 1 * * * root dummy 00 4 * * * root dummy */5 * * * * root dummy #00 */10 * * * root dummy 01 0 * * * root dummy 00 5 * * * root dummy 00 4 * * * root dummy # If i start crontab -e it creates a new file /tmp/crontab.vn87tv/crontab, which is unfortunaly on a tmpfs and which also doesn't work. Thanks & Best regards

    Read the article

  • PHP: Type hints for fields with Eclipse PDT

    - by Silvio Donnini
    Using Eclipse + PDT, I know that you can specify the return type of a method or the type of a variable within a method via type hints. How about class fields? Can I declare the type of a field in order to enable autocompletion for that variable? I tried something on the lines of: class MyClass { protected $Field; /* @var $Field MyType */ ... but it doesn't work. Is there a way to achieve autocompletion of class fields with Eclipse and PDT? thanks, Silvio

    Read the article

  • Intersecting boundaries with lucene

    - by Silvio Donnini
    I'm using Lucene, and I'm trying to find a way to index and retrieve documents that have a ranged property. For example I have: Document 1: Price:[30 TO 50] Document 2: Price:[45 TO 60] Document 3: Price:[60 TO 70] And I would like to search for all the documents whose ranges intersect a specific interval, in the above example, if I search for Price in [55 TO 65] I should get Document 2 and Document 3 as results. I don't think NumericRangeQueries alone would do the trick, I need to work on the index with something similar to R-trees, but are they implemented in Lucene? Also, I suppose that what I need should be a subclass of MultiTermQuery, because the query Price in [55 TO 65] has two boundaries, but I don't see anything suitable among MultiTermQuery's subclasses. Any help is appreciated, thanks, Silvio P.S. I'm using Lucene 2.9.0, but I can update to the latest release if needed.

    Read the article

  • Memory leak with preg_replace

    - by Silvio Donnini
    I'm using the preg_replace function to replace accents in a string, I'm working with UTF-8. I have incurred in what seems to be a memory leak, but I can't isolate the root cause, my code is rather simple: preg_replace( array_keys($aToNoAccents), array_values($aToNoAccents), $sText ); where $aToNoAccents is an associative array with entries like '~[A]~u' => 'A', '~[C]~u' => 'C',. My script prints this error for the above line: Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 3039 bytes) Obviously it's not a matter of increasing the allowed memory for PHP, (a 1Gb footprint is way off the scale of my application). Also, that line is executed thousands of times without problems but, just for some cases which are difficult to reproduce, it yields the error. Is anyone aware of memory problems with preg_replace and UTF-8 strings? Am I to use special care in passing actual parameters to such function? I'm using PHP 5.2.6-3 with Suhosin-Patch thanks Silvio

    Read the article

  • MySQL: updating a row and deleting the original in case it becomes a duplicate

    - by Silvio Donnini
    I have a simple table made up of two columns: col_A and col_B. The primary key is defined over both. I need to update some rows and assign to col_A values that may generate duplicates, for example: UPDATE `table` SET `col_A` = 66 WHERE `col_B` = 70 This statement sometimes yields a duplicate key error. I don't want to simply ignore the error with UPDATE IGNORE, because then the rows that generate the error would remain unchanged. Instead, I want them to be deleted when they would conflict with another row after they have been updated I'd like to write something like: UPDATE `table` SET `col_A` = 66 WHERE `col_B` = 70 ON DUPLICATE KEY REPLACE which unfortunately isn't legal in SQL, so I need help finding another way around. Also, I'm using PHP and could consider a hybrid solution (i.e. part query part php code), but keep in mind that I have to perform this updating operation many millions of times. thanks for your attention, Silvio Reminder: UPDATE's syntax has problems with joins with the same table that is being updated

    Read the article

  • Jetty 6: Unknown Error 99

    - by Silvio Donnini
    The system I'm developing is comprised of a jetty server (v6.1.2rc4) and a php frontend that sends http requests to jetty via curl_exec. The server and the client are on the same machine. The requests I send can be both POSTs and GETs, I get the same error for either which is: Failed to connect to 127.0.0.1: Unknown error 99 This is rather cryptic. It seems that after the first problematic request, some of the following (unrelated) requests also get corrupted. It looks like jetty is simply refusing the connection, but I can't read more than that into the error message. I thought it was a problem with the server's configuration, so I tried changing jetty's maxIdleTimeMs, but without success. Any idea about what to do is welcome thanks, Silvio

    Read the article

  • Weird javascript problem...

    - by Silvio Iannone
    Hi there, i'm building a page that is dinamically loaded with ajax. This is what the '$.get' jQuery function calls (this is located on an external HTML page): <script type="text/javascript"> $(function() { $('button').sb_animateButton(); $('input').sb_animateInput(); $('#settings_security_error').hide(); }); function check_passwords(password, password_confirm) { $('#settings_security_error').show(); alert('I\'m in funcion!'); // This works... if(password.length < 4) // ... this doesn't { $('#settings_security_error').innerHTML = 'Password too short'; } else { password = hex_md5(password); password_confirm = hex_md5(password_confirm); $.get('/engine/ajax/check_password.php?password=' + password + '$password_confirm=' + password_confirm, {language: "php", version: 5}, function(result) { $('#settings_security_error').innerHTML = result; }, 'html'); } } </script> <div class="title">Security</div> <table class="sub_container"> <tr> <td><label>Old password</label></td> <td class="td_input"><input type="password" name="old_password"/></td> </tr> <tr> <td><label>New password</label></td> <td class="td_input"><input type="password" name="new_password" id="settings_security_new_password" onkeyup="check_passwords(this.value, getElementById('settings_security_password_confirm').value)"/></td> </tr> <tr> <td><label>Confirm password</label></td> <td class="td_input"><input type="password" name="new_password_confirm" id="settings_security_password_confirm" onkeyup="check_passwords(getElementById('settings_security_new_password').value, this.value)"/></td> </tr> <tr> <td class="td_error" id="settings_security_error"></td> </tr> </table> And this is where the external HTML is placed...: <div id="settings_appearance"> </div> ... from this javascript snippet: function get_page_content(page, target_id) { $.get('engine/ajax/get_page_content.php?page=' + page, null, function(result) { $("#"+target_id).html(result); // Or whatever you need to insert the result }, 'html'); } Well... the problem is that the javascript in the first snippet is executed when it's loaded by the $.get function, but i still can't understand the reason why when i type into the input boxes nothing happen. It should write the output of the javascript function check_passwords(password, password_confirm) in <td class="td_error" id="settings_security_error"></td>. Thanks for helping. Silvio

    Read the article

  • Hot to get XChat to trust CA certificate?

    - by Silvio
    I have created an SSL certificate authority including a sub-authority to issue certificates. I have copied the root certificate to /usr/share/ca-certificates/extra and added it to /etc/ca-certificates, then ran dpkg-reconfigure ca-certificates and update-ca-certificates. After it said "Adding debian:.pem done." I am now fairly convinced that Ubuntu knows about my CA. Now I issued a certificate for the ZNC irc bouncer from the subca, installed it onto znc, but XChat will not trust the certificate despite all the above. I also issued a certificate to use with apache2 and that one works fine after adding the root ca to chromium. Does someone know how I can get XChat to trust the certificate?

    Read the article

  • Force full garbage collection when memory occupation goes beyond a certain threshold

    - by Silvio Donnini
    I have a server application that, in rare occasions, can allocate large chunks of memory. It's not a memory leak, as these chunks can be claimed back by the garbage collector by executing a full garbage collection. Normal garbage collection frees amounts of memory that are too small: it is not adequate in this context. The garbage collector executes these full GCs when it deems appropriate, namely when the memory footprint of the application nears the allotted maximum specified with -Xmx. That would be ok, if it wasn't for the fact that these problematic memory allocations come in bursts, and can cause OutOfMemoryErrors due to the fact that the jvm is not able to perform a GC quickly enough to free the required memory. If I manually call System.gc() beforehand, I can prevent this situation. Anyway, I'd prefer not having to monitor my jvm's memory allocation myself (or insert memory management into my application's logic); it would be nice if there was a way to run the virtual machine with a memory threshold, over which full GCs would be executed automatically, in order to release very early the memory I'm going to need. Long story short: I need a way (a command line option?) to configure the jvm in order to release early a good amount of memory (i.e. perform a full GC) when memory occupation reaches a certain threshold, I don't care if this slows my application down every once in a while. All I've found till now are ways to modify the size of the generations, but that's not what I need (at least not directly). I'd appreciate your suggestions, Silvio P.S. I'm working on a way to avoid large allocations, but it could require a long time and meanwhile my app needs a little stability

    Read the article

  • Cron Script to Delete Folder Contents Every 5 Minutes on Media Temple

    - by Brian Iannone
    I'm not familiar with server-side scripting, but I'm currently using a PHP application on Media Temple to cache JPEGs from four webcams hosted on a server located in the middle of the Indian Ocean. (Hence my reason for caching them in the US.) The webcams are updated every five minutes. The PHP application stores the cached images in http://static.rigic.co/cache/. I would like to create a cron script to automatically delete the contents of "cache" (not the folder itself; just the files inside) at a regular interval.

    Read the article

  • Insert HTML into a page with AJAX

    - by Silvio Iannone
    Hi there, i'm currently developing a website and i need that the pages loads dinamicallly based on what actions the user does. Example: if the user clicks on the button 'Settings' an ajax funcion will load from an external page the code and will put into the div with tag 'settings'. This is the code i use to make the Ajax request: function get_page_content(page, target_id) { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById(target_id).innerHTML = xmlhttp.responseText; // After getting the response we have to re-apply ui effects or they // won't be available on new elements coming from request. $('button').sb_animateButton(); $('input').sb_animateInput(); } } xmlhttp.open('GET', 'engine/ajax/get_page_content.php?page=' + page, true); xmlhttp.send(); } And this is where the ajax results will be put by first snippet: <div id="settings_appearance"> </div> The code is called from a function here: <div class="left_menu_item" id="left_menu_settings_appearance" onclick="show_settings_appearance()"> Appearance </div> And this is the html that the ajax function will put into the settings_appearance div: <script type="text/javascript"> $(function() { $('#upload_hidden_frame').hide(); show_mybrain(); document.getElementById('avatar_upload_form').onsubmit = function() { document.getElementById('avatar_upload_form').target = 'upload_hidden_frame'; upload_avatar(); } }); </script> <div class="title">Appearance</div> <iframe id="upload_hidden_frame" name="upload_hidden_frame" src="" class="error_message"></iframe> <table class="sub_container" id="avatar_upload_form" method="post" enctype="multipart/form-data" action="engine/ajax/upload_avatar.php"> <tr> <td><label for="file">Avatar</label></td> <td><input type="file" name="file" id="file" class="file_upload" /></td> <td><button type="submit" name="button_upload">Upload</button></td> </tr> <tr> <td><div class="hint">The image must be in PNG, JPEG or GIF format.</div></td> </tr> </table> I would like to know if there's a way to execute also the javascript code that's returned by the ajax function and if it's possible to apply some customized ui effects i build that are loaded with the main page. Thanks for helping. P.S. This is the script that applies the ui effects: <script type="text/javascript"> // UI effects $(document).ready(function() { $('button').sb_animateButton(); $('input').sb_animateInput(); $('.top_menu_item').sb_animateMenuItem(); $('.top_menu_item_right').sb_animateMenuItem(); $('.left_menu_item').sb_animateMenuItem(); }); </script>

    Read the article

  • jQuery .live() not working.

    - by Silvio Iannone
    Hi there, my actual problem is that .live() jQuery method is not working. This si the code where i use it: jQuery.fn.sb_animateMenuItem = function() { var mousehoverColor = '#0089F7'; var duration = 250; return this.each(function() { var originalColor = $(this).css('background-color'); $(this).live('mouseover', function() { this.style.cursor = 'pointer'; $(this).animate().stop(); $(this).animate( { backgroundColor: mousehoverColor }, duration); }); $(this).live('mouseout', function() { this.style.cursor = 'default'; $(this).animate( { backgroundColor: originalColor }, duration); }); }); }; This snipped is used i another page in this way: <script type="text/javascript" src="ui/js/jquery-1.4.2.js"></script> <script type="text/javascript" src="ui/js/jquery-ui-1.8.1.custom.min.js"></script> <script type="text/javascript" src="ui/js/color.js"></script> <script type="text/javascript" src="engine/js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="ui/js/ui.js"></script> <script type="text/javascript"> // UI effects $(document).ready(function() { $('button').sb_animateButton(); $('input').sb_animateInput(); $('.top_menu_item').sb_animateMenuItem(); $('.top_menu_item_right').sb_animateMenuItem(); $('.left_menu_item').sb_animateMenuItem(); }); </script> Since my site uses AJAX requests i used the .live method in the first snippet, but when i load the page the effects are not applied the the button/input... tags. If i remove the .live method and use the 'normal' way, ui effects defined in the first snipped are applied but only the the elements loaded before any AJAX request. The elements loaded after the ajax request are not affected by first snippet (though they have the same selector). Thanks for helping.

    Read the article

  • Android seekbar widget: no vertical orientation?

    - by Silvio Donnini
    I can't believe there is no way to change the orientation of the SeekBar widget. I've been perusing this widget's properties and I can't find anything that allows me to change its orientation to vertical. So, am I missing something obvious? Do I have to write my own implementation of a seekbar to have its thumb slide up/down instead of left/right?

    Read the article

  • Cocoa memory management

    - by silvio
    At various points during my application's workflow, I need so show a view. That view is quite memory intensive, so I want it to be deallocated when it gets discarded by the user. So, I wrote the following code: - (MyView *)myView { if (myView != nil) return myView; myView = [[UIView alloc] initWithFrame:CGRectZero]; // allocate memory if necessary. // further init here return myView; } - (void)discardView { [myView discard]; // the discard methods puts the view offscreen. [myView release]; // free memory! } - (void)showView { view = [self myView]; // more code that puts the view onscreen. } Unfortunately, this methods only works the first time. Subsequent requests to put the view onscreen result in "message sent to deallocated instance" errors. Apparently, a deallocated instance isn't the same thing as nil. I thought about putting an additional line after [myView release] that reads myView = nil. However, that could result in errors (any calls to myView after that line would probably yield errors). So, how can I solve this problem?

    Read the article

1