Daily Archives

Articles indexed Friday May 14 2010

Page 8/116 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How do I fork correctly in a perl module for znc?

    - by rarbox
    I'm currently writing an IRC bot. The scripts are loaded as perl modules in ZNC but the bot gets disconnected with an Input/Output error if I create a forked process. This is a working example script without fork, but this causes the bot to freeze until the script finishes doing its task. package imdb; use warnings; use strict; sub new { my ($class) = @_; my $self = {}; bless( $self, $class ); return( $self ); } sub OnChanMsg { my ($self, $nick, $channel,$text) = @_; #unless (my $pid = fork()) { my $result = a_slow_process($text); ZNC::PutIRC( "PRIVMSG $channel :$result" ); # exit; #} return( ZNC::CONTINUE ); } sub OnShutdown { my ( $me ) = @_; } sub a_slow_process { my $input = shift; sleep 10; return "You said $input."; } 1; The fork code that is causing the error is commented out. How do I fix this? Edited to add: I was told that ZNC::PutIRC should not be put in the child process.

    Read the article

  • Cygwin environment variable case

    - by Michael
    For some reason on one pc, when variable names are going from batch file to Cygwin environment, they are capitalizing. On other the case stay intact. @set aa=bb %BASH% --login -c "set" so the output in one case will show AA=bb in other case aa=bb How to control the case of the exported variables?

    Read the article

  • Centering a div block without the width

    - by Vinicius
    Hi, I have a problem when I try to center the div block "products" because I don't know in advance the div width. Anybody have a solution? Update: The problem I have is I don't know how many products I'll display, I can have 1, 2 or 3 products, I can center them if it was a fixed number as I'd know the width of the parent div, I just don't know how to do it when the content is dynamic. <style> .product_container { text-align: center; height: 150px; } .products { height: 140px; text-align: center; margin: 0 auto; clear: ccc both; } .price { margin: 6px 2px; width: 137px; color: #666; font-size: 14pt; font-style: normal; border: 1px solid #CCC; background-color: #EFEFEF; } </style> <div class="product_container"> <div class="products" id="products"> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> </div> </div>

    Read the article

  • MSBuild script fails but produces no errors

    - by Kate
    I have a MSBuild script that I am executing through TeamCity. One of the tasks that is runs is from Xheo DeploxLX CodeVeil which obfuscates some DLLs. The task I am using is called VeilProject. I have run the CodeVeil Project through the interface manually and it works correctly, so I think I can safely assume that the actual obfuscate process is ok. This task used to take around 40 minutes and the rest of the MSBuild file executed perfectly and finished without errors. For some reason this task is now taking 1hr 20 minutes or so to execute. Once the VeilProject task is finished the output from the task says it completely successfully, however the MSBuild script fails at this point. I have a task directly after the VeilProject task and it does not get outputted. Using diagnostic output from MSBUild I can see the following: My questions are: Would it be possible that the MSBuild script has timed out? Once the task has completed it is after a certain timeout period so it just fails? Why would the build fail with no errors and no warnings? [05:39:06]: [Target "Obfuscate"] Finished. [05:39:06]: [Target "Obfuscate"] Saving exception map [05:49:21]: [Target "Obfuscate"] Ended at 11/05/2010 05:49:21, ~1 hour, 48 minutes, 6 seconds [05:49:22]: [Target "Obfuscate"] Done. [05:49:51]: MSBuild output: Ended at 11/05/2010 05:49:21, ~1 hour, 48 minutes, 6 seconds (TaskId:8) Done. (TaskId:8) Done executing task "VeilProject" -- FAILED. (TaskId:8) Done building target "Obfuscate" in project "AMK_Release.proj.teamcity.patch.tcprojx" -- FAILED.: (TargetId:12) Done Building Project "C:\Builds\Scripts\AMK_Release.proj.teamcity.patch.tcprojx" (All target(s)) -- FAILED. Project Performance Summary: 6535484 ms C:\Builds\Scripts\AMK_Release.proj.teamcity.patch.tcprojx 1 calls 6535484 ms All 1 calls Target Performance Summary: 156 ms PreClean 1 calls 266 ms SetBuildVersionNumber 1 calls 2406 ms CopyFiles 1 calls 6532391 ms Obfuscate 1 calls Task Performance Summary: 16 ms MakeDir 2 calls 31 ms TeamCitySetBuildNumber 1 calls 31 ms Message 1 calls 62 ms RemoveDir 2 calls 234 ms GetAssemblyIdentity 1 calls 2406 ms Copy 1 calls 6528047 ms VeilProject 1 calls Build FAILED. 0 Warning(s) 0 Error(s) Time Elapsed 01:48:57.46 [05:49:52]: Process exit code: 1 [05:49:55]: Build finished

    Read the article

  • Using trace and dbg in Erlang

    - by Gordon Guthrie
    I am trying to start using erlang:trace/3 and the dbg module to trace the behaviour of a live production system without taking the server down. The documentation is opaque (to put it mildly) and there don't appear to be any useful tutorials online. What I spent all day trying to do was capture what was happening in a particular function by trying to apply a trace to module:function using dbg:c and dbg:p but with no success at all... Does anyone have a succinct explanation of how to use trace in a live Erlang system?

    Read the article

  • phpUnit - mock php extended exception object

    - by awongh
    I'm testing some legacy code that extends the default php exception object. This code prints out a custom HTML error message. I would like to mock this exception object in such a way that when the tested code generates an exception it will just echo the basic message instead of giving me the whole HTML message. I cannot figure out a way to do this. It seems like you can test for explicit exceptions, but you can't change in a general way the behavior of an exception, and you also can't mock up an object that extends a default php functionality. ( can't think of another example of this beyond exceptions... but it would seem to be the case ) I guess the problem is, where would you attach the mocked object?? It seems like you can't interfere with 'throw new' and this is the place that the object method is called.... Or if you could somehow use the existing phpunit exception functionality to change the exception behavior the way you want, in a general way for all your code... but this seems like it would be hacky and bad....

    Read the article

  • Setting WMI permissions remotely on windows server 2003

    - by user41507
    Hello. I am a programmer , I don know the server well. I made a simple program checking the service on the remote server is started or not. by using this(http://msdn.microsoft.com/en-us/library/dwd0y33x(v=VS.90).aspx) but the permission should be set. and I can't find any document via the internet. except one document. http://msdn.microsoft.com/en-us/library/aa393266(VS.85).aspx but the engineer say that 'tell me exactly what I do. there are many DCOM are they any nice document to show him? thanks in advance

    Read the article

  • Visual Studio Installed - Icons not showing correctly

    - by James
    Hello, I have just installed Visual Studio but it seems to have not installed properly. Here is a picture of the problem: As you can see, there is no icon for the solution file even though Windows recognizes it correctly as a Visual Studio solution and opens it correctly. How can I fix this? Thankyou.

    Read the article

  • 4?????????????(Fusion Middleware??)

    - by rika.tokumichi
    ??????????OTN????????? ????????????????????????????????????????????????????? ???????????????????????????????? ????????????????????????????????????????????? ??????Fusion Middleware??4?1?~4?30?????????????! ??????????? 1?:Oracle WebLogic Server 11g?Download? 2?:Oracle JDeveloper 11g?Download? 3?:Oracle JRockit Mission Control 3.1.2?Download? 4?:Oracle SOA Suite 11g ?Download? 5?:Oracle JDeveloper 10g?Download? (????4?1?~4?30?) 1?~3??????????4??5??????????!??Oracle Fusion Middleware 11g R1 (11.1.1.3) ????? ??????????????????????????????? ??????????????????????????????????????? ?????????????????????????????????????????????????????????????????? >S/N Ratio Oracle Fusion Middleware 11g R1 (11.1.1.3) ???? (WebLogic?SOA?BPM?WebCenter?JDeveloper) ?????????OTN??????????????????????????? ??????7??????????Oracle Coherence?????????????????????? ???????????????????????????????????????????????????????????? Oracle Coherence ?????????????????? ??????????????????????????????????????????^^ OTN?????????? ??????????????????·???·???????????????????????????????????????? >Oracle Coherence???????????? ???? ????????????????? ???????????FX???????????????????FX??????????????????? >???FX?? - ?????????????????????(5/19) OTN?????????? 30??Oracle Coherence ???????????????????OracleFlash??????????pdf???????????? >Oracle Coherence ???? ?Flash?? >Oracle Coherence ???? ?pdf?? ????????????????????????Java?????????·?????????????? Oracle Coherence????????????????????????????????? ??? Oracle Coherence???????????????????????? ?????·??????????????? >?1?:?????????????!??????????????? >?2?:?????·?????????????????? >?3?:?????·??????????????:????? ?????? >Oracle Coherence?Oracle WebLogic Server:Eclipse??????? ??? >???? >?????? >???????????? ??????????????????????!

    Read the article

  • altering jQuery UI datepicker format

    - by stef
    i cant for the life of me figure out how to change the date from default mm/dd/yyyy to the european dd/mm/yyyy the manual states to use: $.datepicker.formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26)); so far i have: $('#next_date').datepicker(); which shows the calendar fine but im not sure where the first line of code goes. this for example disables the calendar, nothing shows up, no js errors reported $('#next_date').datepicker.formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26));

    Read the article

  • What Swing look and feel should I use for a Java desktop application?

    - by waiting
    I am developing a Java desktop application and I use Swing to build the GUI. I realize that I can change the look of my app by setting different L&Fs. The JRE (from SUN) provides me at least two L&Fs, one is the default Metal L&F and the other is the "System" L&F which let my app have a native look. Also I can find some really cool L&Fs on the internet. The question is: which L&F should I use for my desktop app? Someone said the native look will be more user friendly, is that true? If I use the system L&F, should I make different versions of my user handbook (since the UI will change according to the OS)?

    Read the article

  • Cannot call scalar-valued CLR UDF from select ... from table statement

    - by Henrik B
    I have created a scalar-valued CLR UDF (user defined function). It takes a timezone id and a datetime and returns the datetime converted to that timezone. I can call it from a simple select without problems: "select dbo.udfConvert('Romance Standard Time', @datetime)" (@datetime is of course a valid datetime variable) But if I call it passing in a datetime from a table it fails: "select dbo.udfConvert('Romance Standard Time', StartTime) from sometable" (column StartTime is of course a column of type datetime) The error message is: "Cannot find either column "dbo" or the user-defined function or aggregate "dbo.udfConvert", or the name is ambiguous." This message is really for beginners that has misspelled something, but as it works in one case and not in the other, I don't think I have done any misspellings. Any ideas?

    Read the article

  • silverlight security with WCF service, Forms Authentication and Custom Form Ticket

    - by user74825
    I have a silverlight application with login on the silverlight page. It uses Forms Authentication with WCF authentication service and customer Membership Provider. Something like : http://blogs.msdn.com/phaniraj/archive/2009/09/10/using-the-ado-net-data-services-silverlight-client-library-in-x-domain-and-out-of-browser-scenarios-ii-forms-authentication.aspx So, SL page login page calls the WCF service authentication service, it validates using DB - brings back username and password. Now, in each subsequent calls (in Global.asax in Authenticate_Request, I get HttpContext.User.IsAuthenticated and HttpContext.User.UserName). I have all this working properly. But, I just don't want the username, but more information surrounding the user, like UserId, UserAddress, UserAssociateCustomer etc. I tried couple of different approaches. 1) Use HttpContext.Cache as a dictionary to save the item and get it off based on httpcontext.user.name, problem is cache can be erased if there memory is being used heavily. 2) Tried CustomFormsAuth Ticket, when forms authentication writes a ticket, I intercept CreatingCookie method and write additional info in formauthentication ticket, so that I can read it in subsequent requests, I am having problems with this approach, I don't find the ticket in subsequent requests. I read about how we should use REsponse.Redirect, but where do I redirect user from WCF call. How do you guys implement the above scenario? Any best practices.? Any issues you see with going on HTTPS? All examples (or most of them) just explains simple forms authentication with "I am logged in message".. Any suggestions ?

    Read the article

  • centering a div without setting width

    - by Daniel
    Is there a way to do this? When using navigation that can change the number of items often, it would be nice not having to calculate the with and updating the css, but just having a solution that works. if that's impossible (I'm assuming it is) can anyone point me to a javascript that can do this? edit re: provide code some code basically I'm working with, what I think is, the most typical setup <div class="main"> <div class="nav"> <ul> <li>short title</li> <li>Item 3 Long title</li> <li>Item 4 Long title</li> <li>Item 5 Long title</li> <li>Item 6 Extra Long title</li> </ul> </div> </div> edit .main { width:100%; text-align:center; } .nav { margin:0 auto; } .nav ul li { display:inline; text-align:left; } the issue I've found with this/these solutions is that the content is nudged to the right adding some right padding (of 40px) seems to fix this across the browsers I'm checking on (O FF IE). .nav { margin:0 auto; padding-right:40px; } I don't know where this value is coming from though and why 40px fixes this. Does anyone know where this is coming from? it's not a margin or padding but no matter what I do the first about 40px can not be used for placement. Maybe it's the ul or li that's adding this. I've had a look at the display:table-cell way of doing this, but there's that complication with IE and it still has the same issue as the other solution edit (final) okay I've tried some things in regard to the indent. I've reset all padding to 0 *{padding:0;} that fixed it, and I don't need to offset the padding (I think I'll leave my whole process up so if anyone comes across this, it'll save them some time) thanks for the comments and replies

    Read the article

  • WinForms GDI+ Polygon Events and custom shaped panels

    - by JD
    I have converted postcode boundary polygons to point data (point[] for each polygon) from GIS Shape Files. I am wanting to show this in a c# windows forms application. I have managed to show this using the System.Drawing (GDI+) DrawPolygon() method. Graphics g = this.CreateGraphics(); Pen pen = new Pen(Color.Black); Brush brush = new SolidBrush(Color.FromArgb(255,255,o)); PointF[] ptr = { point data here }; g.FillPolygon(brush, ptr); g.DrawPolygon(pen, ptr); Is it possible to add events to a drawn polygon? If so how do I do this for individual polygons. For example, click on a postcode polygon and a messagebox shows information about the postcode. Secondly, would it be easier to make a custom control inheriting the winforms panel. Is there a way to shape the border of a winforms panel control using a set of points? Postcode objects are serialised and stored in the filesystem.

    Read the article

  • extending satchmo user profile

    - by z3a
    I'm trying to extend the basic user registration form and profile included in satchmo store, but I'm in problems with that. This what I've done: Create a new app "extendedprofile" Wrote a models.py that extends the satchmo_store.contact.models class and add the custom name fields. wrote an admin.py that unregister the Contact class and register my newapp but this still showing me the default user profile form. Maybe some one can show me the correct way to do this?

    Read the article

  • documentFragment.cloneNode(true) doesn't clone jQuery data

    - by taber
    I have a documentFragment with several child nodes containing some .data() added like so: myDocumentFragment = document.createDocumentFragment(); for(...) { myDocumentFragment.appendChild( $('').addClass('button') .attr('href', 'javascript:void(0)') .html('click me') .data('rowData', { 'id': 103, 'test': 'testy' }) .get(0) ); } When I try to append the documentFragment to a div on the page: $('#div').append( myDocumentFragment ); I can access the data just fine: alert( $('#div a:first').data('rowData').id ); // alerts '103' But if I clone the node with cloneNode(true), I can't access the node's data. :( $('#div').append( myDocumentFragment.cloneNode(true) ); ... alert( $('#div a:first').data('rowData').id ); // alerts undefined Has anyone else done this or know of a workaround? I guess I could store the row's data in jQuery.data('#some_random_parent_div', 'rows', [array of ids]), but that kinda defeats the purpose of making the data immediately/easily available to each row. I've also read that jQuery uses documentFragments, but I'm not sure exactly how, or in what methods. Does anyone have any more details there? Thanks!

    Read the article

  • phpMyAdmin 3.2.4 error #1227 - Access denied; you need the SUPER privilege for this operation

    - by CheeseConQueso
    I want to make a simple sql trigger on inserts... something like this CREATE TRIGGER filter AFTER INSERT ON table FOR EACH ROW DELETE FROM table WHERE field LIKE "%chicken%" OR field LIKE "%egg%"; After running it through phpMyAdmin 3.2.4 & MySQL 5.0.45 you get an error that says #1227 - Access denied; you need the SUPER privilege for this operation Is this syntax wrong or do I have to change something else to get past this error?

    Read the article

  • JQuery - Ajax saving sortables in connected lists when sortable item is moved

    - by Ben Sinclair
    I have multiple JQuery sortable lists that connect with each other... They allow you to assign users to certain roles. Basically what I want to do is when a user is dragged from one list to another, I want JQuery to pick up the first list that the user was moved from so that I can send an AJAX request to delete it from that list in my database. I tried the following but every time you move the user over a list and haven't even dropped it within a list, it sends this request which means I'll be sending multiple AJAX requests... Does that make sense? $( ".selector" ).sortable({ out: function(event, ui) { ... } }); From my testing, I can use the following code to just update the list that user has been moved to so I've got the second half covered: $( ".selector" ).sortable({ receive: function(event, ui) { ... } }); Hopefully I am making sense :)

    Read the article

  • Position of least significant bit that is set

    - by peterchen
    I am looking for an efficient way to determine the position of the least significant bit that is set in an integer, e.g. for 0x0FF0 it would be 4. A trivial implementation is this: unsigned GetLowestBitPos(unsigned value) { assert(value != 0); // handled separately unsigned pos = 0; while (!(value & 1)) { value >>= 1; ++pos; } return pos; } Any ideas how to squeeze some cycles out of it? (Note: this question is for people that enjoy such things, not for people to tell me xyzoptimization is evil.) [edit] Thanks everyone for the ideas! I've learnt a few other things, too. Cool!

    Read the article

  • How to extract block of XML from a log file on Linux

    - by dragonmantank
    I have a log file that looks like the following: 2010-05-12 12:23:45 Some sort of log entry 2010-05-12 01:45:12 Request XML: <RootTag> <Element>Value</Element> <Element>Another Value</Element> </RootTag> 2010-05-12 01:45:32 Response XML: <ResponseRoot> <Element>Value</Element> </ResponseRoot> 2010-05-12 01:45:49 Another log entry What I want to do is extract the Request and Response XML (and ultimately dump them into their own single files). I had a similar parser that used egrep but the XML was all on one line, not multiple ones like above. The log files are also somewhat large, hitting 500-600 megs a log. Smaller logs I would read in via a PHP script and use regex matching, but the amount of memory required for such a large file would more than likely kill the script. Is there an easy way using the built-in tools on a Linux box (CentOS in this case) to extract multiple lines or am I going to have to bite the bullet and use Perl or PHP to read in the entire file to extract it?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >